Lines Matching refs:len

41 xmlStrndup(const xmlChar *cur, int len) {  in xmlStrndup()  argument
44 if ((cur == NULL) || (len < 0)) return(NULL); in xmlStrndup()
45 ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); in xmlStrndup()
50 memcpy(ret, cur, len * sizeof(xmlChar)); in xmlStrndup()
51 ret[len] = 0; in xmlStrndup()
85 xmlCharStrndup(const char *cur, int len) { in xmlCharStrndup() argument
89 if ((cur == NULL) || (len < 0)) return(NULL); in xmlCharStrndup()
90 ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar)); in xmlCharStrndup()
95 for (i = 0;i < len;i++) { in xmlCharStrndup()
99 ret[len] = 0; in xmlCharStrndup()
206 xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) { in xmlStrncmp() argument
209 if (len <= 0) return(0); in xmlStrncmp()
214 tmp = strncmp((const char *)str1, (const char *)str2, len); in xmlStrncmp()
219 if (tmp != 0 || --len == 0) return(tmp); in xmlStrncmp()
296 xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) { in xmlStrncasecmp() argument
299 if (len <= 0) return(0); in xmlStrncasecmp()
305 if (tmp != 0 || --len == 0) return(tmp); in xmlStrncasecmp()
397 xmlStrsub(const xmlChar *str, int start, int len) { in xmlStrsub() argument
402 if (len < 0) return(NULL); in xmlStrsub()
409 return(xmlStrndup(str, len)); in xmlStrsub()
423 int len = 0; in xmlStrlen() local
428 len++; in xmlStrlen()
430 return(len); in xmlStrlen()
448 xmlStrncat(xmlChar *cur, const xmlChar *add, int len) { in xmlStrncat() argument
452 if ((add == NULL) || (len == 0)) in xmlStrncat()
454 if (len < 0) in xmlStrncat()
457 return(xmlStrndup(add, len)); in xmlStrncat()
460 ret = (xmlChar *) xmlRealloc(cur, (size + len + 1) * sizeof(xmlChar)); in xmlStrncat()
465 memcpy(&ret[size], add, len * sizeof(xmlChar)); in xmlStrncat()
466 ret[size + len] = 0; in xmlStrncat()
483 xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) { in xmlStrncatNew() argument
487 if (len < 0) in xmlStrncatNew()
488 len = xmlStrlen(str2); in xmlStrncatNew()
489 if ((str2 == NULL) || (len == 0)) in xmlStrncatNew()
492 return(xmlStrndup(str2, len)); in xmlStrncatNew()
495 ret = (xmlChar *) xmlMalloc((size + len + 1) * sizeof(xmlChar)); in xmlStrncatNew()
501 memcpy(&ret[size], str2, len * sizeof(xmlChar)); in xmlStrncatNew()
502 ret[size + len] = 0; in xmlStrncatNew()
541 xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) { in xmlStrPrintf() argument
550 ret = vsnprintf((char *) buf, len, (const char *) msg, args); in xmlStrPrintf()
552 buf[len - 1] = 0; /* be safe ! */ in xmlStrPrintf()
569 xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) { in xmlStrVPrintf() argument
576 ret = vsnprintf((char *) buf, len, (const char *) msg, ap); in xmlStrVPrintf()
577 buf[len - 1] = 0; /* be safe ! */ in xmlStrVPrintf()
609 int len; in xmlUTF8Size() local
619 len = 2; in xmlUTF8Size()
622 return len; in xmlUTF8Size()
623 len++; in xmlUTF8Size()
702 xmlGetUTF8Char(const unsigned char *utf, int *len) { in xmlGetUTF8Char() argument
707 if (len == NULL) in xmlGetUTF8Char()
709 if (*len < 1) in xmlGetUTF8Char()
714 if (*len < 2) in xmlGetUTF8Char()
719 if (*len < 3) in xmlGetUTF8Char()
724 if (*len < 4) in xmlGetUTF8Char()
728 *len = 4; in xmlGetUTF8Char()
736 *len = 3; in xmlGetUTF8Char()
743 *len = 2; in xmlGetUTF8Char()
749 *len = 1; in xmlGetUTF8Char()
754 if (len != NULL) in xmlGetUTF8Char()
755 *len = 0; in xmlGetUTF8Char()
825 xmlUTF8Strsize(const xmlChar *utf, int len) { in xmlUTF8Strsize() argument
832 if (len <= 0) in xmlUTF8Strsize()
835 while ( len-- > 0) { in xmlUTF8Strsize()
858 xmlUTF8Strndup(const xmlChar *utf, int len) { in xmlUTF8Strndup() argument
862 if ((utf == NULL) || (len < 0)) return(NULL); in xmlUTF8Strndup()
863 i = xmlUTF8Strsize(utf, len); in xmlUTF8Strndup()
868 (len + 1) * (long)sizeof(xmlChar)); in xmlUTF8Strndup()
956 xmlUTF8Strsub(const xmlChar *utf, int start, int len) { in xmlUTF8Strsub() argument
962 if (len < 0) return(NULL); in xmlUTF8Strsub()
980 return(xmlUTF8Strndup(utf, len)); in xmlUTF8Strsub()