]> wimlib.net Git - wimlib/blobdiff - programs/wgetopt.h
Char encoding updates and misc. fixes
[wimlib] / programs / wgetopt.h
diff --git a/programs/wgetopt.h b/programs/wgetopt.h
new file mode 100644 (file)
index 0000000..9b2f3a3
--- /dev/null
@@ -0,0 +1,31 @@
+#ifndef _WGETOPT_H
+#define _WGETOPT_H
+
+#include <wchar.h>
+
+extern wchar_t *woptarg;
+extern int woptind, wopterr, woptopt;
+
+struct woption {
+       const wchar_t *name;
+       int            has_arg;
+       int           *flag;
+       int            val;
+};
+
+#define no_argument 0
+#define required_argument 1
+#define optional_argument 2
+
+extern int
+wgetopt (int argc, wchar_t *const *argv, const wchar_t *optstring);
+
+extern int
+wgetopt_long(int argc, wchar_t * const *argv, const wchar_t *options,
+            const struct woption *long_options, int *opt_index);
+
+extern int
+wgetopt_long_only(int argc, wchar_t *const *argv, const wchar_t *options,
+                 const struct woption *long_options, int *opt_index);
+
+#endif