summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorespie <espie@openbsd.org>2005-11-16 16:48:14 +0000
committerespie <espie@openbsd.org>2005-11-16 16:48:14 +0000
commit3ec4269ff93c7dda45bad5ab022c7601a2b1f06d (patch)
treeaeb4150fb43c84a31423630d0a76b50ebb461834
parentknf & cleanup; mickey ok (diff)
downloadwireguard-openbsd-3ec4269ff93c7dda45bad5ab022c7601a2b1f06d.tar.xz
wireguard-openbsd-3ec4269ff93c7dda45bad5ab022c7601a2b1f06d.zip
CODESET support. okay millert@, otto@
(not really useful for now, it mostly helps some programs which want to use it, it will become useful when we have full 16 bits locale).
-rw-r--r--include/langinfo.h4
-rw-r--r--lib/libc/locale/nl_langinfo.c9
-rw-r--r--lib/libc/shlib_version2
3 files changed, 12 insertions, 3 deletions
diff --git a/include/langinfo.h b/include/langinfo.h
index b3aafd04500..22edfa8c3bc 100644
--- a/include/langinfo.h
+++ b/include/langinfo.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: langinfo.h,v 1.4 2002/02/16 21:27:17 millert Exp $ */
+/* $OpenBSD: langinfo.h,v 1.5 2005/11/16 16:48:14 espie Exp $ */
/* $NetBSD: langinfo.h,v 1.3 1995/04/28 23:30:54 jtc Exp $ */
/*
@@ -69,6 +69,8 @@
#define NOEXPR 49 /* Negative response for yes/no queries */
#define CRNCYSTR 50 /* Currency symbol */
+#define CODESET 51 /* Codeset name */
+
__BEGIN_DECLS
char *nl_langinfo(nl_item);
__END_DECLS
diff --git a/lib/libc/locale/nl_langinfo.c b/lib/libc/locale/nl_langinfo.c
index 176d5588351..eee8d08c9d7 100644
--- a/lib/libc/locale/nl_langinfo.c
+++ b/lib/libc/locale/nl_langinfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nl_langinfo.c,v 1.5 2005/08/08 08:05:35 espie Exp $ */
+/* $OpenBSD: nl_langinfo.c,v 1.6 2005/11/16 16:48:15 espie Exp $ */
/*
* Written by J.T. Conklin <jtc@netbsd.org>.
* Public domain.
@@ -8,6 +8,8 @@
#include <locale.h>
#include <nl_types.h>
#include <langinfo.h>
+#include "rune.h"
+#include "runetype.h"
char *
nl_langinfo(nl_item item)
@@ -98,6 +100,11 @@ nl_langinfo(nl_item item)
case CRNCYSTR: /* XXX */
s = "";
break;
+ case CODESET:
+ s = _CurrentRuneLocale->rl_codeset;
+ if (!s)
+ s = "";
+ break;
default:
s = "";
break;
diff --git a/lib/libc/shlib_version b/lib/libc/shlib_version
index 5a05179b472..281ecb0047b 100644
--- a/lib/libc/shlib_version
+++ b/lib/libc/shlib_version
@@ -1,4 +1,4 @@
major=38
-minor=3
+minor=4
# note: If changes were made to include/thread_private.h or if system
# calls were added/changed then libpthread must also be updated.