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