| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/bash/src/include/shmbchar.h |
| Source code | Switch to Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | /* Multibyte character data type. | - |
| 2 | Copyright (C) 2001, 2005-2007, 2009-2010 Free Software Foundation, Inc. | - |
| 3 | - | |
| 4 | This program is free software: you can redistribute it and/or modify | - |
| 5 | it under the terms of the GNU General Public License as published by | - |
| 6 | the Free Software Foundation; either version 3 of the License, or | - |
| 7 | (at your option) any later version. | - |
| 8 | - | |
| 9 | This program is distributed in the hope that it will be useful, | - |
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | - |
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | - |
| 12 | GNU General Public License for more details. | - |
| 13 | - | |
| 14 | You should have received a copy of the GNU General Public License | - |
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. */ | - |
| 16 | - | |
| 17 | /* Written by Bruno Haible <bruno@clisp.org>. */ | - |
| 18 | - | |
| 19 | #ifndef _SHMBCHAR_H | - |
| 20 | #define _SHMBCHAR_H 1 | - |
| 21 | - | |
| 22 | #if defined (HANDLE_MULTIBYTE) | - |
| 23 | - | |
| 24 | #include <string.h> | - |
| 25 | - | |
| 26 | /* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before | - |
| 27 | <wchar.h>. | - |
| 28 | BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before | - |
| 29 | <wchar.h>. */ | - |
| 30 | #include <stdio.h> | - |
| 31 | #include <time.h> | - |
| 32 | #include <wchar.h> | - |
| 33 | #include <wctype.h> | - |
| 34 | - | |
| 35 | - | |
| 36 | /* is_basic(c) tests whether the single-byte character c is in the | - |
| 37 | ISO C "basic character set". */ | - |
| 38 | - | |
| 39 | #if (' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ | - |
| 40 | && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ | - |
| 41 | && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \ | - |
| 42 | && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \ | - |
| 43 | && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \ | - |
| 44 | && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \ | - |
| 45 | && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \ | - |
| 46 | && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \ | - |
| 47 | && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \ | - |
| 48 | && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \ | - |
| 49 | && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \ | - |
| 50 | && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \ | - |
| 51 | && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \ | - |
| 52 | && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \ | - |
| 53 | && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \ | - |
| 54 | && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \ | - |
| 55 | && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \ | - |
| 56 | && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \ | - |
| 57 | && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \ | - |
| 58 | && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \ | - |
| 59 | && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \ | - |
| 60 | && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \ | - |
| 61 | && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126) | - |
| 62 | /* The character set is ISO-646, not EBCDIC. */ | - |
| 63 | # define IS_BASIC_ASCII 1 | - |
| 64 | - | |
| 65 | extern const unsigned int is_basic_table[]; | - |
| 66 | - | |
| 67 | static inline int | - |
| 68 | is_basic (char c) | - |
| 69 | { | - |
| 70 | return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) executed 2053625957 times by 1 test: return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) & 1;Executed by:
| 2053625957 |
| 71 | & 1; executed 2053625957 times by 1 test: return (is_basic_table [(unsigned char) c >> 5] >> ((unsigned char) c & 31)) & 1;Executed by:
| 2053625957 |
| 72 | } | - |
| 73 | - | |
| 74 | #else | - |
| 75 | - | |
| 76 | static inline int | - |
| 77 | is_basic (char c) | - |
| 78 | { | - |
| 79 | switch (c) | - |
| 80 | { | - |
| 81 | case '\b': case '\r': case '\n': | - |
| 82 | case '\t': case '\v': case '\f': | - |
| 83 | case ' ': case '!': case '"': case '#': case '%': | - |
| 84 | case '&': case '\'': case '(': case ')': case '*': | - |
| 85 | case '+': case ',': case '-': case '.': case '/': | - |
| 86 | case '0': case '1': case '2': case '3': case '4': | - |
| 87 | case '5': case '6': case '7': case '8': case '9': | - |
| 88 | case ':': case ';': case '<': case '=': case '>': | - |
| 89 | case '?': | - |
| 90 | case 'A': case 'B': case 'C': case 'D': case 'E': | - |
| 91 | case 'F': case 'G': case 'H': case 'I': case 'J': | - |
| 92 | case 'K': case 'L': case 'M': case 'N': case 'O': | - |
| 93 | case 'P': case 'Q': case 'R': case 'S': case 'T': | - |
| 94 | case 'U': case 'V': case 'W': case 'X': case 'Y': | - |
| 95 | case 'Z': | - |
| 96 | case '[': case '\\': case ']': case '^': case '_': | - |
| 97 | case 'a': case 'b': case 'c': case 'd': case 'e': | - |
| 98 | case 'f': case 'g': case 'h': case 'i': case 'j': | - |
| 99 | case 'k': case 'l': case 'm': case 'n': case 'o': | - |
| 100 | case 'p': case 'q': case 'r': case 's': case 't': | - |
| 101 | case 'u': case 'v': case 'w': case 'x': case 'y': | - |
| 102 | case 'z': case '{': case '|': case '}': case '~': | - |
| 103 | return 1; | - |
| 104 | default: | - |
| 105 | return 0; | - |
| 106 | } | - |
| 107 | } | - |
| 108 | - | |
| 109 | #endif | - |
| 110 | - | |
| 111 | #endif /* HANDLE_MULTIBYTE */ | - |
| 112 | #endif /* _SHMBCHAR_H */ | - |
| Source code | Switch to Preprocessed file |