yumapro  24.10-1
YumaPro SDK
Loading...
Searching...
No Matches
XML Namespace Support

YANG and other namespaces maintained in a registry. More...

Collaboration diagram for XML Namespace Support:

Data Structures

struct  xmlns_qname_t
 represents one QName data element More...
 
struct  xmlns_t
 represents one registered namespace More...
 
struct  xmlns_pmap_t
 represents one namespace prefix mapping More...
 

Typedefs

typedef uint16 xmlns_id_t
 integer handle for registered namespaces
 

Functions

void xmlns_init (void)
 Initialize the module static variables. More...
 
void xmlns_cleanup (void)
 Cleanup module static data. More...
 
status_t xmlns_register_ns (const xmlChar *ns, const xmlChar *pfix, const xmlChar *modname, void *modptr, xmlns_id_t *ns_id)
 Register the specified namespace. More...
 
void xmlns_unregister_ns (xmlns_id_t ns_id)
 Unregister the specified namespace. More...
 
status_t xmlns_register_temp_ns (const xmlChar *ns, const xmlChar *pfix, xmlns_id_t *ns_id)
 Register the specified temporary namespace. More...
 
status_t xmlns_convert_temp_ns (xmlns_id_t nsid, const xmlChar *pfix, const xmlChar *modname, void *modptr)
 Register the specified permanent namespace by converting the specified temporary NSID to a permanent entry. More...
 
const xmlChar * xmlns_get_ns_prefix (xmlns_id_t ns_id)
 Get the prefix for the specified namespace. More...
 
const xmlChar * xmlns_get_ns_name (xmlns_id_t ns_id)
 Get the name for the specified namespace. More...
 
xmlns_id_t xmlns_find_ns_by_module (const xmlChar *modname)
 Find the NS ID from its module name that registered it. More...
 
xmlns_id_t xmlns_find_ns_by_module_str (const xmlChar *modname, uint32 len)
 Find the NS ID from its module name that registered it. More...
 
xmlns_id_t xmlns_find_ns_by_prefix (const xmlChar *pfix)
 Find the NS ID from its prefix. More...
 
xmlns_id_t xmlns_find_ns_by_name (const xmlChar *name)
 Find the NS ID from its name. More...
 
xmlns_id_t xmlns_find_ns_by_name_str (const xmlChar *name, uint32 namelen)
 Find the NS ID from its name (counted string version) More...
 
xmlns_id_t xmlns_nc_id (void)
 Get the ID for the NETCONF namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_ncx_id (void)
 Get the ID for the NETCONF Extensions namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_ns_id (void)
 Get the ID for the XMLNS namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_inv_id (void)
 Get the INVALID namespace ID. More...
 
xmlns_id_t xmlns_xs_id (void)
 Get the ID for the XSD namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_xsi_id (void)
 Get the ID for the XSD Instance (XSI) namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_xml_id (void)
 Get the ID for the 1998 XML namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_ncn_id (void)
 Get the ID for the NETCONF Notifications namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_yang_id (void)
 Get the ID for the YANG namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_yin_id (void)
 Get the ID for the YIN namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_wildcard_id (void)
 Get the ID for the base:1.1 wildcard namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_wda_id (void)
 Get the ID for the wd:default XML attribute namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_ywattrs_id (void)
 Get the ID for the YumaWorks attributes namespace or 0 if it doesn't exist. More...
 
xmlns_id_t xmlns_origin_id (void)
 Get the ID for the ietf-origin namespace or 0 if it doesn't exist. More...
 
const xmlChar * xmlns_get_module (xmlns_id_t nsid)
 get the module name of the namespace ID More...
 
void * xmlns_get_modptr (xmlns_id_t nsid)
 get the module pointer for the namespace ID More...
 
void xmlns_set_modptrs (const xmlChar *modname, void *modptr)
 get the module pointer for the namespace ID More...
 
void xmlns_clear_modptrs (void *modptr)
 Clear the module pointer for the namespace ID. More...
 
xmlns_pmap_txmlns_new_pmap (uint32 buffsize)
 malloc and initialize a new xmlns_pmap_t struct More...
 
void xmlns_free_pmap (xmlns_pmap_t *pmap)
 free a xmlns_pmap_t struct More...
 
xmlns_qname_txmlns_new_qname (void)
 malloc and initialize a new xmlns_qname_t struct More...
 
void xmlns_free_qname (xmlns_qname_t *qname)
 free a xmlns_qname_t struct More...
 
boolean xmlns_ids_equal (xmlns_id_t ns1, xmlns_id_t ns2)
 compare 2 namespace IDs only if they are both non-zero and return TRUE if they are equal More...
 
void xmlns_check_deleted_ns (void)
 Check if a deleted namespace is pending and free it. More...
 
uint16 xmlns_get_mod_count (void)
 Get the total count of the currently loaded modules in the array of the Namespaces. More...
 

Detailed Description

YANG and other namespaces maintained in a registry.

Function Documentation

◆ xmlns_check_deleted_ns()

void xmlns_check_deleted_ns ( void  )

Check if a deleted namespace is pending and free it.

Here is the caller graph for this function:

◆ xmlns_cleanup()

void xmlns_cleanup ( void  )

Cleanup module static data.

Here is the caller graph for this function:

◆ xmlns_clear_modptrs()

void xmlns_clear_modptrs ( void *  modptr)

Clear the module pointer for the namespace ID.

Parameters
modptrncx_module_t back-ptr to clear
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_convert_temp_ns()

status_t xmlns_convert_temp_ns ( xmlns_id_t  nsid,
const xmlChar *  pfix,
const xmlChar *  modname,
void *  modptr 
)

Register the specified permanent namespace by converting the specified temporary NSID to a permanent entry.

Parameters
nsidnamespace id
pfixnamespace prefix to use (if none provided but needed)
modnamename string of module associated with this NS
modptrback-ptr to ncx_module_t struct (may be NULL)
Returns
status, NO_ERR if all okay
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_find_ns_by_module()

xmlns_id_t xmlns_find_ns_by_module ( const xmlChar *  modname)

Find the NS ID from its module name that registered it.

Parameters
modnamemodule name string to find
Returns
namespace ID or XMLNS_NULL_NS_ID if error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_find_ns_by_module_str()

xmlns_id_t xmlns_find_ns_by_module_str ( const xmlChar *  modname,
uint32  len 
)

Find the NS ID from its module name that registered it.

Parameters
modnamemodule name string to find (NOT Z-TERMINATED)
lenlength of modname
Returns
namespace ID or XMLNS_NULL_NS_ID if error
Here is the call graph for this function:

◆ xmlns_find_ns_by_name()

xmlns_id_t xmlns_find_ns_by_name ( const xmlChar *  name)

Find the NS ID from its name.

Parameters
namepointer to name string
Returns
namespace ID or XMLNS_NULL_NS_ID if error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_find_ns_by_name_str()

xmlns_id_t xmlns_find_ns_by_name_str ( const xmlChar *  name,
uint32  namelen 
)

Find the NS ID from its name (counted string version)

Parameters
namepointer to name string
namelenlength of name string
Returns
namespace ID or XMLNS_NULL_NS_ID if error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_find_ns_by_prefix()

xmlns_id_t xmlns_find_ns_by_prefix ( const xmlChar *  pfix)

Find the NS ID from its prefix.

Parameters
pfixpointer to prefix string
Returns
namespace ID or XMLNS_NULL_NS_ID if error
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_free_pmap()

void xmlns_free_pmap ( xmlns_pmap_t pmap)

free a xmlns_pmap_t struct

Parameters
pmapprefix map struct to free
Here is the caller graph for this function:

◆ xmlns_free_qname()

void xmlns_free_qname ( xmlns_qname_t qname)

free a xmlns_qname_t struct

Parameters
qnameQName struct to free
Here is the caller graph for this function:

◆ xmlns_get_mod_count()

uint16 xmlns_get_mod_count ( void  )

Get the total count of the currently loaded modules in the array of the Namespaces.

Returns modules that are not fully loaded (in progress)

Returns
total number of loaded or laading modules

◆ xmlns_get_modptr()

void * xmlns_get_modptr ( xmlns_id_t  nsid)

get the module pointer for the namespace ID

Parameters
nsidnamespace ID to check
Returns
void * cast of ncx_module_t * to the module or NULL
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_get_module()

const xmlChar * xmlns_get_module ( xmlns_id_t  nsid)

get the module name of the namespace ID

get module name that registered this namespace

Parameters
nsidnamespace ID to check
Returns
module name string
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_get_ns_name()

const xmlChar * xmlns_get_ns_name ( xmlns_id_t  ns_id)

Get the name for the specified namespace.

Parameters
ns_idnamespace ID
Returns
pointer to name or NULL if bad params
Here is the caller graph for this function:

◆ xmlns_get_ns_prefix()

const xmlChar * xmlns_get_ns_prefix ( xmlns_id_t  ns_id)

Get the prefix for the specified namespace.

Parameters
ns_idnamespace ID
Returns
pointer to prefix or NULL if bad params
Here is the caller graph for this function:

◆ xmlns_ids_equal()

boolean xmlns_ids_equal ( xmlns_id_t  ns1,
xmlns_id_t  ns2 
)

compare 2 namespace IDs only if they are both non-zero and return TRUE if they are equal

Parameters
ns1namespace ID 1
ns2namespace ID 2
Returns
TRUE if equal or both IDs are not zero
FALSE if both IDs are non-zero and they are different
Here is the caller graph for this function:

◆ xmlns_init()

void xmlns_init ( void  )

Initialize the module static variables.

Here is the caller graph for this function:

◆ xmlns_inv_id()

xmlns_id_t xmlns_inv_id ( void  )

Get the INVALID namespace ID.

Returns
INVALID NS ID or 0 if not set yet
Here is the caller graph for this function:

◆ xmlns_nc_id()

xmlns_id_t xmlns_nc_id ( void  )

Get the ID for the NETCONF namespace or 0 if it doesn't exist.

Returns
NETCONF NS ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_ncn_id()

xmlns_id_t xmlns_ncn_id ( void  )

Get the ID for the NETCONF Notifications namespace or 0 if it doesn't exist.

Returns
NCN ID or 0 if not found

◆ xmlns_ncx_id()

xmlns_id_t xmlns_ncx_id ( void  )

Get the ID for the NETCONF Extensions namespace or 0 if it doesn't exist.

Returns
NETCONF-X NS ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_new_pmap()

xmlns_pmap_t * xmlns_new_pmap ( uint32  buffsize)

malloc and initialize a new xmlns_pmap_t struct

Parameters
buffsizesize of the prefix buffer to allocate within this pmap (0 == do not malloc yet)
Returns
pointer to new struct or NULL if malloc error
Here is the caller graph for this function:

◆ xmlns_new_qname()

xmlns_qname_t * xmlns_new_qname ( void  )

malloc and initialize a new xmlns_qname_t struct

Returns
pointer to new struct or NULL if malloc error

◆ xmlns_ns_id()

xmlns_id_t xmlns_ns_id ( void  )

Get the ID for the XMLNS namespace or 0 if it doesn't exist.

Returns
XMLNS NS ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_origin_id()

xmlns_id_t xmlns_origin_id ( void  )

Get the ID for the ietf-origin namespace or 0 if it doesn't exist.

Returns
ietf-origin namespace ID or 0 if not loaded
Here is the caller graph for this function:

◆ xmlns_register_ns()

status_t xmlns_register_ns ( const xmlChar *  ns,
const xmlChar *  pfix,
const xmlChar *  modname,
void *  modptr,
xmlns_id_t ns_id 
)

Register the specified namespace.

Each namespace or prefix can only be registered once. An entry must be removed and added back in order to change it.

Parameters
nsnamespace name
pfixnamespace prefix to use (may be NULL)
modnamename string of module associated with this NS
modptrback-ptr to ncx_module_t struct (may be NULL)
[out]ns_idaddress of return NSID
  • *ns_id contains the ID assigned to the namespace
Returns
status, NO_ERR if all okay
Here is the caller graph for this function:

◆ xmlns_register_temp_ns()

status_t xmlns_register_temp_ns ( const xmlChar *  ns,
const xmlChar *  pfix,
xmlns_id_t ns_id 
)

Register the specified temporary namespace.

Parameters
nsnamespace name
pfixnamespace prefix to use (may be NULL)
[out]ns_idaddress of return NSID
  • *ns_id contains the ID assigned to the namespace
Returns
status, NO_ERR if all okay
Here is the caller graph for this function:

◆ xmlns_set_modptrs()

void xmlns_set_modptrs ( const xmlChar *  modname,
void *  modptr 
)

get the module pointer for the namespace ID

Parameters
modnamemodule owner name to find
modptrncx_module_t back-ptr to set
Here is the call graph for this function:
Here is the caller graph for this function:

◆ xmlns_unregister_ns()

void xmlns_unregister_ns ( xmlns_id_t  ns_id)

Unregister the specified namespace.

Parameters
ns_idID of namespace to unregister and free
Here is the caller graph for this function:

◆ xmlns_wda_id()

xmlns_id_t xmlns_wda_id ( void  )

Get the ID for the wd:default XML attribute namespace or 0 if it doesn't exist.

Returns
with-defaults default attribute namespace ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_wildcard_id()

xmlns_id_t xmlns_wildcard_id ( void  )

Get the ID for the base:1.1 wildcard namespace or 0 if it doesn't exist.

Returns
Wildcard ID or 0 if not found

◆ xmlns_xml_id()

xmlns_id_t xmlns_xml_id ( void  )

Get the ID for the 1998 XML namespace or 0 if it doesn't exist.

Returns
XML ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_xs_id()

xmlns_id_t xmlns_xs_id ( void  )

Get the ID for the XSD namespace or 0 if it doesn't exist.

Returns
XSD NS ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_xsi_id()

xmlns_id_t xmlns_xsi_id ( void  )

Get the ID for the XSD Instance (XSI) namespace or 0 if it doesn't exist.

Returns
XSI ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_yang_id()

xmlns_id_t xmlns_yang_id ( void  )

Get the ID for the YANG namespace or 0 if it doesn't exist.

Returns
YANG ID or 0 if not found
Here is the caller graph for this function:

◆ xmlns_yin_id()

xmlns_id_t xmlns_yin_id ( void  )

Get the ID for the YIN namespace or 0 if it doesn't exist.

Returns
YIN ID or 0 if not found

◆ xmlns_ywattrs_id()

xmlns_id_t xmlns_ywattrs_id ( void  )

Get the ID for the YumaWorks attributes namespace or 0 if it doesn't exist.

Returns
YumaWorks Attrs namespace (yumaworks-attrs.yang)
Here is the caller graph for this function: