CNDP  22.08.0
jcfg_private.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright (c) 2019-2022 Intel Corporation.
3  */
4 
5 #ifndef _JCFG_PRIVATE_H_
6 #define _JCFG_PRIVATE_H_
7 
8 #include <sys/queue.h>
9 #include <pthread.h>
10 
11 #include <json-c/json_object.h>
12 #include <json-c/json_tokener.h>
13 #include <json-c/json_util.h>
14 #include <json-c/json_visit.h>
15 #include <json-c/linkhash.h>
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif
20 
24 typedef struct jcfg_client_s {
25  int s;
27  pthread_barrier_t barrier;
29 
33 struct jcfg {
34  struct jcfg_data data;
35  char *str;
36  struct json_object *root;
37  struct json_tokener *tok;
38 };
39 
44  uint16_t v;
46 };
47 
51 TAILQ_HEAD(queue_list_head, queue_list_entry);
52 
56 struct queue_list {
57  uint16_t min;
58  uint16_t max;
59  uint16_t num;
61  struct queue_list_head head;
62 };
63 
72 static inline char *
73 jcfg_get_json_string(struct jcfg *cfg)
74 {
75  return (cfg) ? cfg->str : NULL;
76 }
77 
86 static inline struct json_tokener *
87 jcfg_get_json_token(struct jcfg *cfg)
88 {
89  return (cfg) ? cfg->tok : NULL;
90 }
91 
99 void jcfg_umem_free(jcfg_hdr_t *hdr);
100 
101 #ifdef __cplusplus
102 }
103 #endif
104 
105 #endif /* _JCFG_PRIVATE_H_ */
TAILQ_HEAD(pktdev_driver_list, pktdev_driver)
jcfg_info_t * info
Definition: jcfg_private.h:26
pthread_barrier_t barrier
Definition: jcfg_private.h:27
Definition: jcfg.h:129
struct jcfg_data data
Definition: jcfg_private.h:34
struct json_tokener * tok
Definition: jcfg_private.h:37
struct json_object * root
Definition: jcfg_private.h:36
char * str
Definition: jcfg_private.h:35
Definition: jcfg_private.h:43
TAILQ_ENTRY(queue_list_entry) next
uint16_t v
Definition: jcfg_private.h:44
uint16_t min
Definition: jcfg_private.h:57
uint16_t num
Definition: jcfg_private.h:59
struct queue_list_head head
Definition: jcfg_private.h:61
uint16_t max
Definition: jcfg_private.h:58