DPDK  24.07.0
rte_kvargs.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2013 Intel Corporation.
3  * Copyright(c) 2014 6WIND S.A.
4  */
5 
6 #ifndef _RTE_KVARGS_H_
7 #define _RTE_KVARGS_H_
8 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
29 #define RTE_KVARGS_MAX 32
30 
32 #define RTE_KVARGS_PAIRS_DELIM ","
33 
35 #define RTE_KVARGS_KV_DELIM "="
36 
50 typedef int (*arg_handler_t)(const char *key, const char *value, void *opaque);
51 
54  char *key;
55  char *value;
56 };
57 
59 struct rte_kvargs {
60  char *str;
61  unsigned count;
63 };
64 
83 struct rte_kvargs *rte_kvargs_parse(const char *args,
84  const char *const valid_keys[]);
85 
111 struct rte_kvargs *rte_kvargs_parse_delim(const char *args,
112  const char *const valid_keys[],
113  const char *valid_ends);
114 
124 void rte_kvargs_free(struct rte_kvargs *kvlist);
125 
143 const char *rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key);
144 
165 const char *rte_kvargs_get_with_value(const struct rte_kvargs *kvlist,
166  const char *key, const char *value);
167 
189 int rte_kvargs_process(const struct rte_kvargs *kvlist,
190  const char *key_match, arg_handler_t handler, void *opaque_arg);
191 
203 unsigned rte_kvargs_count(const struct rte_kvargs *kvlist,
204  const char *key_match);
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 
210 #endif
#define RTE_KVARGS_MAX
Definition: rte_kvargs.h:29
struct rte_kvargs * rte_kvargs_parse_delim(const char *args, const char *const valid_keys[], const char *valid_ends)
const char * rte_kvargs_get_with_value(const struct rte_kvargs *kvlist, const char *key, const char *value)
void *(* handler)(void *sock_id)
unsigned count
Definition: rte_kvargs.h:61
void rte_kvargs_free(struct rte_kvargs *kvlist)
unsigned rte_kvargs_count(const struct rte_kvargs *kvlist, const char *key_match)
int(* arg_handler_t)(const char *key, const char *value, void *opaque)
Definition: rte_kvargs.h:50
const char * rte_kvargs_get(const struct rte_kvargs *kvlist, const char *key)
char * str
Definition: rte_kvargs.h:60
struct rte_kvargs * rte_kvargs_parse(const char *args, const char *const valid_keys[])
int rte_kvargs_process(const struct rte_kvargs *kvlist, const char *key_match, arg_handler_t handler, void *opaque_arg)