Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/distrib/utils/libhack More locale hacks.
details: https://anonhg.NetBSD.org/src/rev/4498292a7edb
branches: trunk
changeset: 786199:4498292a7edb
user: joerg <joerg%NetBSD.org@localhost>
date: Fri Apr 19 18:45:03 2013 +0000
description:
More locale hacks.
diffstat:
distrib/utils/libhack/multibyte.c | 60 +++++++++++++++++++++++++++++++++++++-
1 files changed, 58 insertions(+), 2 deletions(-)
diffs (112 lines):
diff -r 31eae7b49fd5 -r 4498292a7edb distrib/utils/libhack/multibyte.c
--- a/distrib/utils/libhack/multibyte.c Fri Apr 19 17:43:05 2013 +0000
+++ b/distrib/utils/libhack/multibyte.c Fri Apr 19 18:45:03 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: multibyte.c,v 1.4 2008/07/29 13:46:16 tnozaki Exp $ */
+/* $NetBSD: multibyte.c,v 1.5 2013/04/19 18:45:03 joerg Exp $ */
/*
* Ignore all multibyte sequences, removes all the citrus code.
@@ -6,6 +6,7 @@
* And possibly from libcurses if compiled with HAVE_WCHAR.
*/
+#include <stdlib.h>
#include <wchar.h>
size_t
@@ -15,20 +16,46 @@
}
size_t
+mbrtowc_l(wchar_t *wc, const char *str, size_t max_sz, mbstate_t *ps, locale_t loc)
+{
+ return mbrtowc(wc, str, max_sz, ps);
+}
+
+size_t
wcrtomb(char *str, wchar_t wc, mbstate_t *ps)
{
*str = wc & 0xFF;
return 1;
}
+
+size_t
+wcrtomb_l(char *str, wchar_t wc, mbstate_t *ps, locale_t loc)
+{
+ return wcrtomb(str, wc, ps);
+}
+
int
wctob(wint_t x)
{
return x;
}
+int
+wctob_l(wint_t x, locale_t loc)
+{
+ return x;
+}
+
wint_t
-btowc(int x) {
+btowc(int x)
+{
+ return x;
+}
+
+wint_t
+btowc_l(int x, locale_t loc)
+{
return x;
}
@@ -42,6 +69,14 @@
return l;
}
+
+size_t
+mbrlen_l(const char * __restrict p, size_t l, mbstate_t * __restrict v,
+ locale_t loc)
+{
+ return mbrlen(p, l, v);
+}
+
int
mbsinit(const mbstate_t *s)
{
@@ -66,6 +101,14 @@
return count;
}
+
+size_t
+mbsrtowcs_l(wchar_t * __restrict pwcs, const char ** __restrict s, size_t n,
+ mbstate_t * __restrict ps, locale_t loc)
+{
+ return mbsrtowcs(pwcs, s, n, ps);
+}
+
size_t
wcsrtombs(char * __restrict s, const wchar_t ** __restrict pwcs, size_t n,
mbstate_t * __restrict ps)
@@ -83,3 +126,16 @@
*d = 0;
return count;
}
+
+size_t
+wcsrtombs_l(char * __restrict s, const wchar_t ** __restrict pwcs, size_t n,
+ mbstate_t * __restrict ps, locale_t loc)
+{
+ return wcsrtombs(s, pwcs, n, ps);
+}
+
+size_t
+_mb_cur_max_l(locale_t loc)
+{
+ return MB_CUR_MAX;
+}
Home |
Main Index |
Thread Index |
Old Index