aboutsummaryrefslogtreecommitdiff
path: root/lib/libc/locale/runetype.c
diff options
context:
space:
mode:
authorDavid Chisnall <theraven@FreeBSD.org>2011-11-20 14:45:42 +0000
committerDavid Chisnall <theraven@FreeBSD.org>2011-11-20 14:45:42 +0000
commit3c87aa1d3dc1d8dad3efad322852a8e1e76dee55 (patch)
tree909189922493cddbeeac84af2e316dc897661311 /lib/libc/locale/runetype.c
parent9e134d91bf553c39d4590a9e373837326c465758 (diff)
downloadsrc-3c87aa1d3dc1d8dad3efad322852a8e1e76dee55.tar.gz
src-3c87aa1d3dc1d8dad3efad322852a8e1e76dee55.zip
Notes
Diffstat (limited to 'lib/libc/locale/runetype.c')
-rw-r--r--lib/libc/locale/runetype.c27
1 files changed, 25 insertions, 2 deletions
diff --git a/lib/libc/locale/runetype.c b/lib/libc/locale/runetype.c
index 5765b855073a..a0da47b5de98 100644
--- a/lib/libc/locale/runetype.c
+++ b/lib/libc/locale/runetype.c
@@ -5,6 +5,11 @@
* This code is derived from software contributed to Berkeley by
* Paul Borman at Krystal Technologies.
*
+ * Copyright (c) 2011 The FreeBSD Foundation
+ * All rights reserved.
+ * Portions of this software were developed by David Chisnall
+ * under sponsorship from the FreeBSD Foundation.
+ *
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
@@ -36,12 +41,15 @@ __FBSDID("$FreeBSD$");
#include <ctype.h>
#include <stdio.h>
#include <runetype.h>
+#include <wchar.h>
+#include "mblocal.h"
unsigned long
-___runetype(__ct_rune_t c)
+___runetype_l(__ct_rune_t c, locale_t locale)
{
size_t lim;
- _RuneRange *rr = &_CurrentRuneLocale->__runetype_ext;
+ FIX_LOCALE(locale);
+ _RuneRange *rr = &(XLOCALE_CTYPE(locale)->runes->__runetype_ext);
_RuneEntry *base, *re;
if (c < 0 || c == EOF)
@@ -64,3 +72,18 @@ ___runetype(__ct_rune_t c)
return(0L);
}
+unsigned long
+___runetype(__ct_rune_t c)
+{
+ return ___runetype_l(c, __get_locale());
+}
+
+int ___mb_cur_max(void)
+{
+ return XLOCALE_CTYPE(__get_locale())->__mb_cur_max;
+}
+int ___mb_cur_max_l(locale_t locale)
+{
+ FIX_LOCALE(locale);
+ return XLOCALE_CTYPE(locale)->__mb_cur_max;
+}