+void argpar_parse_ret_fini(struct argpar_parse_ret *ret);
+
+/*
+ * Creates an argument parsing iterator.
+ *
+ * This function initializes the returned structure, but doesn't
+ * actually start parsing the arguments.
+ *
+ * `*argv` and `*descrs` must NOT change for the lifetime of the
+ * returned iterator (until you call argpar_iter_destroy()).
+ *
+ * Call argpar_iter_parse_next() with the returned iterator to obtain
+ * the next parsing result (item).
+ */
+ARGPAR_HIDDEN
+struct argpar_iter *argpar_iter_create(unsigned int argc,
+ const char * const *argv,
+ const struct argpar_opt_descr *descrs);
+
+/*
+ * Destroys `iter`, as returned by argpar_iter_create().
+ */
+ARGPAR_HIDDEN
+void argpar_iter_destroy(struct argpar_iter *iter);
+
+/*
+ * Return type of argpar_iter_parse_next().
+ */
+enum argpar_iter_parse_next_status {
+ ARGPAR_ITER_PARSE_NEXT_STATUS_OK,
+ ARGPAR_ITER_PARSE_NEXT_STATUS_END,
+ ARGPAR_ITER_PARSE_NEXT_STATUS_ERROR_UNKNOWN_OPT,
+ ARGPAR_ITER_PARSE_NEXT_STATUS_ERROR,
+};
+
+/*
+ * Parses and returns the next item from `iter`.
+ *
+ * On success, this function sets `*item` to an item which describes the
+ * next option or non-option argument and returns
+ * `ARGPAR_ITER_PARSE_NEXT_STATUS_OK`. Destroy `*item` with
+ * argpar_item_destroy().
+ *
+ * If there are no more items to return, this function returns
+ * `ARGPAR_ITER_PARSE_NEXT_STATUS_END`.
+ *
+ * On failure (status codes
+ * `ARGPAR_ITER_PARSE_NEXT_STATUS_ERROR_UNKNOWN_OPT` and
+ * `ARGPAR_ITER_PARSE_NEXT_STATUS_ERROR`), this function sets `*error`,
+ * if not `NULL`, to a descriptive error string. Free `*error` with
+ * free().
+ *
+ * Create an argument parsing iterator with argpar_iter_create().
+ */
+enum argpar_iter_parse_next_status argpar_iter_parse_next(
+ struct argpar_iter *iter, const struct argpar_item **item,
+ char **error);
+
+/*
+ * Returns the number of ingested elements from `argv`, as passed to
+ * argpar_iter_create() to create `*iter`, that were required to produce
+ * 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_parse_next().
+ */
+ARGPAR_HIDDEN
+void argpar_item_destroy(const struct argpar_item *item);
+
+/*
+ * Destroys `_item` (`const struct argpar_item *`) and sets it to
+ * `NULL`.
+ */
+#define ARGPAR_ITEM_DESTROY_AND_RESET(_item) \
+ { \
+ argpar_item_destroy(_item); \
+ _item = NULL; \
+ }