Usermode/libposix - add stubbed getopt
authorJohn Hodge <[email protected]>
Sat, 10 May 2014 09:05:02 +0000 (17:05 +0800)
committerJohn Hodge <[email protected]>
Sat, 10 May 2014 09:05:32 +0000 (17:05 +0800)
Usermode/Libraries/libposix.so_src/Makefile
Usermode/Libraries/libposix.so_src/getopt.c [new file with mode: 0644]
Usermode/Libraries/libposix.so_src/include_exp/getopt.h [new file with mode: 0644]

index dcbf8f5..41684d6 100644 (file)
@@ -11,7 +11,7 @@ LDFLAGS  += -soname libposix.so -Map map.txt -lc
 OBJ  = main.o unistd.o dirent.o stat.o utmpx.o termios.o\r
 OBJ += pwd.o syslog.o sys_time.o sys_ioctl.o sys_resource.o\r
 OBJ += fcntl.o clocks.o sys_wait.o unistd_crypt.o\r
-OBJ += grp.o pty.o mktemp.o utime.o\r
+OBJ += grp.o pty.o mktemp.o utime.o getopt.o\r
 DEPFILES := $(OBJ:%.o=%.d)\r
 BIN = libposix.so\r
 \r
diff --git a/Usermode/Libraries/libposix.so_src/getopt.c b/Usermode/Libraries/libposix.so_src/getopt.c
new file mode 100644 (file)
index 0000000..ab6186b
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Acess2 POSIX Emulation Layer
+ * - By John Hodge (thePowersGang)
+ *
+ * getopt.c
+ * - getopt() command line parsing code
+ */
+#include <getopt.h>
+
+// === GLOBALS ===
+char*  optarg;
+ int   opterr;
+ int   optind;
+ int   optopt;
+
+// === CODE ===
+int getopt(int argc, char * const argv[], const char *optstring)
+{
+       return -1;
+}
+
diff --git a/Usermode/Libraries/libposix.so_src/include_exp/getopt.h b/Usermode/Libraries/libposix.so_src/include_exp/getopt.h
new file mode 100644 (file)
index 0000000..b6db119
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ * Acess2 POSIX Emulation Layer
+ * - By John Hodge (thePowersGang)
+ *
+ * getopt.h
+ * - getopt() command line parsing code
+ */
+#ifndef _LIBPOSIX_GETOPT_H_
+#define _LIBPOSIX_GETOPT_H_
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+extern char*   optarg;
+extern int     opterr;
+extern int     optind;
+extern int     optopt;
+
+extern int     getopt(int argc, char * const argv[], const char *optstring);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
+

UCC git Repository :: git.ucc.asn.au