yumapro  23.10T-6
YumaPro SDK
Loading...
Searching...
No Matches
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

◆ ncx_clean_str()

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:

◆ ncx_compare_strs()

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:

◆ ncx_copy_c_safe_str()

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:

◆ ncx_copy_str()

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
[out]str2second string
  • str2 contains copy of str1
btypexpected data type
Returns
status
Here is the call graph for this function:
Here is the caller graph for this function: