yumapro  20.10-10
YumaPro SDK
YANG String (ncx_str_t)

Make sure to include "ncxtypes.h" and "ncx_str.h" to use the ncx_str APIs. More...

Collaboration diagram for YANG String (ncx_str_t):

Functions

int32 ncx_compare_strs (const ncx_str_t *str1, const ncx_str_t *str2, ncx_btype_t btyp)
 Compare 2 ncx_str_t union contents. More...
 
status_t ncx_copy_str (const ncx_str_t *str1, ncx_str_t *str2, ncx_btype_t btyp)
 Copy the contents of str1 to str2. More...
 
void ncx_clean_str (ncx_str_t *str)
 Scrub the memory in a ncx_str_t by freeing all the sub-fields. More...
 
uint32 ncx_copy_c_safe_str (xmlChar *buffer, const xmlChar *strval)
 Copy the string to the buffer, changing legal YANG identifier chars that cannot be used in C function names to underscore. More...
 

Detailed Description

Make sure to include "ncxtypes.h" and "ncx_str.h" to use the ncx_str APIs.

Function Documentation

void ncx_clean_str ( ncx_str_t str)

Scrub the memory in a ncx_str_t by freeing all the sub-fields.

DOES NOT free the entire struct itself The struct must be removed from any queue it is in before this function is called.

Parameters
strncx_str_t data structure to clean

Here is the caller graph for this function:

int32 ncx_compare_strs ( const ncx_str_t str1,
const ncx_str_t str2,
ncx_btype_t  btyp 
)

Compare 2 ncx_str_t union contents.

Parameters
str1first string
str2second string
btypexpected data type (NCX_BT_STRING, NCX_BT_INSTANCE_ID)
Returns
compare value
      -1 if str1 is < str2
       0 if str1 == str2   (also for error, after SET_ERROR called)
       1 if str1 is > str2

Here is the call graph for this function:

Here is the caller graph for this function:

uint32 ncx_copy_c_safe_str ( xmlChar *  buffer,
const xmlChar *  strval 
)

Copy the string to the buffer, changing legal YANG identifier chars that cannot be used in C function names to underscore.

!!! DOES NOT CHECK BUFFER OVERRUN !!! !!! LENGTH OF STRING IS NOT CHANGED WHEN COPIED TO THE BUFFER !!!

Parameters
bufferbuffer to write into
strvalstring value to copy
Returns
number of chars copied

Here is the caller graph for this function:

status_t ncx_copy_str ( const ncx_str_t str1,
ncx_str_t str2,
ncx_btype_t  btyp 
)

Copy the contents of str1 to str2.

  Supports base types:
      NCX_BT_STRING
      NCX_BT_INSTANCE_ID
      NCX_BT_LEAFREF
Parameters
str1first string
str2second string
btypexpected data type
Return values
str2contains copy of str1
Returns
status

Here is the call graph for this function:

Here is the caller graph for this function: