aboutsummaryrefslogtreecommitdiffstats
path: root/localeinfo.h
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2016-09-01 20:46:51 +0300
committerArnold D. Robbins <arnold@skeeve.com>2016-09-01 20:46:51 +0300
commit0e4da77d0490190e9371d35aa7b5225484369cb1 (patch)
tree9791b1b69963883e9d8496a64ea04e1f74a72405 /localeinfo.h
parenta94fdadfd58ce0f4f611911cec3c231f95fad818 (diff)
parentb02f580f06996bd88f741f9c7330aff79216a169 (diff)
downloadegawk-0e4da77d0490190e9371d35aa7b5225484369cb1.tar.gz
egawk-0e4da77d0490190e9371d35aa7b5225484369cb1.tar.bz2
egawk-0e4da77d0490190e9371d35aa7b5225484369cb1.zip
Merge branch 'master' into feature/cmake
Diffstat (limited to 'localeinfo.h')
-rw-r--r--localeinfo.h54
1 files changed, 54 insertions, 0 deletions
diff --git a/localeinfo.h b/localeinfo.h
new file mode 100644
index 00000000..cf2f9a69
--- /dev/null
+++ b/localeinfo.h
@@ -0,0 +1,54 @@
+/* locale information
+
+ Copyright 2016 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ 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., 51 Franklin Street - Fifth Floor, Boston, MA
+ 02110-1301, USA. */
+
+/* Written by Paul Eggert. */
+
+#include <limits.h>
+#include <stdbool.h>
+#include <wchar.h>
+
+struct localeinfo
+{
+ /* MB_CUR_MAX > 1. */
+ bool multibyte;
+
+ /* The locale uses UTF-8. */
+ bool using_utf8;
+
+ /* An array indexed by byte values B that contains 1 if B is a
+ single-byte character, -1 if B is an encoding error, and -2 if B
+ is the leading byte of a multibyte character that contains more
+ than one byte. */
+ signed char sbclen[UCHAR_MAX + 1];
+
+ /* An array indexed by byte values B that contains the corresponding
+ wide character (if any) for B if sbclen[B] == 1. WEOF means the
+ byte is not a valid single-byte character, i.e., sbclen[B] == -1
+ or -2. */
+ wint_t sbctowc[UCHAR_MAX + 1];
+};
+
+extern void init_localeinfo (struct localeinfo *);
+
+/* Maximum number of characters that can be the case-folded
+ counterparts of a single character, not counting the character
+ itself. This is a generous upper bound. */
+enum { CASE_FOLDED_BUFSIZE = 32 };
+
+extern int case_folded_counterparts (wchar_t, wchar_t[CASE_FOLDED_BUFSIZE]);