/* Copyright (C) 2003 Manuel Novoa III
*
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Library General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
- *
- * You should have received a copy of the GNU Library General Public
- * License along with this library; if not, write to the Free
- * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball.
*/
/* ATTENTION! ATTENTION! ATTENTION! ATTENTION! ATTENTION!
#include <unistd.h>
#include <string.h>
#include <stdio.h>
+#include <getopt.h>
-#ifndef __BCC__
libc_hidden_proto(fprintf)
-libc_hidden_proto(strchr)
-libc_hidden_proto(stderr)
-#endif
+/* Experimentally off - libc_hidden_proto(strchr) */
#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: Enable gettext awareness.
int optopt = 0;
char *optarg = NULL;
+libc_hidden_proto(getopt)
int getopt(int argc, char * const argv[], const char *optstring)
{
static const char *o; /* multi opt position */
retval = '?';
goto BAD;
}
-
+
if (s[1] == ':') { /* Option takes an arg? */
if (o[1]) { /* No space between option and arg? */
optarg = (char *)(o + 1);
DONE:
return retval;
}
+libc_hidden_def(getopt)