uCmd source file More...
#include <limits.h>
Go to the source code of this file.
Data Structures | |
struct | Command |
simple struct to hold data for a single command More... | |
Defines | |
#define | UCMD_CMD_NOT_FOUND INT_MIN |
return value when no command match is found | |
#define | UCMD_DEFAULT_DELIMETER " " |
default delimeter to use if given NULL | |
Typedefs | |
typedef int(* | Command_cb )(int, char *[]) |
type for command callback functions | |
Functions | |
int | ucmd_parse (Command[], const char *, const char *) |
Parse a command string and match against a Command List. |
uCmd source file
This file declares Command_cb() and Command types for use with ucmd_parse()
Definition in file ucmd.h.
struct Command |
Data Fields | ||
---|---|---|
const char * | cmd | the command string to match against |
Command_cb | fn | the function to call when cmd is matched |
const char * | help | the help text associated with cmd |
#define UCMD_CMD_NOT_FOUND INT_MIN |
#define UCMD_DEFAULT_DELIMETER " " |
typedef int(* Command_cb)(int, char *[]) |
type for command callback functions
See Command callback functions for more information
int | number of arguments (argc style) |
char*[] | array of strings (argv style) |
int ucmd_parse | ( | Command | cmd_list[], |
const char * | delim, | ||
const char * | in | ||
) |
Parse a command string and match against a Command List.
cmd_list | a Command array (see the Command List section for more info) |
delim | a null terminated string used to split the command string |
in | a null terminated command string to parse |