From 818a35a1cadd3d8325619a06abc9df322b99eaff Mon Sep 17 00:00:00 2001 From: tomo Date: Sat, 12 Jul 2003 10:18:29 +0000 Subject: [PATCH] Move strnlen related code from chise.h to chise.c. --- chise.c | 16 ++++++++++++++++ chise.h | 20 -------------------- 2 files changed, 16 insertions(+), 20 deletions(-) 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, -- 1.7.10.4