.TH "include/Zycore/ArgParse.h" 3 "Version 1.5.0.0" "Zycore" \" -*- nroff -*- .ad l .nh .SH NAME include/Zycore/ArgParse.h .SH SYNOPSIS .br .PP \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br \fC#include \fP .br .SS "Classes" .in +1c .ti -1c .RI "struct \fBZyanArgParseDefinition_\fP" .br .ti -1c .RI "struct \fBZyanArgParseConfig_\fP" .br .ti -1c .RI "struct \fBZyanArgParseArg_\fP" .br .in -1c .SS "Typedefs" .in +1c .ti -1c .RI "typedef struct \fBZyanArgParseDefinition_\fP \fBZyanArgParseDefinition\fP" .br .ti -1c .RI "typedef struct \fBZyanArgParseConfig_\fP \fBZyanArgParseConfig\fP" .br .ti -1c .RI "typedef struct \fBZyanArgParseArg_\fP \fBZyanArgParseArg\fP" .br .in -1c .SS "Functions" .in +1c .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanArgParse\fP (const \fBZyanArgParseConfig\fP *cfg, \fBZyanVector\fP *parsed, const char **error_token)" .br .ti -1c .RI "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP \fBZyanArgParseEx\fP (const \fBZyanArgParseConfig\fP *cfg, \fBZyanVector\fP *parsed, const char **error_token, \fBZyanAllocator\fP *allocator)" .br .in -1c .SH "Detailed Description" .PP Implements command-line argument parsing\&. .SH "Typedef Documentation" .PP .SS "typedef struct \fBZyanArgParseArg_\fP \fBZyanArgParseArg\fP" Information about a parsed argument\&. .SS "typedef struct \fBZyanArgParseConfig_\fP \fBZyanArgParseConfig\fP" Configuration for argument parsing\&. .SS "typedef struct \fBZyanArgParseDefinition_\fP \fBZyanArgParseDefinition\fP" Definition of a single argument\&. .SH "Function Documentation" .PP .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanArgParse (const \fBZyanArgParseConfig\fP * cfg, \fBZyanVector\fP * parsed, const char ** error_token)" Parse arguments according to a \fCZyanArgParseConfig\fP definition\&. .PP \fBParameters\fP .RS 4 \fIcfg\fP Argument parser config to use\&. .br \fIparsed\fP Receives the parsed output\&. Vector of \fCZyanArgParseArg\fP\&. Ownership is transferred to the user\&. Input is expected to be uninitialized\&. On error, the vector remains uninitialized\&. .br \fIerror_token\fP On error, if it makes sense, receives the argument fragment causing the error\&. Optional, may be \fCZYAN_NULL\fP\&. The pointer borrows into the \fCcfg\fP struct and doesn't have to be freed by the user\&. .RE .PP \fBReturns\fP .RS 4 A \fCZyanStatus\fP status determining whether the parsing succeeded\&. .RE .PP .SS "\fBZYCORE_EXPORT\fP \fBZyanStatus\fP ZyanArgParseEx (const \fBZyanArgParseConfig\fP * cfg, \fBZyanVector\fP * parsed, const char ** error_token, \fBZyanAllocator\fP * allocator)" Parse arguments according to a \fCZyanArgParseConfig\fP definition\&. .PP This version allows specification of a custom memory allocator and thus supports no-libc\&. .PP \fBParameters\fP .RS 4 \fIcfg\fP Argument parser config to use\&. .br \fIparsed\fP Receives the parsed output\&. Vector of \fCZyanArgParseArg\fP\&. Ownership is transferred to the user\&. Input is expected to be uninitialized\&. On error, the vector remains uninitialized\&. .br \fIerror_token\fP On error, if it makes sense, receives the argument fragment causing the error\&. Optional, may be \fCZYAN_NULL\fP\&. The pointer borrows into the \fCcfg\fP struct and doesn't have to be freed by the user\&. .br \fIallocator\fP The \fCZyanAllocator\fP to be used for allocating the output vector's data\&. .RE .PP \fBReturns\fP .RS 4 A \fCZyanStatus\fP status determining whether the parsing succeeded\&. .RE .PP .SH "Author" .PP Generated automatically by Doxygen for Zycore from the source code\&.