diff options
author | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-09-02 11:39:05 +0000 |
---|---|---|
committer | martin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220> | 2011-09-02 11:39:05 +0000 |
commit | 489e46f5b2379c1e4086a51fff635dededf996cc (patch) | |
tree | f57b9fedd6019dd70b6b5a46f5915fecae70b575 /navit/util.c | |
parent | 01eccb5b1dd50886dd4d2ac996fdad90da498a01 (diff) | |
download | navit-489e46f5b2379c1e4086a51fff635dededf996cc.tar.gz |
Fix:Core:Better prototype for getline/getdelim and check for requirement
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@4747 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/util.c')
-rw-r--r-- | navit/util.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/navit/util.c b/navit/util.c index cbb42f144..604674754 100644 --- a/navit/util.c +++ b/navit/util.c @@ -32,6 +32,7 @@ #endif #include "util.h" #include "debug.h" +#include "config.h" void strtoupper(char *dest, const char *src) @@ -165,6 +166,7 @@ char *stristr(const char *String, const char *Pattern) #endif +#ifndef HAVE_GETDELIM /** * Read the part of a file up to a delimiter to a string. * <p> @@ -178,7 +180,7 @@ char *stristr(const char *String, const char *Pattern) * @return Number of characters read (not including the null terminator), or -1 on error or EOF. */ -int +ssize_t getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) { int result; @@ -252,12 +254,15 @@ getdelim (char **lineptr, size_t *n, int delimiter, FILE *fp) return result; } +#endif -int +#ifndef HAVE_GETLINE +ssize_t getline (char **lineptr, size_t *n, FILE *stream) { return getdelim (lineptr, n, '\n', stream); } +#endif #if defined(_UNICODE) wchar_t* newSysString(const char *toconvert) |