# 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)))
#include <db.h>
#include <errno.h>
-#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,