Usermode - Hacky and stubbed libiconv and libintl clones/implementations
authorJohn Hodge <[email protected]>
Mon, 25 Aug 2014 05:07:05 +0000 (13:07 +0800)
committerJohn Hodge <[email protected]>
Mon, 25 Aug 2014 05:07:05 +0000 (13:07 +0800)
Usermode/Libraries/libiconv.so_src/Makefile [new file with mode: 0644]
Usermode/Libraries/libiconv.so_src/iconv.c [new file with mode: 0644]
Usermode/Libraries/libiconv.so_src/include_exp/iconv.h [new file with mode: 0644]
Usermode/Libraries/libintl.so_src/Makefile [new file with mode: 0644]
Usermode/Libraries/libintl.so_src/gettext.c [new file with mode: 0644]
Usermode/Libraries/libintl.so_src/include_exp/libintl.h [new file with mode: 0644]
Usermode/Libraries/libintl.so_src/main.c [new file with mode: 0644]

diff --git a/Usermode/Libraries/libiconv.so_src/Makefile b/Usermode/Libraries/libiconv.so_src/Makefile
new file mode 100644 (file)
index 0000000..50f257a
--- /dev/null
@@ -0,0 +1,15 @@
+# Acess 2 "libiconv"
+#
+
+include ../Makefile.cfg
+
+CPPFLAGS +=
+CFLAGS   += -Wall
+LDFLAGS  += -lc -soname libiconv.so
+
+OBJ = iconv.o
+BIN = libiconv.so
+
+include ../Makefile.tpl
+
+
diff --git a/Usermode/Libraries/libiconv.so_src/iconv.c b/Usermode/Libraries/libiconv.so_src/iconv.c
new file mode 100644 (file)
index 0000000..d339555
--- /dev/null
@@ -0,0 +1,27 @@
+/*
+ */
+#include <iconv.h>
+#include <acess/sys.h>
+
+// === CODE ===
+int SoMain(void)
+{
+       return 0;
+}
+
+iconv_t iconv_open(const char *to, const char *from)
+{
+       return NULL;
+}
+
+size_t iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft)
+{
+       _SysDebug("WTF are you using iconv for?");
+       return 0;
+}
+
+int iconv_close(iconv_t cd)
+{
+       return 0;
+}
+
diff --git a/Usermode/Libraries/libiconv.so_src/include_exp/iconv.h b/Usermode/Libraries/libiconv.so_src/include_exp/iconv.h
new file mode 100644 (file)
index 0000000..817abee
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * Acess2 libiconv
+ * - By John Hodge (thePowersGang)
+ *
+ * iconv.h
+ * - External header
+ */
+#ifndef _ICONV_H_
+#define _ICONV_H_
+
+#include <stddef.h>
+
+typedef void   *iconv_t;
+
+extern iconv_t iconv_open(const char *to, const char *from);
+extern size_t  iconv(iconv_t cd, const char **inbuf, size_t *inbytesleft, char **outbuf, size_t *outbytesleft);
+extern int     iconv_close(iconv_t cd);
+
+#endif
+
diff --git a/Usermode/Libraries/libintl.so_src/Makefile b/Usermode/Libraries/libintl.so_src/Makefile
new file mode 100644 (file)
index 0000000..398ffc4
--- /dev/null
@@ -0,0 +1,16 @@
+# Acess 2 "libintl"
+#
+
+include ../Makefile.cfg
+
+CPPFLAGS +=
+CFLAGS   += -Wall
+LDFLAGS  += -lc
+
+OBJ = main.o gettext.o
+BIN = libintl.so
+
+include ../Makefile.tpl
+
+
+
diff --git a/Usermode/Libraries/libintl.so_src/gettext.c b/Usermode/Libraries/libintl.so_src/gettext.c
new file mode 100644 (file)
index 0000000..3b10d41
--- /dev/null
@@ -0,0 +1,35 @@
+/*
+ */
+#include <stddef.h>
+#include <libintl.h>
+
+// === CODE ===
+char *gettext(const char *msg)
+{
+       return dcgettext(NULL, msg, 0);
+}
+char *dgettext(const char *domain, const char *msg)
+{
+       return dcgettext(domain, msg, 0);
+}
+char *dcgettext(const char *domain, const char *msg, int category)
+{
+       return (char*)msg;
+}
+
+char *ngettext(const char *msg, const char *msgp, unsigned long int n)
+{
+       return dcngettext(NULL, msg, msgp, n, 0);
+}
+char *dngettext(const char *domain, const char *msg, const char *msgp, unsigned long int n)
+{
+       return dcngettext(domain, msg, msgp, n, 0);
+}
+char *dcngettext(const char *domain, const char *msg, const char *msgp, unsigned long int n, int category)
+{
+       if( n == 1 )
+               return (char*)msg;
+       else
+               return (char*)msgp;
+}
+
diff --git a/Usermode/Libraries/libintl.so_src/include_exp/libintl.h b/Usermode/Libraries/libintl.so_src/include_exp/libintl.h
new file mode 100644 (file)
index 0000000..54c0993
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ */
+#ifndef _LIBINTL_H_
+#define _LIBINTL_H_
+
+extern char    *gettext(const char *msg);
+extern char    *dgettext(const char *domain, const char *msg);
+extern char    *dcgettext(const char *domain, const char *msg, int category);
+extern char    *ngettext(const char *msg, const char *msgp, unsigned long int n);
+extern char    *dngettext(const char *domain, const char *msg, const char *msgp, unsigned long int n);
+extern char    *dcngettext(const char *domain, const char *msg, const char *msgp, unsigned long int n, int category);
+
+#endif
diff --git a/Usermode/Libraries/libintl.so_src/main.c b/Usermode/Libraries/libintl.so_src/main.c
new file mode 100644 (file)
index 0000000..30dead7
--- /dev/null
@@ -0,0 +1,7 @@
+/*
+ */
+
+int SoMain(void)
+{
+       return 0;
+}

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