summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2003-01-21 20:16:37 +0000
committerJeremy Katz <katzj@redhat.com>2003-01-21 20:16:37 +0000
commit9ba318ec9f57970b2a1b9a0769f2a9e5c5d61069 (patch)
treec18278acf3a878ab291bba4e4f024bcca72c8396
parent83c81307f62578f321f756d977012ece891886b1 (diff)
downloadanaconda-9ba318ec9f57970b2a1b9a0769f2a9e5c5d61069.tar.gz
anaconda-9ba318ec9f57970b2a1b9a0769f2a9e5c5d61069.tar.xz
anaconda-9ba318ec9f57970b2a1b9a0769f2a9e5c5d61069.zip
add wcstubs from dietstubs to their own file currently used by non-diet builds.
should make this used by diet builds also and then use it for prepping the unicode-lite stub lib that we use for ftp/http
-rw-r--r--loader2/Makefile2
-rw-r--r--loader2/wcstubs.c53
2 files changed, 55 insertions, 0 deletions
diff --git a/loader2/Makefile b/loader2/Makefile
index b67868335..c804938fc 100644
--- a/loader2/Makefile
+++ b/loader2/Makefile
@@ -47,6 +47,8 @@ GUNZIP = ../isys/gzlib/libgunzip-diet.a
OBJS += dietstubs.o ctype.o
ISYSLIB += -lrpc
CTYPEDEP = ctype.c
+else
+OBJS += wcstubs.o
endif
ifeq (i386, $(ARCH))
diff --git a/loader2/wcstubs.c b/loader2/wcstubs.c
new file mode 100644
index 000000000..6dc00a0a9
--- /dev/null
+++ b/loader2/wcstubs.c
@@ -0,0 +1,53 @@
+/*
+ * unicode-lite.c - simple library to LD_PRELOAD for emulation of
+ * wide character functionality when glibc gconv data isn't available
+ *
+ * Matt Wilson <msw@redhat.com>
+ * Jeremy Katz <katzj@redhat.com>
+ *
+ * Copyright 2002 Red Hat, Inc.
+ *
+ * This software may be freely redistributed under the terms of the GNU
+ * General Public License.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+
+
+#define WLITE_REDEF_STDC 0
+#include <wlite_wchar.h>
+#include <wlite_wctype.h>
+
+
+int wcwidth (wchar_t c) {
+ return wlite_wcwidth(c);
+}
+
+size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, void *ps) {
+ return wlite_mbrtowc (pwc, s, n, ps);
+}
+
+int iswspace (wchar_t c) {
+ return wlite_iswctype((c), wlite_space_);
+}
+
+size_t wcrtomb(char *s, wchar_t wc, void *ps) {
+ return wlite_wcrtomb (s, wc, ps);
+}
+
+/* Define ALIAS as a strong alias for ORIGINAL. */
+# define strong_alias(name, aliasname) _strong_alias(name, aliasname)
+# define _strong_alias(name, aliasname) \
+ extern __typeof (name) aliasname __attribute__ ((alias (#name)));
+
+
+/* lie to slang to trick it into using unicode chars for linedrawing */
+/* can't do this one -- the symbol size changes */
+/*char * setlocale (int category, const char *locale) {
+ if (locale == NULL || *locale == '\0')
+ return "en_US.UTF-8";
+ return 0;
+ }*/
+