1 --- dietlibc-0.31/include/stdlib.h~ 2009-03-19 14:33:16.000000000 +0100
2 +++ dietlibc-0.31/include/stdlib.h 2009-03-19 14:46:17.000000000 +0100
4 long int labs(long int i) __THROW __attribute__((__const__));
5 __extension__ long long int llabs(long long int i) __THROW __attribute__((__const__));
7 +#ifdef __USE_XOPEN_EXTENDED
8 +/* Parse comma separated suboption from *OPTIONP and match against
9 + strings in TOKENS. If found return index and set *VALUEP to
10 + optional value introduced by an equal sign. If the suboption is
11 + not part of TOKENS return in *VALUEP beginning of unknown
12 + suboption. On exit *OPTIONP is set to the beginning of the next
13 + token or at the terminating NUL character. */
14 +extern int getsubopt (char **optionp, char *const *tokens, char **valuep) __THROW;
18 int grantpt (int fd) __THROW;
19 int unlockpt (int fd) __THROW;
20 --- /dev/null 2009-03-05 20:33:59.000000000 +0100
21 +++ dietlibc-0.31/lib/getsubopt.c 2009-03-19 14:55:18.000000000 +0100
23 +/* Parse comma separate list into words.
24 + Copyright (C) 1996, 1997, 1999, 2004 Free Software Foundation, Inc.
25 + This file is part of the GNU C Library.
26 + Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
28 + The GNU C Library is free software; you can redistribute it and/or
29 + modify it under the terms of the GNU Lesser General Public
30 + License as published by the Free Software Foundation; either
31 + version 2.1 of the License, or (at your option) any later version.
33 + The GNU C Library is distributed in the hope that it will be useful,
34 + but WITHOUT ANY WARRANTY; without even the implied warranty of
35 + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
36 + Lesser General Public License for more details.
38 + You should have received a copy of the GNU Lesser General Public
39 + License along with the GNU C Library; if not, write to the Free
40 + Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
46 +/* Parse comma separated suboption from *OPTIONP and match against
47 + strings in TOKENS. If found return index and set *VALUEP to
48 + optional value introduced by an equal sign. If the suboption is
49 + not part of TOKENS return in *VALUEP beginning of unknown
50 + suboption. On exit *OPTIONP is set to the beginning of the next
51 + token or at the terminating NUL character. */
53 +getsubopt (char **optionp, char *const *tokens, char **valuep)
55 + char *endp, *vstart;
58 + if (**optionp == '\0')
61 + /* Find end of next token. */
62 + endp = strchr (*optionp, ',');
64 + endp = strchr (*optionp, '\0');
66 + /* Find start of value. */
67 + vstart = memchr (*optionp, '=', endp - *optionp);
71 + /* Try to match the characters between *OPTIONP and VSTART against
72 + one of the TOKENS. */
73 + for (cnt = 0; tokens[cnt] != NULL; ++cnt)
74 + if (strncmp (*optionp, tokens[cnt], vstart - *optionp) == 0
75 + && tokens[cnt][vstart - *optionp] == '\0')
77 + /* We found the current option in TOKENS. */
78 + *valuep = vstart != endp ? vstart + 1 : NULL;
87 + /* The current suboption does not match any option. */