Lines Matching +full:cs +full:- +full:number

1 // SPDX-License-Identifier: GPL-2.0
11 * found in <asm-xx/string.h>), or get overloaded by FORTIFY_SOURCE.
31 #include <asm/word-at-a-time.h>
35 * strncasecmp - Case insensitive, length-limited string comparison
38 * @len: the maximum number of characters to compare
59 } while (--len); in strncasecmp()
60 return (int)c1 - (int)c2; in strncasecmp()
74 return c1 - c2; in strcasecmp()
100 count--; in strncpy()
120 return -E2BIG; in sized_strscpy()
127 if ((long)src & (sizeof(long) - 1)) { in sized_strscpy()
128 size_t limit = PAGE_SIZE - ((long)src & (PAGE_SIZE - 1)); in sized_strscpy()
133 /* If src or dest is unaligned, don't do word-at-a-time. */ in sized_strscpy()
134 if (((long) dest | (long) src) & (sizeof(long) - 1)) in sized_strscpy()
156 count -= sizeof(unsigned long); in sized_strscpy()
160 return -E2BIG; in sized_strscpy()
164 max -= sizeof(unsigned long); in sized_strscpy()
175 count--; in sized_strscpy()
178 /* Force NUL-termination. */ in sized_strscpy()
182 return src[res] ? -E2BIG : res; in sized_strscpy()
187 * stpcpy - copy a string from src to dest returning a pointer to the new end
188 * of dest, including src's %NUL-terminator. May overrun dest.
195 * to the new %NUL-terminating character in @dest. (For strcpy, the return
206 return --dest; in stpcpy()
233 if (--count == 0) { in strncat()
255 count -= dsize; in strlcat()
257 len = count-1; in strlcat()
267 * strcmp - Compare two strings
268 * @cs: One string
271 int strcmp(const char *cs, const char *ct) in strcmp() argument
276 c1 = *cs++; in strcmp()
279 return c1 < c2 ? -1 : 1; in strcmp()
290 * strncmp - Compare two length-limited strings
291 * @cs: One string
293 * @count: The maximum number of bytes to compare
295 int strncmp(const char *cs, const char *ct, size_t count) in strncmp() argument
300 c1 = *cs++; in strncmp()
303 return c1 < c2 ? -1 : 1; in strncmp()
306 count--; in strncmp()
315 * strchr - Find the first occurrence of a character in a string
319 * Note that the %NUL-terminator is considered part of the string, and can
334 * strchrnul - Find and return a character in a string, or end of string
351 * strnchrnul - Find and return a character in a length limited string,
354 * @count: The number of characters to be searched
362 while (count-- && *s && *s != (char)c) in strnchrnul()
369 * strrchr - Find the last occurrence of a character in a string
387 * strnchr - Find a character in a length limited string
389 * @count: The number of characters to be searched
392 * Note that the %NUL-terminator is considered part of the string, and can
397 while (count--) { in strnchr()
415 return sc - s; in strlen()
425 for (sc = s; count-- && *sc != '\0'; ++sc) in strnlen()
427 return sc - s; in strnlen()
434 …* strspn - Calculate the length of the initial substring of @s which only contain letters in @acce…
446 return p - s; in strspn()
453 …* strcspn - Calculate the length of the initial substring of @s which does not contain letters in …
465 return p - s; in strcspn()
472 * strpbrk - Find the first occurrence of a set of characters
473 * @cs: The string to be searched
476 char *strpbrk(const char *cs, const char *ct) in strpbrk() argument
480 for (sc = cs; *sc != '\0'; ++sc) { in strpbrk()
491 * strsep - Split a string into tokens
498 * of that name. In fact, it was stolen from glibc2 and de-fancy-fied.
520 * memset - Fill a region of memory with the given value
531 while (count--) in memset()
540 * memset16() - Fill a memory area with a uint16_t
543 * @count: The number of values to store
546 * of a byte. Remember that @count is the number of uint16_ts to
547 * store, not the number of bytes.
553 while (count--) in memset16()
562 * memset32() - Fill a memory area with a uint32_t
565 * @count: The number of values to store
568 * of a byte. Remember that @count is the number of uint32_ts to
569 * store, not the number of bytes.
575 while (count--) in memset32()
584 * memset64() - Fill a memory area with a uint64_t
587 * @count: The number of values to store
590 * of a byte. Remember that @count is the number of uint64_ts to
591 * store, not the number of bytes.
597 while (count--) in memset64()
606 * memcpy - Copy one area of memory to another
619 while (count--) in memcpy()
628 * memmove - Copy one area of memory to another
643 while (count--) in memmove()
650 while (count--) in memmove()
651 *--tmp = *--s; in memmove()
660 * memcmp - Compare two areas of memory
661 * @cs: One area of memory
666 __visible int memcmp(const void *cs, const void *ct, size_t count) in memcmp() argument
673 const unsigned long *u1 = cs; in memcmp()
680 count -= sizeof(unsigned long); in memcmp()
682 cs = u1; in memcmp()
686 for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) in memcmp()
687 if ((res = *su1 - *su2) != 0) in memcmp()
696 * bcmp - returns 0 if and only if the buffers have identical contents.
701 * The sign or magnitude of a non-zero return value has no particular
704 * not rely on anything but whether the return value is zero or non-zero.
715 * memscan - Find a character in an area of memory.
731 size--; in memscan()
740 * strstr - Find the first substring in a %NUL terminated string
753 l1--; in strstr()
765 * strnstr - Find the first substring in a length-limited string
768 * @len: the maximum number of characters to search
778 len--; in strnstr()
790 * memchr - Find a character in an area of memory.
801 while (n-- != 0) { in memchr()
803 return (void *)(p - 1); in memchr()
817 bytes--; in check_bytes8()
823 * memchr_inv - Find an unmatching character in an area of memory.
856 prefix = 8 - prefix; in memchr_inv()
861 bytes -= prefix; in memchr_inv()
870 words--; in memchr_inv()