argpar.h: argpar_iter_create(): add iterator lifetime details
[argpar.git] / argpar / argpar.h
index 1fb8835f67f6df274c1f1d799f1ad2133f3f0ba0..453f53385eec786140b425eae1f9d157b2cbeda1 100644 (file)
@@ -188,6 +188,12 @@ unsigned int argpar_item_non_opt_orig_index(const struct argpar_item *item);
 ARGPAR_HIDDEN
 unsigned int argpar_item_non_opt_non_opt_index(const struct argpar_item *item);
 
+/*
+ * Destroys `item`, as created by argpar_iter_next().
+ */
+ARGPAR_HIDDEN
+void argpar_item_destroy(const struct argpar_item *item);
+
 struct argpar_item_array {
        const struct argpar_item **items;
 
@@ -284,7 +290,9 @@ void argpar_parse_ret_fini(struct argpar_parse_ret *ret);
  * actually start parsing the arguments.
  *
  * `*argv` and `*descrs` must NOT change for the lifetime of the
- * returned iterator (until you call argpar_iter_destroy()).
+ * returned iterator (until you call argpar_iter_destroy()) and for the
+ * lifetime of any parsing item (until you call argpar_item_destroy())
+ * argpar_iter_next() creates for the returned iterator.
  *
  * Call argpar_iter_next() with the returned iterator to obtain the next
  * parsing result (item).
@@ -362,13 +370,7 @@ enum argpar_iter_next_status argpar_iter_next(
  * the previously returned items.
  */
 ARGPAR_HIDDEN
-unsigned int argpar_iter_get_ingested_orig_args(const struct argpar_iter *iter);
-
-/*
- * Destroys `item`, as created by argpar_iter_next().
- */
-ARGPAR_HIDDEN
-void argpar_item_destroy(const struct argpar_item *item);
+unsigned int argpar_iter_ingested_orig_args(const struct argpar_iter *iter);
 
 /*
  * Destroys `_item` (`const struct argpar_item *`) and sets it to
This page took 0.022445 seconds and 4 git commands to generate.