ReactOS  0.4.13-dev-551-gf37fb1f
xmlstring.c File Reference
#include "libxml.h"
#include <stdlib.h>
#include <string.h>
#include <libxml/xmlmemory.h>
#include <libxml/parserInternals.h>
#include <libxml/xmlstring.h>
#include "elfgcchack.h"
Include dependency graph for xmlstring.c:

Go to the source code of this file.

Macros

#define IN_LIBXML
 

Functions

xmlCharxmlStrndup (const xmlChar *cur, int len)
 
xmlCharxmlStrdup (const xmlChar *cur)
 
xmlCharxmlCharStrndup (const char *cur, int len)
 
xmlCharxmlCharStrdup (const char *cur)
 
int xmlStrcmp (const xmlChar *str1, const xmlChar *str2)
 
int xmlStrEqual (const xmlChar *str1, const xmlChar *str2)
 

: the localname of the QName

xmlStrQEqual: @pref: the prefix of the QName

@str: the second xmlChar *

Check if a QName is Equal to a given string

Returns 1 if they are equal, 0 if they are different

#define bottom_xmlstring
 
static const xmlChar casemap [256]
 
int xmlStrQEqual (const xmlChar *pref, const xmlChar *name, const xmlChar *str)
 
int xmlStrncmp (const xmlChar *str1, const xmlChar *str2, int len)
 
int xmlStrcasecmp (const xmlChar *str1, const xmlChar *str2)
 
int xmlStrncasecmp (const xmlChar *str1, const xmlChar *str2, int len)
 
const xmlCharxmlStrchr (const xmlChar *str, xmlChar val)
 
const xmlCharxmlStrstr (const xmlChar *str, const xmlChar *val)
 
const xmlCharxmlStrcasestr (const xmlChar *str, const xmlChar *val)
 
xmlCharxmlStrsub (const xmlChar *str, int start, int len)
 
int xmlStrlen (const xmlChar *str)
 
xmlCharxmlStrncat (xmlChar *cur, const xmlChar *add, int len)
 
xmlCharxmlStrncatNew (const xmlChar *str1, const xmlChar *str2, int len)
 
xmlCharxmlStrcat (xmlChar *cur, const xmlChar *add)
 
int XMLCDECL xmlStrPrintf (xmlChar *buf, int len, const char *msg,...)
 
int xmlStrVPrintf (xmlChar *buf, int len, const char *msg, va_list ap)
 
int xmlUTF8Size (const xmlChar *utf)
 
int xmlUTF8Charcmp (const xmlChar *utf1, const xmlChar *utf2)
 
int xmlUTF8Strlen (const xmlChar *utf)
 
int xmlGetUTF8Char (const unsigned char *utf, int *len)
 
int xmlCheckUTF8 (const unsigned char *utf)
 
int xmlUTF8Strsize (const xmlChar *utf, int len)
 
xmlCharxmlUTF8Strndup (const xmlChar *utf, int len)
 
const xmlCharxmlUTF8Strpos (const xmlChar *utf, int pos)
 
int xmlUTF8Strloc (const xmlChar *utf, const xmlChar *utfchar)
 
xmlCharxmlUTF8Strsub (const xmlChar *utf, int start, int len)
 
xmlCharxmlEscapeFormatString (xmlChar **msg)
 

Macro Definition Documentation

◆ bottom_xmlstring

#define bottom_xmlstring

Definition at line 1046 of file xmlstring.c.

◆ IN_LIBXML

#define IN_LIBXML

Definition at line 16 of file xmlstring.c.

Function Documentation

◆ xmlCharStrdup()

xmlChar* xmlCharStrdup ( const char cur)

xmlCharStrdup: @cur: the input char *

a strdup for char's to xmlChar's

Returns a new xmlChar * or NULL

Definition at line 113 of file xmlstring.c.

113  {
114  const char *p = cur;
115 
116  if (cur == NULL) return(NULL);
117  while (*p != '\0') p++; /* non input consuming */
118  return(xmlCharStrndup(cur, p - cur));
119 }
smooth NULL
Definition: ftsmooth.c:416
xmlChar * xmlCharStrndup(const char *cur, int len)
Definition: xmlstring.c:85
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by xmlParseDocument(), xmlParseExtParsedEnt(), xmlParseTextDecl(), and xmlPosixStrdup().

◆ xmlCharStrndup()

xmlChar* xmlCharStrndup ( const char cur,
int  len 
)

xmlCharStrndup: @cur: the input char * @len: the len of @cur

a strndup for char's to xmlChar's

Returns a new xmlChar * or NULL

Definition at line 85 of file xmlstring.c.

85  {
86  int i;
87  xmlChar *ret;
88 
89  if ((cur == NULL) || (len < 0)) return(NULL);
90  ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
91  if (ret == NULL) {
93  return(NULL);
94  }
95  for (i = 0;i < len;i++) {
96  ret[i] = (xmlChar) cur[i];
97  if (ret[i] == 0) return(ret);
98  }
99  ret[len] = 0;
100  return(ret);
101 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
int ret
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722

Referenced by xmlCharStrdup().

◆ xmlCheckUTF8()

int xmlCheckUTF8 ( const unsigned char utf)

xmlCheckUTF8: @utf: Pointer to putative UTF-8 encoded string.

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.

Return value: true if @utf is valid.

Definition at line 781 of file xmlstring.c.

782 {
783  int ix;
784  unsigned char c;
785 
786  if (utf == NULL)
787  return(0);
788  /*
789  * utf is a string of 1, 2, 3 or 4 bytes. The valid strings
790  * are as follows (in "bit format"):
791  * 0xxxxxxx valid 1-byte
792  * 110xxxxx 10xxxxxx valid 2-byte
793  * 1110xxxx 10xxxxxx 10xxxxxx valid 3-byte
794  * 11110xxx 10xxxxxx 10xxxxxx 10xxxxxx valid 4-byte
795  */
796  for (ix = 0; (c = utf[ix]);) { /* string is 0-terminated */
797  if ((c & 0x80) == 0x00) { /* 1-byte code, starts with 10 */
798  ix++;
799  } else if ((c & 0xe0) == 0xc0) {/* 2-byte code, starts with 110 */
800  if ((utf[ix+1] & 0xc0 ) != 0x80)
801  return 0;
802  ix += 2;
803  } else if ((c & 0xf0) == 0xe0) {/* 3-byte code, starts with 1110 */
804  if (((utf[ix+1] & 0xc0) != 0x80) ||
805  ((utf[ix+2] & 0xc0) != 0x80))
806  return 0;
807  ix += 3;
808  } else if ((c & 0xf8) == 0xf0) {/* 4-byte code, starts with 11110 */
809  if (((utf[ix+1] & 0xc0) != 0x80) ||
810  ((utf[ix+2] & 0xc0) != 0x80) ||
811  ((utf[ix+3] & 0xc0) != 0x80))
812  return 0;
813  ix += 4;
814  } else /* unknown encoding */
815  return 0;
816  }
817  return(1);
818 }
smooth NULL
Definition: ftsmooth.c:416
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80

◆ xmlEscapeFormatString()

xmlChar* xmlEscapeFormatString ( xmlChar **  msg)

xmlEscapeFormatString: @msg: a pointer to the string in which to escape '' characters. Must be a heap-allocated buffer created by libxml2 that may be returned, or that may be freed and replaced.

Replaces the string pointed to by 'msg' with an escaped string. Returns the same string with all '' characters escaped.

Definition at line 1001 of file xmlstring.c.

1002 {
1003  xmlChar *msgPtr = NULL;
1004  xmlChar *result = NULL;
1005  xmlChar *resultPtr = NULL;
1006  size_t count = 0;
1007  size_t msgLen = 0;
1008  size_t resultLen = 0;
1009 
1010  if (!msg || !*msg)
1011  return(NULL);
1012 
1013  for (msgPtr = *msg; *msgPtr != '\0'; ++msgPtr) {
1014  ++msgLen;
1015  if (*msgPtr == '%')
1016  ++count;
1017  }
1018 
1019  if (count == 0)
1020  return(*msg);
1021 
1022  resultLen = msgLen + count + 1;
1023  result = (xmlChar *) xmlMallocAtomic(resultLen * sizeof(xmlChar));
1024  if (result == NULL) {
1025  /* Clear *msg to prevent format string vulnerabilities in
1026  out-of-memory situations. */
1027  xmlFree(*msg);
1028  *msg = NULL;
1030  return(NULL);
1031  }
1032 
1033  for (msgPtr = *msg, resultPtr = result; *msgPtr != '\0'; ++msgPtr, ++resultPtr) {
1034  *resultPtr = *msgPtr;
1035  if (*msgPtr == '%')
1036  *(++resultPtr) = '%';
1037  }
1038  result[resultLen - 1] = '\0';
1039 
1040  xmlFree(*msg);
1041  *msg = result;
1042 
1043  return *msg;
1044 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
GLuint GLuint GLsizei count
Definition: gl.h:1545
smooth NULL
Definition: ftsmooth.c:416
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
XMLPUBVAR xmlFreeFunc xmlFree
Definition: globals.h:250
unsigned char xmlChar
Definition: xmlstring.h:28
#define msg(x)
Definition: auth_time.c:54
GLuint64EXT * result
Definition: glext.h:11304

◆ xmlGetUTF8Char()

int xmlGetUTF8Char ( const unsigned char utf,
int len 
)

xmlGetUTF8Char: @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.

Read the first UTF8 character from @utf

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)

Definition at line 710 of file xmlstring.c.

710  {
711  unsigned int c;
712 
713  if (utf == NULL)
714  goto error;
715  if (len == NULL)
716  goto error;
717  if (*len < 1)
718  goto error;
719 
720  c = utf[0];
721  if (c & 0x80) {
722  if (*len < 2)
723  goto error;
724  if ((utf[1] & 0xc0) != 0x80)
725  goto error;
726  if ((c & 0xe0) == 0xe0) {
727  if (*len < 3)
728  goto error;
729  if ((utf[2] & 0xc0) != 0x80)
730  goto error;
731  if ((c & 0xf0) == 0xf0) {
732  if (*len < 4)
733  goto error;
734  if ((c & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
735  goto error;
736  *len = 4;
737  /* 4-byte code */
738  c = (utf[0] & 0x7) << 18;
739  c |= (utf[1] & 0x3f) << 12;
740  c |= (utf[2] & 0x3f) << 6;
741  c |= utf[3] & 0x3f;
742  } else {
743  /* 3-byte code */
744  *len = 3;
745  c = (utf[0] & 0xf) << 12;
746  c |= (utf[1] & 0x3f) << 6;
747  c |= utf[2] & 0x3f;
748  }
749  } else {
750  /* 2-byte code */
751  *len = 2;
752  c = (utf[0] & 0x1f) << 6;
753  c |= utf[1] & 0x3f;
754  }
755  } else {
756  /* 1-byte code */
757  *len = 1;
758  }
759  return(c);
760 
761 error:
762  if (len != NULL)
763  *len = 0;
764  return(-1);
765 }
#define error(str)
Definition: mkdosfs.c:1605
smooth NULL
Definition: ftsmooth.c:416
const GLubyte * c
Definition: glext.h:8905
GLenum GLsizei len
Definition: glext.h:6722
#define c
Definition: ke_i.h:80

Referenced by xmlCharEncOutFunc().

◆ xmlStrcasecmp()

int xmlStrcasecmp ( const xmlChar str1,
const xmlChar str2 
)

xmlStrcasecmp: @str1: the first xmlChar * @str2: the second xmlChar *

a strcasecmp for xmlChar's

Returns the integer result of the comparison

Definition at line 271 of file xmlstring.c.

271  {
272  register int tmp;
273 
274  if (str1 == str2) return(0);
275  if (str1 == NULL) return(-1);
276  if (str2 == NULL) return(1);
277  do {
278  tmp = casemap[*str1++] - casemap[*str2];
279  if (tmp != 0) return(tmp);
280  } while (*str2++ != 0);
281  return 0;
282 }
static const xmlChar casemap[256]
Definition: xmlstring.c:225
smooth NULL
Definition: ftsmooth.c:416

Referenced by xmlParseEncodingDecl(), xsltApplyStylesheetInternal(), xsltDocumentElem(), xsltGetHTMLIDs(), and xsltParseStylesheetPI().

◆ xmlStrcasestr()

const xmlChar* xmlStrcasestr ( const xmlChar str,
const xmlChar val 
)

xmlStrcasestr: @str: the xmlChar * array (haystack) @val: the xmlChar to search (needle)

a case-ignoring strstr for xmlChar's

Returns the xmlChar * for the first occurrence or NULL.

Definition at line 369 of file xmlstring.c.

369  {
370  int n;
371 
372  if (str == NULL) return(NULL);
373  if (val == NULL) return(NULL);
374  n = xmlStrlen(val);
375 
376  if (n == 0) return(str);
377  while (*str != 0) { /* non input consuming */
378  if (casemap[*str] == casemap[*val])
379  if (!xmlStrncasecmp(str, val, n)) return(str);
380  str++;
381  }
382  return(NULL);
383 }
int xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len)
Definition: xmlstring.c:296
GLdouble n
Definition: glext.h:7729
static const xmlChar casemap[256]
Definition: xmlstring.c:225
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLuint GLfloat * val
Definition: glext.h:7180
int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:422

◆ xmlStrcat()

xmlChar* xmlStrcat ( xmlChar cur,
const xmlChar add 
)

xmlStrcat: @cur: the original xmlChar * array @add: the xmlChar * array added

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'.

Returns a new xmlChar * containing the concatenated string. The original @cur is reallocated and should not be freed.

Definition at line 526 of file xmlstring.c.

526  {
527  const xmlChar *p = add;
528 
529  if (add == NULL) return(cur);
530  if (cur == NULL)
531  return(xmlStrdup(add));
532 
533  while (*p != 0) p++; /* non input consuming */
534  return(xmlStrncat(cur, add, p - add));
535 }
int add
Definition: i386-dis.c:3122
xmlChar * xmlStrncat(xmlChar *cur, const xmlChar *add, int len)
Definition: xmlstring.c:448
smooth NULL
Definition: ftsmooth.c:416
unsigned char xmlChar
Definition: xmlstring.h:28
GLfloat GLfloat p
Definition: glext.h:8902
xmlChar * xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66

Referenced by xmllintExternalEntityLoader(), xmlURIEscape(), xsltAddKey(), xsltAttrTemplateValueProcessNode(), xsltEvalAVT(), xsltFormatNumberConversion(), and xsltReverseCompMatch().

◆ xmlStrchr()

const xmlChar* xmlStrchr ( const xmlChar str,
xmlChar  val 
)

xmlStrchr: @str: the xmlChar * array @val: the xmlChar to search

a strchr for xmlChar's

Returns the xmlChar * for the first occurrence or NULL.

Definition at line 321 of file xmlstring.c.

321  {
322  if (str == NULL) return(NULL);
323  while (*str != 0) { /* non input consuming */
324  if (*str == val) return((xmlChar *) str);
325  str++;
326  }
327  return(NULL);
328 }
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLuint GLfloat * val
Definition: glext.h:7180
unsigned char xmlChar
Definition: xmlstring.h:28

Referenced by xmlBufWriteQuotedString(), xmlParseAttValueComplex(), xmlParseEntityDecl(), xmlParseEntityRef(), xmlParseNotationDecl(), xmlParsePITarget(), xmlParseReference(), xmlParserEntityCheck(), xmlParseStringEntityRef(), xmlSAX2GetEntity(), xmlURIEscapeStr(), xsltCompileAttr(), and xsltEvalStaticAttrValueTemplate().

◆ xmlStrcmp()

int xmlStrcmp ( const xmlChar str1,
const xmlChar str2 
)

xmlStrcmp: @str1: the first xmlChar * @str2: the second xmlChar *

a strcmp for xmlChar's

Returns the integer result of the comparison

Definition at line 132 of file xmlstring.c.

132  {
133  register int tmp;
134 
135  if (str1 == str2) return(0);
136  if (str1 == NULL) return(-1);
137  if (str2 == NULL) return(1);
138  do {
139  tmp = *str1++ - *str2;
140  if (tmp != 0) return(tmp);
141  } while (*str2++ != 0);
142  return 0;
143 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by xmlBuildRelativeURI(), xsltDefaultSortFunction(), and xsltLocaleStrcmp().

◆ xmlStrdup()

xmlChar* xmlStrdup ( const xmlChar cur)

xmlStrdup: @cur: the input xmlChar *

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'.

Returns a new xmlChar * or NULL

Definition at line 66 of file xmlstring.c.

66  {
67  const xmlChar *p = cur;
68 
69  if (cur == NULL) return(NULL);
70  while (*p != 0) p++; /* non input consuming */
71  return(xmlStrndup(cur, p - cur));
72 }
smooth NULL
Definition: ftsmooth.c:416
xmlChar * xmlStrndup(const xmlChar *cur, int len)
Definition: xmlstring.c:41
unsigned char xmlChar
Definition: xmlstring.h:28
GLfloat GLfloat p
Definition: glext.h:8902

Referenced by xmlAddAttributeDecl(), xmlAddElementDecl(), xmlAddID(), xmlAddNotationDecl(), xmlAddRef(), xmlBuildRelativeURI(), xmlBuildURI(), xmlCanonicPath(), xmlCopyDocElementContent(), xmlCreateEnumeration(), xmlCtxtResetPush(), xmlCtxtUseOptionsInternal(), xmlDoRead(), xmlGetDtdElementDesc2(), xmlHashAddEntry3(), xmlHashUpdateEntry3(), xmlInitializeGlobalState(), xmllintExternalEntityLoader(), xmlNewDocElementContent(), xmlNewEntityInputStream(), xmlNewInputFromFile(), xmlParseCtxtExternalEntity(), xmlParseExternalEntityPrivate(), xmlParseInNodeContext(), xmlPathToURI(), xmlSAX2AttributeNs(), xmlSAX2Characters(), xmlSAX2EndDocument(), xmlSAX2StartDocument(), xmlSAX2StartElementNs(), xmlSplitQName(), xmlStrcat(), xmlStrncatNew(), xmlSwitchEncoding(), xmlURIEscapeStr(), xsltAddKey(), xsltApplyStylesheetInternal(), xsltAttribute(), xsltAttrListTemplateProcess(), xsltAttrTemplateProcess(), xsltCheckWrite(), xsltCompileStepPattern(), xsltCopyText(), xsltDocumentElem(), xsltElement(), xsltElementAvailableFunction(), xsltFormatNumberConversion(), xsltFunctionAvailableFunction(), xsltGetNsProp(), xsltGetQNameURI(), xsltKeyFunction(), xsltNewDecimalFormat(), xsltNewExtDef(), xsltNewKeyDef(), xsltNewKeyTable(), xsltParseStylesheetKey(), xsltParseStylesheetOutput(), xsltParseStylesheetProcess(), xsltParseStylesheetTemplate(), xsltReverseCompMatch(), and xsltSystemPropertyFunction().

◆ xmlStrEqual()

int xmlStrEqual ( const xmlChar str1,
const xmlChar str2 
)

xmlStrEqual: @str1: the first xmlChar * @str2: the second xmlChar *

Check if both strings are equal of have same content. Should be a bit more readable and faster than xmlStrcmp()

Returns 1 if they are equal, 0 if they are different

Definition at line 157 of file xmlstring.c.

157  {
158  if (str1 == str2) return(1);
159  if (str1 == NULL) return(0);
160  if (str2 == NULL) return(0);
161  do {
162  if (*str1++ != *str2) return(0);
163  } while (*str2++);
164  return(1);
165 }
smooth NULL
Definition: ftsmooth.c:416

Referenced by exclPrefixPush(), xmlAddAttributeDecl(), xmlBuildRelativeURI(), xmlHashAddEntry3(), xmlHashLookup3(), xmlHashRemoveEntry3(), xmlHashScanFull3(), xmlHashUpdateEntry3(), xmlIsID(), xmlIsXHTML(), xmlParseAttribute2(), xmlParseCtxtExternalEntity(), xmlParseDocument(), xmlParseEntityDecl(), xmlParseEnumerationType(), xmlParseNotationType(), xmlParsePI(), xmlParsePITarget(), xmlParseStartTag2(), xmlParseXMLDecl(), xmlSaveUri(), xmlSAX2AttributeDecl(), xmlSAX2StartElementNs(), xmlStrQEqual(), xsltApplyFallbacks(), xsltApplySequenceConstructor(), xsltApplyStylesheetInternal(), xsltApplyTemplates(), xsltApplyXSLTTemplate(), xsltAttribute(), xsltAttributeComp(), xsltAttrListTemplateProcess(), xsltAttrTemplateProcess(), xsltCheckExtPrefix(), xsltCheckExtURI(), xsltCheckInstructionElement(), xsltCheckParentElement(), xsltCheckRead(), xsltCheckTopLevelElement(), xsltCheckWrite(), xsltCompileIdKeyPattern(), xsltCompileStepPattern(), xsltCopyNamespaceList(), xsltCopyNamespaceListInternal(), xsltCopyTree(), xsltDecimalFormatGetByName(), xsltDecimalFormatGetByQName(), xsltDefaultSortFunction(), xsltDocumentComp(), xsltDocumentElem(), xsltDocumentFunction(), xsltDocumentFunctionLoadDocument(), xsltElement(), xsltFindElemSpaceHandling(), xsltGatherNamespaces(), xsltGetCNsProp(), xsltGetInheritedNsList(), xsltGetKey(), xsltGetNsProp(), xsltGetSpecialNamespace(), xsltInitAllDocKeys(), xsltInitCtxtKey(), xsltInitDocKeyTable(), xsltLoadDocument(), xsltLoadStyleDocument(), xsltLoadStylesheetPI(), xsltMessage(), xsltNamespaceAlias(), xsltNumberComp(), xsltNumberFormat(), xsltParseStylesheetExcludePrefix(), xsltParseStylesheetExtPrefix(), xsltParseStylesheetImport(), xsltParseStylesheetInclude(), xsltParseStylesheetOutput(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetProcess(), xsltParseStylesheetStripSpace(), xsltParseStylesheetTop(), xsltParseTemplateContent(), xsltPreprocessStylesheet(), xsltProcessUserParamInternal(), xsltRegisterExtPrefix(), xsltRegisterGlobalVariable(), xsltSaveResultTo(), xsltSaveResultToFd(), xsltSaveResultToFile(), xsltSaveResultToFilename(), xsltSaveResultToString(), xsltShallowCopyNsNode(), xsltSortComp(), xsltStylePreCompute(), xsltSystemPropertyFunction(), xsltTestCompMatch(), xsltTestCompMatchCount(), xsltTestPredicateMatch(), xsltTextComp(), and xsltValueOfComp().

◆ xmlStrlen()

int xmlStrlen ( const xmlChar str)

xmlStrlen: @str: the xmlChar * array

length of a xmlChar's string

Returns the number of xmlChar contained in the ARRAY.

Definition at line 422 of file xmlstring.c.

422  {
423  int len = 0;
424 
425  if (str == NULL) return(0);
426  while (*str != 0) { /* non input consuming */
427  str++;
428  len++;
429  }
430  return(len);
431 }
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLenum GLsizei len
Definition: glext.h:6722

Referenced by xmlAddDefAttrs(), xmlBufAdd(), xmlBufAddHead(), xmlBuildRelativeURI(), xmlCanonicPath(), xmlCreateDocParserCtxt(), xmlNewEntityInputStream(), xmlNewStringInputStream(), xmlParseAttValueComplex(), xmlParseBalancedChunkMemoryInternal(), xmlParseReference(), xmlParseStartTag2(), xmlReportError(), xmlSAX2Characters(), xmlSnprintfElementContent(), xmlStrcasestr(), xmlStringDecodeEntities(), xmlStringLenDecodeEntities(), xmlStrncat(), xmlStrncatNew(), xmlStrstr(), xmlURIEscapeStr(), xsltAddTextString(), xsltComment(), xsltCopyText(), xsltCopyTextString(), xsltFormatNumberConversion(), xsltMessage(), xsltNumberComp(), and xsltSaveProfiling().

◆ xmlStrncasecmp()

int xmlStrncasecmp ( const xmlChar str1,
const xmlChar str2,
int  len 
)

xmlStrncasecmp: @str1: the first xmlChar * @str2: the second xmlChar * @len: the max comparison length

a strncasecmp for xmlChar's

Returns the integer result of the comparison

Definition at line 296 of file xmlstring.c.

296  {
297  register int tmp;
298 
299  if (len <= 0) return(0);
300  if (str1 == str2) return(0);
301  if (str1 == NULL) return(-1);
302  if (str2 == NULL) return(1);
303  do {
304  tmp = casemap[*str1++] - casemap[*str2];
305  if (tmp != 0 || --len == 0) return(tmp);
306  } while (*str2++ != 0);
307  return 0;
308 }
static const xmlChar casemap[256]
Definition: xmlstring.c:225
smooth NULL
Definition: ftsmooth.c:416
GLenum GLsizei len
Definition: glext.h:6722

Referenced by xmlStrcasestr(), and xsltElementComp().

◆ xmlStrncat()

xmlChar* xmlStrncat ( xmlChar cur,
const xmlChar add,
int  len 
)

xmlStrncat: @cur: the original xmlChar * array @add: the xmlChar * array added @len: the length of @add

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.

Returns a new xmlChar *, the original @cur is reallocated and should not be freed.

Definition at line 448 of file xmlstring.c.

448  {
449  int size;
450  xmlChar *ret;
451 
452  if ((add == NULL) || (len == 0))
453  return(cur);
454  if (len < 0)
455  return(NULL);
456  if (cur == NULL)
457  return(xmlStrndup(add, len));
458 
459  size = xmlStrlen(cur);
460  if (size < 0)
461  return(NULL);
462  ret = (xmlChar *) xmlRealloc(cur, (size + len + 1) * sizeof(xmlChar));
463  if (ret == NULL) {
465  return(cur);
466  }
467  memcpy(&ret[size], add, len * sizeof(xmlChar));
468  ret[size + len] = 0;
469  return(ret);
470 }
int add
Definition: i386-dis.c:3122
smooth NULL
Definition: ftsmooth.c:416
XMLPUBVAR xmlReallocFunc xmlRealloc
Definition: globals.h:249
GLsizeiptr size
Definition: glext.h:5919
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
xmlChar * xmlStrndup(const xmlChar *cur, int len)
Definition: xmlstring.c:41
int ret
unsigned char xmlChar
Definition: xmlstring.h:28
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:422

Referenced by xmlStrcat(), xsltAddKey(), xsltAttrTemplateValueProcessNode(), and xsltCompileAttr().

◆ xmlStrncatNew()

xmlChar* xmlStrncatNew ( const xmlChar str1,
const xmlChar str2,
int  len 
)

xmlStrncatNew: @str1: first xmlChar string @str2: second xmlChar string @len: the len of @str2 or < 0

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.

Returns a new xmlChar * or NULL

Definition at line 485 of file xmlstring.c.

485  {
486  int size;
487  xmlChar *ret;
488 
489  if (len < 0) {
490  len = xmlStrlen(str2);
491  if (len < 0)
492  return(NULL);
493  }
494  if ((str2 == NULL) || (len == 0))
495  return(xmlStrdup(str1));
496  if (str1 == NULL)
497  return(xmlStrndup(str2, len));
498 
499  size = xmlStrlen(str1);
500  if (size < 0)
501  return(NULL);
502  ret = (xmlChar *) xmlMalloc((size + len + 1) * sizeof(xmlChar));
503  if (ret == NULL) {
505  return(xmlStrndup(str1, size));
506  }
507  memcpy(ret, str1, size * sizeof(xmlChar));
508  memcpy(&ret[size], str2, len * sizeof(xmlChar));
509  ret[size + len] = 0;
510  return(ret);
511 }
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
xmlChar * xmlStrndup(const xmlChar *cur, int len)
Definition: xmlstring.c:41
int ret
unsigned char xmlChar
Definition: xmlstring.h:28
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:422
XMLPUBVAR xmlMallocFunc xmlMalloc
Definition: globals.h:247
xmlChar * xmlStrdup(const xmlChar *cur)
Definition: xmlstring.c:66

◆ xmlStrncmp()

int xmlStrncmp ( const xmlChar str1,
const xmlChar str2,
int  len 
)

xmlStrncmp: @str1: the first xmlChar * @str2: the second xmlChar * @len: the max comparison length

a strncmp for xmlChar's

Returns the integer result of the comparison

Definition at line 206 of file xmlstring.c.

206  {
207  register int tmp;
208 
209  if (len <= 0) return(0);
210  if (str1 == str2) return(0);
211  if (str1 == NULL) return(-1);
212  if (str2 == NULL) return(1);
213 #ifdef __GNUC__
214  tmp = strncmp((const char *)str1, (const char *)str2, len);
215  return tmp;
216 #else
217  do {
218  tmp = *str1++ - *str2;
219  if (tmp != 0 || --len == 0) return(tmp);
220  } while (*str2++ != 0);
221  return 0;
222 #endif
223 }
smooth NULL
Definition: ftsmooth.c:416
int strncmp(const char *String1, const char *String2, ACPI_SIZE Count)
Definition: utclib.c:534
GLenum GLsizei len
Definition: glext.h:6722

Referenced by xmlDictExists(), xmlDictLookup(), xmlParseEndTag2(), xmlStrstr(), xmlUTF8Charcmp(), xmlUTF8Strloc(), xsltFormatNumberConversion(), and xsltUTF8Charcmp().

◆ xmlStrndup()

xmlChar* xmlStrndup ( const xmlChar cur,
int  len 
)

xmlStrndup: @cur: the input xmlChar * @len: the len of @cur

a strndup for array of xmlChar's

Returns a new xmlChar * or NULL

Definition at line 41 of file xmlstring.c.

41  {
42  xmlChar *ret;
43 
44  if ((cur == NULL) || (len < 0)) return(NULL);
45  ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
46  if (ret == NULL) {
48  return(NULL);
49  }
50  memcpy(ret, cur, len * sizeof(xmlChar));
51  ret[len] = 0;
52  return(ret);
53 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
smooth NULL
Definition: ftsmooth.c:416
void xmlErrMemory(xmlParserCtxtPtr ctxt, const char *extra)
int ret
unsigned char xmlChar
Definition: xmlstring.h:28
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722

Referenced by parsePath(), xmlAttrNormalizeSpace2(), xmlNewDocElementContent(), xmlParseAttribute2(), xmlParseAttValueInternal(), xmlParseNmtoken(), xmlParseStringName(), xmlSAX2AttributeNs(), xmlSAX2TextNode(), xmlSplitQName(), xmlStrdup(), xmlStrncat(), xmlStrncatNew(), xmlStrsub(), xsltAttrTemplateValueProcessNode(), xsltCompileAttr(), xsltCompilePatternInternal(), xsltCompileStepPattern(), xsltDocumentElem(), xsltGetQNameURI2(), xsltNumberFormatTokenize(), xsltParseStylesheetExcludePrefix(), xsltParseStylesheetExtPrefix(), xsltParseStylesheetOutput(), xsltParseStylesheetPI(), xsltParseStylesheetPreserveSpace(), xsltParseStylesheetStripSpace(), xsltSaveResultToString(), xsltScanLiteral(), and xsltScanNCName().

◆ xmlStrPrintf()

int XMLCDECL xmlStrPrintf ( xmlChar buf,
int  len,
const char msg,
  ... 
)

xmlStrPrintf: @buf: the result buffer. @len: the result buffer length. @msg: the message with printf formatting. ...: extra parameters for the message.

Formats @msg and places result into @buf.

Returns the number of characters written to @buf or -1 if an error occurs.

Definition at line 549 of file xmlstring.c.

549  {
550  va_list args;
551  int ret;
552 
553  if((buf == NULL) || (msg == NULL)) {
554  return(-1);
555  }
556 
557  va_start(args, msg);
558  ret = vsnprintf((char *) buf, len, (const char *) msg, args);
559  va_end(args);
560  buf[len - 1] = 0; /* be safe ! */
561 
562  return(ret);
563 }
#define vsnprintf
Definition: tif_win32.c:406
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
Definition: match.c:390
#define va_end(ap)
Definition: acmsvcex.h:90
smooth NULL
Definition: ftsmooth.c:416
char * va_list
Definition: acmsvcex.h:78
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define msg(x)
Definition: auth_time.c:54
#define args
Definition: format.c:66

◆ xmlStrQEqual()

int xmlStrQEqual ( const xmlChar pref,
const xmlChar name,
const xmlChar str 
)

Definition at line 179 of file xmlstring.c.

179  {
180  if (pref == NULL) return(xmlStrEqual(name, str));
181  if (name == NULL) return(0);
182  if (str == NULL) return(0);
183 
184  do {
185  if (*pref++ != *str) return(0);
186  } while ((*str++) && (*pref));
187  if (*str++ != ':') return(0);
188  do {
189  if (*name++ != *str) return(0);
190  } while (*str++);
191  return(1);
192 }
int xmlStrEqual(const xmlChar *str1, const xmlChar *str2)
Definition: xmlstring.c:157
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
Definition: name.c:36

Referenced by xmlDictQLookup(), and xmlHashQLookup3().

◆ xmlStrstr()

const xmlChar* xmlStrstr ( const xmlChar str,
const xmlChar val 
)

xmlStrstr: @str: the xmlChar * array (haystack) @val: the xmlChar to search (needle)

a strstr for xmlChar's

Returns the xmlChar * for the first occurrence or NULL.

Definition at line 341 of file xmlstring.c.

341  {
342  int n;
343 
344  if (str == NULL) return(NULL);
345  if (val == NULL) return(NULL);
346  n = xmlStrlen(val);
347 
348  if (n == 0) return(str);
349  while (*str != 0) { /* non input consuming */
350  if (*str == *val) {
351  if (!xmlStrncmp(str, val, n)) return((const xmlChar *) str);
352  }
353  str++;
354  }
355  return(NULL);
356 }
GLdouble n
Definition: glext.h:7729
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
GLuint GLfloat * val
Definition: glext.h:7180
unsigned char xmlChar
Definition: xmlstring.h:28
int xmlStrlen(const xmlChar *str)
Definition: xmlstring.c:422
int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
Definition: xmlstring.c:206

Referenced by xmlCanonicPath(), xsltComment(), xsltProcessingInstruction(), and xsltSystemPropertyFunction().

◆ xmlStrsub()

xmlChar* xmlStrsub ( const xmlChar str,
int  start,
int  len 
)

xmlStrsub: @str: the xmlChar * array (haystack) @start: the index of the first char (zero based) @len: the length of the substring

Extract a substring of a given string

Returns the xmlChar * for the first occurrence or NULL.

Definition at line 397 of file xmlstring.c.

397  {
398  int i;
399 
400  if (str == NULL) return(NULL);
401  if (start < 0) return(NULL);
402  if (len < 0) return(NULL);
403 
404  for (i = 0;i < start;i++) {
405  if (*str == 0) return(NULL);
406  str++;
407  }
408  if (*str == 0) return(NULL);
409  return(xmlStrndup(str, len));
410 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
xmlChar * xmlStrndup(const xmlChar *cur, int len)
Definition: xmlstring.c:41
GLenum GLsizei len
Definition: glext.h:6722
GLuint start
Definition: gl.h:1545

◆ xmlStrVPrintf()

int xmlStrVPrintf ( xmlChar buf,
int  len,
const char msg,
va_list  ap 
)

xmlStrVPrintf: @buf: the result buffer. @len: the result buffer length. @msg: the message with printf formatting. @ap: extra parameters for the message.

Formats @msg and places result into @buf.

Returns the number of characters written to @buf or -1 if an error occurs.

Definition at line 577 of file xmlstring.c.

577  {
578  int ret;
579 
580  if((buf == NULL) || (msg == NULL)) {
581  return(-1);
582  }
583 
584  ret = vsnprintf((char *) buf, len, (const char *) msg, ap);
585  buf[len - 1] = 0; /* be safe ! */
586 
587  return(ret);
588 }
#define vsnprintf
Definition: tif_win32.c:406
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:7751
smooth NULL
Definition: ftsmooth.c:416
int ret
GLenum GLsizei len
Definition: glext.h:6722
#define msg(x)
Definition: auth_time.c:54
void int int ULONGLONG int va_list * ap
Definition: winesup.h:32

◆ xmlUTF8Charcmp()

int xmlUTF8Charcmp ( const xmlChar utf1,
const xmlChar utf2 
)

xmlUTF8Charcmp: @utf1: pointer to first UTF8 char @utf2: pointer to second UTF8 char

compares the two UCS4 values

returns result of the compare as with xmlStrncmp

Definition at line 646 of file xmlstring.c.

646  {
647 
648  if (utf1 == NULL ) {
649  if (utf2 == NULL)
650  return 0;
651  return -1;
652  }
653  return xmlStrncmp(utf1, utf2, xmlUTF8Size(utf1));
654 }
smooth NULL
Definition: ftsmooth.c:416
int xmlUTF8Size(const xmlChar *utf)
Definition: xmlstring.c:615
int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
Definition: xmlstring.c:206

◆ xmlUTF8Size()

int xmlUTF8Size ( const xmlChar utf)

xmlUTF8Size: @utf: pointer to the UTF8 character

calculates the internal size of a UTF8 character

returns the numbers of bytes in the character, -1 on format error

Definition at line 615 of file xmlstring.c.

615  {
616  xmlChar mask;
617  int len;
618 
619  if (utf == NULL)
620  return -1;
621  if (*utf < 0x80)
622  return 1;
623  /* check valid UTF8 character */
624  if (!(*utf & 0x40))
625  return -1;
626  /* determine number of bytes in char */
627  len = 2;
628  for (mask=0x20; mask != 0; mask>>=1) {
629  if (!(*utf & mask))
630  return len;
631  len++;
632  }
633  return -1;
634 }
GLenum GLint GLuint mask
Definition: glext.h:6028
smooth NULL
Definition: ftsmooth.c:416
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722

Referenced by xmlUTF8Charcmp().

◆ xmlUTF8Strlen()

int xmlUTF8Strlen ( const xmlChar utf)

xmlUTF8Strlen: @utf: a sequence of UTF-8 encoded bytes

compute the length of an UTF8 string, it doesn't do a full UTF8 checking of the content of the string.

Returns the number of characters in the string or -1 in case of error

Definition at line 666 of file xmlstring.c.

666  {
667  int ret = 0;
668 
669  if (utf == NULL)
670  return(-1);
671 
672  while (*utf != 0) {
673  if (utf[0] & 0x80) {
674  if ((utf[1] & 0xc0) != 0x80)
675  return(-1);
676  if ((utf[0] & 0xe0) == 0xe0) {
677  if ((utf[2] & 0xc0) != 0x80)
678  return(-1);
679  if ((utf[0] & 0xf0) == 0xf0) {
680  if ((utf[0] & 0xf8) != 0xf0 || (utf[3] & 0xc0) != 0x80)
681  return(-1);
682  utf += 4;
683  } else {
684  utf += 3;
685  }
686  } else {
687  utf += 2;
688  }
689  } else {
690  utf++;
691  }
692  ret++;
693  }
694  return(ret);
695 }
smooth NULL
Definition: ftsmooth.c:416
int ret

◆ xmlUTF8Strloc()

int xmlUTF8Strloc ( const xmlChar utf,
const xmlChar utfchar 
)

xmlUTF8Strloc: @utf: the input UTF8 * @utfchar: the UTF8 character to be found

a function to provide the relative location of a UTF8 char

Returns the relative character position of the desired char or -1 if not found

Definition at line 927 of file xmlstring.c.

927  {
928  int i, size;
929  xmlChar ch;
930 
931  if (utf==NULL || utfchar==NULL) return -1;
932  size = xmlUTF8Strsize(utfchar, 1);
933  for(i=0; (ch=*utf) != 0; i++) {
934  if (xmlStrncmp(utf, utfchar, size)==0)
935  return(i);
936  utf++;
937  if ( ch & 0x80 ) {
938  /* if not simple ascii, verify proper format */
939  if ( (ch & 0xc0) != 0xc0 )
940  return(-1);
941  /* then skip over remaining bytes for this char */
942  while ( (ch <<= 1) & 0x80 )
943  if ( (*utf++ & 0xc0) != 0x80 )
944  return(-1);
945  }
946  }
947 
948  return(-1);
949 }
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
int xmlUTF8Strsize(const xmlChar *utf, int len)
Definition: xmlstring.c:833
GLsizeiptr size
Definition: glext.h:5919
unsigned char xmlChar
Definition: xmlstring.h:28
int xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len)
Definition: xmlstring.c:206

Referenced by xsltFormatNumberConversion().

◆ xmlUTF8Strndup()

xmlChar* xmlUTF8Strndup ( const xmlChar utf,
int  len 
)

xmlUTF8Strndup: @utf: the input UTF8 * @len: the len of @utf (in chars)

a strndup for array of UTF8's

Returns a new UTF8 * or NULL

Definition at line 866 of file xmlstring.c.

866  {
867  xmlChar *ret;
868  int i;
869 
870  if ((utf == NULL) || (len < 0)) return(NULL);
871  i = xmlUTF8Strsize(utf, len);
872  ret = (xmlChar *) xmlMallocAtomic((i + 1) * sizeof(xmlChar));
873  if (ret == NULL) {
875  "malloc of %ld byte failed\n",
876  (len + 1) * (long)sizeof(xmlChar));
877  return(NULL);
878  }
879  memcpy(ret, utf, i * sizeof(xmlChar));
880  ret[i] = 0;
881  return(ret);
882 }
XMLPUBVAR xmlMallocFunc xmlMallocAtomic
Definition: globals.h:248
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
XMLPUBVAR xmlGenericErrorFunc xmlGenericError
Definition: globals.h:346
smooth NULL
Definition: ftsmooth.c:416
int xmlUTF8Strsize(const xmlChar *utf, int len)
Definition: xmlstring.c:833
int ret
unsigned char xmlChar
Definition: xmlstring.h:28
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
XMLPUBVAR void * xmlGenericErrorContext
Definition: globals.h:362

Referenced by xmlUTF8Strsub().

◆ xmlUTF8Strpos()

const xmlChar* xmlUTF8Strpos ( const xmlChar utf,
int  pos 
)

xmlUTF8Strpos: @utf: the input UTF8 * @pos: the position of the desired UTF8 char (in chars)

a function to provide the equivalent of fetching a character from a string array

Returns a pointer to the UTF8 character or NULL

Definition at line 895 of file xmlstring.c.

895  {
896  xmlChar ch;
897 
898  if (utf == NULL) return(NULL);
899  if (pos < 0)
900  return(NULL);
901  while (pos--) {
902  if ((ch=*utf++) == 0) return(NULL);
903  if ( ch & 0x80 ) {
904  /* if not simple ascii, verify proper format */
905  if ( (ch & 0xc0) != 0xc0 )
906  return(NULL);
907  /* then skip over remaining bytes for this char */
908  while ( (ch <<= 1) & 0x80 )
909  if ( (*utf++ & 0xc0) != 0x80 )
910  return(NULL);
911  }
912  }
913  return((xmlChar *)utf);
914 }
smooth NULL
Definition: ftsmooth.c:416
unsigned char xmlChar
Definition: xmlstring.h:28

Referenced by xsltFormatNumberConversion().

◆ xmlUTF8Strsize()

int xmlUTF8Strsize ( const xmlChar utf,
int  len 
)

xmlUTF8Strsize: @utf: a sequence of UTF-8 encoded bytes @len: the number of characters in the array

storage size of an UTF8 string the behaviour is not guaranteed if the input string is not UTF-8

Returns the storage size of the first 'len' characters of ARRAY

Definition at line 833 of file xmlstring.c.

833  {
834  const xmlChar *ptr=utf;
835  xmlChar ch;
836 
837  if (utf == NULL)
838  return(0);
839 
840  if (len <= 0)
841  return(0);
842 
843  while ( len-- > 0) {
844  if ( !*ptr )
845  break;
846  if ( (ch = *ptr++) & 0x80)
847  while ((ch<<=1) & 0x80 ) {
848  if (*ptr == 0) break;
849  ptr++;
850  }
851  }
852  return (ptr - utf);
853 }
static PVOID ptr
Definition: dispmode.c:27
smooth NULL
Definition: ftsmooth.c:416
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722

Referenced by xmlUTF8Strloc(), xmlUTF8Strndup(), xsltFormatNumberConversion(), xsltFormatNumberPreSuffix(), and xsltUTF8Charcmp().

◆ xmlUTF8Strsub()

xmlChar* xmlUTF8Strsub ( const xmlChar utf,
int  start,
int  len 
)

xmlUTF8Strsub: @utf: a sequence of UTF-8 encoded bytes @start: relative pos of first char @len: total number to copy

Create a substring from a given UTF-8 string Note: positions are given in units of UTF-8 chars

Returns a pointer to a newly created string or NULL if any problem

Definition at line 964 of file xmlstring.c.

964  {
965  int i;
966  xmlChar ch;
967 
968  if (utf == NULL) return(NULL);
969  if (start < 0) return(NULL);
970  if (len < 0) return(NULL);
971 
972  /*
973  * Skip over any leading chars
974  */
975  for (i = 0;i < start;i++) {
976  if ((ch=*utf++) == 0) return(NULL);
977  if ( ch & 0x80 ) {
978  /* if not simple ascii, verify proper format */
979  if ( (ch & 0xc0) != 0xc0 )
980  return(NULL);
981  /* then skip over remaining bytes for this char */
982  while ( (ch <<= 1) & 0x80 )
983  if ( (*utf++ & 0xc0) != 0x80 )
984  return(NULL);
985  }
986  }
987 
988  return(xmlUTF8Strndup(utf, len));
989 }
xmlChar * xmlUTF8Strndup(const xmlChar *utf, int len)
Definition: xmlstring.c:866
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
smooth NULL
Definition: ftsmooth.c:416
unsigned char xmlChar
Definition: xmlstring.h:28
GLenum GLsizei len
Definition: glext.h:6722
GLuint start
Definition: gl.h:1545

Variable Documentation

◆ casemap

const xmlChar casemap[256]
static

Definition at line 225 of file xmlstring.c.

Referenced by xmlStrcasecmp(), xmlStrcasestr(), and xmlStrncasecmp().