|
CNDP 22.08.0
|
Go to the source code of this file.
Typedefs | |
| typedef char *(*) | cli_sfunc_t(const char *str) |
Functions | |
| CNDP_API struct cli_env * | cli_env_create (void) |
| CNDP_API void | cli_env_destroy (struct cli_env *env) |
| CNDP_API int | cli_env_set (struct cli_env *env, const char *var, const char *val) |
| CNDP_API int | cli_env_string (struct cli_env *env, const char *var, cli_sfunc_t sfunc, const char *val) |
| CNDP_API const char * | cli_env_get (struct cli_env *env, const char *var) |
| CNDP_API int | cli_env_del (struct cli_env *env, const char *var) |
| CNDP_API void | cli_env_substitution (struct cli_env *env, char *line, int sz) |
| static int | cli_env_count (struct cli_env *env) |
| CNDP_API int | cli_env_get_all (struct cli_env *env, struct env_node **list, int max_size) |
| CNDP_API void | cli_env_show (struct cli_env *env) |
CNE Command line interface
Definition in file cli_env.h.
| typedef char *(*) cli_sfunc_t(const char *str) |
| CNDP_API struct cli_env * cli_env_create | ( | void | ) |
Create a environment for the cli
| CNDP_API void cli_env_destroy | ( | struct cli_env * | env | ) |
Delete the environment for the CLI
| env | The pointer to the environment structure |
| CNDP_API int cli_env_set | ( | struct cli_env * | env, |
| const char * | var, | ||
| const char * | val ) |
Set a environment variable for the CLI
| env | The cli_env pointer |
| var | Pointer to the variable name const string |
| val | Pointer to the string assigned to the variable |
| CNDP_API int cli_env_string | ( | struct cli_env * | env, |
| const char * | var, | ||
| cli_sfunc_t | sfunc, | ||
| const char * | val ) |
Set a environment variable for the CLI with a function pointer
| env | The cli_env pointer |
| var | Pointer to the variable name const string. |
| sfunc | Pointer to function (optional) |
| val | Pointer to the string assigned to the variable |
| CNDP_API const char * cli_env_get | ( | struct cli_env * | env, |
| const char * | var ) |
Get the environment variable from the cli
| env | The cli_env pointer |
| var | The const string variable name |
| CNDP_API int cli_env_del | ( | struct cli_env * | env, |
| const char * | var ) |
Remove the environment variable from the cli
| env | The cli_env pointer |
| var | The const string variable name |
| CNDP_API void cli_env_substitution | ( | struct cli_env * | env, |
| char * | line, | ||
| int | sz ) |
Do environment variable substitution on the line.
| env | Pointer to the environment structure |
| line | Pointer to the line to parse |
| sz | Number of total characters the line can hold. |
|
inlinestatic |
| CNDP_API int cli_env_get_all | ( | struct cli_env * | env, |
| struct env_node ** | list, | ||
| int | max_size ) |
Get all of the environment variables
| env | Pointer to environment list |
| list | Array of env_node pointers to be returned |
| max_size | Max size of the list array |
| CNDP_API void cli_env_show | ( | struct cli_env * | env | ) |
Show all environment variable
| env | Pointer to the cli_env structure. |