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.
29 #include <asm/word-at-a-time.h>
34 * strncasecmp - Case insensitive, length-limited string comparison
37 * @len: the maximum number of characters to compare
58 } while (--len); in strncasecmp()
59 return (int)c1 - (int)c2; in strncasecmp()
73 return c1 - c2; in strcasecmp()
80 * strcpy - Copy a %NUL terminated string
97 * strncpy - Copy a length-limited, C-string
100 * @count: The maximum number of bytes to copy
102 * The result is not %NUL-terminated if the source exceeds
117 count--; in strncpy()
126 * strlcpy - Copy a C-string into a sized buffer
132 * NUL-terminated string that fits in the buffer (unless,
141 size_t len = (ret >= size) ? size - 1 : ret; in strlcpy()
152 * strscpy - Copy a C-string into a sized buffer
159 * buffer is always NUL terminated, unless it's zero-sized.
163 * the return value is easier to error-check than strlcpy()'s.
172 * * The number of characters copied (not including the trailing %NUL)
173 * * -E2BIG if count is 0 or @src was truncated.
182 return -E2BIG; in strscpy()
189 if ((long)src & (sizeof(long) - 1)) { in strscpy()
190 size_t limit = PAGE_SIZE - ((long)src & (PAGE_SIZE - 1)); in strscpy()
195 /* If src or dest is unaligned, don't do word-at-a-time. */ in strscpy()
196 if (((long) dest | (long) src) & (sizeof(long) - 1)) in strscpy()
220 count -= sizeof(unsigned long); in strscpy()
221 max -= sizeof(unsigned long); in strscpy()
232 count--; in strscpy()
235 /* Hit buffer length without finding a NUL; force NUL-termination. */ in strscpy()
237 dest[res-1] = '\0'; in strscpy()
239 return -E2BIG; in strscpy()
245 * stpcpy - copy a string from src to dest returning a pointer to the new end
246 * of dest, including src's %NUL-terminator. May overrun dest.
253 * to the new %NUL-terminating character in @dest. (For strcpy, the return
264 return --dest; in stpcpy()
270 * strcat - Append one %NUL-terminated string to another
289 * strncat - Append a length-limited, C-string to another
305 if (--count == 0) { in strncat()
318 * strlcat - Append a length-limited, C-string to another
333 count -= dsize; in strlcat()
335 len = count-1; in strlcat()
345 * strcmp - Compare two strings
346 * @cs: One string
349 int strcmp(const char *cs, const char *ct) in strcmp() argument
354 c1 = *cs++; in strcmp()
357 return c1 < c2 ? -1 : 1; in strcmp()
368 * strncmp - Compare two length-limited strings
369 * @cs: One string
371 * @count: The maximum number of bytes to compare
373 int strncmp(const char *cs, const char *ct, size_t count) in strncmp() argument
378 c1 = *cs++; in strncmp()
381 return c1 < c2 ? -1 : 1; in strncmp()
384 count--; in strncmp()
393 * strchr - Find the first occurrence of a character in a string
397 * Note that the %NUL-terminator is considered part of the string, and can
412 * strchrnul - Find and return a character in a string, or end of string
429 * strnchrnul - Find and return a character in a length limited string,
432 * @count: The number of characters to be searched
440 while (count-- && *s && *s != (char)c) in strnchrnul()
447 * strrchr - Find the last occurrence of a character in a string
465 * strnchr - Find a character in a length limited string
467 * @count: The number of characters to be searched
470 * Note that the %NUL-terminator is considered part of the string, and can
475 while (count--) { in strnchr()
488 * strlen - Find the length of a string
497 return sc - s; in strlen()
504 * strnlen - Find the length of a length-limited string
506 * @count: The maximum number of bytes to search
512 for (sc = s; count-- && *sc != '\0'; ++sc) in strnlen()
514 return sc - s; in strnlen()
521 …* strspn - Calculate the length of the initial substring of @s which only contain letters in @acce…
533 return p - s; in strspn()
540 …* strcspn - Calculate the length of the initial substring of @s which does not contain letters in …
552 return p - s; in strcspn()
559 * strpbrk - Find the first occurrence of a set of characters
560 * @cs: The string to be searched
563 char *strpbrk(const char *cs, const char *ct) in strpbrk() argument
567 for (sc1 = cs; *sc1 != '\0'; ++sc1) { in strpbrk()
580 * strsep - Split a string into tokens
587 * of that name. In fact, it was stolen from glibc2 and de-fancy-fied.
609 * memset - Fill a region of memory with the given value
620 while (count--) in memset()
629 * memset16() - Fill a memory area with a uint16_t
632 * @count: The number of values to store
635 * of a byte. Remember that @count is the number of uint16_ts to
636 * store, not the number of bytes.
642 while (count--) in memset16()
651 * memset32() - Fill a memory area with a uint32_t
654 * @count: The number of values to store
657 * of a byte. Remember that @count is the number of uint32_ts to
658 * store, not the number of bytes.
664 while (count--) in memset32()
673 * memset64() - Fill a memory area with a uint64_t
676 * @count: The number of values to store
679 * of a byte. Remember that @count is the number of uint64_ts to
680 * store, not the number of bytes.
686 while (count--) in memset64()
695 * memcpy - Copy one area of memory to another
708 while (count--) in memcpy()
717 * memmove - Copy one area of memory to another
732 while (count--) in memmove()
739 while (count--) in memmove()
740 *--tmp = *--s; in memmove()
749 * memcmp - Compare two areas of memory
750 * @cs: One area of memory
755 __visible int memcmp(const void *cs, const void *ct, size_t count) in memcmp() argument
762 const unsigned long *u1 = cs; in memcmp()
769 count -= sizeof(unsigned long); in memcmp()
771 cs = u1; in memcmp()
775 for (su1 = cs, su2 = ct; 0 < count; ++su1, ++su2, count--) in memcmp()
776 if ((res = *su1 - *su2) != 0) in memcmp()
785 * bcmp - returns 0 if and only if the buffers have identical contents.
790 * The sign or magnitude of a non-zero return value has no particular
793 * not rely on anything but whether the return value is zero or non-zero.
804 * memscan - Find a character in an area of memory.
820 size--; in memscan()
829 * strstr - Find the first substring in a %NUL terminated string
842 l1--; in strstr()
854 * strnstr - Find the first substring in a length-limited string
857 * @len: the maximum number of characters to search
867 len--; in strnstr()
879 * memchr - Find a character in an area of memory.
890 while (n-- != 0) { in memchr()
892 return (void *)(p - 1); in memchr()
906 bytes--; in check_bytes8()
912 * memchr_inv - Find an unmatching character in an area of memory.
945 prefix = 8 - prefix; in memchr_inv()
950 bytes -= prefix; in memchr_inv()
959 words--; in memchr_inv()