Blender V2.61 - r43446
Classes | Typedefs | Functions | Variables

BLI_args.c File Reference

#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 bArgumentlookUp (struct bArgs *ba, const char *arg, int pass, int case_str)
bArgsBLI_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 bArgDocinternalDocs (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"

Detailed Description

Definition in file BLI_args.c.


Typedef Documentation

typedef struct bAKey bAKey
typedef struct bArgDoc bArgDoc
typedef struct bArgument bArgument

Function Documentation

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]
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)
static unsigned int case_strhash ( const void *  ptr) [static]

Definition at line 79 of file BLI_args.c.

References i.

Referenced by keyhash().

static void freeItem ( void *  val) [static]

Definition at line 134 of file BLI_args.c.

References MEM_freeN().

Referenced by BLI_argsFree().

static void internalAdd ( struct bArgs ba,
const char *  arg,
int  pass,
int  case_str,
BA_ArgCallback  cb,
void *  data,
bArgDoc d 
) [static]
static void internalDocPrint ( bArgDoc d) [static]
static bArgDoc* internalDocs ( struct bArgs ba,
const char *  short_arg,
const char *  long_arg,
const char *  doc 
) [static]
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().

static bArgument* lookUp ( struct bArgs ba,
const char *  arg,
int  pass,
int  case_str 
) [static]

Variable Documentation

char NO_DOCS[] = "NO DOCUMENTATION SPECIFIED" [static]

Definition at line 47 of file BLI_args.c.

Referenced by internalDocs().