(c) 1997 Han-Wen Nienhuys <hanwen@stack.nl>
*/
-
+#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include "libc-extension.hh"
/*
compensate for lacking libc functions.
*/
- char*
+char*
strnlwr( char* start_l ,int n)
{
char * p = start_l + n;
return start_l;
}
- char*
+char*
strnupr( char* start_l, int n)
{
char * p = start_l + n;
return start_l;
}
+#ifndef HAVE_MEMMEM
+
/** locate a substring. #memmem# finds the first occurrence of
#needle# in #haystack#
*/
- char *
-memmem(const Byte * haystack, const Byte *needle,
- int haystack_len, int needle_len)
+char *
+memmem(const Byte * haystack, int haystack_len,
+ const Byte *needle,int needle_len)
{
const Byte * end_haystack = haystack + haystack_len - needle_len;
const Byte * end_needle = needle + needle_len ;
}
return 0;
}
+#endif
Byte *
memrchr(const Byte * p, int n, char c)
}
return byte_l;
}
+
+#ifndef HAVE_SNPRINTF
+int snprintf ( char *str, size_t n,
+ const char *format, ... )
+{
+ va_list ap;
+ va_start(ap, format);
+ int i = vsprintf(str, format, ap);
+ va_end(ap);
+ return i;
+}
+#endif