|
libclap 1.0.0
Command Line Argument Parser for C
|
Error handling for libclap. More...


Go to the source code of this file.
Classes | |
| struct | clap_error_s |
| Error information structure. More... | |
Macros | |
| #define | CLAP_ERR_NONE 0 |
| #define | CLAP_ERR_INVALID_ARGUMENT 1 |
| #define | CLAP_ERR_MISSING_VALUE 2 |
| #define | CLAP_ERR_TYPE_CONVERSION 3 |
| #define | CLAP_ERR_INVALID_CHOICE 4 |
| #define | CLAP_ERR_MUTUALLY_EXCLUSIVE 5 |
| #define | CLAP_ERR_REQUIRED_MISSING 6 |
| #define | CLAP_ERR_UNRECOGNIZED 7 |
| #define | CLAP_ERR_TOO_MANY_ARGS 8 |
| #define | CLAP_ERR_TOO_FEW_ARGS 9 |
| #define | CLAP_ERR_MEMORY 10 |
| #define | CLAP_ERR_SUBCOMMAND_FAILED 11 |
| #define | CLAP_ERR_DEPENDENCY_VIOLATION 12 |
| #define | CLAP_ERR_CUSTOM 100 |
Typedefs | |
| typedef struct clap_error_s | clap_error_t |
| Error information structure. | |
Functions | |
| CLAP_EXPORT void | clap_error_set (clap_error_t *error, int code, const char *format,...) |
| Set error code and printf-style message. | |
| CLAP_EXPORT int | clap_error_code (const clap_error_t *error) |
| Get the error code from an error structure. | |
| CLAP_EXPORT const char * | clap_error_message (const clap_error_t *error) |
| Get the human-readable message from an error structure. | |
Error handling for libclap.
| #define CLAP_ERR_CUSTOM 100 |
| #define CLAP_ERR_DEPENDENCY_VIOLATION 12 |
| #define CLAP_ERR_INVALID_ARGUMENT 1 |
| #define CLAP_ERR_INVALID_CHOICE 4 |
| #define CLAP_ERR_MEMORY 10 |
| #define CLAP_ERR_MISSING_VALUE 2 |
| #define CLAP_ERR_MUTUALLY_EXCLUSIVE 5 |
| #define CLAP_ERR_NONE 0 |
| #define CLAP_ERR_REQUIRED_MISSING 6 |
| #define CLAP_ERR_SUBCOMMAND_FAILED 11 |
| #define CLAP_ERR_TOO_FEW_ARGS 9 |
| #define CLAP_ERR_TOO_MANY_ARGS 8 |
| #define CLAP_ERR_TYPE_CONVERSION 3 |
| #define CLAP_ERR_UNRECOGNIZED 7 |
| typedef struct clap_error_s clap_error_t |
Error information structure.
| CLAP_EXPORT int clap_error_code | ( | const clap_error_t * | error | ) |
Get the error code from an error structure.
| error | Error struct (must not be NULL). |
| CLAP_EXPORT const char * clap_error_message | ( | const clap_error_t * | error | ) |
Get the human-readable message from an error structure.
| error | Error struct (must not be NULL). |
| CLAP_EXPORT void clap_error_set | ( | clap_error_t * | error, |
| int | code, | ||
| const char * | format, | ||
| ... | |||
| ) |
Set error code and printf-style message.
| error | Error struct to fill. |
| code | Error code (CLAP_ERR_* constant). |
| format | printf-style format string. |
| ... | printf arguments. |