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,
358 boolean isfirstchild,
359 boolean isfirstsibling,
360 boolean force_lastsibling,
361 boolean force_lastsib_value,
362 boolean force_array_obj);
406 boolean isfirstchild,
407 boolean isfirstsibling,
408 boolean force_lastsibling,
409 boolean force_lastsib_value,
410 boolean force_array_obj,
412 const xmlChar *force_name);
464 const xmlChar *force_name);
616 boolean isfirstchild);
642 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:3004
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:2805
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:1731
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:2729
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:1863
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:2063
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:1694
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:3150
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:1495
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:2926
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:1617
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:1443
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:2774
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:2684
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:1799
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:2894
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:2973
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:1558
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:1898
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:3065
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:3031
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:1992
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:1665
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:210
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:357
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:1229
Session Control Block.
Definition: ses.h:573
one value to match one type
Definition: val.h:912
Common Encoding Message Header No longer XML specific!! Used by JSON and CBOR parsing as well!...
Definition: xml_msg.h:404
Value Node Basic Support.