enum argpar_iter_next_status: assign negative integral values to errors
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Wed, 2 Jun 2021 15:50:17 +0000 (11:50 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 4 Jun 2021 17:59:12 +0000 (13:59 -0400)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Idd77c0b08296a150b9f771d06fbaf3415e1c2cc9

argpar/argpar.h

index 3cd437fa043d68390a933f4f4c1e99912935027f..3340d90f593031756a6e8d80f5a704ddff6f89a1 100644 (file)
@@ -593,6 +593,8 @@ void argpar_iter_destroy(struct argpar_iter *iter);
 /*!
 @brief
     Return type of argpar_iter_next().
+
+Error status enumerators have a negative value.
 */
 enum argpar_iter_next_status {
        /// Success
@@ -602,16 +604,16 @@ enum argpar_iter_next_status {
        ARGPAR_ITER_NEXT_STATUS_END,
 
        /// Unknown option error
-       ARGPAR_ITER_NEXT_STATUS_ERROR_UNKNOWN_OPT,
+       ARGPAR_ITER_NEXT_STATUS_ERROR_UNKNOWN_OPT = -1,
 
        /// Missing option argument error
-       ARGPAR_ITER_NEXT_STATUS_ERROR_MISSING_OPT_ARG,
+       ARGPAR_ITER_NEXT_STATUS_ERROR_MISSING_OPT_ARG = -2,
 
        /// Unexpected option argument error
-       ARGPAR_ITER_NEXT_STATUS_ERROR_UNEXPECTED_OPT_ARG,
+       ARGPAR_ITER_NEXT_STATUS_ERROR_UNEXPECTED_OPT_ARG = -3,
 
        /// Memory error
-       ARGPAR_ITER_NEXT_STATUS_ERROR_MEMORY,
+       ARGPAR_ITER_NEXT_STATUS_ERROR_MEMORY = -12,
 };
 
 /*!
This page took 0.032363 seconds and 4 git commands to generate.