![]() |
yumapro
25.10-1
YumaPro SDK
|
Make sure to include "ncxtypes.h" and "ncx_str.h" to use the ncx_str APIs. More...

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... | |
Make sure to include "ncxtypes.h" and "ncx_str.h" to use the ncx_str APIs.
| 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.
| str | ncx_str_t data structure to clean |

| 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.
| str1 | first string |
| str2 | second string |
| btyp | expected data type (NCX_BT_STRING, NCX_BT_INSTANCE_ID) |
-1 if str1 is < str2
0 if str1 == str2 (also for error, after SET_ERROR called)
1 if str1 is > str2


| 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 !!!
| buffer | buffer to write into |
| strval | string value to copy |

| 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
| str1 | first string | |
| [out] | str2 | second string
|
| btyp | expected data type |

