diff options
Diffstat (limited to 'newlib/libc/argz')
-rw-r--r-- | newlib/libc/argz/Makefile.in | 2 | ||||
-rw-r--r-- | newlib/libc/argz/argz_replace.c | 6 | ||||
-rw-r--r-- | newlib/libc/argz/buf_findstr.c | 4 | ||||
-rw-r--r-- | newlib/libc/argz/buf_findstr.h | 12 | ||||
-rw-r--r-- | newlib/libc/argz/envz_entry.c | 8 | ||||
-rw-r--r-- | newlib/libc/argz/envz_get.c | 8 | ||||
-rw-r--r-- | newlib/libc/argz/envz_merge.c | 2 |
7 files changed, 29 insertions, 13 deletions
diff --git a/newlib/libc/argz/Makefile.in b/newlib/libc/argz/Makefile.in index 69332c88c..888cfca66 100644 --- a/newlib/libc/argz/Makefile.in +++ b/newlib/libc/argz/Makefile.in @@ -82,6 +82,8 @@ LIBC_MACHINE_LIB = @LIBC_MACHINE_LIB@ LIBC_POSIX_LIB = @LIBC_POSIX_LIB@ LIBC_SIGNAL_DEF = @LIBC_SIGNAL_DEF@ LIBC_SIGNAL_LIB = @LIBC_SIGNAL_LIB@ +LIBC_STDIO64_DEF = @LIBC_STDIO64_DEF@ +LIBC_STDIO64_LIB = @LIBC_STDIO64_LIB@ LIBC_SYSCALL_LIB = @LIBC_SYSCALL_LIB@ LIBC_SYS_LIB = @LIBC_SYS_LIB@ LIBC_UNIX_LIB = @LIBC_UNIX_LIB@ diff --git a/newlib/libc/argz/argz_replace.c b/newlib/libc/argz/argz_replace.c index 92979e6f5..cc0d78f5a 100644 --- a/newlib/libc/argz/argz_replace.c +++ b/newlib/libc/argz/argz_replace.c @@ -10,7 +10,7 @@ #include <stdlib.h> #include <argz.h> -extern int buf_findstr(const char *str, char **buf, size_t *buf_len); +#include "buf_findstr.h" error_t argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, unsigned *replace_count) @@ -31,7 +31,7 @@ argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, while(buf_len) { - if(buf_findstr(str, &buf_iter, &buf_len)) + if(_buf_findstr(str, &buf_iter, &buf_len)) { *replace_count += 1; new_argz_len += len_diff; @@ -49,7 +49,7 @@ argz_replace (char **argz, size_t *argz_len, const char *str, const char *with, while(buf_len) { - if (buf_findstr(str, &buf_iter, &buf_len)) + if (_buf_findstr(str, &buf_iter, &buf_len)) { /* copy everything up to, but not including str, from old argz to new argz. */ diff --git a/newlib/libc/argz/buf_findstr.c b/newlib/libc/argz/buf_findstr.c index 792706e88..aeb32a943 100644 --- a/newlib/libc/argz/buf_findstr.c +++ b/newlib/libc/argz/buf_findstr.c @@ -9,10 +9,12 @@ #include <string.h> #include <stdlib.h> +#include "buf_findstr.h" + /* Find string str in buffer buf of length buf_len. Point buf to character after string, or set it to NULL if end of buffer is reached. Return 1 if found, 0 if not. */ int -buf_findstr(const char *str, const char **buf, size_t *buf_len) +_buf_findstr(const char *str, char **buf, size_t *buf_len) { int i = 0; int j = 0; diff --git a/newlib/libc/argz/buf_findstr.h b/newlib/libc/argz/buf_findstr.h new file mode 100644 index 000000000..d6cef7c15 --- /dev/null +++ b/newlib/libc/argz/buf_findstr.h @@ -0,0 +1,12 @@ +/* Copyright (C) 2002 by Red Hat, Incorporated. All rights reserved. + * + * Permission to use, copy, modify, and distribute this software + * is freely granted, provided that this notice is preserved. + */ + +#include <sys/types.h> + +/* Find string str in buffer buf of length buf_len. Point buf to + character after string, or set it to NULL if end of buffer is + reached. Return 1 if found, 0 if not. */ +int _buf_findstr(const char *str, char **buf, size_t *buf_len); diff --git a/newlib/libc/argz/envz_entry.c b/newlib/libc/argz/envz_entry.c index 4c06f0f40..300aec9d5 100644 --- a/newlib/libc/argz/envz_entry.c +++ b/newlib/libc/argz/envz_entry.c @@ -10,17 +10,17 @@ #include <stdlib.h> #include <envz.h> -extern int buf_findstr(const char *str, char **buf, size_t *buf_len); +#include "buf_findstr.h" char * envz_entry (const char *envz, size_t envz_len, const char *name) { - const char *buf_ptr = envz; + char *buf_ptr = (char *)envz; size_t buf_len = envz_len; while(buf_len) { - if (buf_findstr(name, &buf_ptr, &buf_len)) + if (_buf_findstr(name, &buf_ptr, &buf_len)) { if (buf_ptr) { @@ -34,7 +34,7 @@ envz_entry (const char *envz, size_t envz_len, const char *name) if(*buf_ptr == '\0') buf_ptr++; - return buf_ptr; + return (char *)buf_ptr; } } } diff --git a/newlib/libc/argz/envz_get.c b/newlib/libc/argz/envz_get.c index dae51bed7..718806ec5 100644 --- a/newlib/libc/argz/envz_get.c +++ b/newlib/libc/argz/envz_get.c @@ -10,22 +10,22 @@ #include <stdlib.h> #include <envz.h> -extern int buf_findstr(const char *str, char **buf, size_t *buf_len); +#include "buf_findstr.h" char * envz_get (const char *envz, size_t envz_len, const char *name) { - const char *buf_ptr = envz; + char *buf_ptr = (char *)envz; size_t buf_len = envz_len; while(buf_len) { - if (buf_findstr(name, &buf_ptr, &buf_len)) + if (_buf_findstr(name, &buf_ptr, &buf_len)) { if (*buf_ptr == '=') { buf_ptr++; - return buf_ptr; + return (char *)buf_ptr; } else { diff --git a/newlib/libc/argz/envz_merge.c b/newlib/libc/argz/envz_merge.c index b01733017..da2d8cb08 100644 --- a/newlib/libc/argz/envz_merge.c +++ b/newlib/libc/argz/envz_merge.c @@ -20,7 +20,7 @@ envz_merge (char **envz, size_t *envz_len, const char *envz2, size_t envz2_len, char *name_iter = NULL; int retval = 0; - while((entry = argz_next(envz2, envz2_len, entry)) && !retval) + while((entry = argz_next((char *)envz2, envz2_len, entry)) && !retval) { if (!override) { |