OpenRaider  0.1.4-dev
Open Source Tomb Raider Game Engine implementation
Classes | Macros | Typedefs | Functions
commander.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  command_option_t
 
struct  command_t
 

Macros

#define COMMANDER_MAX_OPTIONS   32
 
#define COMMANDER_MAX_ARGS   32
 

Typedefs

typedef void(* command_callback_t) (struct command *self)
 

Functions

void command_init (command_t *self, const char *name, const char *version)
 
void command_free (command_t *self)
 
void command_help (command_t *self)
 
void command_option (command_t *self, const char *small, const char *large, const char *desc, command_callback_t cb)
 
void command_parse (command_t *self, int argc, char **argv)
 

Class Documentation

struct command_option_t

Definition at line 47 of file commander.h.

Class Members
int optional_arg
int required_arg
char * argname
char * large
const char * small
const char * large_with_arg
const char * description
command_callback_t cb
struct command_t

Definition at line 62 of file commander.h.

Collaboration diagram for command_t:
[legend]
Class Members
void * data
const char * usage
const char * arg
const char * name
const char * version
int option_count
command_option_t options[COMMANDER_MAX_OPTIONS]
int argc
char * argv[COMMANDER_MAX_ARGS]
char ** nargv

Macro Definition Documentation

#define COMMANDER_MAX_OPTIONS   32

Definition at line 20 of file commander.h.

#define COMMANDER_MAX_ARGS   32

Definition at line 28 of file commander.h.

Typedef Documentation

typedef void(* command_callback_t) (struct command *self)

Definition at line 41 of file commander.h.

Function Documentation

void command_init ( command_t self,
const char *  name,
const char *  version 
)

Definition at line 66 of file commander.c.

void command_free ( command_t self)

Definition at line 82 of file commander.c.

void command_help ( command_t self)

Definition at line 40 of file commander.c.

void command_option ( command_t self,
const char *  small,
const char *  large,
const char *  desc,
command_callback_t  cb 
)

Definition at line 173 of file commander.c.

void command_parse ( command_t self,
int  argc,
char **  argv 
)

Definition at line 266 of file commander.c.