|
Blender
V2.93
|
A general argument parsing module. More...
#include <ctype.h>#include <stdio.h>#include <string.h>#include "MEM_guardedalloc.h"#include "BLI_args.h"#include "BLI_ghash.h"#include "BLI_listbase.h"#include "BLI_string.h"#include "BLI_utildefines.h"Go to the source code of this file.
Classes | |
| struct | bArgDoc |
| struct | bAKey |
| struct | bArgument |
| struct | bArgs |
Typedefs | |
| typedef struct bArgDoc | bArgDoc |
| typedef struct bAKey | bAKey |
| typedef struct bArgument | bArgument |
Functions | |
| static uint | case_strhash (const void *ptr) |
| static uint | keyhash (const void *ptr) |
| static bool | keycmp (const void *a, const void *b) |
| static bArgument * | lookUp (struct bArgs *ba, const char *arg, int pass, int case_str) |
| bArgs * | BLI_args_create (int argc, const char **argv) |
| void | BLI_args_destroy (struct bArgs *ba) |
| void | BLI_args_pass_set (struct bArgs *ba, int current_pass) |
| void | BLI_args_print (struct bArgs *ba) |
| static bArgDoc * | internalDocs (struct bArgs *ba, const char *short_arg, const char *long_arg, const char *doc) |
| static void | internalAdd (struct bArgs *ba, const char *arg, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d) |
| void | BLI_args_add_case (struct bArgs *ba, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data) |
| void | BLI_args_add (struct bArgs *ba, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data) |
| static void | internalDocPrint (bArgDoc *d) |
| void | BLI_args_print_arg_doc (struct bArgs *ba, const char *arg) |
| void | BLI_args_print_other_doc (struct bArgs *ba) |
| bool | BLI_args_has_other_doc (const struct bArgs *ba) |
| void | BLI_args_parse (struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data) |
Variables | |
| static char | NO_DOCS [] = "NO DOCUMENTATION SPECIFIED" |
A general argument parsing module.
Definition in file BLI_args.c.
| void BLI_args_add | ( | struct bArgs * | ba, |
| const char * | short_arg, | ||
| const char * | long_arg, | ||
| const char * | doc, | ||
| BA_ArgCallback | cb, | ||
| void * | data | ||
| ) |
Pass starts at 1, -1 means valid all the time short_arg or long_arg can be null to specify no short or long versions
Definition at line 230 of file BLI_args.c.
References BLI_args_add_case(), and data.
Referenced by main_args_setup().
| void BLI_args_add_case | ( | struct bArgs * | ba, |
| const char * | short_arg, | ||
| int | short_case, | ||
| const char * | long_arg, | ||
| int | long_case, | ||
| const char * | doc, | ||
| BA_ArgCallback | cb, | ||
| void * | data | ||
| ) |
Short_case and long_case specify if those arguments are case specific
Definition at line 210 of file BLI_args.c.
References data, internalAdd(), and internalDocs().
Referenced by BLI_args_add(), and main_args_setup().
| bArgs* BLI_args_create | ( | int | argc, |
| const char ** | argv | ||
| ) |
Definition at line 115 of file BLI_args.c.
References bArgs::argc, bArgs::argv, BLI_ghash_new(), BLI_listbase_clear(), bArgs::current_pass, bArgs::docs, bArgs::items, keycmp(), keyhash(), MEM_callocN, and bArgs::passes.
Referenced by main().
| void BLI_args_destroy | ( | struct bArgs * | ba | ) |
Definition at line 130 of file BLI_args.c.
References BLI_freelistN(), BLI_ghash_free(), bArgs::docs, bArgs::items, MEM_freeN, and bArgs::passes.
Referenced by callback_main_atexit().
| bool BLI_args_has_other_doc | ( | const struct bArgs * | ba | ) |
Definition at line 279 of file BLI_args.c.
References bArgs::docs, and ListBase::first.
Referenced by arg_handle_print_help().
| void BLI_args_parse | ( | struct bArgs * | ba, |
| int | pass, | ||
| BA_ArgCallback | default_cb, | ||
| void * | default_data | ||
| ) |
Definition at line 289 of file BLI_args.c.
References Freestyle::a, bArgs::argc, bArgs::argv, BLI_assert, data, lookUp(), NULL, and bArgs::passes.
Referenced by main(), and main_args_setup_post().
| void BLI_args_pass_set | ( | struct bArgs * | ba, |
| int | current_pass | ||
| ) |
The pass to use for BLI_args_add.
Definition at line 138 of file BLI_args.c.
References BLI_assert, and bArgs::current_pass.
Referenced by main_args_setup().
| void BLI_args_print | ( | struct bArgs * | ba | ) |
Definition at line 144 of file BLI_args.c.
References bArgs::argc, and bArgs::argv.
Referenced by arg_handle_debug_mode_set().
| void BLI_args_print_arg_doc | ( | struct bArgs * | ba, |
| const char * | arg | ||
| ) |
Definition at line 255 of file BLI_args.c.
References Freestyle::a, bArgDoc::done, internalDocPrint(), and lookUp().
Referenced by arg_handle_print_help().
| void BLI_args_print_other_doc | ( | struct bArgs * | ba | ) |
Definition at line 268 of file BLI_args.c.
References bArgs::docs, bArgDoc::done, ListBase::first, internalDocPrint(), and bArgDoc::next.
Referenced by arg_handle_print_help().
|
static |
Definition at line 72 of file BLI_args.c.
References Freestyle::c, and ptr.
Referenced by keyhash().
|
static |
Definition at line 174 of file BLI_args.c.
References Freestyle::a, bAKey::arg, BLI_ghash_insert(), bAKey::case_str, bArgs::current_pass, data, bArgs::items, lookUp(), MEM_callocN, and bAKey::pass.
Referenced by BLI_args_add_case().
|
static |
Definition at line 240 of file BLI_args.c.
References bArgDoc::documentation, bArgDoc::long_arg, and bArgDoc::short_arg.
Referenced by BLI_args_print_arg_doc(), and BLI_args_print_other_doc().
|
static |
Definition at line 152 of file BLI_args.c.
References BLI_addtail(), bArgs::docs, bArgDoc::documentation, bArgDoc::long_arg, MEM_callocN, NO_DOCS, NULL, and bArgDoc::short_arg.
Referenced by BLI_args_add_case().
|
static |
Definition at line 91 of file BLI_args.c.
References Freestyle::a, bAKey::arg, BLI_ghashutil_intcmp(), BLI_strcasecmp(), bAKey::case_str, bAKey::pass, and STREQ.
Referenced by BLI_args_create().
|
static |
Definition at line 85 of file BLI_args.c.
References bAKey::arg, case_strhash(), and ptr.
Referenced by BLI_args_create().
Definition at line 104 of file BLI_args.c.
References bAKey::arg, BLI_ghash_lookup(), bAKey::case_str, bArgs::items, and bAKey::pass.
Referenced by BLI_args_parse(), BLI_args_print_arg_doc(), and internalAdd().
|
static |
Definition at line 37 of file BLI_args.c.
Referenced by internalDocs().