xref: /dflybsd-src/contrib/grep/lib/mbchar.c (revision 91b9ed38d3db6a8a8ac5b66da1d43e6e331e259a)
1*09d4459fSDaniel Fojt /* Copyright (C) 2001, 2006, 2009-2020 Free Software Foundation, Inc.
295b7b453SJohn Marino 
395b7b453SJohn Marino    This program is free software: you can redistribute it and/or modify
495b7b453SJohn Marino    it under the terms of the GNU General Public License as published by
595b7b453SJohn Marino    the Free Software Foundation; either version 3 of the License, or
695b7b453SJohn Marino    (at your option) any later version.
795b7b453SJohn Marino 
895b7b453SJohn Marino    This program is distributed in the hope that it will be useful,
995b7b453SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
1095b7b453SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1195b7b453SJohn Marino    GNU General Public License for more details.
1295b7b453SJohn Marino 
1395b7b453SJohn Marino    You should have received a copy of the GNU General Public License
14*09d4459fSDaniel Fojt    along with this program.  If not, see <https://www.gnu.org/licenses/>.  */
1595b7b453SJohn Marino 
1695b7b453SJohn Marino 
1795b7b453SJohn Marino #include <config.h>
1895b7b453SJohn Marino 
19680a9cb8SJohn Marino #define MBCHAR_INLINE _GL_EXTERN_INLINE
20680a9cb8SJohn Marino 
2195b7b453SJohn Marino #include <limits.h>
2295b7b453SJohn Marino 
2395b7b453SJohn Marino #include "mbchar.h"
2495b7b453SJohn Marino 
2595b7b453SJohn Marino #if IS_BASIC_ASCII
2695b7b453SJohn Marino 
2795b7b453SJohn Marino /* Bit table of characters in the ISO C "basic character set".  */
2895b7b453SJohn Marino const unsigned int is_basic_table [UCHAR_MAX / 32 + 1] =
2995b7b453SJohn Marino {
3095b7b453SJohn Marino   0x00001a00,           /* '\t' '\v' '\f' */
3195b7b453SJohn Marino   0xffffffef,           /* ' '...'#' '%'...'?' */
3295b7b453SJohn Marino   0xfffffffe,           /* 'A'...'Z' '[' '\\' ']' '^' '_' */
3395b7b453SJohn Marino   0x7ffffffe            /* 'a'...'z' '{' '|' '}' '~' */
3495b7b453SJohn Marino   /* The remaining bits are 0.  */
3595b7b453SJohn Marino };
3695b7b453SJohn Marino 
3795b7b453SJohn Marino #endif /* IS_BASIC_ASCII */
38