From: Mathieu Desnoyers Date: Thu, 8 Mar 2012 21:10:26 +0000 (-0500) Subject: API cleanup: Move bt_iter_create/destroy to internal header X-Git-Tag: v1.0.0-pre4~14 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=9347cbab752c9672e64f8a71a465cca15f7b45ce API cleanup: Move bt_iter_create/destroy to internal header bt_iter is an abstract class, so its constructor/destructor should not be public. Reported-by: Yannick Brosseau Acked-by: Julien Desfossez Signed-off-by: Mathieu Desnoyers --- diff --git a/include/babeltrace/iterator-internal.h b/include/babeltrace/iterator-internal.h index 626a7a00..ea47745a 100644 --- a/include/babeltrace/iterator-internal.h +++ b/include/babeltrace/iterator-internal.h @@ -33,6 +33,27 @@ struct bt_iter { struct bt_iter_pos *end_pos; }; +/* + * bt_iter_create - Allocate a trace collection iterator. + * + * begin_pos and end_pos are optional parameters to specify the position + * at which the trace collection should be seeked upon iterator + * creation, and the position at which iteration will start returning + * "EOF". + * + * By default, if begin_pos is NULL, a BT_SEEK_CUR is performed at + * creation. By default, if end_pos is NULL, a BT_SEEK_END (end of + * trace) is the EOF criterion. + */ +struct bt_iter *bt_iter_create(struct bt_context *ctx, + struct bt_iter_pos *begin_pos, + struct bt_iter_pos *end_pos); + +/* + * bt_iter_destroy - Free a trace collection iterator. + */ +void bt_iter_destroy(struct bt_iter *iter); + int bt_iter_init(struct bt_iter *iter, struct bt_context *ctx, struct bt_iter_pos *begin_pos, diff --git a/include/babeltrace/iterator.h b/include/babeltrace/iterator.h index 530d8460..94df03c8 100644 --- a/include/babeltrace/iterator.h +++ b/include/babeltrace/iterator.h @@ -38,27 +38,6 @@ struct bt_iter_pos { } u; }; -/* - * bt_iter_create - Allocate a trace collection iterator. - * - * begin_pos and end_pos are optional parameters to specify the position - * at which the trace collection should be seeked upon iterator - * creation, and the position at which iteration will start returning - * "EOF". - * - * By default, if begin_pos is NULL, a BT_SEEK_CUR is performed at - * creation. By default, if end_pos is NULL, a BT_SEEK_END (end of - * trace) is the EOF criterion. - */ -struct bt_iter *bt_iter_create(struct bt_context *ctx, - struct bt_iter_pos *begin_pos, - struct bt_iter_pos *end_pos); - -/* - * bt_iter_destroy - Free a trace collection iterator. - */ -void bt_iter_destroy(struct bt_iter *iter); - /* * bt_iter_next: Move trace collection position to the next event. *