71#define JSON_WR_YANG_NULL (const xmlChar *)"[null]"
88typedef enum json_wr_tag_t_ {
96typedef struct json_walker_cookie_t_ {
151 const xmlChar *modname,
170 const xmlChar *modname,
208 const xmlChar *modname,
255 const xmlChar *modname,
260 boolean startbracket);
279 boolean startbracket);
313 const xmlChar *namestr,
314 const xmlChar *valstr,
341 const xmlChar *modname,
342 const xmlChar *namestr,
343 const xmlChar *valstr,
387 boolean isfirstchild,
388 boolean isfirstsibling,
389 boolean force_lastsibling,
390 boolean force_lastsib_value,
391 boolean force_array_obj);
435 boolean isfirstchild,
436 boolean isfirstsibling,
437 boolean force_lastsibling,
438 boolean force_lastsib_value,
439 boolean force_array_obj,
441 const xmlChar *force_name);
493 const xmlChar *force_name);
645 boolean isfirstchild);
671 boolean isfirstchild);
GET1 and GET2 Callback Support.
status_t json_wr_file2(const xmlChar *filespec, val_value_t *val, int32 startindent, int32 indent, boolean modnames)
Write the specified value to a FILE in JSON format.
Definition: json_wr.c:3126
status_t json_wr_check_open_file2(FILE *fp, val_value_t *val, int32 startindent, int32 indent, val_nodetest_fn_t testfn, boolean modnames)
Write the specified value to an open FILE in JSON format Allow JSON or JSON-IETF format.
Definition: json_wr.c:2927
void json_wr_start_array_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *name, obj_template_t *obj, int32 startindent, boolean startbrace, boolean startbracket)
generate start of a JSON array; use OBJ to check the modname
Definition: json_wr.c:1765
status_t json_wr_full_check_val_force(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, val_value_t *val, int32 startindent, val_nodetest_fn_t testfn, xmlns_id_t force_nsid, const xmlChar *force_name)
generate entire val_value_t *w/filter)
Definition: json_wr.c:2851
void json_wr_end_array(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate end of a JSON array
Definition: json_wr.c:1897
status_t json_wr_max_check_val_force(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, val_value_t *val, int32 startindent, val_nodetest_fn_t testfn, boolean isfirst, boolean islast, boolean isfirstchild, boolean isfirstsibling, boolean force_lastsibling, boolean force_lastsib_value, boolean force_array_obj, xmlns_id_t force_nsid, const xmlChar *force_name)
generate entire val_value_t *w/filter)
Definition: json_wr.c:2143
void json_wr_start_array(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate start of a JSON array
Definition: json_wr.c:1728
void json_wr_check_child_obj_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, getcb_get2_t *parent_get2cb, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn, boolean isfirst, boolean isfirstchild)
generate entire val_value_t *w/filter) (extended version)
Definition: json_wr.c:3272
json_wr_tag_t
type parser used in 3 separate modes
Definition: json_wr.h:88
void json_wr_start_object_ex(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *name, int32 startindent, boolean startbrace, boolean endbrace)
generate start of a JSON object (extended version)
Definition: json_wr.c:1517
void json_wr_simval_line2(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *namestr, const xmlChar *valstr, ncx_btype_t btyp, int32 startindent, boolean isfirst)
generate 1 line for a simple value within a container or array
Definition: json_wr.c:1935
status_t json_wr_check_file2(const xmlChar *filespec, val_value_t *val, int32 startindent, int32 indent, val_nodetest_fn_t testfn, boolean modnames)
Write the specified value to a FILE in JSON format.
Definition: json_wr.c:3048
void json_wr_start_object_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *name, obj_template_t *obj, int32 startindent)
generate start of a JSON object based on val value tree; use OBJ to check the modname
Definition: json_wr.c:1644
void json_wr_start_object(ses_cb_t *scb, xml_msg_hdr_t *msg, const xmlChar *modname, const xmlChar *name, int32 startindent)
generate start of a JSON object
Definition: json_wr.c:1465
status_t json_wr_check_open_file(FILE *fp, val_value_t *val, int32 startindent, int32 indent, val_nodetest_fn_t testfn)
Write the specified value to an open FILE in JSON format.
Definition: json_wr.c:2896
status_t json_wr_full_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, val_value_t *val, int32 startindent, val_nodetest_fn_t testfn)
generate entire val_value_t *w/filter)
Definition: json_wr.c:2806
void json_wr_start_array_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 startindent, boolean startbrace, boolean startbracket)
generate start of a JSON array; use value node
Definition: json_wr.c:1833
status_t json_wr_check_file(const xmlChar *filespec, val_value_t *val, int32 startindent, int32 indent, val_nodetest_fn_t testfn)
Write the specified value to a FILE in JSON format.
Definition: json_wr.c:3016
status_t json_wr_file(const xmlChar *filespec, val_value_t *val, int32 startindent, int32 indent)
Write the specified value to a FILE in JSON format.
Definition: json_wr.c:3095
void json_wr_start_object_val(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, int32 startindent)
generate start of a JSON object based on val value tree
Definition: json_wr.c:1580
void json_wr_simval_line(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t nsid, const xmlChar *namestr, const xmlChar *valstr, ncx_btype_t btyp, int32 startindent, boolean isfirst)
generate 1 line for a simple value within a container or array
Definition: json_wr.c:2016
void json_wr_check_child_obj(ses_cb_t *scb, xml_msg_hdr_t *msg, val_value_t *val, obj_template_t *objnode, int32 indent, val_nodetest_fn_t testfn, boolean isfirst, boolean isfirstchild)
generate entire val_value_t *w/filter)
Definition: json_wr.c:3187
void json_wr_output_null(ses_cb_t *scb, int32 startindent)
generate a null value; needed for printing empty <data> element which is done as a wrapper,...
Definition: json_wr.c:3153
status_t json_wr_max_check_val(ses_cb_t *scb, xml_msg_hdr_t *msg, xmlns_id_t parent_nsid, val_value_t *val, int32 startindent, val_nodetest_fn_t testfn, boolean isfirst, boolean islast, boolean isfirstchild, boolean isfirstsibling, boolean force_lastsibling, boolean force_lastsib_value, boolean force_array_obj)
generate entire val_value_t *w/filter)
Definition: json_wr.c:2072
void json_wr_end_object(ses_cb_t *scb, xml_msg_hdr_t *msg, int32 startindent)
generate end of a JSON object
Definition: json_wr.c:1699
boolean(* val_nodetest_fn_t)(xml_msg_hdr_t *mhdr, ncx_withdefaults_t withdef, boolean realtest, val_value_t *node)
user function callback template to test output of a specified node.
Definition: val_util.h:132
status_t
global error return code
Definition: status_enum.h:219
uint16 xmlns_id_t
integer handle for registered namespaces
Definition: xmlns.h:89
ncx_btype_t
enumeration of the built-in NCX types These types cannot be overridden and cannot be imported
Definition: ncxtypes.h:213
NETCONF Session Common definitions module.
Global error messages for status code enumerations.
GET2 control block.
Definition: getcb.h:360
JSON walker function for GET2 support.
Definition: json_wr.h:96
boolean isfirst
the first call has been done
Definition: json_wr.h:116
boolean isfirstchild
the first child node call has been done
Definition: json_wr.h:119
int32 indent
indent amount
Definition: json_wr.h:104
val_nodetest_fn_t testfn
test function to skip or include the YANG data node
Definition: json_wr.h:107
boolean list_failed
Set to true if the list callback failed, so forcing the end of the array processing,...
Definition: json_wr.h:127
ses_cb_t * scb
backptr to session control block to use for output
Definition: json_wr.h:98
boolean maxmode
flag to indicate max-depth already reached
Definition: json_wr.h:113
boolean expand_varexpr
expand yangcli variable expressions if found
Definition: json_wr.h:110
xml_msg_hdr_t * msg
back-ptr to message header in progress
Definition: json_wr.h:101
One YANG data-def-stmt.
Definition: obj.h:1284
Session Control Block.
Definition: ses.h:759
one value to match one type
Definition: val.h:962
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:436
Value Node Basic Support.