+ (<code>const argpar_item_t *</code> type).
+*/
+#define ARGPAR_ITEM_DESTROY_AND_RESET(_item) \
+ { \
+ argpar_item_destroy(_item); \
+ (_item) = NULL; \
+ }
+
+/// @}
+
+/*!
+@name Error API
+@{
+*/
+
+/*!
+@brief
+ Parsing error type, as returned by
+ \link argpar_error_type(const argpar_error_t *) argpar_error_type()\endlink.
+*/
+typedef enum argpar_error_type
+{
+ /// Unknown option error
+ ARGPAR_ERROR_TYPE_UNKNOWN_OPT,
+
+ /// Missing option argument error
+ ARGPAR_ERROR_TYPE_MISSING_OPT_ARG,
+
+ /// Unexpected option argument error
+ ARGPAR_ERROR_TYPE_UNEXPECTED_OPT_ARG,
+} argpar_error_type_t;
+
+/*!
+@struct argpar_error
+
+@brief
+ Opaque parsing error type
+*/
+typedef struct argpar_error argpar_error_t;
+
+/*!
+@brief
+ Returns the type of the parsing error object \p error.
+
+@param[in] error
+ Parsing error of which to get the type.
+
+@returns
+ Type of \p error.
+
+@pre
+ \p error is not \c NULL.
+*/
+argpar_error_type_t argpar_error_type(const argpar_error_t *error) ARGPAR_NOEXCEPT;
+
+/*!
+@brief
+ Returns the index of the original argument (in \p argv, as passed to
+ argpar_iter_create()) for which the parsing error described by
+ \p error occurred.
+
+@param[in] error
+ Parsing error of which to get the original argument index.
+
+@returns
+ Original argument index of \p error.
+
+@pre
+ \p error is not \c NULL.
+*/
+unsigned int argpar_error_orig_index(const argpar_error_t *error) ARGPAR_NOEXCEPT;
+
+/*!
+@brief
+ Returns the name of the unknown option for which the parsing error
+ described by \p error occurred.
+
+The returned name includes any <code>-</code> or <code>\--</code>
+prefix.
+
+With the long option with argument form, for example
+<code>\--mireille=deyglun</code>, this function only returns the name
+part (<code>\--mireille</code> in the last example).
+
+@param[in] error
+ Parsing error of which to get the name of the unknown option.
+
+@returns
+ Name of the unknown option of \p error.
+
+@pre
+ \p error is not \c NULL.
+@pre
+ The type of \p error, as returned by
+ \link argpar_error_type(const argpar_error_t *) argpar_error_type()\endlink,
+ is #ARGPAR_ERROR_TYPE_UNKNOWN_OPT.