codekingpro/portable-devtools
116k
1/*2 * Summary: set of routines to process strings3 * Description: type and interfaces needed for the internal string handling4 * of the library, especially UTF8 processing.5 *6 * Copy: See Copyright for the status of this software.7 *8 * Author: Daniel Veillard9 */10 11#ifndef __XML_STRING_H__12#define __XML_STRING_H__13 14#include <stdarg.h>15#include <libxml/xmlversion.h>16 17#ifdef __cplusplus18extern "C" {19#endif20 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 assigned26 * to xmlChar * (possibly making serialization back impossible).27 */28typedef unsigned char xmlChar;29 30/**31 * BAD_CAST:32 *33 * Macro to cast a string to an xmlChar * when one know its safe.34 */35#define BAD_CAST (xmlChar *)36 37/*38 * xmlChar handling39 */40XMLPUBFUN xmlChar *41 xmlStrdup (const xmlChar *cur);42XMLPUBFUN xmlChar *43 xmlStrndup (const xmlChar *cur,44 int len);45XMLPUBFUN xmlChar *46 xmlCharStrndup (const char *cur,47 int len);48XMLPUBFUN xmlChar *49 xmlCharStrdup (const char *cur);50XMLPUBFUN xmlChar *51 xmlStrsub (const xmlChar *str,52 int start,53 int len);54XMLPUBFUN const xmlChar *55 xmlStrchr (const xmlChar *str,56 xmlChar val);57XMLPUBFUN const xmlChar *58 xmlStrstr (const xmlChar *str,59 const xmlChar *val);60XMLPUBFUN const xmlChar *61 xmlStrcasestr (const xmlChar *str,62 const xmlChar *val);63XMLPUBFUN int64 xmlStrcmp (const xmlChar *str1,65 const xmlChar *str2);66XMLPUBFUN int67 xmlStrncmp (const xmlChar *str1,68 const xmlChar *str2,69 int len);70XMLPUBFUN int71 xmlStrcasecmp (const xmlChar *str1,72 const xmlChar *str2);73XMLPUBFUN int74 xmlStrncasecmp (const xmlChar *str1,75 const xmlChar *str2,76 int len);77XMLPUBFUN int78 xmlStrEqual (const xmlChar *str1,79 const xmlChar *str2);80XMLPUBFUN int81 xmlStrQEqual (const xmlChar *pref,82 const xmlChar *name,83 const xmlChar *str);84XMLPUBFUN int85 xmlStrlen (const xmlChar *str);86XMLPUBFUN xmlChar *87 xmlStrcat (xmlChar *cur,88 const xmlChar *add);89XMLPUBFUN xmlChar *90 xmlStrncat (xmlChar *cur,91 const xmlChar *add,92 int len);93XMLPUBFUN xmlChar *94 xmlStrncatNew (const xmlChar *str1,95 const xmlChar *str2,96 int len);97XMLPUBFUN int98 xmlStrPrintf (xmlChar *buf,99 int len,100 const char *msg,101 ...) LIBXML_ATTR_FORMAT(3,4);102XMLPUBFUN int103 xmlStrVPrintf (xmlChar *buf,104 int len,105 const char *msg,106 va_list ap) LIBXML_ATTR_FORMAT(3,0);107 108XMLPUBFUN int109 xmlGetUTF8Char (const unsigned char *utf,110 int *len);111XMLPUBFUN int112 xmlCheckUTF8 (const unsigned char *utf);113XMLPUBFUN int114 xmlUTF8Strsize (const xmlChar *utf,115 int len);116XMLPUBFUN xmlChar *117 xmlUTF8Strndup (const xmlChar *utf,118 int len);119XMLPUBFUN const xmlChar *120 xmlUTF8Strpos (const xmlChar *utf,121 int pos);122XMLPUBFUN int123 xmlUTF8Strloc (const xmlChar *utf,124 const xmlChar *utfchar);125XMLPUBFUN xmlChar *126 xmlUTF8Strsub (const xmlChar *utf,127 int start,128 int len);129XMLPUBFUN int130 xmlUTF8Strlen (const xmlChar *utf);131XMLPUBFUN int132 xmlUTF8Size (const xmlChar *utf);133XMLPUBFUN int134 xmlUTF8Charcmp (const xmlChar *utf1,135 const xmlChar *utf2);136 137#ifdef __cplusplus138}139#endif140#endif /* __XML_STRING_H__ */141 