Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:19:32

0001 /*
0002  * Summary: set of routines to process strings
0003  * Description: type and interfaces needed for the internal string handling
0004  *              of the library, especially UTF8 processing.
0005  *
0006  * Copy: See Copyright for the status of this software.
0007  *
0008  * Author: Daniel Veillard
0009  */
0010 
0011 #ifndef __XML_STRING_H__
0012 #define __XML_STRING_H__
0013 
0014 #include <stdarg.h>
0015 #include <libxml/xmlversion.h>
0016 
0017 #ifdef __cplusplus
0018 extern "C" {
0019 #endif
0020 
0021 /**
0022  * xmlChar:
0023  *
0024  * This is a basic byte in an UTF-8 encoded string.
0025  * It's unsigned allowing to pinpoint case where char * are assigned
0026  * to xmlChar * (possibly making serialization back impossible).
0027  */
0028 typedef unsigned char xmlChar;
0029 
0030 /**
0031  * BAD_CAST:
0032  *
0033  * Macro to cast a string to an xmlChar * when one know its safe.
0034  */
0035 #define BAD_CAST (xmlChar *)
0036 
0037 /*
0038  * xmlChar handling
0039  */
0040 XMLPUBFUN xmlChar *
0041                 xmlStrdup                (const xmlChar *cur);
0042 XMLPUBFUN xmlChar *
0043                 xmlStrndup               (const xmlChar *cur,
0044                                          int len);
0045 XMLPUBFUN xmlChar *
0046                 xmlCharStrndup           (const char *cur,
0047                                          int len);
0048 XMLPUBFUN xmlChar *
0049                 xmlCharStrdup            (const char *cur);
0050 XMLPUBFUN xmlChar *
0051                 xmlStrsub                (const xmlChar *str,
0052                                          int start,
0053                                          int len);
0054 XMLPUBFUN const xmlChar *
0055                 xmlStrchr                (const xmlChar *str,
0056                                          xmlChar val);
0057 XMLPUBFUN const xmlChar *
0058                 xmlStrstr                (const xmlChar *str,
0059                                          const xmlChar *val);
0060 XMLPUBFUN const xmlChar *
0061                 xmlStrcasestr            (const xmlChar *str,
0062                                          const xmlChar *val);
0063 XMLPUBFUN int
0064                 xmlStrcmp                (const xmlChar *str1,
0065                                          const xmlChar *str2);
0066 XMLPUBFUN int
0067                 xmlStrncmp               (const xmlChar *str1,
0068                                          const xmlChar *str2,
0069                                          int len);
0070 XMLPUBFUN int
0071                 xmlStrcasecmp            (const xmlChar *str1,
0072                                          const xmlChar *str2);
0073 XMLPUBFUN int
0074                 xmlStrncasecmp           (const xmlChar *str1,
0075                                          const xmlChar *str2,
0076                                          int len);
0077 XMLPUBFUN int
0078                 xmlStrEqual              (const xmlChar *str1,
0079                                          const xmlChar *str2);
0080 XMLPUBFUN int
0081                 xmlStrQEqual             (const xmlChar *pref,
0082                                          const xmlChar *name,
0083                                          const xmlChar *str);
0084 XMLPUBFUN int
0085                 xmlStrlen                (const xmlChar *str);
0086 XMLPUBFUN xmlChar *
0087                 xmlStrcat                (xmlChar *cur,
0088                                          const xmlChar *add);
0089 XMLPUBFUN xmlChar *
0090                 xmlStrncat               (xmlChar *cur,
0091                                          const xmlChar *add,
0092                                          int len);
0093 XMLPUBFUN xmlChar *
0094                 xmlStrncatNew            (const xmlChar *str1,
0095                                          const xmlChar *str2,
0096                                          int len);
0097 XMLPUBFUN int
0098                 xmlStrPrintf             (xmlChar *buf,
0099                                          int len,
0100                                          const char *msg,
0101                                          ...) LIBXML_ATTR_FORMAT(3,4);
0102 XMLPUBFUN int
0103                 xmlStrVPrintf                (xmlChar *buf,
0104                                          int len,
0105                                          const char *msg,
0106                                          va_list ap) LIBXML_ATTR_FORMAT(3,0);
0107 
0108 XMLPUBFUN int
0109         xmlGetUTF8Char                   (const unsigned char *utf,
0110                                          int *len);
0111 XMLPUBFUN int
0112         xmlCheckUTF8                     (const unsigned char *utf);
0113 XMLPUBFUN int
0114         xmlUTF8Strsize                   (const xmlChar *utf,
0115                                          int len);
0116 XMLPUBFUN xmlChar *
0117         xmlUTF8Strndup                   (const xmlChar *utf,
0118                                          int len);
0119 XMLPUBFUN const xmlChar *
0120         xmlUTF8Strpos                    (const xmlChar *utf,
0121                                          int pos);
0122 XMLPUBFUN int
0123         xmlUTF8Strloc                    (const xmlChar *utf,
0124                                          const xmlChar *utfchar);
0125 XMLPUBFUN xmlChar *
0126         xmlUTF8Strsub                    (const xmlChar *utf,
0127                                          int start,
0128                                          int len);
0129 XMLPUBFUN int
0130         xmlUTF8Strlen                    (const xmlChar *utf);
0131 XMLPUBFUN int
0132         xmlUTF8Size                      (const xmlChar *utf);
0133 XMLPUBFUN int
0134         xmlUTF8Charcmp                   (const xmlChar *utf1,
0135                                          const xmlChar *utf2);
0136 
0137 #ifdef __cplusplus
0138 }
0139 #endif
0140 #endif /* __XML_STRING_H__ */