diff options
Diffstat (limited to 'src/u8c/chk.h.d')
-rw-r--r-- | src/u8c/chk.h.d/isalnum.c | 26 | ||||
-rw-r--r-- | src/u8c/chk.h.d/isalpha.c | 109 | ||||
-rw-r--r-- | src/u8c/chk.h.d/iscntrl.c | 104 | ||||
-rw-r--r-- | src/u8c/chk.h.d/isdigit.c | 44 | ||||
-rw-r--r-- | src/u8c/chk.h.d/islower.c | 187 | ||||
-rw-r--r-- | src/u8c/chk.h.d/ispunct.c | 165 | ||||
-rw-r--r-- | src/u8c/chk.h.d/isspace.c | 38 | ||||
-rw-r--r-- | src/u8c/chk.h.d/issurro.c | 30 | ||||
-rw-r--r-- | src/u8c/chk.h.d/isupper.c | 147 | ||||
-rw-r--r-- | src/u8c/chk.h.d/isxdigit.c | 48 |
10 files changed, 898 insertions, 0 deletions
diff --git a/src/u8c/chk.h.d/isalnum.c b/src/u8c/chk.h.d/isalnum.c new file mode 100644 index 0000000..2c8115b --- /dev/null +++ b/src/u8c/chk.h.d/isalnum.c @@ -0,0 +1,26 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_isalnum_tuple u8c_isalnum(char32_t const _chr) { + struct u8c_isalnum_tuple ret = { + .stat = false, + }; + ret.res = u8c_isalpha(_chr).res || u8c_isdigit(_chr).res; + return ret; +} diff --git a/src/u8c/chk.h.d/isalpha.c b/src/u8c/chk.h.d/isalpha.c new file mode 100644 index 0000000..2631095 --- /dev/null +++ b/src/u8c/chk.h.d/isalpha.c @@ -0,0 +1,109 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_isalpha_tuple u8c_isalpha(char32_t const _chr) { + struct u8c_isalpha_tuple ret = { + .stat = false, + }; + ret.res = u8c_islower(_chr).res || u8c_isupper(_chr).res; + if(ret.res) { + return ret; + } + switch(_chr) { + case U'\u0297': /* LATIN LETTER GLOTTAL STOP */ + case U'\u16A0': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A1': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A2': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A3': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A4': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A5': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A6': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A7': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A8': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16A9': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16AA': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16AB': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16AC': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16AD': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16AE': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16AF': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B0': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B1': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B2': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B3': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B4': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B5': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B6': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B7': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B8': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16B9': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16BA': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16BB': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16BC': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16BD': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16BE': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16BF': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C0': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C1': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C2': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C3': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C4': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C5': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C6': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C7': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C8': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16C9': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16CA': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16CB': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16CC': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16CD': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16CE': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16CF': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D0': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D1': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D2': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D3': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D4': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D5': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D6': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D7': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D8': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16D9': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16DA': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16DB': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16DC': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16DD': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16DE': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16DF': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E0': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E1': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E2': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E3': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E4': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E5': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E6': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E7': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E8': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16E9': /* RUNIC LETTER FEHU FEOH FE F */ + case U'\u16EA': /* RUNIC LETTER FEHU FEOH FE F */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/iscntrl.c b/src/u8c/chk.h.d/iscntrl.c new file mode 100644 index 0000000..c8532fc --- /dev/null +++ b/src/u8c/chk.h.d/iscntrl.c @@ -0,0 +1,104 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_iscntrl_tuple u8c_iscntrl(char32_t const _chr) { + struct u8c_iscntrl_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'\x0': /* NULL */ + case U'\x1': /* START OF HEADING */ + case U'\x2': /* START OF TEXT */ + case U'\x3': /* END OF TEXT */ + case U'\x4': /* END OF TRANSMISSION */ + case U'\x5': /* ENQUIRY */ + case U'\x6': /* ACKNOWLEDGE */ + case U'\a': /* BELL */ + case U'\b': /* BACKSPACE */ + case U'\t': /* HORIZONTAL TABULATION */ + case U'\n': /* NEW LINE */ + case U'\v': /* VERTICAL TABULATION */ + case U'\f': /* FORM FEED */ + case U'\r': /* CARRIAGE RETURN */ + case U'\xE': /* SHIFT OUT */ + case U'\xF': /* SHIFT IN */ + case U'\x10': /* DATA LINK ESCAPE */ + case U'\x11': /* DEVICE CONTROL ONE */ + case U'\x12': /* DEVICE CONTROL TWO */ + case U'\x13': /* DEVICE CONTROL THREE */ + case U'\x14': /* DEVICE CONTROL FOUR */ + case U'\x15': /* NEGATIVE ACKNOWLEDGE */ + case U'\x16': /* SYNCHRONOUS IDLE */ + case U'\x17': /* END OF TRANSMISSION BLOCK */ + case U'\x18': /* CANCEL */ + case U'\x19': /* END OF MEDIUM */ + case U'\x1A': /* SUBSTITUTE */ + case U'\x1B': /* ESCAPE */ + case U'\x1C': /* FILE SEPERATOR */ + case U'\x1D': /* GROUP SEPERATOR */ + case U'\x1E': /* RECORD SEPERATOR */ + case U'\x1F': /* UNIT SEPERATOR */ + case U'\x7F': /* DELETE */ + case U'\x80': /* <CONTROL> */ + case U'\x81': /* <CONTROL */ + case U'\x82': /* BREAK PERMITTED HERE */ + case U'\x83': /* NO BREAK HERE */ + case U'\x84': /* <CONTROL> */ + case U'\x85': /* NEXT LINE */ + case U'\x86': /* START OF SELECTED AREA */ + case U'\x87': /* END OF SELECTED AREA */ + case U'\x88': /* CHARACTER TABULATION SET */ + case U'\x89': /* CHARACTER TABULATION SET WITH JUSTIFICATION */ + case U'\x8A': /* LINE TABULATION SET */ + case U'\x8B': /* PARTIAL LINE FORWARD */ + case U'\x8C': /* PARTIAL LINE BACKWARD */ + case U'\x8D': /* REVERSE LINE FEED */ + case U'\x8E': /* SINGLE SHIFT TWO */ + case U'\x8F': /* SINGLE SHIFT THREE */ + case U'\x90': /* DEVICE CONTROL STRING */ + case U'\x91': /* PRIVATE USE ONE */ + case U'\x92': /* PRIVATE USE TWO */ + case U'\x93': /* SET TRANSMIT STATE */ + case U'\x94': /* CANCEL CHARACTER */ + case U'\x95': /* MESSAGE WAITING */ + case U'\x96': /* START OF GUARDED AREA */ + case U'\x97': /* END OF GUARDED AREA */ + case U'\x98': /* START OF STRING */ + case U'\x99': /* <CONTROL> */ + case U'\x9A': /* SINGLE CHARACTER INTRODUCER */ + case U'\x9B': /* CONTROL SEQUENCE INTRODUCER */ + case U'\x9C': /* STRING TERMINATOR */ + case U'\x9D': /* OPERATING SYSTEM COMMAND */ + case U'\x9E': /* PRIVACY MESSAGE */ + case U'\x9F': /* APPLICATION PROGRAM COMMAND */ + case U'\xA0': /* NO-BREAK SPACE */ + case U'\u2028': /* LINE SEPERATOR */ + case U'\u2029': /* PARAGRAPH SEPERATOR */ + case U'\u202D': /* LEFT-TO-RIGHT OVERRIDE */ + case U'\u202E': /* RIGHT-TO-LEFT OVERRIDE */ + case U'\u2068': /* FIRST STRONG ISOLATE */ + case U'\u2069': /* POP DIRECTIONAL ISOLATE */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/isdigit.c b/src/u8c/chk.h.d/isdigit.c new file mode 100644 index 0000000..61665cf --- /dev/null +++ b/src/u8c/chk.h.d/isdigit.c @@ -0,0 +1,44 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_isdigit_tuple u8c_isdigit(char32_t const _chr) { + struct u8c_isdigit_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'0': /* DIGIT ZERO */ + case U'1': /* DIGIT ONE */ + case U'2': /* DIGIT TWO */ + case U'3': /* DIGIT THREE */ + case U'4': /* DIGIT FOUR */ + case U'5': /* DIGIT FIVE */ + case U'6': /* DIGIT SIX */ + case U'7': /* DIGIT SEVEN */ + case U'8': /* DIGIT EIGHT */ + case U'9': /* DIGIT NINE */ + case U'\u218A': /* TURNED DIGIT TWO */ + case U'\u218B': /* TURNED DIGIT THREE */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/islower.c b/src/u8c/chk.h.d/islower.c new file mode 100644 index 0000000..0cb3ea1 --- /dev/null +++ b/src/u8c/chk.h.d/islower.c @@ -0,0 +1,187 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_islower_tuple u8c_islower(char32_t const _chr) { + struct u8c_islower_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'a': /* LATIN SMALL LETTER A */ + case U'b': /* LATIN SMALL LETTER B */ + case U'c': /* LATIN SMALL LETTER C */ + case U'd': /* LATIN SMALL LETTER D */ + case U'e': /* LATIN SMALL LETTER E */ + case U'f': /* LATIN SMALL LETTER F */ + case U'g': /* LATIN SMALL LETTER G */ + case U'h': /* LATIN SMALL LETTER H */ + case U'i': /* LATIN SMALL LETTER I */ + case U'j': /* LATIN SMALL LETTER J */ + case U'k': /* LATIN SMALL LETTER K */ + case U'l': /* LATIN SMALL LETTER L */ + case U'm': /* LATIN SMALL LETTER M */ + case U'n': /* LATIN SMALL LETTER N */ + case U'o': /* LATIN SMALL LETTER O */ + case U'p': /* LATIN SMALL LETTER P */ + case U'q': /* LATIN SMALL LETTER Q */ + case U'r': /* LATIN SMALL LETTER R */ + case U's': /* LATIN SMALL LETTER S */ + case U't': /* LATIN SMALL LETTER T */ + case U'u': /* LATIN SMALL LETTER U */ + case U'v': /* LATIN SMALL LETTER V */ + case U'w': /* LATIN SMALL LETTER W */ + case U'x': /* LATIN SMALL LETTER X */ + case U'y': /* LATIN SMALL LETTER Y */ + case U'z': /* LATIN SMALL LETTER Z */ + case U'\u00DF': /* LATIN SMALL LETTER SHARP S */ + case U'\u00E0': /* LATIN SMALL LETTER A WITH GRAVE */ + case U'\u00E1': /* LATIN SMALL LETTER A WITH ACUTE */ + case U'\u00E2': /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ + case U'\u00E3': /* LATIN SMALL LETTER A WITH TILDE */ + case U'\u00E4': /* LATIN SMALL LETTER A WITH DIAERESIS */ + case U'\u00E5': /* LATIN SMALL LETTER A WITH RING ABOVE */ + case U'\u00E6': /* LATIN SMALL LETTER AE */ + case U'\u00E7': /* LATIN SMALL LETTER C WITH CEDILLA */ + case U'\u00E8': /* LATIN SMALL LETTER E WITH GRAVE */ + case U'\u00E9': /* LATIN SMALL LETTER E WITH ACUTE */ + case U'\u00EA': /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ + case U'\u00EB': /* LATIN SMALL LETTER E WITH DIAERESIS */ + case U'\u00EC': /* LATIN SMALL LETTER I WITH GRAVE */ + case U'\u00ED': /* LATIN SMALL LETTER I WITH ACUTE */ + case U'\u00EE': /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ + case U'\u00EF': /* LATIN SMALL LETTER I WITH DIAERESIS */ + case U'\u00F0': /* LATIN SMALL LETTER ETH */ + case U'\u00F1': /* LATIN SMALL LETTER N WITH TILDE */ + case U'\u00F2': /* LATIN SMALL LETTER O WITH GRAVE */ + case U'\u00F3': /* LATIN SMALL LETTER O WITH ACUTE */ + case U'\u00F4': /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ + case U'\u00F5': /* LATIN SMALL LETTER O WITH TILDE */ + case U'\u00F6': /* LATIN SMALL LETTER O WITH DIAERESIS */ + case U'\u00F8': /* LATIN SMALL LETTER O WITH STROKE */ + case U'\u00F9': /* LATIN SMALL LETTER U WITH GRAVE */ + case U'\u00FA': /* LATIN SMALL LETTER U WITH ACUTE */ + case U'\u00FB': /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ + case U'\u00FC': /* U WITH TWO DOTS */ + case U'\u00FD': /* LATIN SMALL LETTER Y WITH ACUTE */ + case U'\u00FE': /* LATIN SMALL LETTER THORN */ + case U'\u00FF': /* LATIN SMALL LETTER Y WITH DIAERESIS */ + case U'\u0105': /* LATIN SMALL LETTER A WITH OGONEK */ + case U'\u0107': /* LATIN SMALL LETTER C WITH ACUTE */ + case U'\u010D': /* LATIN SMALL LETTER C WITH CARON */ + case U'\u010F': /* LATIN SMALL LETTER D WITH CARON */ + case U'\u0119': /* LATIN SMALL LETTER E WITH OGONEK */ + case U'\u011B': /* LATIN SMALL LETTER E WITH CARON */ + case U'\u011F': /* LATIN SMALL LETTER G WITH BREVE */ + case U'\u0131': /* LATIN SMALL LETTER DOTLESS I */ + case U'\u0133': /* LATIN SMALL LIGATURE LJ */ + case U'\u0138': /* LATIN SMALL LETTER KRA */ + case U'\u0142': /* LATIN SMALL LETTER L WITH STROKE */ + case U'\u0144': /* LATIN SMALL LETTER N WITH ACUTE */ + case U'\u0148': /* LATIN SMALL LETTER N WITH CARON */ + case U'\u014B': /* LATIN SMALL LETTER ENG */ + case U'\u0153': /* LATIN SMALL LIGATURE OE */ + case U'\u0159': /* LATIN SMALL LETTER R WITH CARON */ + case U'\u015B': /* LATIN SMALL LETTER S WITH ACUTE */ + case U'\u015F': /* LATIN SMALL LETTER S WITH CEDILLA */ + case U'\u0161': /* LATIN SMALL LETTER S WITH CARON */ + case U'\u0165': /* LATIN SMALL LETTER T WITH CARON */ + case U'\u016F': /* LATIN SMALL LETTER U WITH RING ABOVE */ + case U'\u017A': /* LATIN SMALL LETTER Z WITH ACUTE */ + case U'\u017C': /* LATIN SMALL LETTER Z WITH DOT ABOVE */ + case U'\u017E': /* LATIN SMALL LETTER Z WITH CARON */ + case U'\u01BF': /* LATIN LETTER WYNN */ + case U'\u01DD': /* LATIN SMALL LETTER TURNED E */ + case U'\u021D': /* LATIN SMALL LETTER YOGH */ + case U'\u0242': /* LATIN SMALL LETTER GLOTTAL STOP */ + case U'\u0250': /* LATIN SMALL LETTER TURNED A */ + case U'\u0251': /* LATIN SMALL LETTER ALPHA */ + case U'\u0252': /* LATIN SMALL LETTER TURNED ALPHA */ + case U'\u0253': /* LATIN SMALL LETTER B WITH HOOk */ + case U'\u0254': /* LATIN SMALL LETTER OPEN O */ + case U'\u0255': /* LATIN SMALL LETTER C WITH CURL */ + case U'\u0256': /* LATIN SMALL LETTER D WITH TAIL */ + case U'\u0257': /* LATIN SMALL LETTER D WITH HOOk */ + case U'\u0258': /* LATIN SMALL LETTER REVERSED E */ + case U'\u0259': /* LATIN SMALL LETTER SCHWA */ + case U'\u025A': /* LATIN SMALL LETTER SCHWA WITH HOOK */ + case U'\u025B': /* LATIN SMALL LETTER OPEN E */ + case U'\u025C': /* LATIN SMALL LETTER REVERSED OPEN E */ + case U'\u025D': /* LATIN SMALL LETTER REVERSED OPEN E WITH HOOK */ + case U'\u025E': /* LATIN SMALL LETTER CLOSED REVERSED OPEN E */ + case U'\u025F': /* LATIN SMALL LETTER DOTLESS J WITH STROKE */ + case U'\u0260': /* LATIN SMALL LETTER G WITH HOOK */ + case U'\u0261': /* LATIN SMALL LETTER SCRIPT G */ + case U'\u0262': /* LATIN LETTER SMALL CAPITAL G */ + case U'\u0263': /* LATIN SMALL LETTER GAMMA */ + case U'\u0264': /* LATIN SMALL LETTER RAMS HORN */ + case U'\u0265': /* LATIN SMALL LETTER TURNED H */ + case U'\u0266': /* LATIN SMALL LETTER H WITH HOOK */ + case U'\u0267': /* LATIN SMALL LETTER HENG WITH HOOK */ + case U'\u0268': /* LATIN SMALL LETTER I WITH STROKE */ + case U'\u0269': /* LATIN SMALL LETTER IOTA */ + case U'\u026A': /* LATIN LETTER SMALL CAPITAL I */ + case U'\u026B': /* LATIN SMALL LETTER L WITH MIDDLE TILDE */ + case U'\u026C': /* LATIN SMALL LETTER L WITH BELT */ + case U'\u026D': /* LATIN SMALL LETTER L WITH RETROFLEX HOOK */ + case U'\u026E': /* LATIN SMALL LETTER LEZH */ + case U'\u026F': /* LATIN SMALL LETTER TURNED M */ + case U'\u0270': /* LATIN SMALL LETTER TURNED M WITH LONG LEG */ + case U'\u0271': /* LATIN SMALL LETTER M WITH HOOK */ + case U'\u0272': /* LATIN SMALL LETTER N WITH LEFT HOOK */ + case U'\u0273': /* LATIN SMALL LETTER N WITH RETROFLEX HOOK */ + case U'\u0283': /* LATIN SMALL LETTER ESH */ + case U'\u028A': /* LATIN SMALL LETTER UPSILON */ + case U'\u028B': /* LATIN SMALL LETTER V WITH HOOK */ + case U'\u0292': /* LATIN SMALL LETTER EZH */ + case U'\u0294': /* LATIN SMALL LETTER GLOTTAL STOP */ + case U'\u03B1': /* GREEK SMALL LETTER ALPHA */ + case U'\u03B2': /* GREEK SMALL LETTER BETA */ + case U'\u03B3': /* GREEK SMALL LETTER GAMMA */ + case U'\u03B4': /* GREEK SMALL LETTER DELTA */ + case U'\u03B5': /* GREEK SMALL LETTER EPSILON */ + case U'\u03B6': /* GREEK SMALL LETTER ZETA */ + case U'\u03B7': /* GREEK SMALL LETTER ETA */ + case U'\u03B8': /* GREEK SMALL LETTER THETA */ + case U'\u03B9': /* GREEK SMALL LETTER IOTA */ + case U'\u03BA': /* GREEK SMALL LETTER KAPPA */ + case U'\u03BB': /* GREEK SMALL LETTER LAMBDA */ + case U'\u03BC': /* GREEK SMALL LETTER MU */ + case U'\u03BD': /* GREEK SMALL LETTER NU */ + case U'\u03BE': /* GREEK SMALL LETTER XI */ + case U'\u03BF': /* GREEK SMALL LETTER OMICRON */ + case U'\u03C0': /* GREEK SMALL LETTER PI */ + case U'\u03C1': /* GREEK SMALL LETTER RHO */ + case U'\u03C2': /* GREEK SMALL LETTER FINAL SIGMA */ + case U'\u03C3': /* GREEK SMALL LETTER SIGMA */ + case U'\u03C4': /* GREEK SMALL LETTER TAU */ + case U'\u03C5': /* GREEK SMALL LETTER UPSILON */ + case U'\u03C6': /* GREEK SMALL LETTER PHI */ + case U'\u03C7': /* GREEK SMALL LETTER CHI */ + case U'\u03C8': /* GREEK SMALL LETTER PSI */ + case U'\u03C9': /* GREEK SMALL LETTER OMEGA */ + case U'\u1D79': /* LATIN SMALL LETTER INSULAR G */ + case U'\uA7B7': /* LATIN SMALL LETTER OMEGA */ + case U'\uFB00': /* LATIN SMALL LIGATURE FF */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/ispunct.c b/src/u8c/chk.h.d/ispunct.c new file mode 100644 index 0000000..2d2a276 --- /dev/null +++ b/src/u8c/chk.h.d/ispunct.c @@ -0,0 +1,165 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_ispunct_tuple u8c_ispunct(char32_t const _chr) { + struct u8c_ispunct_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'!': /* EXCLAMATION MARK */ + case U'\"': /* QUOTATION MARK */ + case U'#': /* NUMBER SIGN */ + case U'\u0024': /* DOLLAR SIGN */ + case U'%': /* PERCENT SIGN */ + case U'&': /* AMPERSAND */ + case U'\'': /* APOSTROPHE */ + case U'(': /* LEFT PARANTHESIS */ + case U')': /* RIGHT PARANTHESIS */ + case U'*': /* ASTERISK */ + case U'+': /* PLUS SIGN */ + case U',': /* COMMA */ + case U'-': /* HYPHEN-MINUS */ + case U'.': /* FULL STOP */ + case U'/': /* SOLIDUS */ + case U':': /* COLON */ + case U';': /* SEMICOLON */ + case U'<': /* LESS-THAN SIGN */ + case U'=': /* EQUALS SIGN */ + case U'>': /* GREATER-THAN SIGN */ + case U'\?': /* QUESTION MARK */ + case U'\u0040': /* COMMERCIAL AT */ + case U'[': /* LEFT SQUARE BRACKET */ + case U'\\': /* REVERSE SOLIDUS */ + case U']': /* RIGHT SQUARE BRACKET */ + case U'^': /* CIRCUMFLEX ACCENT */ + case U'_': /* LOW LINE */ + case U'\u0060': /* GRAVE ACCENT */ + case U'{': /* LEFT CURLY BRACKET */ + case U'|': /* VERTICAL LINE */ + case U'}': /* RIGHT CURLY BRACKET */ + case U'~': /* TILDE */ + case U'\u00A1': /* INVERT EXCLAMATION MARK */ + case U'\u00A2': /* CENT SIGN */ + case U'\u00A3': /* POUND SIGN */ + case U'\u00A4': /* CURRENCY SIGN */ + case U'\u00A5': /* YEN SIGN */ + case U'\u00A7': /* SECTION SIGN */ + case U'\u00A8': /* DIAERESIS */ + case U'\u00A9': /* COPYRIGHT SIGN */ + case U'\u00AB': /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ + case U'\u00AE': /* REGISTERED SIGN */ + case U'\u00B0': /* DEGREE SIGN */ + case U'\u00B4': /* ACUTE ACCENT */ + case U'\u00B6': /* PILCROW SIGN */ + case U'\u00BB': /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ + case U'\u00B1': /* PLUS MINUS SIGN */ + case U'\u00BF': /* INVERT QUESTION MARK */ + case U'\u00D7': /* MULTIPLICATION SIGN */ + case U'\u00F7': /* DIVISION SIGN */ + case U'\u2010': /* HYPHEN */ + case U'\u2013': /* EN DASH */ + case U'\u2014': /* EM DASH */ + case U'\u2018': /* LEFT SINGLE QUOTATION MARK */ + case U'\u2019': /* RIGHT SINGLE QUOTATION MARK */ + case U'\u201C': /* LEFT DOUBLE QUOTATION MARK */ + case U'\u201D': /* RIGHT DOUBLE QUOTATION MARK */ + case U'\u2026': /* HORIZONTAL ELLIPSIS */ + case U'\u2030': /* PER MILLE SIGN */ + case U'\u2031': /* PER TEN THOUSAND SIGN */ + case U'\u2032': /* PRIME */ + case U'\u2033': /* DOUBLE PRIME */ + case U'\u2034': /* TRIPLE PRIME */ + case U'\u2035': /* REVERSED PRIME */ + case U'\u2036': /* REVERSED DOUBLE PRIME */ + case U'\u2037': /* REVERSED TRIPLE PRIME */ + case U'\u203C': /* DOUBLE EXCLAMATION MARK */ + case U'\u203D': /* INTERROBANG */ + case U'\u2047': /* DOUBLE QUOTATION MARK */ + case U'\u2048': /* QUESTION EXCLAMATION MARK */ + case U'\u2049': /* EXCLAMATION QUESTION MARK */ + case U'\u20A3': /* FRENCH FRANC SIGN */ + case U'\u20A4': /* LIRA SIGN */ + case U'\u20A8': /* RUPEE SIGN */ + case U'\u20A9': /* WON SIGN */ + case U'\u20AC': /* EURO SIGN */ + case U'\u20B9': /* INDIAN RUPEE SIGN */ + case U'\u20BF': /* BITCOIN SIGN */ + case U'\u2103': /* DEGREE CELSIUS */ + case U'\u2107': /* EULER CONSTANT */ + case U'\u2109': /* DEGREE FAHRENHEIT */ + case U'\u210E': /* PLANCK CONSTANT */ + case U'\u2117': /* SOUND RECORDING COPYRIGHT */ + case U'\u2122': /* TRADE MARK SIGN */ + case U'\u2125': /* OUNCE SIGN */ + case U'\u2126': /* OHM SIGN */ + case U'\u212A': /* KELVIN SIGN */ + case U'\u214D': /* AKTIESELSKAB */ + case U'\u2205': /* EMPTY SET */ + case U'\u2212': /* MINUS SIGN */ + case U'\u221A': /* SQUARE ROOT */ + case U'\u221B': /* CUBE ROOT */ + case U'\u221C': /* FOURTH ROOT */ + case U'\u221E': /* INFINITY */ + case U'\u2228': /* LOGICAL OR */ + case U'\u2248': /* ALMOST EQUAL TO */ + case U'\u2260': /* NOT EQUAL TO */ + case U'\u2264': /* LESS-THAN OR EQUAL TO */ + case U'\u2265': /* GREATER-THAN OR EQUAL TO */ + case U'\u2609': /* SUN */ + case U'\u263F': /* MERCURY */ + case U'\u2640': /* FEMALE SIGN */ + case U'\u2641': /* EARTH */ + case U'\u2642': /* MALE SIGN */ + case U'\u2643': /* JUPITER */ + case U'\u2644': /* SATURN */ + case U'\u2645': /* URANUS */ + case U'\u2646': /* NEPTUNE */ + case U'\u2647': /* PLUTO */ + case U'\u26A2': /* DOUBLED FEMALE SIGN */ + case U'\u26A3': /* DOUBLED MALE SIGN */ + case U'\u26A4': /* INTERLOCKED FEMALE AND MALE SIGN */ + case U'\u26A5': /* MALE AND FEMALE SIGN */ + case U'\u26B3': /* CERES */ + case U'\u26B4': /* PALLAS */ + case U'\u26B5': /* JUNO */ + case U'\u26B6': /* VESTA */ + case U'\u26B7': /* CHIRON */ + case U'\u2BD8': /* PROSERPINA */ + case U'\u2BD9': /* ASTRAEA */ + case U'\u2BDA': /* HYGIEA */ + case U'\u2BDB': /* PHOLOS */ + case U'\u2BDC': /* NESSUS */ + case U'\u2E2E': /* INVERTED QUESTION MARK */ + case U'\u33D7': /* SQUARE PH */ + case U'\uFDFC': /* RIAL SIGN */ + case U'\U0001F10D': /* CIRCLED ZERO WITH SLASH */ + case U'\U0001F10E': /* CIRCLED ANTICKLOCKWISE ARROW */ + case U'\U0001F10F': /* CIRCLED DOLLAR SIGN WITH OVERLAID BACKSLASH */ + case U'\U0001F12F': /* COPYLEFT SYMBOL */ + case U'\U0001F16D': /* CIRCLED CC */ + case U'\U0001F16E': /* CIRCLED C WITH OVERLAID BACKSLASH */ + case U'\U0001F16F': /* CIRCLED HUMAN FIGURE */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/isspace.c b/src/u8c/chk.h.d/isspace.c new file mode 100644 index 0000000..478e7a7 --- /dev/null +++ b/src/u8c/chk.h.d/isspace.c @@ -0,0 +1,38 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_isspace_tuple u8c_isspace(char32_t const _chr) { + struct u8c_isspace_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'\t': /* HORIZONTAL TABULATION */ + case U'\n': /* NEW LINE */ + case U'\v': /* VERTICAL TABULATION */ + case U'\f': /* FORM FEED */ + case U'\r': /* CARRIAGE RETURN */ + case U' ': /* SPACE */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/issurro.c b/src/u8c/chk.h.d/issurro.c new file mode 100644 index 0000000..e6873cd --- /dev/null +++ b/src/u8c/chk.h.d/issurro.c @@ -0,0 +1,30 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_issurro_tuple u8c_issurro(char32_t const _chr) { + struct u8c_issurro_tuple ret = { + .stat = false, + }; + bool res = false; + if(_chr >= U'\xD800' && _chr <= U'\xDFFF') { + res = true; + } + ret.res = res; + return ret; +} diff --git a/src/u8c/chk.h.d/isupper.c b/src/u8c/chk.h.d/isupper.c new file mode 100644 index 0000000..8c5e2ab --- /dev/null +++ b/src/u8c/chk.h.d/isupper.c @@ -0,0 +1,147 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_isupper_tuple u8c_isupper(char32_t const _chr) { + struct u8c_isupper_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'A': /* LATIN CAPITAL LETTER A */ + case U'B': /* LATIN CAPITAL LETTER B */ + case U'C': /* LATIN CAPITAL LETTER C */ + case U'D': /* LATIN CAPITAL LETTER D */ + case U'E': /* LATIN CAPITAL LETTER E */ + case U'F': /* LATIN CAPITAL LETTER F */ + case U'G': /* LATIN CAPITAL LETTER G */ + case U'H': /* LATIN CAPITAL LETTER H */ + case U'I': /* LATIN CAPITAL LETTER I */ + case U'J': /* LATIN CAPITAL LETTER J */ + case U'K': /* LATIN CAPITAL LETTER K */ + case U'L': /* LATIN CAPITAL LETTER L */ + case U'M': /* LATIN CAPITAL LETTER M */ + case U'N': /* LATIN CAPITAL LETTER N */ + case U'O': /* LATIN CAPITAL LETTER O */ + case U'P': /* LATIN CAPITAL LETTER P */ + case U'Q': /* LATIN CAPITAL LETTER Q */ + case U'R': /* LATIN CAPITAL LETTER R */ + case U'S': /* LATIN CAPITAL LETTER S */ + case U'T': /* LATIN CAPITAL LETTER T */ + case U'U': /* LATIN CAPITAL LETTER U */ + case U'V': /* LATIN CAPITAL LETTER V */ + case U'X': /* LATIN CAPITAL LETTER Y */ + case U'W': /* LATIN CAPITAL LETTER X */ + case U'Y': /* LATIN CAPITAL LETTER Y */ + case U'Z': /* LATIN CAPITAL LETTER Z */ + case U'\u00C0': /* LATIN CAPITAL LETTER A WITH GRAVE */ + case U'\u00C1': /* LATIN CAPITAL LETTER A WITH ACUTE */ + case U'\u00C2': /* LATIN CAPITAL LETTER A WITH CIRCUMFLEX */ + case U'\u00C3': /* LATIN CAPITAL LETTER A WITH TILDE */ + case U'\u00C4': /* LATIN CAPITAL LETTER A WITH DIAERESIS */ + case U'\u00C5': /* LATIN CAPITAL LETTER A WITH RING ABOVE */ + case U'\u00C6': /* LATIN CAPITAL LETTER AE */ + case U'\u00C7': /* LATIN CAPITAL LETTER C WITH CEDILLA */ + case U'\u00C8': /* LATIN CAPITAL LETTER E WITH GRAVE */ + case U'\u00C9': /* LATIN CAPITAL LETTER E WITH ACUTE */ + case U'\u00CA': /* LATIN CAPITAL LETTER E WITH CIRCUMFLEX */ + case U'\u00CB': /* LATIN CAPITAL LETTER E WITH DIAERESIS */ + case U'\u00CC': /* LATIN CAPITAL LETTER I WITH GRAVE */ + case U'\u00CD': /* LATIN CAPITAL LETTER I WITH ACUTE */ + case U'\u00CE': /* LATIN CAPITAL LETTER I WITH CIRCUMFLEX */ + case U'\u00CF': /* LATIN CAPITAL LETTER I WITH DIAERESIS */ + case U'\u00D0': /* LATIN CAPITAL LETTER ETH */ + case U'\u00D1': /* LATIN CAPITAL LETTER N WITH TILDE */ + case U'\u00D2': /* LATIN CAPITAL LETTER O WITH GRAVE */ + case U'\u00D3': /* LATIN CAPITAL LETTER O WITH ACUTE */ + case U'\u00D4': /* LATIN CAPITAL LETTER O WITH CIRCUMFLEX */ + case U'\u00D5': /* LATIN CAPITAL LETTER O WITH TILDE */ + case U'\u00D6': /* LATIN CAPITAL LETTER O WITH DIAERESIS */ + case U'\u00D8': /* LATIN CAPITAL LETTER O WITH STROKE */ + case U'\u00D9': /* LATIN CAPITAL LETTER U WITH GRAVE */ + case U'\u00DA': /* LATIN CAPITAL LETTER U WITH STROKE */ + case U'\u00DB': /* LATIN CAPITAL LETTER U WITH CIRCUMFLEX */ + case U'\u00DC': /* LATIN CAPITAL LETTER U WITH DIAERESIS */ + case U'\u00DD': /* LATIN CAPITAL LETTER Y WITH ACUTE */ + case U'\u00DE': /* LATIN CAPITAL LETTER THORN */ + case U'\u0100': /* LATIN CAPITAL LETTER A WITH MACRON */ + case U'\u0102': /* LATIN CAPITAL LETTER A WITH BREVE */ + case U'\u0104': /* LATIN CAPITAL LETTER A WITH OGONEK */ + case U'\u0106': /* LATIN CAPITAL LETTER C WITH ACUTE */ + case U'\u0108': /* LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ + case U'\u010A': /* LATIN CAPITAL LETTER C WITH DOT ABOVE */ + case U'\u010C': /* LATIN CAPITAL LETTER C WITH CARON */ + case U'\u010E': /* LATIN CAPITAL LETTER D WITH CARON */ + case U'\u0110': /* LATIN CAPITAL LETTER D WITH STROKE */ + case U'\u0112': /* LATIN CAPITAL LETTER E WITH MACRON */ + case U'\u0114': /* LATIN CAPITAL LETTER E WITH BREVE */ + case U'\u0116': /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ + case U'\u0118': /* LATIN CAPITAL LETTER E WITH OGONEK */ + case U'\u011A': /* LATIN CAPITAL LETTER E WITH CARON */ + case U'\u011C': /* LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ + case U'\u014A': /* LATIN CAPITAL LETTER ENG */ + case U'\u0152': /* LATIN CAPITAL LIGATURE OE */ + case U'\u0186': /* LATIN CAPITAL LETTER OPEN O */ + case U'\u018E': /* LATIN CAPITAL LETTER REVERSED E */ + case U'\u018F': /* LATIN CAPITAL LETTER SCHWA */ + case U'\u0190': /* LATIN CAPITAL LETTER OPEN E */ + case U'\u0194': /* LATIN CAPITAL LETTER GAMMA */ + case U'\u0196': /* LATIN CAPITAL LETTER IOTA */ + case U'\u01A9': /* LATIN CAPITAL LETTER ESH */ + case U'\u01B1': /* LATIN CAPITAL LETTER UPSILON */ + case U'\u01B2': /* LATIN CAPITAL LETTER V WITH HOOk */ + case U'\u01B7': /* LATIN CAPITAL LETTER EZH */ + case U'\u01F7': /* LATIN CAPITAL LETTER WYNN */ + case U'\u021C': /* LATIN CAPITAL LETTER YOGH */ + case U'\u0241': /* LATIN CAPITAL LETTER GLOTTAL STOP */ + case U'\u0391': /* GREEK CAPITAL LETTER ALPHA */ + case U'\u0392': /* GREEK CAPITAL LETTER BETA */ + case U'\u0393': /* GREEK CAPITAL LETTER GAMMA */ + case U'\u0394': /* GREEK CAPITAL LETTER DELTA */ + case U'\u0395': /* GREEK CAPITAL LETTER EPSILON */ + case U'\u0396': /* GREEK CAPITAL LETTER ZETA */ + case U'\u0397': /* GREEK CAPITAL LETTER ETA */ + case U'\u0398': /* GREEK CAPITAL LETTER THETA */ + case U'\u0399': /* GREEK CAPITAL LETTER IOTA */ + case U'\u039A': /* GREEK CAPITAL LETTER KAPPA */ + case U'\u039B': /* GREEK CAPITAL LETTER LAMBDA */ + case U'\u039C': /* GREEK CAPITAL LETTER MU */ + case U'\u039D': /* GREEK CAPITAL LETTER NU */ + case U'\u039E': /* GREEK CAPITAL LETTER XI */ + case U'\u039F': /* GREEK CAPITAL LETTER OMICRON */ + case U'\u03A0': /* GREEK CAPITAL LETTER PI */ + case U'\u03A1': /* GREEK CAPITAL LETTER RHO */ + case U'\u03A3': /* GREEK CAPITAL LETTER SIGMA */ + case U'\u03A4': /* GREEK CAPITAL LETTER TAU */ + case U'\u03A5': /* GREEK CAPITAL LETTER UPSILON */ + case U'\u03A6': /* GREEK CAPITAL LETTER PHI */ + case U'\u03A7': /* GREEK CAPITAL LETTER CHI */ + case U'\u03A8': /* GREEK CAPITAL LETTER PSI */ + case U'\u03A9': /* GREEK CAPITAL LETTER OMEGA */ + case U'\u1E9E': /* LATIN CAPITAL LETTER SHARP S */ + case U'\u2C6D': /* LATIN CAPITAL LETTER ALPHA */ + case U'\uA77D': /* LATIN CAPITAL LETTER INSULAR G */ + case U'\uA7B4': /* LATIN CAPITAL LETTER BETA */ + case U'\uA7B6': /* LATIN CAPITAL LETTER OMEGA */ + ret.res = true; + break; + } + return ret; +} diff --git a/src/u8c/chk.h.d/isxdigit.c b/src/u8c/chk.h.d/isxdigit.c new file mode 100644 index 0000000..5100624 --- /dev/null +++ b/src/u8c/chk.h.d/isxdigit.c @@ -0,0 +1,48 @@ +/* + Copyright 2021 Gabriel Jensen + + This file is part of u8c. + + u8c is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. + + u8c 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 Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License along with u8c. + + If not, see <https://www.gnu.org/licenses/>. +*/ +# include <stdbool.h> +# include <stddef.h> +# include <stdint.h> +# include <u8c/chk.h> +struct u8c_isxdigit_tuple u8c_isxdigit(char32_t const _chr) { + struct u8c_isxdigit_tuple ret = { + .stat = false, + }; + switch(_chr) { + default: + ret.res = false; + break; + case U'0': /* DIGIT ZERO */ + case U'1': /* DIGIT ONE */ + case U'2': /* DIGIT TWO */ + case U'3': /* DIGIT THREE */ + case U'4': /* DIGIT FOUR */ + case U'5': /* DIGIT FIVE */ + case U'6': /* DIGIT SIX */ + case U'7': /* DIGIT SEVEN */ + case U'8': /* DIGIT EIGHT */ + case U'9': /* DIGIT NINE */ + case U'A': /* LATIN CAPITAL LETTER A */ + case U'B': /* LATIN CAPITAL LETTER B */ + case U'C': /* LATIN CAPITAL LETTER C */ + case U'D': /* LATIN CAPITAL LETTER D */ + case U'E': /* LATIN CAPITAL LETTER E */ + case U'F': /* LATIN CAPITAL LETTER F */ + ret.res = true; + break; + } + return ret; +} |