Go to the source code of this file.
Data Structures | |
struct | kb_command_s |
Typedefs | |
typedef struct kb_command_s | kb_command_t |
Functions | |
int | kb_parse_command (char *line, kb_command_t *cmds, void *data) |
char * | kb_get_arg (char *, unsigned) |
int | kb_find_string (const char *str, const char *list[]) |
int | kb_find_command (const char *cmd_name, const kb_command_t *cmd_list) |
typedef struct kb_command_s kb_command_t |
int kb_find_command | ( | const char * | cmd_name, | |
const kb_command_t * | cmd_list | |||
) |
This function finds a command in an array of command_s
cmd_name | Pointer to the command name. | |
cmd_list | Pointer to the array of commands. |
Definition at line 165 of file kb_cmdparser.c.
References KB_ERROR, KB_ERROR_UNKCMD, and kb_command_s::name.
Referenced by ksock_remove_command().
int kb_find_string | ( | const char * | str, | |
const char * | list[] | |||
) |
char* kb_get_arg | ( | char * | cmd, | |
unsigned | arg | |||
) |
return the given argument from the given command string.
cmd | the command string | |
arg | the argument to find |
Definition at line 36 of file kb_cmdparser.c.
int kb_parse_command | ( | char * | line, | |
kb_command_t * | cmds, | |||
void * | data | |||
) |
This function parses a given command line and executes commands found in a given command descriptor table.
line | Pointer to the command line. | |
cmds | Pointer to an array of command descriptor | |
data | Pointer to additional data that the application may need to pass to the command |
Definition at line 79 of file kb_cmdparser.c.
References ARGV_SIZE, kb_error(), KB_ERROR, KB_ERROR_CMDARGMAX, KB_ERROR_CMDARGMIN, KB_ERROR_INVAL, KB_ERROR_TOOMANYARGS, KB_ERROR_UNKCMD, and kb_command_s::name.
Referenced by kb_parse_config_file(), ksock_exec_command(), ksock_exec_command_pending(), and main().