yumapro  20.10-12
YumaPro SDK
xpath1_aio.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2019 - 2021, YumaWorks, Inc., All Rights Reserved.
3  *
4  * Unless required by applicable law or agreed to in writing,
5  * software distributed under the License is distributed on an
6  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
7  * KIND, either express or implied. See the License for the
8  * specific language governing permissions and limitations
9  * under the License.
10  */
11 #ifndef _H_xpath1_aio
12 #define _H_xpath1_aio
13 
14 /* FILE: xpath1_aio.h
15 *********************************************************************
16 * *
17 * P U R P O S E *
18 * *
19 *********************************************************************/
20 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 07nov19 am begun;
36 */
37 
38 #include <xmlstring.h>
39 #include <xmlreader.h>
40 #include <xmlregexp.h>
41 
42 #ifndef _H_dlq
43 #include "dlq.h"
44 #endif
45 
46 #ifndef _H_ncxtypes
47 #include "ncxtypes.h"
48 #endif
49 
50 #ifndef _H_status
51 #include "status.h"
52 #endif
53 
54 #ifndef _H_obj
55 #include "obj.h"
56 #endif
57 
58 #ifndef _H_tk
59 #include "tk.h"
60 #endif
61 
62 #ifndef _H_val
63 #include "val.h"
64 #endif
65 
66 #ifndef _H_var
67 #include "var.h"
68 #endif
69 
70 #ifndef _H_yang
71 #include "yang.h"
72 #endif
73 
74 #ifdef __cplusplus
75 extern "C" {
76 #endif
77 
78 /********************************************************************
79 * *
80 * C O N S T A N T S *
81 * *
82 *********************************************************************/
83 
84 
85 /********************************************************************
86 * *
87 * M A C R O S *
88 * *
89 *********************************************************************/
90 
91 
92 /********************************************************************
93 * *
94 * T Y P E S *
95 * *
96 *********************************************************************/
97 
98 
99 /********************************************************************
100 * *
101 * F U N C T I O N S *
102 * *
103 *********************************************************************/
104 
105 
106 
125 extern xpath_aio_cb_t *
126  xpath1_aio_find_aiocb_full (dlq_hdr_t *aioQ,
127  obj_template_t *obj,
128  xpath_get2_cb_t *cb);
129 
130 
138 extern xpath_aio_cb_t *
139  xpath1_aio_find_aiocb_que (dlq_hdr_t *aioQ,
140  obj_template_t *obj);
141 
142 
150 extern xpath_aio_cb_t *
151  xpath1_aio_find_aiocb_pcb (xpath_pcb_t *pcb,
152  obj_template_t *obj);
153 
154 
160 extern void
161  xpath1_aio_free_cb (xpath_aio_cb_t *cb);
162 
163 
170 extern xpath_aio_cb_t *
171  xpath1_aio_get_first_aio (xpath_pcb_t *pcb);
172 
173 
180 extern xpath_aio_cb_t *
181  xpath1_aio_get_next_aio (xpath_aio_cb_t *cb);
182 
183 
190 extern val_value_t *
191  xpath1_aio_get_first_aio_ptr (xpath_aio_cb_t *cb);
192 
193 
200 extern val_value_t *
201  xpath1_aio_get_next_aio_ptr (val_value_t *entry);
202 
203 
215 extern status_t
216  xpath1_aio_setup_aiocb (xpath_pcb_t *pcb,
217  getcb_get2_t *get2cb,
218  obj_template_t *obj);
219 
220 
229 extern status_t
230  xpath1_aio_setup_get2cb (getcb_get2_t *get2cb,
231  val_value_t *useval);
232 
233 
244 extern boolean
245  xpath1_aio_check_ascend_lists (val_value_t *useval,
246  xpath_get2_cb_t *cb);
247 
248 
252 #ifdef __cplusplus
253 } /* end extern 'C' */
254 #endif
255 
256 #endif /* _H_xpath1_aio */
xpath1_get2.h
XPath 1.0 expression support for server GET2 callback functions.
ncx_feature.h
NCX Module Library YANG Feature Utility Functions.
xpath1_aio.h
Xpath 1.0 search support; XPath function library. Interface to the AIO GET2 object callback API.
xpath1_aio_get_next_aio_ptr
val_value_t * xpath1_aio_get_next_aio_ptr(val_value_t *entry)
Get the next AIO val value in the valQ Queue.
Definition: xpath1_aio.c:572
obj_is_terminal
boolean obj_is_terminal(const obj_template_t *obj)
Check if object is a proper leaf or leaflist or anyxml.
Definition: obj.c:13493
obj_has_aio_list
boolean obj_has_aio_list(obj_template_t *obj)
Check is AIO object is a list or if its parent is a list object.
Definition: obj.c:18458
val.h
Value Node Basic Support.
getcb.h
GET1 and GET2 Callback Support.
tk.h
NCX Syntax Token Handler.
log_debug3
void void void void void void void void void void void log_debug3(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG3 log entry.
xpath1_aio_check_ascend_lists
boolean xpath1_aio_check_ascend_lists(val_value_t *useval, xpath_get2_cb_t *cb)
Check if all the ascendent AIO lists are correct lists for the current val value and XPath GET2 contr...
Definition: xpath1_aio.c:749
ncx_num.h
NCX Module Library Number Utility Functions.
obj_is_key
boolean obj_is_key(const obj_template_t *obj)
Check if object is being used as a key leaf within a list.
Definition: obj.c:14278
ncxconst.h
Contains NCX constants.
xpath1_aio_setup_get2cb
status_t xpath1_aio_setup_get2cb(getcb_get2_t *get2cb, val_value_t *useval)
Setup GET2 control block based on val value from the AIO control block, use the value val to contruct...
Definition: xpath1_aio.c:670
obj_is_list
boolean obj_is_list(const obj_template_t *obj)
Check if object is a YANG list.
Definition: obj.c:13349
xpath1_aio_get_next_aio
xpath_aio_cb_t * xpath1_aio_get_next_aio(xpath_aio_cb_t *cb)
Get the next AIO Control block for the next level object.
Definition: xpath1_aio.c:520
log_debug2
void void void void void void void void void log_debug2(const char *fstr,...) __attribute__((format(printf
Generate a new LOG_DEBUG_DEBUG2 log entry.
xpath1.h
XPath 1.0 expression support.
def_reg.h
Definition Registry module.
xpath_aio_cb_t_::obj
obj_template_t * obj
object for this subtree
Definition: xpath.h:1035
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
xpath.h
Schema and data model Xpath search support.
obj_get_name
const xmlChar * obj_get_name(const obj_template_t *obj)
Get the name field for this obj.
Definition: obj.c:10511
xpath_aio_cb_t_::parent_cb
struct xpath_aio_cb_t_ * parent_cb
parent AIO control block
Definition: xpath.h:1032
LOGDEBUG2
#define LOGDEBUG2
Check if at least log-level=debug2.
Definition: log.h:292
dlq_createSQue
void dlq_createSQue(dlq_hdrT *queAddr)
create a static queue header
Definition: dlq.c:177
xpath1_aio_setup_aiocb
status_t xpath1_aio_setup_aiocb(xpath_pcb_t *pcb, getcb_get2_t *get2cb, obj_template_t *obj)
Setup AIO control block entries.
Definition: xpath1_aio.c:601
xpath1_aio_find_aiocb_que
xpath_aio_cb_t * xpath1_aio_find_aiocb_que(dlq_hdr_t *aioQ, obj_template_t *obj)
Find AIO control block by object.
Definition: xpath1_aio.c:407
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
val_clone
val_value_t * val_clone(const val_value_t *val)
Clone a specified val_value_t struct and sub-trees.
Definition: val.c:7836
val_child.h
Value Node Child Access Support.
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
yang.h
YANG Module parser utilities.
typ.h
Parameter Type Handler.
tk_get_btype_sym
const char * tk_get_btype_sym(ncx_btype_t btyp)
Get the symbolic token symbol for one of the base types.
Definition: tk.c:3324
yangconst.h
Contains YANG constants separated to prevent H file include loops.
dlq_nextEntry
#define dlq_nextEntry(nodeP)
get the next queue entry after the current entry
Definition: dlq.h:265
xpath1_aio_find_aiocb_pcb
xpath_aio_cb_t * xpath1_aio_find_aiocb_pcb(xpath_pcb_t *pcb, obj_template_t *obj)
Find AIO control block by object.
Definition: xpath1_aio.c:438
xpath1_aio_get_first_aio
xpath_aio_cb_t * xpath1_aio_get_first_aio(xpath_pcb_t *pcb)
Get the first AIO Control block for the top level object.
Definition: xpath1_aio.c:493
val_get_next_child
val_value_t * val_get_next_child(const val_value_t *curchild)
Get the next child node.
Definition: val.c:8496
val_child_next_terminal
val_value_t * val_child_next_terminal(const val_value_t *curchild)
Get the next terminal node child present for the current node Parent must be set.
Definition: val_child.c:2447
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
getcb_match_keys_keyQ
boolean getcb_match_keys_keyQ(obj_template_t *useobj, val_value_t *useval, dlq_hdr_t *srcQ)
Match the requested list entry.
Definition: getcb.c:9163
val_clean_valQ
void val_clean_valQ(dlq_hdr_t *valQ)
Clean a queue of val_value_t.
Definition: val.c:13911
dlq_deque
void * dlq_deque(dlq_hdrT *listP)
remove the first queue node from the queue list
Definition: dlq.c:286
val_get_first_child
val_value_t * val_get_first_child(const val_value_t *parent)
Get the first child node.
Definition: val.c:8477
xpath1_aio_find_aiocb_full
xpath_aio_cb_t * xpath1_aio_find_aiocb_full(dlq_hdr_t *aioQ, obj_template_t *obj, xpath_get2_cb_t *cb)
Find AIO control block by object and also check if the AIO CB is the correct control block with the s...
Definition: xpath1_aio.c:354
dlq_empty
#define dlq_empty(listP)
check if queue list is empty
Definition: dlq.h:367
log_debug2_append
void void void void void void void void void void log_debug2_append(const char *fstr,...) __attribute__((format(printf
Append to a LOG_DEBUG_DEBUG2 log entry.
xpath1_aio_get_first_aio_ptr
val_value_t * xpath1_aio_get_first_aio_ptr(xpath_aio_cb_t *cb)
Get the first AIO val value in the valQ Queue.
Definition: xpath1_aio.c:545
obj_get_basetype
ncx_btype_t obj_get_basetype(const obj_template_t *obj)
Get the NCX base type enum for the object type.
Definition: obj.c:12077
VAL_BTYPE
#define VAL_BTYPE(V)
Access the base type : same as VAL_TYPE.
Definition: val.h:548
dlq_firstEntry
#define dlq_firstEntry(listP)
get the first entry in the queue list
Definition: dlq.h:337
VAL_OBJ
#define VAL_OBJ(V)
Access the object template.
Definition: val.h:381
ncx.h
YANG module utility functions.
obj_get_level
uint32 obj_get_level(const obj_template_t *obj)
Get the nest level for the specified object Top-level is '1' Does not count groupings as a level.
Definition: obj.c:11833
obj.h
Data Object Support.
xpath1_aio_free_cb
void xpath1_aio_free_cb(xpath_aio_cb_t *cb)
Free a malloced AIO control block.
Definition: xpath1_aio.c:468
grp.h
YANG Grouping Statement Handler.
xpath1_res.h
XPath 1.0 expression support; result support.
dlq_enque
void dlq_enque(REG void *newP, REG dlq_hdrT *listP)
add a queue node to the end of a queue list Add newP to listP
Definition: dlq.c:246
val_has_complex_child
boolean val_has_complex_child(const val_value_t *val)
Check if the value has complex children nodes.
Definition: val.c:15120
val_free_value
void val_free_value(val_value_t *val)
Scrub the memory in a val_value_t by freeing all the sub-fields and then freeing the entire struct it...
Definition: val.c:2842
val_child_first_terminal
val_value_t * val_child_first_terminal(const val_value_t *parent)
Get the first terminal node child present for this parent.
Definition: val_child.c:2412
status.h
Global error messages for status code enumerations.
obj_get_nsid
xmlns_id_t obj_get_nsid(const obj_template_t *obj)
Get the namespace ID for this object.
Definition: obj.c:12395
dlq.h
dlq provides general double-linked list and queue support:
var.h
NCX Variable Support. Used within a runstack by a CLI user or script.
typ_has_children
boolean typ_has_children(ncx_btype_t btyp)
Check if this is a data type that uses the val.v.childQ.
Definition: typ.c:3056
LOGDEBUG3
#define LOGDEBUG3
Check if at least log-level=debug3.
Definition: log.h:297