Lines Matching full:len
34 * @len: the len of @cur
41 xmlStrndup(const xmlChar *cur, int len) {
44 if ((cur == NULL) || (len < 0)) return(NULL);
45 ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
50 memcpy(ret, cur, len * sizeof(xmlChar));
51 ret[len] = 0;
77 * @len: the len of @cur
85 xmlCharStrndup(const char *cur, int len) {
89 if ((cur == NULL) || (len < 0)) return(NULL);
90 ret = (xmlChar *) xmlMallocAtomic((len + 1) * sizeof(xmlChar));
95 for (i = 0;i < len;i++) {
99 ret[len] = 0;
198 * @len: the max comparison length
206 xmlStrncmp(const xmlChar *str1, const xmlChar *str2, int len) {
209 if (len <= 0) return(0);
214 tmp = strncmp((const char *)str1, (const char *)str2, len);
219 if (tmp != 0 || --len == 0) return(tmp);
288 * @len: the max comparison length
296 xmlStrncasecmp(const xmlChar *str1, const xmlChar *str2, int len) {
299 if (len <= 0) return(0);
305 if (tmp != 0 || --len == 0) return(tmp);
389 * @len: the length of the substring
397 xmlStrsub(const xmlChar *str, int start, int len) {
402 if (len < 0) return(NULL);
409 return(xmlStrndup(str, len));
423 int len = 0;
428 len++;
430 return(len);
437 * @len: the length of @add
439 * a strncat for array of xmlChar's, it will extend @cur with the len
440 * first bytes of @add. Note that if @len < 0 then this is an API error
448 xmlStrncat(xmlChar *cur, const xmlChar *add, int len) {
452 if ((add == NULL) || (len == 0))
454 if (len < 0)
457 return(xmlStrndup(add, len));
460 ret = (xmlChar *) xmlRealloc(cur, (size + len + 1) * sizeof(xmlChar));
465 memcpy(&ret[size], add, len * sizeof(xmlChar));
466 ret[size + len] = 0;
474 * @len: the len of @str2 or < 0
477 * two strings are not freed. If @len is < 0 then the length
483 xmlStrncatNew(const xmlChar *str1, const xmlChar *str2, int len) {
487 if (len < 0)
488 len = xmlStrlen(str2);
489 if ((str2 == NULL) || (len == 0))
492 return(xmlStrndup(str2, len));
495 ret = (xmlChar *) xmlMalloc((size + len + 1) * sizeof(xmlChar));
501 memcpy(&ret[size], str2, len * sizeof(xmlChar));
502 ret[size + len] = 0;
532 * @len: the result buffer length.
541 xmlStrPrintf(xmlChar *buf, int len, const xmlChar *msg, ...) {
550 ret = vsnprintf((char *) buf, len, (const char *) msg, args);
552 buf[len - 1] = 0; /* be safe ! */
560 * @len: the result buffer length.
569 xmlStrVPrintf(xmlChar *buf, int len, const xmlChar *msg, va_list ap) {
576 ret = vsnprintf((char *) buf, len, (const char *) msg, ap);
577 buf[len - 1] = 0; /* be safe ! */
609 int len;
619 len = 2;
622 return len;
623 len++;
692 * @len: a pointer to the minimum number of bytes present in
698 * Returns the char value or -1 in case of error, and sets *len to
702 xmlGetUTF8Char(const unsigned char *utf, int *len) {
707 if (len == NULL)
709 if (*len < 1)
714 if (*len < 2)
719 if (*len < 3)
724 if (*len < 4)
728 *len = 4;
736 *len = 3;
743 *len = 2;
749 *len = 1;
754 if (len != NULL)
755 *len = 0;
815 * @len: the number of characters in the array
821 * the first 'len' characters of ARRAY
825 xmlUTF8Strsize(const xmlChar *utf, int len) {
832 if (len <= 0)
835 while ( len-- > 0) {
851 * @len: the len of @utf (in chars)
858 xmlUTF8Strndup(const xmlChar *utf, int len) {
862 if ((utf == NULL) || (len < 0)) return(NULL);
863 i = xmlUTF8Strsize(utf, len);
868 (len + 1) * (long)sizeof(xmlChar));
946 * @len: total number to copy
956 xmlUTF8Strsub(const xmlChar *utf, int start, int len) {
962 if (len < 0) return(NULL);
980 return(xmlUTF8Strndup(utf, len));