summaryrefslogtreecommitdiff
path: root/libc/unistd/getsubopt.c
diff options
context:
space:
mode:
authorPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
committerPeter S. Mazinger <ps.m@gmx.net>2006-01-14 00:58:03 +0000
commitaf0172162f7c653cad6a11ed1c1a5459bc154465 (patch)
tree70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/unistd/getsubopt.c
parentc8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff)
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/unistd/getsubopt.c')
-rw-r--r--libc/unistd/getsubopt.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/libc/unistd/getsubopt.c b/libc/unistd/getsubopt.c
index bebfbc4ed..c6c078f6f 100644
--- a/libc/unistd/getsubopt.c
+++ b/libc/unistd/getsubopt.c
@@ -18,12 +18,13 @@
Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
02111-1307 USA. */
-#define memchr __memchr
-
+#define _GNU_SOURCE
#include <stdlib.h>
#include <string.h>
-extern char *__strchrnul(const char *s, int c);
+libc_hidden_proto(memchr)
+libc_hidden_proto(memcmp)
+libc_hidden_proto(strchrnul)
/* Parse comma separated suboption from *OPTIONP and match against
strings in TOKENS. If found return index and set *VALUEP to
@@ -40,7 +41,7 @@ int getsubopt(char **optionp, char *const *tokens, char **valuep)
return -1;
/* Find end of next token. */
- endp = __strchrnul (*optionp, ',');
+ endp = strchrnul (*optionp, ',');
/* Find start of value. */
vstart = memchr (*optionp, '=', endp - *optionp);
@@ -50,7 +51,7 @@ int getsubopt(char **optionp, char *const *tokens, char **valuep)
/* Try to match the characters between *OPTIONP and VSTART against
one of the TOKENS. */
for (cnt = 0; tokens[cnt] != NULL; ++cnt)
- if (__memcmp (*optionp, tokens[cnt], vstart - *optionp) == 0
+ if (memcmp (*optionp, tokens[cnt], vstart - *optionp) == 0
&& tokens[cnt][vstart - *optionp] == '\0')
{
/* We found the current option in TOKENS. */