http://swpat.ffii.org/Action against software patents http://www.gnome.org/Gnome2 Logo http://www.w3.org/StatusW3C Logo http://www.redhat.com/Red Hat Logo http://xmlsoft.org/Made with Libxml2 Logo 
Module xmlstring from libxml2
API Menu ../index.htmlMain Menu ../docs.htmlDeveloper Menu ../examples/index.htmlCode Examples index.htmlAPI Menu libxml-parser.htmlParser API libxml-tree.htmlTree API libxml-xmlreader.htmlReader API ../guidelines.htmlXML Guidelines ../ChangeLog.htmlChangeLog API Indexes ../APIchunk0.htmlAlphabetic ../APIconstructors.htmlConstructors ../APIfunctions.htmlFunctions/Types ../APIfiles.htmlModules ../APIsymbols.htmlSymbols Related links http://mail.gnome.org/archives/xml/Mail archive http://xmlsoft.org/XSLT/XSLT libxslt http://phd.cs.unibo.it/gdome2/DOM gdome2 http://www.aleksey.com/xmlsec/XML-DSig xmlsec ftp://xmlsoft.org/FTP http://www.zlatkovic.com/projects/libxml/Windows binaries http://www.blastwave.org/packages.php/libxml2Solaris binaries http://www.explain.com.au/oss/libxml2xslt.htmlMacOsX binaries http://libxmlplusplus.sourceforge.net/C++ bindings http://www.zend.com/php5/articles/php5-xmlphp.php#Heading4PHP bindings http://sourceforge.net/projects/libxml2-pas/Pascal bindings http://rubyforge.org/projects/xml-tools/Ruby bindings http://tclxml.sourceforge.net/Tcl bindings http://bugzilla.gnome.org/buglist.cgi?product=libxml2Bug Tracker libxml-xmlschemastypes.htmlPrev libxml-xmlschemastypes.htmlxmlschemastypes index.htmlUp index.htmlAPI documentation ../index.htmlHome ../index.htmlThe XML C parser and toolkit of Gnome libxml-xmlunicode.htmlxmlunicode libxml-xmlunicode.htmlNext type and interfaces needed for the internal string handling of the library, especially UTF8 processing. 
Table of Contents
#define #BAD_CASTBAD_CAST Typedef unsigned char xmlChar libxml-xmlstring.html#xmlCharxmlChar  *	#xmlCharStrdupxmlCharStrdup 		(const char * cur) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlCharStrndupxmlCharStrndup 		(const char * cur, 					 int len)int	#xmlCheckUTF8xmlCheckUTF8 			(const unsigned char * utf)int	#xmlGetUTF8CharxmlGetUTF8Char 			(const unsigned char * utf, 					 int * len)int	#xmlStrEqualxmlStrEqual 			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2)int	#xmlStrPrintfxmlStrPrintf 			( libxml-xmlstring.html#xmlCharxmlChar  * buf, 					 int len, 					 const libxml-xmlstring.html#xmlCharxmlChar  * msg, 					 ... ...)int	#xmlStrQEqualxmlStrQEqual 			(const libxml-xmlstring.html#xmlCharxmlChar  * pref, 					 const libxml-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str)int	#xmlStrVPrintfxmlStrVPrintf 			( libxml-xmlstring.html#xmlCharxmlChar  * buf, 					 int len, 					 const libxml-xmlstring.html#xmlCharxmlChar  * msg, 					 va_list ap)int	#xmlStrcasecmpxmlStrcasecmp 			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2)const libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrcasestrxmlStrcasestr 		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 libxml-xmlstring.html#xmlCharxmlChar  * val) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrcatxmlStrcat 		( libxml-xmlstring.html#xmlCharxmlChar  * cur, 					 const libxml-xmlstring.html#xmlCharxmlChar  * add)const libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrchrxmlStrchr 		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 libxml-xmlstring.html#xmlCharxmlChar  val)int	#xmlStrcmpxmlStrcmp 			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrdupxmlStrdup 		(const libxml-xmlstring.html#xmlCharxmlChar  * cur)int	#xmlStrlenxmlStrlen 			(const libxml-xmlstring.html#xmlCharxmlChar  * str)int	#xmlStrncasecmpxmlStrncasecmp 			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2, 					 int len) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrncatxmlStrncat 		( libxml-xmlstring.html#xmlCharxmlChar  * cur, 					 const libxml-xmlstring.html#xmlCharxmlChar  * add, 					 int len) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrncatNewxmlStrncatNew 		(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2, 					 int len)int	#xmlStrncmpxmlStrncmp 			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2, 					 int len) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrndupxmlStrndup 		(const libxml-xmlstring.html#xmlCharxmlChar  * cur, 					 int len)const libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrstrxmlStrstr 		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 const libxml-xmlstring.html#xmlCharxmlChar  * val) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlStrsubxmlStrsub 		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 int start, 					 int len)int	#xmlUTF8CharcmpxmlUTF8Charcmp 			(const libxml-xmlstring.html#xmlCharxmlChar  * utf1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * utf2)int	#xmlUTF8SizexmlUTF8Size 			(const libxml-xmlstring.html#xmlCharxmlChar  * utf)int	#xmlUTF8StrlenxmlUTF8Strlen 			(const libxml-xmlstring.html#xmlCharxmlChar  * utf)int	#xmlUTF8StrlocxmlUTF8Strloc 			(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 const libxml-xmlstring.html#xmlCharxmlChar  * utfchar) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlUTF8StrndupxmlUTF8Strndup 		(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int len)const libxml-xmlstring.html#xmlCharxmlChar  *	#xmlUTF8StrposxmlUTF8Strpos 		(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int pos)int	#xmlUTF8StrsizexmlUTF8Strsize 			(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int len) libxml-xmlstring.html#xmlCharxmlChar  *	#xmlUTF8StrsubxmlUTF8Strsub 		(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int start, 					 int len)Description
Macro: BAD_CAST
#define BAD_CASTMacro to cast a string to an libxml-xmlstring.html#xmlCharxmlChar  * when one know its safe.
      This is a basic byte in an UTF-8 encoded string. It's unsigned allowing to pinpoint case where char * are assigned to xmlChar * (possibly making serialization back impossible).
    
Function: xmlCharStrdup
libxml-xmlstring.html#xmlCharxmlChar  *	xmlCharStrdup		(const char * cur)a strdup for char's to xmlChar's
cur: the input char * Returns: a new libxml-xmlstring.html#xmlCharxmlChar  * or NULL Function: xmlCharStrndup
libxml-xmlstring.html#xmlCharxmlChar  *	xmlCharStrndup		(const char * cur, 					 int len)a strndup for char's to xmlChar's
cur: the input char * len: the len of @cur Returns: a new libxml-xmlstring.html#xmlCharxmlChar  * or NULL Function: xmlCheckUTF8
int	xmlCheckUTF8			(const unsigned char * utf)Checks @utf for being valid UTF-8. @utf is assumed to be null-terminated. This function is not super-strict, as it will allow longer UTF-8 sequences than necessary. Note that Java is capable of producing these sequences if provoked. Also note, this routine checks for the 4-byte maximum size, but does not check for 0x10ffff maximum value.
utf: Pointer to putative UTF-8 encoded string. Returns: value: true if @utf is valid. Function: xmlGetUTF8Char
int	xmlGetUTF8Char			(const unsigned char * utf, 					 int * len)Read the first UTF8 character from @utf
utf: a sequence of UTF-8 encoded bytes len: a pointer to the minimum number of bytes present in the sequence. This is used to assure the next character is completely contained within the sequence. Returns: the char value or -1 in case of error, and sets *len to the actual number of bytes consumed (0 in case of error) Function: xmlStrEqual
int	xmlStrEqual			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2)Check if both strings are equal of have same content. Should be a bit more readable and faster than xmlStrcmp()
str1: the first libxml-xmlstring.html#xmlCharxmlChar  * str2: the second libxml-xmlstring.html#xmlCharxmlChar  * Returns: 1 if they are equal, 0 if they are different Function: xmlStrPrintf
int	xmlStrPrintf			( libxml-xmlstring.html#xmlCharxmlChar  * buf, 					 int len, 					 const libxml-xmlstring.html#xmlCharxmlChar  * msg, 					 ... ...)Formats @msg and places result into @buf.
buf: the result buffer. len: the result buffer length. msg: the message with printf formatting. ...: extra parameters for the message. Returns: the number of libxml-SAX.html#characterscharacters  written to @buf or -1 if an error occurs. Function: xmlStrQEqual
int	xmlStrQEqual			(const libxml-xmlstring.html#xmlCharxmlChar  * pref, 					 const libxml-xmlstring.html#xmlCharxmlChar  * name, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str)Check if a QName is Equal to a given string
pref: the prefix of the QName name: the localname of the QName str: the second libxml-xmlstring.html#xmlCharxmlChar  * Returns: 1 if they are equal, 0 if they are different Function: xmlStrVPrintf
int	xmlStrVPrintf			( libxml-xmlstring.html#xmlCharxmlChar  * buf, 					 int len, 					 const libxml-xmlstring.html#xmlCharxmlChar  * msg, 					 va_list ap)Formats @msg and places result into @buf.
buf: the result buffer. len: the result buffer length. msg: the message with printf formatting. ap: extra parameters for the message. Returns: the number of libxml-SAX.html#characterscharacters  written to @buf or -1 if an error occurs. Function: xmlStrcasecmp
int	xmlStrcasecmp			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2)a strcasecmp for xmlChar's
str1: the first libxml-xmlstring.html#xmlCharxmlChar  * str2: the second libxml-xmlstring.html#xmlCharxmlChar  * Returns: the integer result of the comparison Function: xmlStrcasestr
const libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrcasestr		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 libxml-xmlstring.html#xmlCharxmlChar  * val)a case-ignoring strstr for xmlChar's
str: the libxml-xmlstring.html#xmlCharxmlChar  * array (haystack) val: the libxml-xmlstring.html#xmlCharxmlChar  to search (needle) Returns: the libxml-xmlstring.html#xmlCharxmlChar  * for the first occurrence or NULL. Function: xmlStrcat
libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrcat		( libxml-xmlstring.html#xmlCharxmlChar  * cur, 					 const libxml-xmlstring.html#xmlCharxmlChar  * add)a strcat for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
cur: the original libxml-xmlstring.html#xmlCharxmlChar  * array add: the libxml-xmlstring.html#xmlCharxmlChar  * array added Returns: a new libxml-xmlstring.html#xmlCharxmlChar  * containing the concatenated string. Function: xmlStrchr
const libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrchr		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 libxml-xmlstring.html#xmlCharxmlChar  val)a strchr for xmlChar's
str: the libxml-xmlstring.html#xmlCharxmlChar  * array val: the libxml-xmlstring.html#xmlCharxmlChar  to search Returns: the libxml-xmlstring.html#xmlCharxmlChar  * for the first occurrence or NULL. Function: xmlStrcmp
int	xmlStrcmp			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2)a strcmp for xmlChar's
str1: the first libxml-xmlstring.html#xmlCharxmlChar  * str2: the second libxml-xmlstring.html#xmlCharxmlChar  * Returns: the integer result of the comparison Function: xmlStrdup
libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrdup		(const libxml-xmlstring.html#xmlCharxmlChar  * cur)a strdup for array of xmlChar's. Since they are supposed to be encoded in UTF-8 or an encoding with 8bit based chars, we assume a termination mark of '0'.
cur: the input libxml-xmlstring.html#xmlCharxmlChar  * Returns: a new libxml-xmlstring.html#xmlCharxmlChar  * or NULL Function: xmlStrlen
int	xmlStrlen			(const libxml-xmlstring.html#xmlCharxmlChar  * str)length of a xmlChar's string
str: the libxml-xmlstring.html#xmlCharxmlChar  * array Returns: the number of libxml-xmlstring.html#xmlCharxmlChar  contained in the ARRAY. Function: xmlStrncasecmp
int	xmlStrncasecmp			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2, 					 int len)a strncasecmp for xmlChar's
str1: the first libxml-xmlstring.html#xmlCharxmlChar  * str2: the second libxml-xmlstring.html#xmlCharxmlChar  * len: the max comparison length Returns: the integer result of the comparison Function: xmlStrncat
libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrncat		( libxml-xmlstring.html#xmlCharxmlChar  * cur, 					 const libxml-xmlstring.html#xmlCharxmlChar  * add, 					 int len)a strncat for array of xmlChar's, it will extend @cur with the len first bytes of @add. Note that if @len < 0 then this is an API error and NULL will be returned.
cur: the original libxml-xmlstring.html#xmlCharxmlChar  * array add: the libxml-xmlstring.html#xmlCharxmlChar  * array added len: the length of @add Returns: a new libxml-xmlstring.html#xmlCharxmlChar  *, the original @cur is reallocated if needed and should not be freed Function: xmlStrncatNew
libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrncatNew		(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2, 					 int len)same as xmlStrncat, but creates a new string. The original two strings are not freed. If @len is < 0 then the length will be calculated automatically.
str1: first libxml-xmlstring.html#xmlCharxmlChar  string str2: second libxml-xmlstring.html#xmlCharxmlChar  string len: the len of @str2 or < 0 Returns: a new libxml-xmlstring.html#xmlCharxmlChar  * or NULL Function: xmlStrncmp
int	xmlStrncmp			(const libxml-xmlstring.html#xmlCharxmlChar  * str1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * str2, 					 int len)a strncmp for xmlChar's
str1: the first libxml-xmlstring.html#xmlCharxmlChar  * str2: the second libxml-xmlstring.html#xmlCharxmlChar  * len: the max comparison length Returns: the integer result of the comparison Function: xmlStrndup
libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrndup		(const libxml-xmlstring.html#xmlCharxmlChar  * cur, 					 int len)a strndup for array of xmlChar's
cur: the input libxml-xmlstring.html#xmlCharxmlChar  * len: the len of @cur Returns: a new libxml-xmlstring.html#xmlCharxmlChar  * or NULL Function: xmlStrstr
const libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrstr		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 const libxml-xmlstring.html#xmlCharxmlChar  * val)a strstr for xmlChar's
str: the libxml-xmlstring.html#xmlCharxmlChar  * array (haystack) val: the libxml-xmlstring.html#xmlCharxmlChar  to search (needle) Returns: the libxml-xmlstring.html#xmlCharxmlChar  * for the first occurrence or NULL. Function: xmlStrsub
libxml-xmlstring.html#xmlCharxmlChar  *	xmlStrsub		(const libxml-xmlstring.html#xmlCharxmlChar  * str, 					 int start, 					 int len)Extract a substring of a given string
str: the libxml-xmlstring.html#xmlCharxmlChar  * array (haystack) start: the index of the first char (zero based) len: the length of the substring Returns: the libxml-xmlstring.html#xmlCharxmlChar  * for the first occurrence or NULL. Function: xmlUTF8Charcmp
int	xmlUTF8Charcmp			(const libxml-xmlstring.html#xmlCharxmlChar  * utf1, 					 const libxml-xmlstring.html#xmlCharxmlChar  * utf2)compares the two UCS4 values
utf1: pointer to first UTF8 char utf2: pointer to second UTF8 char Returns: result of the compare as with libxml-xmlstring.html#xmlStrncmpxmlStrncmp Function: xmlUTF8Size
int	xmlUTF8Size			(const libxml-xmlstring.html#xmlCharxmlChar  * utf)calculates the internal size of a UTF8 character
utf: pointer to the UTF8 character Returns: the numbers of bytes in the character, -1 on format error Function: xmlUTF8Strlen
int	xmlUTF8Strlen			(const libxml-xmlstring.html#xmlCharxmlChar  * utf)compute the length of an UTF8 string, it doesn't do a full UTF8 checking of the content of the string.
utf: a sequence of UTF-8 encoded bytes Returns: the number of libxml-SAX.html#characterscharacters  in the string or -1 in case of error Function: xmlUTF8Strloc
int	xmlUTF8Strloc			(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 const libxml-xmlstring.html#xmlCharxmlChar  * utfchar)a function to provide the relative location of a UTF8 char
utf: the input UTF8 * utfchar: the UTF8 character to be found Returns: the relative character position of the desired char or -1 if not found Function: xmlUTF8Strndup
libxml-xmlstring.html#xmlCharxmlChar  *	xmlUTF8Strndup		(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int len)a strndup for array of UTF8's
utf: the input UTF8 * len: the len of @utf (in chars) Returns: a new UTF8 * or NULL Function: xmlUTF8Strpos
const libxml-xmlstring.html#xmlCharxmlChar  *	xmlUTF8Strpos		(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int pos)a function to provide the equivalent of fetching a character from a string array
utf: the input UTF8 * pos: the position of the desired UTF8 char (in chars) Returns: a pointer to the UTF8 character or NULL Function: xmlUTF8Strsize
int	xmlUTF8Strsize			(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int len)storage size of an UTF8 string the behaviour is not garanteed if the input string is not UTF-8
utf: a sequence of UTF-8 encoded bytes len: the number of libxml-SAX.html#characterscharacters  in the array Returns: the storage size of the first 'len' libxml-SAX.html#characterscharacters  of ARRAY Function: xmlUTF8Strsub
libxml-xmlstring.html#xmlCharxmlChar  *	xmlUTF8Strsub		(const libxml-xmlstring.html#xmlCharxmlChar  * utf, 					 int start, 					 int len)Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars
utf: a sequence of UTF-8 encoded bytes start: relative pos of first char len: total number to copy Returns: a pointer to a newly created string or NULL if any problem ../bugs.htmlDaniel Veillard 
