yumapro  24.10-3
YumaPro SDK
Loading...
Searching...
No Matches
XML Value Node Utilities

Older XML utilities to make low-level data structures Most high level functions can use val_util APIs instead. More...

Collaboration diagram for XML Value Node Utilities:

Functions

xmlChar * xml_val_make_qname (xmlns_id_t nsid, const xmlChar *name)
 Make a Q-name string. More...
 
uint32 xml_val_qname_len (xmlns_id_t nsid, const xmlChar *name)
 Determine the length of the qname string that would be generated with the xml_val_make_qname function. More...
 
uint32 xml_val_sprintf_qname (xmlChar *buff, uint32 bufflen, xmlns_id_t nsid, const xmlChar *name)
 construct a QName into a buffer More...
 
status_t xml_val_add_attr (const xmlChar *name, xmlns_id_t nsid, xmlChar *attrval, val_value_t *val)
 Set up a new attr val and add it to the specified val hand off a malloced attribute string. More...
 
status_t xml_val_add_cattr (const xmlChar *name, xmlns_id_t nsid, const xmlChar *cattrval, val_value_t *val)
 Set up a new attr val and add it to the specified val const version copies string. More...
 
val_value_txml_val_new_struct (const xmlChar *name, xmlns_id_t nsid)
 Set up a new generic struct. More...
 
val_value_txml_val_new_struct2 (const xmlChar *name, xmlns_id_t nsid)
 Set up a new generic struct; copy the name. More...
 
val_value_txml_val_new_root (const xmlChar *name, xmlns_id_t nsid)
 Set up a new struct as an ncx:root. More...
 
val_value_txml_val_new_string (const xmlChar *name, xmlns_id_t nsid, xmlChar *strval)
 Set up a new string element; reuse the value instead of copying it hand off a malloced string. More...
 
val_value_txml_val_new_cstring (const xmlChar *name, xmlns_id_t nsid, const xmlChar *strval)
 Set up a new string from a const string copy a const string. More...
 
val_value_txml_val_new_cstring2 (const xmlChar *name, xmlns_id_t nsid, const xmlChar *strval)
 Set up a new string from a const string copy a const string; malloc the name! More...
 
val_value_txml_val_new_leaflist_string (const xmlChar *name, xmlns_id_t nsid, xmlChar *strval)
 Set up a new string element; reuse the value instead of copying it hand off a malloced string. More...
 
val_value_txml_val_new_flag (const xmlChar *name, xmlns_id_t nsid)
 Set up a new flag (NCX_NT_EMPTY) More...
 
val_value_txml_val_new_flag2 (const xmlChar *name, xmlns_id_t nsid)
 Set up a new flag; malloc name! More...
 
val_value_txml_val_new_boolean (const xmlChar *name, xmlns_id_t nsid, boolean boo)
 Set up a new boolean. More...
 
val_value_txml_val_new_number (const xmlChar *name, xmlns_id_t nsid, ncx_num_t *num, ncx_btype_t btyp)
 Set up a new number. More...
 

Detailed Description

Older XML utilities to make low-level data structures Most high level functions can use val_util APIs instead.

Function Documentation

◆ xml_val_add_attr()

status_t xml_val_add_attr ( const xmlChar *  name,
xmlns_id_t  nsid,
xmlChar *  attrval,
val_value_t val 
)

Set up a new attr val and add it to the specified val hand off a malloced attribute string.

Parameters
nameattr name
nsidnamespace ID of attr
attrvalattr val to add (do not use strdup)
valparent val struct to hold the new attr
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xml_val_add_cattr()

status_t xml_val_add_cattr ( const xmlChar *  name,
xmlns_id_t  nsid,
const xmlChar *  cattrval,
val_value_t val 
)

Set up a new attr val and add it to the specified val const version copies string.

Parameters
nameattr name
nsidnamespace ID of attr
cattrvalattr val to copy
valparent val struct to hold the new attr
Returns
status
Here is the call graph for this function:

◆ xml_val_make_qname()

xmlChar * xml_val_make_qname ( xmlns_id_t  nsid,
const xmlChar *  name 
)

Make a Q-name string.

Build output value: add child node to a struct node Malloc a string buffer and create a QName string This is complete; The m__free function must be called with the return value if it is non-NULL;

Parameters
nsidnamespace ID to use
namestring
Returns
malloced value string or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_boolean()

val_value_t * xml_val_new_boolean ( const xmlChar *  name,
xmlns_id_t  nsid,
boolean  boo 
)

Set up a new boolean.

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
booboolean value to set
Returns
new generic boolean leaf node or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_cstring()

val_value_t * xml_val_new_cstring ( const xmlChar *  name,
xmlns_id_t  nsid,
const xmlChar *  strval 
)

Set up a new string from a const string copy a const string.

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
strvalconst string to clone for the value node
Returns
new generic string node or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_cstring2()

val_value_t * xml_val_new_cstring2 ( const xmlChar *  name,
xmlns_id_t  nsid,
const xmlChar *  strval 
)

Set up a new string from a const string copy a const string; malloc the name!

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
strvalconst string to clone for the value node
Returns
new generic string node or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_flag()

val_value_t * xml_val_new_flag ( const xmlChar *  name,
xmlns_id_t  nsid 
)

Set up a new flag (NCX_NT_EMPTY)

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
Returns
new generic empty leaf node or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xml_val_new_flag2()

val_value_t * xml_val_new_flag2 ( const xmlChar *  name,
xmlns_id_t  nsid 
)

Set up a new flag; malloc name!

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
Returns
new generic empty leaf node or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_leaflist_string()

val_value_t * xml_val_new_leaflist_string ( const xmlChar *  name,
xmlns_id_t  nsid,
xmlChar *  strval 
)

Set up a new string element; reuse the value instead of copying it hand off a malloced string.

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
strvalmalloced string to pass off to the data node
Returns
new generic string leaf-list node or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xml_val_new_number()

val_value_t * xml_val_new_number ( const xmlChar *  name,
xmlns_id_t  nsid,
ncx_num_t num,
ncx_btype_t  btyp 
)

Set up a new number.

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
numnumber value to set
btypbase type of 'num'
Returns
new generic numeric leaf node or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_root()

val_value_t * xml_val_new_root ( const xmlChar *  name,
xmlns_id_t  nsid 
)

Set up a new struct as an ncx:root.

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
Returns
new generic root struct or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_string()

val_value_t * xml_val_new_string ( const xmlChar *  name,
xmlns_id_t  nsid,
xmlChar *  strval 
)

Set up a new string element; reuse the value instead of copying it hand off a malloced string.

DO NOT USE IN SIL OR SIL-SA CODE This function uses generic objects. YANG data should be created using the correct obj_template_t for the specific subtree

Parameters
nameelement name
nsidnamespace ID of name
strvalmalloced string to pass off to the data node
Returns
new generic string node or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_new_struct()

val_value_t * xml_val_new_struct ( const xmlChar *  name,
xmlns_id_t  nsid 
)

Set up a new generic struct.

Do not use this for SIL or SIL-SA code. This will use the generic objects which can cause elements to be printed out of order

Parameters
nameelement name
nsidnamespace ID of name
Returns
new generic struct or NULL if malloc error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xml_val_new_struct2()

val_value_t * xml_val_new_struct2 ( const xmlChar *  name,
xmlns_id_t  nsid 
)

Set up a new generic struct; copy the name.

Do not use this for SIL or SIL-SA code. This will use the generic objects which can cause elements to be printed out of order

Parameters
nameelement name
nsidnamespace ID of name
Returns
new generic struct or NULL if malloc error
Here is the call graph for this function:

◆ xml_val_qname_len()

uint32 xml_val_qname_len ( xmlns_id_t  nsid,
const xmlChar *  name 
)

Determine the length of the qname string that would be generated with the xml_val_make_qname function.

Parameters
nsidnamespace ID to use
namecondition clause (may be NULL)
Returns
length of string needed for this QName
Here is the call graph for this function:

◆ xml_val_sprintf_qname()

uint32 xml_val_sprintf_qname ( xmlChar *  buff,
uint32  bufflen,
xmlns_id_t  nsid,
const xmlChar *  name 
)

construct a QName into a buffer

Parameters
buffbuffer to use for output
bufflensize of buffer
nsidnamespace ID to use
name== name string
Returns
number of bytes written to the buffer
Here is the call graph for this function: