diff options
author | ed <ed@FreeBSD.org> | 2012-01-03 07:05:30 +0000 |
---|---|---|
committer | ed <ed@FreeBSD.org> | 2012-01-03 07:05:30 +0000 |
commit | d73fab66763e8ae3eb190e76d7ae95aa680d3448 (patch) | |
tree | b2236c91382885ce633154f831c85fc950e01c75 /sys/sys | |
parent | 9976fae0420f3eec4397fb825c227ad21c064262 (diff) | |
download | FreeBSD-src-d73fab66763e8ae3eb190e76d7ae95aa680d3448.zip FreeBSD-src-d73fab66763e8ae3eb190e76d7ae95aa680d3448.tar.gz |
Implement extensions on top of standards instead of the other way around.
Now that index() and rindex() have become unused, simply turn them into
wrappers around strchr() and strrchr(), respectively.
Diffstat (limited to 'sys/sys')
-rw-r--r-- | sys/sys/libkern.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/sys/sys/libkern.h b/sys/sys/libkern.h index bbe3cfc..4cf2188 100644 --- a/sys/sys/libkern.h +++ b/sys/sys/libkern.h @@ -99,12 +99,11 @@ void qsort(void *base, size_t nmemb, size_t size, void qsort_r(void *base, size_t nmemb, size_t size, void *thunk, int (*compar)(void *, const void *, const void *)); u_long random(void); -char *index(const char *, int); -char *rindex(const char *, int); int scanc(u_int, const u_char *, const u_char *, int); void srandom(u_long); int strcasecmp(const char *, const char *); char *strcat(char * __restrict, const char * __restrict); +char *strchr(const char *, int); int strcmp(const char *, const char *); char *strcpy(char * __restrict, const char * __restrict); size_t strcspn(const char * __restrict, const char * __restrict) __pure; @@ -116,6 +115,7 @@ int strncasecmp(const char *, const char *, size_t); int strncmp(const char *, const char *, size_t); char *strncpy(char * __restrict, const char * __restrict, size_t); size_t strnlen(const char *, size_t); +char *strrchr(const char *, int); char *strsep(char **, const char *delim); size_t strspn(const char *, const char *); char *strstr(const char *, const char *); @@ -164,15 +164,17 @@ memset(void *b, int c, size_t len) #endif static __inline char * -strchr(const char *p, int ch) +index(const char *p, int ch) { - return (index(p, ch)); + + return (strchr(p, ch)); } static __inline char * -strrchr(const char *p, int ch) +rindex(const char *p, int ch) { - return (rindex(p, ch)); + + return (strrchr(p, ch)); } /* fnmatch() return values. */ |