From: tomo Date: Sat, 12 Jul 2003 10:18:29 +0000 (+0000) Subject: Move strnlen related code from chise.h to chise.c. X-Git-Tag: r0_1_1-pre1~17 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=818a35a1cadd3d8325619a06abc9df322b99eaff;p=chise%2Flibchise.git Move strnlen related code from chise.h to chise.c. --- diff --git a/chise.c b/chise.c index 6e8bb46..4681fe3 100644 --- a/chise.c +++ b/chise.c @@ -2,6 +2,22 @@ # include "config.h" #endif +#ifndef HAVE_STRNLEN +/* original in mysql, strings/strnlen.c. +uint strnlen(register const char *s, register uint maxlen) +{ + const char *end= (const char *)memchr(s, '\0', maxlen); + return end ? (uint) (end - s) : maxlen; +} +*/ +static inline int +strnlen (register const char *s, register int maxlen) +{ + const char *end= (const char *)memchr(s, '\0', maxlen); + return end ? (int) (end - s) : maxlen; +} +#endif + #include "chise.h" #define xzero(lvalue) ((void) memset (&(lvalue), '\0', sizeof (lvalue))) diff --git a/chise.h b/chise.h index e384802..4a06504 100644 --- a/chise.h +++ b/chise.h @@ -3,26 +3,6 @@ #include #include -#ifndef HAVE_STRNLEN - -/* original in mysql, strings/strnlen.c. -uint strnlen(register const char *s, register uint maxlen) -{ - const char *end= (const char *)memchr(s, '\0', maxlen); - return end ? (uint) (end - s) : maxlen; -} -*/ - -static inline int -strnlen (register const char *s, register int maxlen) -{ - const char *end= (const char *)memchr(s, '\0', maxlen); - return end ? (int) (end - s) : maxlen; -} - -#endif - - typedef enum CHISE_DS_Type { CHISE_DS_NONE,