Path: blob/master/libs/xml2/include/libxml/xmlstring.h
4394 views
/*1* Summary: set of routines to process strings2* Description: type and interfaces needed for the internal string handling3* of the library, especially UTF8 processing.4*5* Copy: See Copyright for the status of this software.6*7* Author: Daniel Veillard8*/910#ifndef __XML_STRING_H__11#define __XML_STRING_H__1213#include <stdarg.h>14#include <libxml/xmlversion.h>1516#ifdef __cplusplus17extern "C" {18#endif1920/**21* xmlChar:22*23* This is a basic byte in an UTF-8 encoded string.24* It's unsigned allowing to pinpoint case where char * are assigned25* to xmlChar * (possibly making serialization back impossible).26*/27typedef unsigned char xmlChar;2829/**30* BAD_CAST:31*32* Macro to cast a string to an xmlChar * when one know its safe.33*/34#define BAD_CAST (xmlChar *)3536/*37* xmlChar handling38*/39XMLPUBFUN xmlChar *40xmlStrdup (const xmlChar *cur);41XMLPUBFUN xmlChar *42xmlStrndup (const xmlChar *cur,43int len);44XMLPUBFUN xmlChar *45xmlCharStrndup (const char *cur,46int len);47XMLPUBFUN xmlChar *48xmlCharStrdup (const char *cur);49XMLPUBFUN xmlChar *50xmlStrsub (const xmlChar *str,51int start,52int len);53XMLPUBFUN const xmlChar *54xmlStrchr (const xmlChar *str,55xmlChar val);56XMLPUBFUN const xmlChar *57xmlStrstr (const xmlChar *str,58const xmlChar *val);59XMLPUBFUN const xmlChar *60xmlStrcasestr (const xmlChar *str,61const xmlChar *val);62XMLPUBFUN int63xmlStrcmp (const xmlChar *str1,64const xmlChar *str2);65XMLPUBFUN int66xmlStrncmp (const xmlChar *str1,67const xmlChar *str2,68int len);69XMLPUBFUN int70xmlStrcasecmp (const xmlChar *str1,71const xmlChar *str2);72XMLPUBFUN int73xmlStrncasecmp (const xmlChar *str1,74const xmlChar *str2,75int len);76XMLPUBFUN int77xmlStrEqual (const xmlChar *str1,78const xmlChar *str2);79XMLPUBFUN int80xmlStrQEqual (const xmlChar *pref,81const xmlChar *name,82const xmlChar *str);83XMLPUBFUN int84xmlStrlen (const xmlChar *str);85XMLPUBFUN xmlChar *86xmlStrcat (xmlChar *cur,87const xmlChar *add);88XMLPUBFUN xmlChar *89xmlStrncat (xmlChar *cur,90const xmlChar *add,91int len);92XMLPUBFUN xmlChar *93xmlStrncatNew (const xmlChar *str1,94const xmlChar *str2,95int len);96XMLPUBFUN int97xmlStrPrintf (xmlChar *buf,98int len,99const char *msg,100...) LIBXML_ATTR_FORMAT(3,4);101XMLPUBFUN int102xmlStrVPrintf (xmlChar *buf,103int len,104const char *msg,105va_list ap) LIBXML_ATTR_FORMAT(3,0);106107XMLPUBFUN int108xmlGetUTF8Char (const unsigned char *utf,109int *len);110XMLPUBFUN int111xmlCheckUTF8 (const unsigned char *utf);112XMLPUBFUN int113xmlUTF8Strsize (const xmlChar *utf,114int len);115XMLPUBFUN xmlChar *116xmlUTF8Strndup (const xmlChar *utf,117int len);118XMLPUBFUN const xmlChar *119xmlUTF8Strpos (const xmlChar *utf,120int pos);121XMLPUBFUN int122xmlUTF8Strloc (const xmlChar *utf,123const xmlChar *utfchar);124XMLPUBFUN xmlChar *125xmlUTF8Strsub (const xmlChar *utf,126int start,127int len);128XMLPUBFUN int129xmlUTF8Strlen (const xmlChar *utf);130XMLPUBFUN int131xmlUTF8Size (const xmlChar *utf);132XMLPUBFUN int133xmlUTF8Charcmp (const xmlChar *utf1,134const xmlChar *utf2);135136#ifdef __cplusplus137}138#endif139#endif /* __XML_STRING_H__ */140141142