Blog
Community
Development
Documentation
CNDP
22.08.0
Toggle main menu visibility
Loading...
Searching...
No Matches
cli_env.h
Go to the documentation of this file.
1
/* SPDX-License-Identifier: BSD-3-Clause
2
* Copyright (c) 2019-2022 Intel Corporation.
3
*/
4
5
#ifndef _CLI_ENV_H_
6
#define _CLI_ENV_H_
7
12
13
#include <sys/queue.h>
// for TAILQ_ENTRY, TAILQ_HEAD
14
#include <
cne_common.h
>
// for CNDP_API
15
16
#ifdef __cplusplus
17
extern
"C"
{
18
#endif
19
20
struct
cli;
21
22
typedef
char
*(*cli_sfunc_t)(
const
char
*str);
24
25
struct
env_node {
26
TAILQ_ENTRY(env_node) next;
27
const
char
*var;
28
const
char
*val;
29
cli_sfunc_t
sfunc;
30
};
31
32
struct
cli_env {
33
TAILQ_HEAD(, env_node) head;
34
int
count;
35
};
36
43
CNDP_API
struct
cli_env *
cli_env_create
(
void
);
44
51
CNDP_API
void
cli_env_destroy
(
struct
cli_env *env);
52
65
CNDP_API
int
cli_env_set
(
struct
cli_env *env,
const
char
*var,
const
char
*val);
66
81
CNDP_API
int
cli_env_string
(
struct
cli_env *env,
const
char
*var,
cli_sfunc_t
sfunc,
82
const
char
*val);
83
94
CNDP_API
const
char
*
cli_env_get
(
struct
cli_env *env,
const
char
*var);
95
106
CNDP_API
int
cli_env_del
(
struct
cli_env *env,
const
char
*var);
107
120
CNDP_API
void
cli_env_substitution
(
struct
cli_env *env,
char
*line,
int
sz);
121
130
static
inline
int
131
cli_env_count
(
struct
cli_env *env)
132
{
133
return
env->count;
134
}
135
146
CNDP_API
int
cli_env_get_all
(
struct
cli_env *env,
struct
env_node **list,
int
max_size);
147
154
CNDP_API
void
cli_env_show
(
struct
cli_env *env);
155
156
#ifdef __cplusplus
157
}
158
#endif
159
160
#endif
/* _CLI_ENV_H_ */
cli_env_count
static int cli_env_count(struct cli_env *env)
Definition
cli_env.h:131
cli_env_get_all
CNDP_API int cli_env_get_all(struct cli_env *env, struct env_node **list, int max_size)
cli_env_substitution
CNDP_API void cli_env_substitution(struct cli_env *env, char *line, int sz)
cli_sfunc_t
char *(*) cli_sfunc_t(const char *str)
Definition
cli_env.h:22
cli_env_get
CNDP_API const char * cli_env_get(struct cli_env *env, const char *var)
cli_env_set
CNDP_API int cli_env_set(struct cli_env *env, const char *var, const char *val)
cli_env_del
CNDP_API int cli_env_del(struct cli_env *env, const char *var)
cli_env_create
CNDP_API struct cli_env * cli_env_create(void)
cli_env_show
CNDP_API void cli_env_show(struct cli_env *env)
cli_env_string
CNDP_API int cli_env_string(struct cli_env *env, const char *var, cli_sfunc_t sfunc, const char *val)
cli_env_destroy
CNDP_API void cli_env_destroy(struct cli_env *env)
cne_common.h
lib
usr
app
cli
cli_env.h
Generated by
1.18.0