X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fstr.h;h=db961959c45205b3a63da19ca773e01c544b121f;hb=d7b5d9144738a5a8989d45a01f4e458a78b68c0b;hp=7816acf2ec78fb4ba290f3d42b2230b10ae4d373;hpb=317e6b778833b5dcd5dd195c0b677835a8024b2a;p=pspp diff --git a/src/str.h b/src/str.h index 7816acf2ec..db961959c4 100644 --- a/src/str.h +++ b/src/str.h @@ -24,37 +24,22 @@ #include #include - -#if STDC_HEADERS - #include -#else - #ifndef HAVE_STRCHR - #define strchr index - #define strrchr rindex - #endif - - char *strchr (), *strrchr (); -#endif - -#if !HAVE_STRTOK_R - char *strtok_r (char *, const char *, char **); -#endif - -#if !HAVE_STPCPY - char *stpcpy (char *dest, const char *src); -#endif - -#if !HAVE_STRCASECMP - int strcasecmp (const char *s1, const char *s2); -#endif - -#if !HAVE_STRNCASECMP - int strncasecmp (const char *s1, const char *s2, size_t n); +#include + +#include "memmem.h" +#include "snprintf.h" +#include "stpcpy.h" +#include "strcase.h" +#include "strftime.h" +#include "strstr.h" +#include "strtok_r.h" +#include "vsnprintf.h" + +#ifndef HAVE_STRCHR +#define strchr index #endif - -#if !HAVE_MEMMEM - void *memmem (const void *haystack, size_t haystack_len, - const void *needle, size_t needle_len); +#ifndef HAVE_STRRCHR +#define strrchr rindex #endif /* sprintf() wrapper functions for convenience. */ @@ -107,14 +92,6 @@ int nvsprintf (char *buf, const char *format, va_list args); #endif /* Not good sprintf(). */ #endif /* Not GNU C. */ - -#if !HAVE_GETLINE -long getline (char **lineptr, size_t *n, FILE *stream); -#endif - -#if !HAVE_GETDELIM -long getdelim (char **lineptr, size_t * n, int delimiter, FILE * stream); -#endif /* Miscellaneous. */ @@ -129,6 +106,7 @@ void buf_copy_str_rpad (char *, size_t, const char *); int str_compare_rpad (const char *, const char *); void str_copy_rpad (char *, size_t, const char *); void str_copy_trunc (char *, size_t, const char *); +void str_copy_buf_trunc (char *, size_t, const char *, size_t); void str_uppercase (char *); /* Fixed-length strings. */