Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/distrib/utils/libhack Stub out mbrtowc(), removes all the ci...



details:   https://anonhg.NetBSD.org/src/rev/b4b6cb1514bc
branches:  trunk
changeset: 580903:b4b6cb1514bc
user:      dsl <dsl%NetBSD.org@localhost>
date:      Sun May 15 10:15:47 2005 +0000

description:
Stub out mbrtowc(), removes all the citrus_xxx stuff from libc.
rescue_tiny fits again...

diffstat:

 distrib/utils/libhack/Makefile     |   3 ++-
 distrib/utils/libhack/Makefile.inc |   4 +++-
 distrib/utils/libhack/mbrtowc.c    |  14 ++++++++++++++
 3 files changed, 19 insertions(+), 2 deletions(-)

diffs (60 lines):

diff -r d386b82a14a8 -r b4b6cb1514bc distrib/utils/libhack/Makefile
--- a/distrib/utils/libhack/Makefile    Sun May 15 09:58:06 2005 +0000
+++ b/distrib/utils/libhack/Makefile    Sun May 15 10:15:47 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.17 2004/06/06 07:03:53 christos Exp $
+# $NetBSD: Makefile,v 1.18 2005/05/15 10:15:47 dsl Exp $
 #
 # Stubs to kill off some things from libc:
 # This save space on a boot system.
@@ -11,6 +11,7 @@
 LIB=           hack
 SRCS=          getcap.c getgrent.c getnet.c getnetgr.c getpwent.c \
                localeconv.c perror.c setlocale.c \
+               mbrtowc.c \
                strerror.c strsignal.c syslog.c utmp.c yplib.c
 
 WARNS=         1
diff -r d386b82a14a8 -r b4b6cb1514bc distrib/utils/libhack/Makefile.inc
--- a/distrib/utils/libhack/Makefile.inc        Sun May 15 09:58:06 2005 +0000
+++ b/distrib/utils/libhack/Makefile.inc        Sun May 15 10:15:47 2005 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.inc,v 1.18 2004/06/06 07:03:53 christos Exp $
+# $NetBSD: Makefile.inc,v 1.19 2005/05/15 10:15:47 dsl Exp $
 #
 # Include this fragment to build libhack.o
 # It is .o and not .a to make sure these are the
@@ -19,6 +19,7 @@
 CPPFLAGS+=     -DSMALL
 HACKOBJS+=     getcap.o getgrent.o getnet.o getnetgr.o getpwent.o \
                localeconv.o perror.o setlocale.o \
+               mbrtowc.o \
                strerror.o strsignal.o syslog.o utmp.o yplib.o
 
 libhack.o: ${HACKOBJS}
@@ -34,6 +35,7 @@
 getnetgr.o:    ${HACKSRC}/getnetgr.c
 getpwent.o:    ${HACKSRC}/getpwent.c
 localeconv.o:  ${HACKSRC}/localeconv.c
+mbrtowc.o:     ${HACKSRC}/mbrtowc.c
 perror.o:      ${HACKSRC}/perror.c
 setlocale.o:   ${HACKSRC}/setlocale.c
 strerror.o:    ${HACKSRC}/strerror.c
diff -r d386b82a14a8 -r b4b6cb1514bc distrib/utils/libhack/mbrtowc.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/distrib/utils/libhack/mbrtowc.c   Sun May 15 10:15:47 2005 +0000
@@ -0,0 +1,14 @@
+/*      $NetBSD: mbrtowc.c,v 1.1 2005/05/15 10:15:47 dsl Exp $      */
+
+/*
+ * Ignore all multibyte sequences, removes all the citrus code.
+ * Probably only used by vfprintf() when parsing the format string.
+ */
+
+#include <wchar.h>
+
+size_t
+mbrtowc(wchar_t *wc, const char *str, size_t max_sz, mbstate_t *ps)
+{
+    return (*wc = *str) == 0 ? 0 : 1;
+}



Home | Main Index | Thread Index | Old Index