SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c
SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c
SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c
-SRC_C += setvbuf.c settimeofday.c sleep.c sprintf.c stat.c stdio0.c
+SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c stat.c stdio0.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
-SRC_C += strnicmp.c strsep.c
+SRC_C += strnlen.c strnicmp.c strsep.c strxfrm.c strcoll.c
SRC_C += strtod.c strtol.c system.c time.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
SRC_C += popen.c printf.c putenv.c putgetch.c putpwent.c pwent.c qsort.c
SRC_C += raise.c rand.c readdir.c readlink.c realloc.c regerror.c
SRC_C += regsub.c remove.c rewind.c rindex.c setbuffer.c setenv.c setjmp.c
-SRC_C += setvbuf.c settimeofday.c sleep.c sprintf.c stat.c stdio0.c
+SRC_C += setlocale.c setvbuf.c settimeofday.c sleep.c sprintf.c stat.c stdio0.c
SRC_C += strcasecmp.c strcasestr.c strdup.c stricmp.c strlcpy.c strncasecmp.c
-SRC_C += strnicmp.c strsep.c
+SRC_C += strnicmp.c strnlen.c strsep.c
SRC_C += system.c time.c tmpnam.c ttyname.c
SRC_C += tzset.c ungetc.c utent.c utimes.c utsname.c
SRC_C += vfprintf.c vprintf.c wait.c xitoa.c pathconf.c
# (cd fuzix; make)
# cat fuzix/syslib.l | tr " " "\\n" | sed -e "s/^/fuzix\//" >syscall.l
-syslib.lib: syscall.l
+syslib.lib: syscall.l $(OBJ_C)
$(AR) a syslib.lib $(OBJ_C)
ln -sf syslib.lib c.lib
$(CC) $(CC_NOOPT) $(@:.o=.c)
clean:
- rm -rf *.rel *.asm *.sym *.lst *.lib *~ syscall.l libc.l syslib.l
+ rm -rf *.o *.lib *~ syscall.l libc.l syslib.l
(cd fuzix-6502; make clean)
--- /dev/null
+#include <string.h>
+#include <locale.h>
+#include <limits.h>
+
+char *setlocale(int category, const char *locale)
+{
+ if(strcmp(locale, "C") && strcmp(locale, "POSIX"))
+ return NULL;
+ return "C";
+}
+
+locale_t uselocale(locale_t newloc)
+{
+ return "C";
+}
+
+locale_t newlocale(int category_mask, const char *locale, locale_t base)
+{
+ if (strcmp(locale, "C") && strcmp(locale, "POSIX"))
+ return NULL;
+ return "C";
+}
+
+void freelocale(locale_t locale)
+{
+}
+
+locale_t duplocale(locale_t locobj)
+{
+ return locobj;
+}
+
+
+static struct lconv C_lc = {
+ ".",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ "",
+ ""
+ "",
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+ CHAR_MAX,
+};
+
+struct lconv *localeconv(void)
+{
+ return &C_lc;
+}
+
--- /dev/null
+#include <string.h>
+
+int strcoll(const char *s1, const char *s2)
+{
+ return strcmp(s1, s2);
+}
--- /dev/null
+#include <string.h>
+
+size_t strnlen(const char *t, size_t n)
+{
+ size_t ct = 0;
+ while (*t++ && ct++ < n)
+ t++;
+ return ct;
+}
--- /dev/null
+#include <string.h>
+
+size_t strxfrm(char *to, const char *from, size_t n)
+{
+ strncpy(to, from, n);
+ return strnlen(to, n);
+}