mirror of
https://github.com/Dasharo/skiboot.git
synced 2026-03-06 14:50:44 -08:00
10d50007fb
sync to upstream ccan.git commit ca7c5a9e04f3 ("ccan: make tal_dump()
format more regular.").
The recipe used to sync upstream is:
$ cd ccan
$ ./tools/create-ccan-tree -b make tmp \
array_size check_type container_of heap \
short_types build_assert endian list str
$ # replace directories in skiboot/ccan/ with those in tmp/ccan/
$ cd ../skiboot
$ patch -p1 < ccan/skiboot.patch
This also adds a README.skiboot to help with future updates.
Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Cédric Le Goater <clg@kaod.org>
109 lines
1.6 KiB
C
109 lines
1.6 KiB
C
/* CC0 (Public domain) - see LICENSE file for details */
|
|
#include "config.h"
|
|
#include <ccan/str/str_debug.h>
|
|
#include <assert.h>
|
|
#include <ctype.h>
|
|
#include <string.h>
|
|
|
|
#ifdef CCAN_STR_DEBUG
|
|
/* Because we mug the real ones with macros, we need our own wrappers. */
|
|
int str_isalnum(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isalnum(i);
|
|
}
|
|
|
|
int str_isalpha(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isalpha(i);
|
|
}
|
|
|
|
int str_isascii(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isascii(i);
|
|
}
|
|
|
|
#if HAVE_ISBLANK
|
|
int str_isblank(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isblank(i);
|
|
}
|
|
#endif
|
|
|
|
int str_iscntrl(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return iscntrl(i);
|
|
}
|
|
|
|
int str_isdigit(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isdigit(i);
|
|
}
|
|
|
|
int str_isgraph(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isgraph(i);
|
|
}
|
|
|
|
int str_islower(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return islower(i);
|
|
}
|
|
|
|
int str_isprint(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isprint(i);
|
|
}
|
|
|
|
int str_ispunct(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return ispunct(i);
|
|
}
|
|
|
|
int str_isspace(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isspace(i);
|
|
}
|
|
|
|
int str_isupper(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isupper(i);
|
|
}
|
|
|
|
int str_isxdigit(int i)
|
|
{
|
|
assert(i >= -1 && i < 256);
|
|
return isxdigit(i);
|
|
}
|
|
|
|
#undef strstr
|
|
#undef strchr
|
|
#undef strrchr
|
|
|
|
char *str_strstr(const char *haystack, const char *needle)
|
|
{
|
|
return strstr(haystack, needle);
|
|
}
|
|
|
|
char *str_strchr(const char *haystack, int c)
|
|
{
|
|
return strchr(haystack, c);
|
|
}
|
|
|
|
char *str_strrchr(const char *haystack, int c)
|
|
{
|
|
return strrchr(haystack, c);
|
|
}
|
|
#endif
|