summaryrefslogtreecommitdiff
path: root/navit/support
diff options
context:
space:
mode:
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-29 11:50:13 +0000
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>2008-10-29 11:50:13 +0000
commitc0b5ad89910f7eeabe10649b022cab7b3acaffb7 (patch)
tree6fe84fc77f1f2e4f6bd6bf9c47f6bc6ad3406abe /navit/support
parentd0c61e4154288e7e1bd0cc0925cb1ce41cca5fb5 (diff)
downloadnavit-c0b5ad89910f7eeabe10649b022cab7b3acaffb7.tar.gz
Add:Core:Added libc stubs for devices which don't have a libc
git-svn-id: http://svn.code.sf.net/p/navit/code/trunk/navit@1610 ffa7fe5e-494d-0410-b361-a75ebd5db220
Diffstat (limited to 'navit/support')
-rw-r--r--navit/support/libc/Makefile.am4
-rw-r--r--navit/support/libc/errno.h4
-rw-r--r--navit/support/libc/libc.c82
-rw-r--r--navit/support/libc/libc_init.c6
-rw-r--r--navit/support/libc/locale.h12
-rw-r--r--navit/support/libc/signal.h2
6 files changed, 110 insertions, 0 deletions
diff --git a/navit/support/libc/Makefile.am b/navit/support/libc/Makefile.am
new file mode 100644
index 000000000..9811dacd9
--- /dev/null
+++ b/navit/support/libc/Makefile.am
@@ -0,0 +1,4 @@
+include $(top_srcdir)/Makefile.inc
+AM_CPPFLAGS = @NAVIT_CFLAGS@ -I$(top_srcdir)/navit -DMODULE=support_libc
+noinst_LTLIBRARIES = libsupport_libc.la
+libsupport_libc_la_SOURCES = libc.c libc_init.c libc.h
diff --git a/navit/support/libc/errno.h b/navit/support/libc/errno.h
new file mode 100644
index 000000000..5ef0a7bd5
--- /dev/null
+++ b/navit/support/libc/errno.h
@@ -0,0 +1,4 @@
+extern int errno;
+#define ENOMEM 12
+#define EINVAL 22
+#define ERANGE 34
diff --git a/navit/support/libc/libc.c b/navit/support/libc/libc.c
new file mode 100644
index 000000000..ca75cdc17
--- /dev/null
+++ b/navit/support/libc/libc.c
@@ -0,0 +1,82 @@
+#include "locale.h"
+int errno;
+
+char *
+getenv(char *name)
+{
+ return 0;
+}
+
+void
+setenv(void)
+{
+}
+
+char *
+getcwd(void)
+{
+ return "dummy";
+}
+
+char *
+getwd(void)
+{
+ return "dummy";
+}
+
+char *strtok_r(char *str, const char *delim, char **saveptr)
+{
+ return strtok(str, delim);
+}
+
+void
+perror(char *x)
+{
+}
+
+void
+raise(void)
+{
+}
+
+void *
+popen(void)
+{
+ return 0;
+}
+
+void
+pclose(void)
+{
+}
+
+void
+rewind(void)
+{
+}
+
+int
+GetThreadLocale(void)
+{
+ return 0;
+}
+
+int
+signal(void)
+{
+ return 0;
+}
+
+void
+setlocale(void)
+{
+ return 0;
+}
+
+static struct lconv localedata={"."};
+
+struct lconv *
+localeconv(void)
+{
+ return &localedata;
+}
diff --git a/navit/support/libc/libc_init.c b/navit/support/libc/libc_init.c
new file mode 100644
index 000000000..32be387da
--- /dev/null
+++ b/navit/support/libc/libc_init.c
@@ -0,0 +1,6 @@
+#include "plugin.h"
+
+void
+plugin_init(void)
+{
+}
diff --git a/navit/support/libc/locale.h b/navit/support/libc/locale.h
new file mode 100644
index 000000000..fad4f95de
--- /dev/null
+++ b/navit/support/libc/locale.h
@@ -0,0 +1,12 @@
+#ifndef _LOCALE_H
+#define _LOCALE_H 1
+#define SUBLANG_BENGALI_BANGLADESH 0x02
+#define SUBLANG_PUNJABI_PAKISTAN 0x02
+#define SUBLANG_ROMANIAN_MOLDOVA 0x02
+struct lconv {
+ char *decimal_point;
+};
+
+#define LC_ALL 1
+#define LC_NUMERIC 2
+#endif
diff --git a/navit/support/libc/signal.h b/navit/support/libc/signal.h
new file mode 100644
index 000000000..18b65399b
--- /dev/null
+++ b/navit/support/libc/signal.h
@@ -0,0 +1,2 @@
+#define SIGFPE 8
+#define SIGSEGV 11