yumapro  20.10-12
YumaPro SDK
ncx_str.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 - 2012, Andy Bierman, All Rights Reserved.
3  * Copyright (c) 2012 - 2021, YumaWorks, Inc., All Rights Reserved.
4  *
5  * Unless required by applicable law or agreed to in writing,
6  * software distributed under the License is distributed on an
7  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
8  * KIND, either express or implied. See the License for the
9  * specific language governing permissions and limitations
10  * under the License.
11  */
12 #ifndef _H_ncx_str
13 #define _H_ncx_str
14 
15 /* FILE: ncx_str.h
16 *********************************************************************
17 * *
18 * P U R P O S E *
19 * *
20 *********************************************************************/
21 
27 /*********************************************************************
28 * *
29 * C H A N G E H I S T O R Y *
30 * *
31 *********************************************************************
32 
33 date init comment
34 ----------------------------------------------------------------------
35 17-feb-10 abb Begun; split out from ncx.c
36 */
37 
38 #include <xmlstring.h>
39 
40 #ifndef _H_dlq
41 #include "dlq.h"
42 #endif
43 
44 #ifndef _H_ncxconst
45 #include "ncxconst.h"
46 #endif
47 
48 #ifndef _H_ncxtypes
49 #include "ncxtypes.h"
50 #endif
51 
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55 
56 /********************************************************************
57 * *
58 * F U N C T I O N S *
59 * *
60 *********************************************************************/
61 
86 extern int32
87  ncx_compare_strs (const ncx_str_t *str1,
88  const ncx_str_t *str2,
89  ncx_btype_t btyp);
90 
91 
108 extern status_t
109  ncx_copy_str (const ncx_str_t *str1,
110  ncx_str_t *str2,
111  ncx_btype_t btyp);
112 
113 
124 extern void
125  ncx_clean_str (ncx_str_t *str);
126 
127 
139 extern uint32
140  ncx_copy_c_safe_str (xmlChar *buffer,
141  const xmlChar *strval);
142 
143 
147 #ifdef __cplusplus
148 } /* end extern 'C' */
149 #endif
150 
151 #endif /* _H_ncx_str */
ncx_str.h
NCX Module Library String Utility Functions.
xml_strdup
xmlChar * xml_strdup(const xmlChar *copyFrom)
String duplicate for xmlChar.
Definition: xml_util.c:1553
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.
Definition: ncx_str.c:196
ncxconst.h
Contains NCX constants.
ncxmod.h
NCX Module Load Manager.
NO_ERR
@ NO_ERR
000
Definition: status_enum.h:188
ncx_str_t
xmlChar * ncx_str_t
string alias for data types:
Definition: ncxtypes.h:589
ERR_INTERNAL_VAL
@ ERR_INTERNAL_VAL
004
Definition: status_enum.h:194
ERR_NCX_INVALID_VALUE
@ ERR_NCX_INVALID_VALUE
258
Definition: status_enum.h:299
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...
Definition: ncx_str.c:231
ERR_INTERNAL_MEM
@ ERR_INTERNAL_MEM
003
Definition: status_enum.h:193
ERR_INTERNAL_PTR
@ ERR_INTERNAL_PTR
002
Definition: status_enum.h:192
typ.h
Parameter Type Handler.
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.
Definition: ncx_str.c:158
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.
Definition: ncx_str.c:115
xml_strcmp
int xml_strcmp(const xmlChar *s1, const xmlChar *s2)
String compare for xmlChar.
Definition: xml_util.c:1746
log.h
NCX System Logging Manager.
ncxtypes.h
YANG module data structures Many internal representations of YANG module constructs.
NCX_BT_BITS
@ NCX_BT_BITS
bits
Definition: ncxtypes.h:203
typ_is_string
boolean typ_is_string(ncx_btype_t btyp)
Check if the base type is a simple string (not list)
Definition: typ.c:4097
ncx.h
YANG module utility functions.
SET_ERROR
#define SET_ERROR(E)
macro SET_ERROR
Definition: status_enum.h:103
status.h
Global error messages for status code enumerations.
dlq.h
dlq provides general double-linked list and queue support: