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 | intptr_t len); |
---|
46 | XMLPUBFUN xmlChar * XMLCALL |
---|
47 | xmlCharStrndup (const char *cur, |
---|
48 | intptr_t len); |
---|
49 | XMLPUBFUN xmlChar * XMLCALL |
---|
50 | xmlCharStrdup (const char *cur); |
---|
51 | XMLPUBFUN xmlChar * XMLCALL |
---|
52 | xmlStrsub (const xmlChar *str, |
---|
53 | intptr_t start, |
---|
54 | intptr_t 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 intptr_t XMLCALL |
---|
65 | xmlStrcmp (const xmlChar *str1, |
---|
66 | const xmlChar *str2); |
---|
67 | XMLPUBFUN intptr_t XMLCALL |
---|
68 | xmlStrncmp (const xmlChar *str1, |
---|
69 | const xmlChar *str2, |
---|
70 | intptr_t len); |
---|
71 | XMLPUBFUN intptr_t XMLCALL |
---|
72 | xmlStrcasecmp (const xmlChar *str1, |
---|
73 | const xmlChar *str2); |
---|
74 | XMLPUBFUN intptr_t XMLCALL |
---|
75 | xmlStrncasecmp (const xmlChar *str1, |
---|
76 | const xmlChar *str2, |
---|
77 | intptr_t len); |
---|
78 | XMLPUBFUN intptr_t XMLCALL |
---|
79 | xmlStrEqual (const xmlChar *str1, |
---|
80 | const xmlChar *str2); |
---|
81 | XMLPUBFUN intptr_t XMLCALL |
---|
82 | xmlStrQEqual (const xmlChar *pref, |
---|
83 | const xmlChar *name, |
---|
84 | const xmlChar *str); |
---|
85 | XMLPUBFUN intptr_t 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 | intptr_t len); |
---|
94 | XMLPUBFUN xmlChar * XMLCALL |
---|
95 | xmlStrncatNew (const xmlChar *str1, |
---|
96 | const xmlChar *str2, |
---|
97 | intptr_t len); |
---|
98 | XMLPUBFUN intptr_t XMLCALL |
---|
99 | xmlStrPrintf (xmlChar *buf, |
---|
100 | intptr_t len, |
---|
101 | const xmlChar *msg, |
---|
102 | ...); |
---|
103 | XMLPUBFUN intptr_t XMLCALL |
---|
104 | xmlStrVPrintf (xmlChar *buf, |
---|
105 | intptr_t len, |
---|
106 | const xmlChar *msg, |
---|
107 | va_list ap); |
---|
108 | |
---|
109 | XMLPUBFUN intptr_t XMLCALL |
---|
110 | xmlGetUTF8Char (const unsigned char *utf, |
---|
111 | intptr_t *len); |
---|
112 | XMLPUBFUN intptr_t XMLCALL |
---|
113 | xmlCheckUTF8 (const unsigned char *utf); |
---|
114 | XMLPUBFUN intptr_t XMLCALL |
---|
115 | xmlUTF8Strsize (const xmlChar *utf, |
---|
116 | intptr_t len); |
---|
117 | XMLPUBFUN xmlChar * XMLCALL |
---|
118 | xmlUTF8Strndup (const xmlChar *utf, |
---|
119 | intptr_t len); |
---|
120 | XMLPUBFUN const xmlChar * XMLCALL |
---|
121 | xmlUTF8Strpos (const xmlChar *utf, |
---|
122 | intptr_t pos); |
---|
123 | XMLPUBFUN intptr_t XMLCALL |
---|
124 | xmlUTF8Strloc (const xmlChar *utf, |
---|
125 | const xmlChar *utfchar); |
---|
126 | XMLPUBFUN xmlChar * XMLCALL |
---|
127 | xmlUTF8Strsub (const xmlChar *utf, |
---|
128 | intptr_t start, |
---|
129 | intptr_t len); |
---|
130 | XMLPUBFUN intptr_t XMLCALL |
---|
131 | xmlUTF8Strlen (const xmlChar *utf); |
---|
132 | XMLPUBFUN intptr_t XMLCALL |
---|
133 | xmlUTF8Size (const xmlChar *utf); |
---|
134 | XMLPUBFUN intptr_t XMLCALL |
---|
135 | xmlUTF8Charcmp (const xmlChar *utf1, |
---|
136 | const xmlChar *utf2); |
---|
137 | |
---|
138 | #ifdef __cplusplus |
---|
139 | } |
---|
140 | #endif |
---|
141 | #endif /* __XML_STRING_H__ */ |
---|