From: Karel Zak Date: Wed, 26 Nov 2014 10:21:16 +0000 (+0100) Subject: libfdisk: add docs for iterator X-Git-Tag: v2.26-rc1~174 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7ab7af75786c519eb64e7a9257b9bd95dd0cd1fd;p=thirdparty%2Futil-linux.git libfdisk: add docs for iterator --- diff --git a/libfdisk/src/iter.c b/libfdisk/src/iter.c index 8e2f342027..9a0b0801cc 100644 --- a/libfdisk/src/iter.c +++ b/libfdisk/src/iter.c @@ -10,8 +10,17 @@ * @title: Iterator * @short_description: unified iterator * - * The iterator keeps the direction and the last position - * for access to the internal library tables/lists. + * The iterator keeps the direction and the last position for access to the + * internal library tables/lists. + * + * It's very unusual to use the same iterator on multiple places in your + * application or share the same iterator, for this purpose libfdisk does not + * provide reference counting for this object. It's recommended to initialize + * the iterator by fdisk_new_iter() at begin of your function and then + * fdisk_free_iter() before you return from the function. + * + * Don't forget to call fdisk_reset_iter() if you want to use the iterator more + * than once. */ #include #include