summaryrefslogtreecommitdiffstats
path: root/newlib/libc/sys/linux/include/getopt.h
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/sys/linux/include/getopt.h')
-rw-r--r--newlib/libc/sys/linux/include/getopt.h27
1 files changed, 27 insertions, 0 deletions
diff --git a/newlib/libc/sys/linux/include/getopt.h b/newlib/libc/sys/linux/include/getopt.h
new file mode 100644
index 000000000..994f86001
--- /dev/null
+++ b/newlib/libc/sys/linux/include/getopt.h
@@ -0,0 +1,27 @@
+/* libc/sys/linux/include/getopt.h - Extended command line parsing */
+
+/* Written 2000 by Werner Almesberger */
+
+
+#ifndef _NEWLIB_GETOPT_H
+#define _NEWLIB_GETOPT_H
+
+#include <unistd.h>
+
+
+enum { no_argument, required_argument, optional_argument };
+
+struct option {
+ const char *name;
+ int has_arg;
+ int *flag;
+ int val;
+};
+
+int getopt_long(int argc,char *const argv[],const char *optstring,
+ const struct option *longopts,int *longindex);
+
+int getopt_long_only(int argc,char *const argv[],const char *optstring,
+ const struct option *longopts,int *longindex);
+
+#endif