Debian Codegraph @

include/libxml/xmlstring.h

raw
1 /**
2 * @file
3 *
4 * @brief set of routines to process strings
5 *
6 * type and interfaces needed for the internal string handling
7 * of the library, especially UTF8 processing.
8 *
9 * @copyright See Copyright for the status of this software.
10 *
11 * @author Daniel Veillard
12 */
13
14 #ifndef __XML_STRING_H__
15 #define __XML_STRING_H__
16
17 #include <stdarg.h>
18 #include <libxml/xmlversion.h>
19
20 #ifdef __cplusplus
21 extern "C" {
22 #endif
23
24 /**
25 * This is a basic byte in an UTF-8 encoded string.
26 * It's unsigned allowing to pinpoint case where char * are assigned
27 * to xmlChar * (possibly making serialization back impossible).
28 */
29 typedef unsigned char xmlChar;
30
31 /**
32 * Macro to cast a string to an xmlChar * when one know its safe.
33 */
34 #define BAD_CAST (xmlChar *)
35
36 /*
37 * xmlChar handling
38 */
39 XMLPUBFUN xmlChar *
40 xmlStrdup (const xmlChar *cur);
41 XMLPUBFUN xmlChar *
42 xmlStrndup (const xmlChar *cur,
43 int len);
44 XMLPUBFUN xmlChar *
45 xmlCharStrndup (const char *cur,
46 int len);
47 XMLPUBFUN xmlChar *
48 xmlCharStrdup (const char *cur);
49 XMLPUBFUN xmlChar *
50 xmlStrsub (const xmlChar *str,
51 int start,
52 int len);
53 XMLPUBFUN const xmlChar *
54 xmlStrchr (const xmlChar *str,
55 xmlChar val);
56 XMLPUBFUN const xmlChar *
57 xmlStrstr (const xmlChar *str,
58 const xmlChar *val);
59 XMLPUBFUN const xmlChar *
60 xmlStrcasestr (const xmlChar *str,
61 const xmlChar *val);
62 XMLPUBFUN int
63 xmlStrcmp (const xmlChar *str1,
64 const xmlChar *str2);
65 XMLPUBFUN int
66 xmlStrncmp (const xmlChar *str1,
67 const xmlChar *str2,
68 int len);
69 XMLPUBFUN int
70 xmlStrcasecmp (const xmlChar *str1,
71 const xmlChar *str2);
72 XMLPUBFUN int
73 xmlStrncasecmp (const xmlChar *str1,
74 const xmlChar *str2,
75 int len);
76 XMLPUBFUN int
77 xmlStrEqual (const xmlChar *str1,
78 const xmlChar *str2);
79 XMLPUBFUN int
80 xmlStrQEqual (const xmlChar *pref,
81 const xmlChar *name,
82 const xmlChar *str);
83 XMLPUBFUN int
84 xmlStrlen (const xmlChar *str);
85 XMLPUBFUN xmlChar *
86 xmlStrcat (xmlChar *cur,
87 const xmlChar *add);
88 XMLPUBFUN xmlChar *
89 xmlStrncat (xmlChar *cur,
90 const xmlChar *add,
91 int len);
92 XMLPUBFUN xmlChar *
93 xmlStrncatNew (const xmlChar *str1,
94 const xmlChar *str2,
95 int len);
96 XMLPUBFUN int
97 xmlStrPrintf (xmlChar *buf,
98 int len,
99 const char *msg,
100 ...) LIBXML_ATTR_FORMAT(3,4);
101 XMLPUBFUN int
102 xmlStrVPrintf (xmlChar *buf,
103 int len,
104 const char *msg,
105 va_list ap) LIBXML_ATTR_FORMAT(3,0);
106
107 XMLPUBFUN int
108 xmlGetUTF8Char (const unsigned char *utf,
109 int *len);
110 XMLPUBFUN int
111 xmlCheckUTF8 (const unsigned char *utf);
112 XMLPUBFUN int
113 xmlUTF8Strsize (const xmlChar *utf,
114 int len);
115 XMLPUBFUN xmlChar *
116 xmlUTF8Strndup (const xmlChar *utf,
117 int len);
118 XMLPUBFUN const xmlChar *
119 xmlUTF8Strpos (const xmlChar *utf,
120 int pos);
121 XMLPUBFUN int
122 xmlUTF8Strloc (const xmlChar *utf,
123 const xmlChar *utfchar);
124 XMLPUBFUN xmlChar *
125 xmlUTF8Strsub (const xmlChar *utf,
126 int start,
127 int len);
128 XMLPUBFUN int
129 xmlUTF8Strlen (const xmlChar *utf);
130 XMLPUBFUN int
131 xmlUTF8Size (const xmlChar *utf);
132 XMLPUBFUN int
133 xmlUTF8Charcmp (const xmlChar *utf1,
134 const xmlChar *utf2);
135
136 #ifdef __cplusplus
137 }
138 #endif
139 #endif /* __XML_STRING_H__ */