OSDN Git Service
(root)
/
uclinux-h8
/
uClibc.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing...
[uclinux-h8/uClibc.git]
/
libc
/
unistd
/
getopt.c
diff --git
a/libc/unistd/getopt.c
b/libc/unistd/getopt.c
index
2cf5dbb
..
d9c4585
100644
(file)
--- a/
libc/unistd/getopt.c
+++ b/
libc/unistd/getopt.c
@@
-34,6
+34,13
@@
#include <libintl.h>
#endif
#include <libintl.h>
#endif
+libc_hidden_proto(strchr)
+libc_hidden_proto(strcmp)
+libc_hidden_proto(strlen)
+libc_hidden_proto(strncmp)
+libc_hidden_proto(getenv)
+libc_hidden_proto(fprintf)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: Enable gettext awareness.
#endif /* __UCLIBC_MJN3_ONLY__ */
#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: Enable gettext awareness.
#endif /* __UCLIBC_MJN3_ONLY__ */
@@
-149,7
+156,7
@@
static enum
} ordering;
# include <string.h>
} ordering;
# include <string.h>
-# define my_index
__
strchr
+# define my_index strchr
\f
/* Handle permutation of arguments. */
\f
/* Handle permutation of arguments. */
@@
-247,7
+254,7
@@
static const char *_getopt_initialize (attribute_unused int argc, attribute_unus
ordering = REQUIRE_ORDER;
++optstring;
}
ordering = REQUIRE_ORDER;
++optstring;
}
- else if (
__
getenv ("POSIXLY_CORRECT") != NULL)
+ else if (getenv ("POSIXLY_CORRECT") != NULL)
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
ordering = REQUIRE_ORDER;
else
ordering = PERMUTE;
@@
-371,7
+378,7
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
then exchange with previous non-options as if it were an option,
then skip everything else like a non-option. */
- if (optind != argc && !
__
strcmp (argv[optind], "--"))
+ if (optind != argc && !strcmp (argv[optind], "--"))
{
optind++;
{
optind++;
@@
-447,10
+454,10
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!
__
strncmp (p->name, nextchar, nameend - nextchar))
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
{
if ((unsigned int) (nameend - nextchar)
{
if ((unsigned int) (nameend - nextchar)
- == (unsigned int)
__
strlen (p->name))
+ == (unsigned int) strlen (p->name))
{
/* Exact match found. */
pfound = p;
{
/* Exact match found. */
pfound = p;
@@
-479,7
+486,7
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
}
fprintf (stderr, _("%s: option `%s' is ambiguous\n"),
argv[0], argv[optind]);
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
optind++;
optopt = 0;
return '?';
optind++;
optopt = 0;
return '?';
@@
-517,7
+524,7
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
}
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
optopt = pfound->val;
return '?';
optopt = pfound->val;
return '?';
@@
-535,12
+542,12
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
}
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
optopt = pfound->val;
return optstring[0] == ':' ? ':' : '?';
}
}
optopt = pfound->val;
return optstring[0] == ':' ? ':' : '?';
}
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
@@
-651,9
+658,9
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
/* Test all long options for either exact match
or abbreviated matches. */
for (p = longopts, option_index = 0; p->name; p++, option_index++)
- if (!
__
strncmp (p->name, nextchar, nameend - nextchar))
+ if (!strncmp (p->name, nextchar, nameend - nextchar))
{
{
- if ((unsigned int) (nameend - nextchar) ==
__
strlen (p->name))
+ if ((unsigned int) (nameend - nextchar) == strlen (p->name))
{
/* Exact match found. */
pfound = p;
{
/* Exact match found. */
pfound = p;
@@
-678,7
+685,7
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
}
fprintf (stderr, _("%s: option `-W %s' is ambiguous\n"),
argv[0], argv[optind]);
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
optind++;
return '?';
}
optind++;
return '?';
}
@@
-700,7
+707,7
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
argv[0], pfound->name);
}
argv[0], pfound->name);
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
return '?';
}
}
return '?';
}
}
@@
-716,11
+723,11
@@
int attribute_hidden _getopt_internal (int argc, char *const *argv, const char *
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
}
_("%s: option `%s' requires an argument\n"),
argv[0], argv[optind - 1]);
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
return optstring[0] == ':' ? ':' : '?';
}
}
return optstring[0] == ':' ? ':' : '?';
}
}
- nextchar +=
__
strlen (nextchar);
+ nextchar += strlen (nextchar);
if (longind != NULL)
*longind = option_index;
if (pfound->flag)
if (longind != NULL)
*longind = option_index;
if (pfound->flag)