ARGPARSE.H(3)
β¨ NAME β¨
include/Zycore/ArgParse.h β and bestie, this is the header that lives in Zycore's Library Functions Manual, which is the fancy way of saying "hey, this is a C header, here's everything it gives you" π
π SYNOPSIS π
Like, first things first β you gotta pull in the essentials:
#include <Zycore/Types.h>
#include <Zycore/Status.h>
#include <Zycore/Vector.h>
#include <Zycore/String.h>
πΈ Classes πΈ
struct ZyanArgParseDefinition_struct ZyanArgParseConfig_struct ZyanArgParseArg_
π¦ Typedefs π¦
typedef struct ZyanArgParseDefinition_ ZyanArgParseDefinitiontypedef struct ZyanArgParseConfig_ ZyanArgParseConfigtypedef struct ZyanArgParseArg_ ZyanArgParseArg
π Functions π
ZYCORE_EXPORT ZyanStatus ZyanArgParse (const ZyanArgParseConfig *cfg,
ZyanVector *parsed, const char **error_token)
ZYCORE_EXPORT ZyanStatus ZyanArgParseEx (const ZyanArgParseConfig *cfg,
ZyanVector *parsed, const char **error_token, ZyanAllocator
*allocator)
π Detailed Description π
Okay so, what does this even do? It implements command-line argument parsing. That's it, that's the whole vibe. Your program gets args, and this header is the one making sense of them. Iconic behavior, truly. β¨
π Typedef Documentation π
π typedef struct ZyanArgParseArg_ ZyanArgParseArg
Information about a parsed argument. (Like, the tea on each arg after it's been chewed up by the parser π)
π typedef struct ZyanArgParseConfig_ ZyanArgParseConfig
Configuration for argument parsing. (The settings that tell the parser how to do its lil job.)
π typedef struct ZyanArgParseDefinition_ ZyanArgParseDefinition
Definition of a single argument. (One arg's whole identity, fr.)
π₯ Function Documentation π₯
β ZYCORE_EXPORT ZyanStatus ZyanArgParse (const ZyanArgParseConfig * cfg, ZyanVector * parsed, const char ** error_token)
Parse arguments according to a ZyanArgParseConfig definition. That's the whole mission statement, bestie.
π Parameters
cfgβ Argument parser config to use.parsedβ Receives the parsed output. Vector ofZyanArgParseArg. Ownership is transferred to the user. Input is expected to be uninitialized. On error, the vector remains uninitialized.error_tokenβ On error, if it makes sense, receives the argument fragment causing the error. Optional, may beZYAN_NULL. The pointer borrows into thecfgstruct and doesn't have to be freed by the user.
Not me stressing about the parsed vector lifecycle π β it starts uninitialized, you own it once it comes back, and if things go sideways it stays uninitialized. No leaks, no drama. π«Ά
β¨ Returns
A ZyanStatus status determining whether the parsing succeeded.
β ZYCORE_EXPORT ZyanStatus ZyanArgParseEx (const ZyanArgParseConfig * cfg, ZyanVector * parsed, const char ** error_token, ZyanAllocator * allocator)
Parse arguments according to a ZyanArgParseConfig definition.
This version allows specification of a custom memory allocator and thus supports no-libc. (Yes, no-libc. It's giving freestanding, it's giving embedded, it's giving main character energy in a bare-metal environment. π₯)
π Parameters
cfgβ Argument parser config to use.parsedβ Receives the parsed output. Vector ofZyanArgParseArg. Ownership is transferred to the user. Input is expected to be uninitialized. On error, the vector remains uninitialized.error_tokenβ On error, if it makes sense, receives the argument fragment causing the error. Optional, may beZYAN_NULL. The pointer borrows into thecfgstruct and doesn't have to be freed by the user.allocatorβ TheZyanAllocatorto be used for allocating the output vector's data.
β¨ Returns
A ZyanStatus status determining whether the parsing succeeded.
πΈ Author πΈ
Generated automatically by Doxygen for Zycore from the source code. (Doxygen said "I got this" and honestly? It ate. π )
And that's the whole page, bestie!! ππ This lil header belongs to Zycore, Version 1.5.2.0, and it's the include/Zy.../ArgParse.h(3) manual page β go forth and parse those arguments, you absolute legend ππβ
π¦ where this page comes from
- ubuntu resolute: libzycore-doc 1.5.2-1build1 Β· MIT
- ubuntu stonking: libzycore-doc 1.5.2-1build1 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms