cfns.h 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366
  1. /* ANSI-C code produced by gperf version 3.0.3 */
  2. /* Command-line: gperf -o -C -E -k '1-6,$' -j1 -D -N libc_name_p -L ANSI-C cfns.gperf */
  3. #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
  4. && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
  5. && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
  6. && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
  7. && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
  8. && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
  9. && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
  10. && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
  11. && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
  12. && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
  13. && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
  14. && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
  15. && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
  16. && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
  17. && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
  18. && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
  19. && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
  20. && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
  21. && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
  22. && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
  23. && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
  24. && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
  25. && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
  26. /* The character set is not based on ISO-646. */
  27. #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
  28. #endif
  29. #line 1 "cfns.gperf"
  30. /* Copyright (C) 2000-2015 Free Software Foundation, Inc.
  31. This file is part of GCC.
  32. GCC is free software; you can redistribute it and/or modify it under
  33. the terms of the GNU General Public License as published by the Free
  34. Software Foundation; either version 3, or (at your option) any later
  35. version.
  36. GCC is distributed in the hope that it will be useful, but WITHOUT ANY
  37. WARRANTY; without even the implied warranty of MERCHANTABILITY or
  38. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
  39. for more details.
  40. You should have received a copy of the GNU General Public License
  41. along with GCC; see the file COPYING3. If not see
  42. <http://www.gnu.org/licenses/>. */
  43. #ifdef __GNUC__
  44. __inline
  45. #endif
  46. static unsigned int hash (const char *, unsigned int);
  47. #ifdef __GNUC__
  48. __inline
  49. #endif
  50. const char * libc_name_p (const char *, unsigned int);
  51. /* maximum key range = 391, duplicates = 0 */
  52. #ifdef __GNUC__
  53. __inline
  54. #else
  55. #ifdef __cplusplus
  56. inline
  57. #endif
  58. #endif
  59. static unsigned int
  60. hash (register const char *str, register unsigned int len)
  61. {
  62. static const unsigned short asso_values[] =
  63. {
  64. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  65. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  66. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  67. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  68. 400, 400, 400, 400, 400, 400, 400, 400, 0, 0,
  69. 1, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  70. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  71. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  72. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  73. 400, 400, 400, 400, 400, 400, 400, 28, 90, 0,
  74. 95, 0, 51, 93, 114, 26, 109, 124, 5, 1,
  75. 6, 13, 37, 128, 3, 0, 0, 49, 38, 0,
  76. 104, 45, 0, 400, 400, 400, 400, 400, 400, 400,
  77. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  78. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  79. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  80. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  81. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  82. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  83. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  84. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  85. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  86. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  87. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  88. 400, 400, 400, 400, 400, 400, 400, 400, 400, 400,
  89. 400, 400, 400, 400, 400, 400, 400
  90. };
  91. register int hval = len;
  92. switch (hval)
  93. {
  94. default:
  95. hval += asso_values[(unsigned char)str[5]+1];
  96. /*FALLTHROUGH*/
  97. case 5:
  98. hval += asso_values[(unsigned char)str[4]];
  99. /*FALLTHROUGH*/
  100. case 4:
  101. hval += asso_values[(unsigned char)str[3]];
  102. /*FALLTHROUGH*/
  103. case 3:
  104. hval += asso_values[(unsigned char)str[2]];
  105. /*FALLTHROUGH*/
  106. case 2:
  107. hval += asso_values[(unsigned char)str[1]];
  108. /*FALLTHROUGH*/
  109. case 1:
  110. hval += asso_values[(unsigned char)str[0]];
  111. break;
  112. }
  113. return hval + asso_values[(unsigned char)str[len - 1]];
  114. }
  115. #ifdef __GNUC__
  116. __inline
  117. #ifdef __GNUC_STDC_INLINE__
  118. __attribute__ ((__gnu_inline__))
  119. #endif
  120. #endif
  121. const char *
  122. libc_name_p (register const char *str, register unsigned int len)
  123. {
  124. enum
  125. {
  126. TOTAL_KEYWORDS = 156,
  127. MIN_WORD_LENGTH = 3,
  128. MAX_WORD_LENGTH = 10,
  129. MIN_HASH_VALUE = 9,
  130. MAX_HASH_VALUE = 399
  131. };
  132. static const char * const wordlist[] =
  133. {
  134. "wcsstr",
  135. "strstr",
  136. "cos",
  137. "towctrans",
  138. "memmove",
  139. "wcstol",
  140. "wcscoll",
  141. "wcstombs",
  142. "strtol",
  143. "strcoll",
  144. "wcslen",
  145. "time",
  146. "ctime",
  147. "strlen",
  148. "iswctype",
  149. "wmemchr",
  150. "wcsrchr",
  151. "ceil",
  152. "sin",
  153. "strrchr",
  154. "tan",
  155. "iscntrl",
  156. "acos",
  157. "wmemmove",
  158. "wcsrtombs",
  159. "wctrans",
  160. "wmemcmp",
  161. "pow",
  162. "atol",
  163. "wcsncmp",
  164. "memset",
  165. "free",
  166. "strncmp",
  167. "wmemset",
  168. "wcsspn",
  169. "wcstoul",
  170. "strspn",
  171. "strtoul",
  172. "asctime",
  173. "atan2",
  174. "asin",
  175. "atan",
  176. "ferror",
  177. "iswalnum",
  178. "wcscat",
  179. "realloc",
  180. "strcat",
  181. "wcscpy",
  182. "memcpy",
  183. "strcpy",
  184. "tolower",
  185. "floor",
  186. "iswcntrl",
  187. "atoi",
  188. "clearerr",
  189. "swscanf",
  190. "wcsncat",
  191. "islower",
  192. "strncat",
  193. "btowc",
  194. "localtime",
  195. "wctomb",
  196. "isalnum",
  197. "isprint",
  198. "mblen",
  199. "wcstod",
  200. "log10",
  201. "strtod",
  202. "wcrtomb",
  203. "abs",
  204. "setlocale",
  205. "wcschr",
  206. "mbrlen",
  207. "memchr",
  208. "strchr",
  209. "labs",
  210. "iswpunct",
  211. "exit",
  212. "sqrt",
  213. "swprintf",
  214. "wctype",
  215. "mbsrtowcs",
  216. "wcscspn",
  217. "getenv",
  218. "strcspn",
  219. "towlower",
  220. "atof",
  221. "wcstok",
  222. "localeconv",
  223. "strtok",
  224. "calloc",
  225. "malloc",
  226. "isalpha",
  227. "iswlower",
  228. "iswspace",
  229. "wcsxfrm",
  230. "signal",
  231. "strxfrm",
  232. "wcsftime",
  233. "feof",
  234. "strftime",
  235. "wcscmp",
  236. "fabs",
  237. "memcmp",
  238. "strcmp",
  239. "vsprintf",
  240. "fwide",
  241. "gmtime",
  242. "sprintf",
  243. "exp",
  244. "wmemcpy",
  245. "iswprint",
  246. "sscanf",
  247. "wcsncpy",
  248. "strncpy",
  249. "isspace",
  250. "toupper",
  251. "wctob",
  252. "div",
  253. "mbtowc",
  254. "ldiv",
  255. "log",
  256. "mktime",
  257. "isupper",
  258. "atexit",
  259. "modf",
  260. "mbstowcs",
  261. "mbrtowc",
  262. "ispunct",
  263. "iswalpha",
  264. "setvbuf",
  265. "rand",
  266. "srand",
  267. "frexp",
  268. "towupper",
  269. "mbsinit",
  270. "cosh",
  271. "vswprintf",
  272. "iswupper",
  273. "wcspbrk",
  274. "fmod",
  275. "strpbrk",
  276. "sinh",
  277. "tanh",
  278. "iswdigit",
  279. "clock",
  280. "longjmp",
  281. "ldexp",
  282. "setbuf",
  283. "fseek",
  284. "iswgraph",
  285. "difftime",
  286. "iswxdigit",
  287. "isdigit",
  288. "isxdigit",
  289. "isgraph"
  290. };
  291. static const short lookup[] =
  292. {
  293. -1, -1, -1, -1, -1, -1, -1, -1, -1, 0,
  294. -1, -1, 1, -1, -1, -1, 2, -1, -1, -1,
  295. -1, -1, 3, 4, -1, 5, 6, 7, 8, 9,
  296. 10, 11, 12, 13, 14, -1, -1, -1, 15, 16,
  297. 17, 18, 19, 20, 21, 22, -1, -1, 23, 24,
  298. -1, 25, 26, 27, -1, 28, 29, 30, 31, 32,
  299. 33, -1, 34, 35, -1, 36, 37, 38, -1, 39,
  300. 40, -1, 41, -1, -1, -1, -1, -1, -1, 42,
  301. -1, 43, -1, 44, -1, 45, 46, -1, 47, -1,
  302. 48, 49, 50, 51, 52, -1, -1, 53, 54, 55,
  303. -1, -1, -1, 56, -1, 57, 58, -1, 59, 60,
  304. 61, 62, 63, 64, 65, -1, 66, 67, -1, 68,
  305. -1, 69, 70, 71, 72, 73, 74, 75, -1, -1,
  306. -1, -1, -1, 76, 77, 78, -1, -1, 79, 80,
  307. 81, 82, -1, 83, 84, -1, 85, 86, 87, -1,
  308. 88, 89, 90, 91, -1, -1, -1, 92, -1, 93,
  309. -1, 94, -1, 95, -1, 96, 97, -1, 98, -1,
  310. 99, 100, 101, 102, 103, 104, 105, 106, 107, 108,
  311. -1, 109, 110, 111, 112, -1, 113, -1, -1, 114,
  312. -1, -1, -1, 115, -1, -1, -1, 116, 117, -1,
  313. 118, -1, -1, -1, -1, 119, 120, 121, -1, 122,
  314. 123, -1, -1, 124, -1, 125, 126, -1, 127, -1,
  315. 128, -1, -1, 129, 130, -1, -1, -1, -1, -1,
  316. -1, 131, 132, -1, -1, -1, -1, 133, 134, 135,
  317. -1, -1, -1, -1, -1, 136, -1, 137, -1, -1,
  318. -1, 138, -1, -1, -1, -1, -1, -1, 139, 140,
  319. -1, 141, -1, -1, 142, -1, 143, -1, -1, 144,
  320. -1, 145, -1, -1, -1, -1, 146, -1, -1, -1,
  321. -1, -1, -1, 147, -1, -1, -1, -1, -1, 148,
  322. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  323. -1, -1, -1, -1, 149, -1, -1, -1, -1, -1,
  324. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  325. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  326. -1, -1, -1, -1, 150, -1, -1, -1, -1, -1,
  327. 151, -1, -1, 152, -1, -1, -1, -1, -1, -1,
  328. -1, -1, -1, -1, -1, -1, 153, -1, -1, -1,
  329. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  330. -1, -1, -1, 154, -1, -1, -1, -1, -1, -1,
  331. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  332. -1, -1, -1, -1, -1, -1, -1, -1, -1, 155
  333. };
  334. if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
  335. {
  336. register int key = hash (str, len);
  337. if (key <= MAX_HASH_VALUE && key >= 0)
  338. {
  339. register int index = lookup[key];
  340. if (index >= 0)
  341. {
  342. register const char *s = wordlist[index];
  343. if (*str == *s && !strcmp (str + 1, s + 1))
  344. return s;
  345. }
  346. }
  347. }
  348. return 0;
  349. }