Blender V2.61 - r43446
|
#include <ctype.h>
#include <string.h>
#include "MEM_guardedalloc.h"
#include "BLI_utildefines.h"
#include "BLI_listbase.h"
#include "BLI_string.h"
#include "BLI_args.h"
#include "BLI_ghash.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 unsigned int | case_strhash (const void *ptr) |
static unsigned int | keyhash (const void *ptr) |
static int | keycmp (const void *a, const void *b) |
static bArgument * | lookUp (struct bArgs *ba, const char *arg, int pass, int case_str) |
bArgs * | BLI_argsInit (int argc, const char **argv) |
static void | freeItem (void *val) |
void | BLI_argsFree (struct bArgs *ba) |
void | BLI_argsPrint (struct bArgs *ba) |
const char ** | BLI_argsArgv (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 pass, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d) |
void | BLI_argsAddCase (struct bArgs *ba, int pass, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data) |
void | BLI_argsAdd (struct bArgs *ba, int pass, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data) |
static void | internalDocPrint (bArgDoc *d) |
void | BLI_argsPrintArgDoc (struct bArgs *ba, const char *arg) |
void | BLI_argsPrintOtherDoc (struct bArgs *ba) |
void | BLI_argsParse (struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data) |
Variables | |
static char | NO_DOCS [] = "NO DOCUMENTATION SPECIFIED" |
Definition in file BLI_args.c.
void BLI_argsAdd | ( | struct bArgs * | ba, |
int | pass, | ||
const char * | short_arg, | ||
const char * | long_arg, | ||
const char * | doc, | ||
BA_ArgCallback | cb, | ||
void * | data | ||
) |
Definition at line 219 of file BLI_args.c.
References BLI_argsAddCase().
Referenced by setupArguments().
void BLI_argsAddCase | ( | struct bArgs * | ba, |
int | pass, | ||
const char * | short_arg, | ||
int | short_case, | ||
const char * | long_arg, | ||
int | long_case, | ||
const char * | doc, | ||
BA_ArgCallback | cb, | ||
void * | data | ||
) |
Definition at line 206 of file BLI_args.c.
References simple_enum_gen::d, internalAdd(), and internalDocs().
Referenced by BLI_argsAdd(), and setupArguments().
const char** BLI_argsArgv | ( | struct bArgs * | ba | ) |
Definition at line 155 of file BLI_args.c.
References bArgs::argv.
void BLI_argsFree | ( | struct bArgs * | ba | ) |
Definition at line 139 of file BLI_args.c.
References BLI_freelistN(), BLI_ghash_free(), bArgs::docs, freeItem(), bArgs::items, MEM_freeN(), and bArgs::passes.
Referenced by main().
bArgs* BLI_argsInit | ( | int | argc, |
const char ** | argv | ||
) | [read] |
Definition at line 122 of file BLI_args.c.
References bArgs::argc, bArgs::argv, BLI_ghash_new(), bArgs::docs, ListBase::first, bArgs::items, keycmp(), keyhash(), ListBase::last, MEM_callocN(), NULL, and bArgs::passes.
Referenced by main().
void BLI_argsParse | ( | struct bArgs * | ba, |
int | pass, | ||
BA_ArgCallback | default_cb, | ||
void * | default_data | ||
) |
Definition at line 263 of file BLI_args.c.
References bArgs::argc, bArgs::argv, data, bArgument::data, bArgument::func, i, bArgument::key, lookUp(), NULL, bAKey::pass, and bArgs::passes.
Referenced by main().
void BLI_argsPrint | ( | struct bArgs * | ba | ) |
Definition at line 147 of file BLI_args.c.
References bArgs::argc, bArgs::argv, and i.
Referenced by debug_mode().
void BLI_argsPrintArgDoc | ( | struct bArgs * | ba, |
const char * | arg | ||
) |
Definition at line 236 of file BLI_args.c.
References simple_enum_gen::d, bArgument::doc, bArgDoc::done, internalDocPrint(), and lookUp().
Referenced by print_help().
void BLI_argsPrintOtherDoc | ( | struct bArgs * | ba | ) |
Definition at line 250 of file BLI_args.c.
References simple_enum_gen::d, bArgs::docs, bArgDoc::done, ListBase::first, internalDocPrint(), and bArgDoc::next.
Referenced by print_help().
static unsigned int case_strhash | ( | const void * | ptr | ) | [static] |
static void freeItem | ( | void * | val | ) | [static] |
static void internalAdd | ( | struct bArgs * | ba, |
const char * | arg, | ||
int | pass, | ||
int | case_str, | ||
BA_ArgCallback | cb, | ||
void * | data, | ||
bArgDoc * | d | ||
) | [static] |
Definition at line 178 of file BLI_args.c.
References bAKey::arg, BLI_ghash_insert(), bAKey::case_str, simple_enum_gen::d, data, bArgument::data, bArgument::doc, bArgument::func, bArgs::items, bArgument::key, lookUp(), MEM_callocN(), and bAKey::pass.
Referenced by BLI_argsAddCase().
static void internalDocPrint | ( | bArgDoc * | d | ) | [static] |
Definition at line 224 of file BLI_args.c.
References bArgDoc::documentation, bArgDoc::long_arg, and bArgDoc::short_arg.
Referenced by BLI_argsPrintArgDoc(), and BLI_argsPrintOtherDoc().
static bArgDoc* internalDocs | ( | struct bArgs * | ba, |
const char * | short_arg, | ||
const char * | long_arg, | ||
const char * | doc | ||
) | [static] |
Definition at line 160 of file BLI_args.c.
References BLI_addtail(), simple_enum_gen::d, bArgs::docs, bArgDoc::documentation, bArgDoc::long_arg, MEM_callocN(), NO_DOCS, NULL, and bArgDoc::short_arg.
Referenced by BLI_argsAddCase().
static int keycmp | ( | const void * | a, |
const void * | b | ||
) | [static] |
Definition at line 97 of file BLI_args.c.
References bAKey::arg, BLI_ghashutil_intcmp(), BLI_strcasecmp(), bAKey::case_str, and bAKey::pass.
Referenced by BLI_argsInit().
static unsigned int keyhash | ( | const void * | ptr | ) | [static] |
Definition at line 91 of file BLI_args.c.
References bAKey::arg, and case_strhash().
Referenced by BLI_argsInit().
Definition at line 111 of file BLI_args.c.
References bAKey::arg, BLI_ghash_lookup(), bAKey::case_str, bArgs::items, and bAKey::pass.
Referenced by BLI_argsParse(), BLI_argsPrintArgDoc(), and internalAdd().
char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED" [static] |
Definition at line 47 of file BLI_args.c.
Referenced by internalDocs().