You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

334 lines
12KB

  1. /* ANSI-C code produced by gperf version 3.0.4 */
  2. /* Command-line: gperf --output-file=xcsv_tokens.gperf -L ANSI-C -D -t xcsv_tokens.in */
  3. /* Computed positions: -k'2,4-5,12,$' */
  4. #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \
  5. && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \
  6. && (')' == 41) && ('*' == 42) && ('+' == 43) && (',' == 44) \
  7. && ('-' == 45) && ('.' == 46) && ('/' == 47) && ('0' == 48) \
  8. && ('1' == 49) && ('2' == 50) && ('3' == 51) && ('4' == 52) \
  9. && ('5' == 53) && ('6' == 54) && ('7' == 55) && ('8' == 56) \
  10. && ('9' == 57) && (':' == 58) && (';' == 59) && ('<' == 60) \
  11. && ('=' == 61) && ('>' == 62) && ('?' == 63) && ('A' == 65) \
  12. && ('B' == 66) && ('C' == 67) && ('D' == 68) && ('E' == 69) \
  13. && ('F' == 70) && ('G' == 71) && ('H' == 72) && ('I' == 73) \
  14. && ('J' == 74) && ('K' == 75) && ('L' == 76) && ('M' == 77) \
  15. && ('N' == 78) && ('O' == 79) && ('P' == 80) && ('Q' == 81) \
  16. && ('R' == 82) && ('S' == 83) && ('T' == 84) && ('U' == 85) \
  17. && ('V' == 86) && ('W' == 87) && ('X' == 88) && ('Y' == 89) \
  18. && ('Z' == 90) && ('[' == 91) && ('\\' == 92) && (']' == 93) \
  19. && ('^' == 94) && ('_' == 95) && ('a' == 97) && ('b' == 98) \
  20. && ('c' == 99) && ('d' == 100) && ('e' == 101) && ('f' == 102) \
  21. && ('g' == 103) && ('h' == 104) && ('i' == 105) && ('j' == 106) \
  22. && ('k' == 107) && ('l' == 108) && ('m' == 109) && ('n' == 110) \
  23. && ('o' == 111) && ('p' == 112) && ('q' == 113) && ('r' == 114) \
  24. && ('s' == 115) && ('t' == 116) && ('u' == 117) && ('v' == 118) \
  25. && ('w' == 119) && ('x' == 120) && ('y' == 121) && ('z' == 122) \
  26. && ('{' == 123) && ('|' == 124) && ('}' == 125) && ('~' == 126))
  27. /* The character set is not based on ISO-646. */
  28. #error "gperf generated tables don't work with this execution character set. Please report a bug to <bug-gnu-gperf@gnu.org>."
  29. #endif
  30. #line 1 "xcsv_tokens.in"
  31. struct xt_mapping {const char *name; int xt_token; };
  32. #define TOTAL_KEYWORDS 86
  33. #define MIN_WORD_LENGTH 3
  34. #define MAX_WORD_LENGTH 21
  35. #define MIN_HASH_VALUE 7
  36. #define MAX_HASH_VALUE 248
  37. /* maximum key range = 242, duplicates = 0 */
  38. #ifdef __GNUC__
  39. __inline
  40. #else
  41. #ifdef __cplusplus
  42. inline
  43. #endif
  44. #endif
  45. static unsigned int
  46. hash (register const char *str, register unsigned int len)
  47. {
  48. static unsigned char asso_values[] =
  49. {
  50. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  51. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  52. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  53. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  54. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  55. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  56. 249, 249, 249, 249, 249, 0, 249, 25, 0, 0,
  57. 10, 90, 60, 25, 249, 30, 65, 25, 20, 5,
  58. 80, 249, 0, 70, 15, 249, 0, 0, 40, 30,
  59. 85, 249, 249, 249, 249, 0, 249, 249, 249, 249,
  60. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  61. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  62. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  63. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  64. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  65. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  66. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  67. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  68. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  69. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  70. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  71. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  72. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  73. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  74. 249, 249, 249, 249, 249, 249, 249, 249, 249, 249,
  75. 249, 249, 249, 249, 249, 249
  76. };
  77. register int hval = len;
  78. switch (hval)
  79. {
  80. default:
  81. hval += asso_values[(unsigned char)str[11]];
  82. /*FALLTHROUGH*/
  83. case 11:
  84. case 10:
  85. case 9:
  86. case 8:
  87. case 7:
  88. case 6:
  89. case 5:
  90. hval += asso_values[(unsigned char)str[4]];
  91. /*FALLTHROUGH*/
  92. case 4:
  93. hval += asso_values[(unsigned char)str[3]];
  94. /*FALLTHROUGH*/
  95. case 3:
  96. case 2:
  97. hval += asso_values[(unsigned char)str[1]];
  98. break;
  99. }
  100. return hval + asso_values[(unsigned char)str[len - 1]];
  101. }
  102. #ifdef __GNUC__
  103. __inline
  104. #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
  105. __attribute__ ((__gnu_inline__))
  106. #endif
  107. #endif
  108. struct xt_mapping *
  109. in_word_set (register const char *str, register unsigned int len)
  110. {
  111. static struct xt_mapping wordlist[] =
  112. {
  113. #line 41 "xcsv_tokens.in"
  114. {"LAT_DIR", XT_LAT_DIR},
  115. #line 69 "xcsv_tokens.in"
  116. {"POWER", XT_POWER},
  117. #line 45 "xcsv_tokens.in"
  118. {"LAT_DDMMDIR", XT_LAT_DDMMDIR},
  119. #line 51 "xcsv_tokens.in"
  120. {"LON_DIR", XT_LON_DIR},
  121. #line 38 "xcsv_tokens.in"
  122. {"LAT_DECIMALDIR", XT_LAT_DECIMALDIR},
  123. #line 54 "xcsv_tokens.in"
  124. {"LON_DDMMDIR", XT_LON_DDMMDIR},
  125. #line 48 "xcsv_tokens.in"
  126. {"LON_DECIMALDIR", XT_LON_DECIMALDIR},
  127. #line 58 "xcsv_tokens.in"
  128. {"NET_TIME", XT_NET_TIME},
  129. #line 30 "xcsv_tokens.in"
  130. {"HEART_RATE", XT_HEART_RATE},
  131. #line 73 "xcsv_tokens.in"
  132. {"STREET_ADDR", XT_STREET_ADDR},
  133. #line 6 "xcsv_tokens.in"
  134. {"CADENCE", XT_CADENCE},
  135. #line 46 "xcsv_tokens.in"
  136. {"LAT_NMEA", XT_LAT_NMEA},
  137. #line 70 "xcsv_tokens.in"
  138. {"ROUTE_NAME", XT_ROUTE_NAME},
  139. #line 68 "xcsv_tokens.in"
  140. {"POSTAL_CODE", XT_POSTAL_CODE},
  141. #line 55 "xcsv_tokens.in"
  142. {"LON_NMEA", XT_LON_NMEA},
  143. #line 72 "xcsv_tokens.in"
  144. {"STATE", XT_STATE},
  145. #line 22 "xcsv_tokens.in"
  146. {"GEOCACHE_TERR", XT_GEOCACHE_TERR},
  147. #line 21 "xcsv_tokens.in"
  148. {"GEOCACHE_PLACER", XT_GEOCACHE_PLACER},
  149. #line 82 "xcsv_tokens.in"
  150. {"UTM", XT_UTM},
  151. #line 18 "xcsv_tokens.in"
  152. {"GEOCACHE_ISARCHIVED", XT_GEOCACHE_ISARCHIVED},
  153. #line 19 "xcsv_tokens.in"
  154. {"GEOCACHE_ISAVAILABLE", XT_GEOCACHE_ISAVAILABLE},
  155. #line 5 "xcsv_tokens.in"
  156. {"ANYNAME", XT_ANYNAME},
  157. #line 24 "xcsv_tokens.in"
  158. {"GMT_TIME", XT_GMT_TIME},
  159. #line 76 "xcsv_tokens.in"
  160. {"TIMET_TIME", XT_TIMET_TIME},
  161. #line 14 "xcsv_tokens.in"
  162. {"FORMAT", XT_FORMAT},
  163. #line 13 "xcsv_tokens.in"
  164. {"FILENAME", XT_FILENAME},
  165. #line 33 "xcsv_tokens.in"
  166. {"ICON_DESCR", XT_ICON_DESCR},
  167. #line 10 "xcsv_tokens.in"
  168. {"DESCRIPTION", XT_DESCRIPTION},
  169. #line 16 "xcsv_tokens.in"
  170. {"GEOCACHE_DIFF", XT_GEOCACHE_DIFF},
  171. #line 15 "xcsv_tokens.in"
  172. {"GEOCACHE_CONTAINER", XT_GEOCACHE_CONTAINER},
  173. #line 79 "xcsv_tokens.in"
  174. {"TRACK_NEW", XT_TRACK_NEW},
  175. #line 78 "xcsv_tokens.in"
  176. {"TRACK_NAME", XT_TRACK_NAME},
  177. #line 81 "xcsv_tokens.in"
  178. {"URL", XT_URL},
  179. #line 66 "xcsv_tokens.in"
  180. {"PATH_SPEED", XT_PATH_SPEED},
  181. #line 59 "xcsv_tokens.in"
  182. {"PATH_COURSE", XT_PATH_COURSE},
  183. #line 17 "xcsv_tokens.in"
  184. {"GEOCACHE_HINT", XT_GEOCACHE_HINT},
  185. #line 39 "xcsv_tokens.in"
  186. {"LAT_DECIMAL", XT_LAT_DECIMAL},
  187. #line 9 "xcsv_tokens.in"
  188. {"COUNTRY", XT_COUNTRY},
  189. #line 42 "xcsv_tokens.in"
  190. {"LAT_HUMAN_READABLE", XT_LAT_HUMAN_READABLE},
  191. #line 47 "xcsv_tokens.in"
  192. {"LOCAL_TIME", XT_LOCAL_TIME},
  193. #line 49 "xcsv_tokens.in"
  194. {"LON_DECIMAL", XT_LON_DECIMAL},
  195. #line 52 "xcsv_tokens.in"
  196. {"LON_HUMAN_READABLE", XT_LON_HUMAN_READABLE},
  197. #line 71 "xcsv_tokens.in"
  198. {"SHORTNAME", XT_SHORTNAME},
  199. #line 67 "xcsv_tokens.in"
  200. {"PHONE_NR", XT_PHONE_NR},
  201. #line 7 "xcsv_tokens.in"
  202. {"CITY", XT_CITY},
  203. #line 74 "xcsv_tokens.in"
  204. {"TEMPERATURE", XT_TEMPERATURE},
  205. #line 37 "xcsv_tokens.in"
  206. {"ISO_TIME", XT_ISO_TIME},
  207. #line 3 "xcsv_tokens.in"
  208. {"ALT_FEET", XT_ALT_FEET},
  209. #line 32 "xcsv_tokens.in"
  210. {"HMSL_TIME", XT_HMSL_TIME},
  211. #line 56 "xcsv_tokens.in"
  212. {"MAP_EN_BNG", XT_MAP_EN_BNG},
  213. #line 34 "xcsv_tokens.in"
  214. {"IGNORE", XT_IGNORE},
  215. #line 75 "xcsv_tokens.in"
  216. {"TEMPERATURE_F", XT_TEMPERATURE_F},
  217. #line 40 "xcsv_tokens.in"
  218. {"LAT_DIRDECIMAL", XT_LAT_DIRDECIMAL},
  219. #line 35 "xcsv_tokens.in"
  220. {"INDEX", XT_INDEX},
  221. #line 83 "xcsv_tokens.in"
  222. {"UTM_ZONE", XT_UTM_ZONE},
  223. #line 50 "xcsv_tokens.in"
  224. {"LON_DIRDECIMAL", XT_LON_DIRDECIMAL},
  225. #line 44 "xcsv_tokens.in"
  226. {"LATLON_HUMAN_READABLE", XT_LATLON_HUMAN_READABLE},
  227. #line 8 "xcsv_tokens.in"
  228. {"CONSTANT", XT_CONSTANT},
  229. #line 20 "xcsv_tokens.in"
  230. {"GEOCACHE_LAST_FOUND", XT_GEOCACHE_LAST_FOUND},
  231. #line 11 "xcsv_tokens.in"
  232. {"EXCEL_TIME", XT_EXCEL_TIME},
  233. #line 86 "xcsv_tokens.in"
  234. {"UTM_EASTING", XT_UTM_EASTING},
  235. #line 23 "xcsv_tokens.in"
  236. {"GEOCACHE_TYPE", XT_GEOCACHE_TYPE},
  237. #line 85 "xcsv_tokens.in"
  238. {"UTM_ZONEF", XT_UTM_ZONEF},
  239. #line 88 "xcsv_tokens.in"
  240. {"YYYYMMDD_TIME", XT_YYYYMMDD_TIME},
  241. #line 31 "xcsv_tokens.in"
  242. {"HMSG_TIME", XT_HMSG_TIME},
  243. #line 60 "xcsv_tokens.in"
  244. {"PATH_DISTANCE_KM", XT_PATH_DISTANCE_KM},
  245. #line 12 "xcsv_tokens.in"
  246. {"FACILITY", XT_FACILITY},
  247. #line 80 "xcsv_tokens.in"
  248. {"URL_LINK_TEXT", XT_URL_LINK_TEXT},
  249. #line 84 "xcsv_tokens.in"
  250. {"UTM_ZONEC", XT_UTM_ZONEC},
  251. #line 25 "xcsv_tokens.in"
  252. {"GPS_FIX", XT_GPS_FIX},
  253. #line 77 "xcsv_tokens.in"
  254. {"TIMET_TIME_MS", XT_TIMET_TIME_MS},
  255. #line 57 "xcsv_tokens.in"
  256. {"NOTES", XT_NOTES},
  257. #line 65 "xcsv_tokens.in"
  258. {"PATH_SPEED_MPH", XT_PATH_SPEED_MPH},
  259. #line 64 "xcsv_tokens.in"
  260. {"PATH_SPEED_KPH", XT_PATH_SPEED_KPH},
  261. #line 36 "xcsv_tokens.in"
  262. {"ISO_TIME_MS", XT_ISO_TIME_MS},
  263. #line 29 "xcsv_tokens.in"
  264. {"GPS_VDOP", XT_GPS_VDOP},
  265. #line 4 "xcsv_tokens.in"
  266. {"ALT_METERS", XT_ALT_METERS},
  267. #line 28 "xcsv_tokens.in"
  268. {"GPS_SAT", XT_GPS_SAT},
  269. #line 62 "xcsv_tokens.in"
  270. {"PATH_DISTANCE_MILES", XT_PATH_DISTANCE_MILES},
  271. #line 61 "xcsv_tokens.in"
  272. {"PATH_DISTANCE_METERS", XT_PATH_DISTANCE_METERS},
  273. #line 63 "xcsv_tokens.in"
  274. {"PATH_SPEED_KNOTS", XT_PATH_SPEED_KNOTS},
  275. #line 43 "xcsv_tokens.in"
  276. {"LAT_INT32DEG", XT_LAT_INT32DEG},
  277. #line 53 "xcsv_tokens.in"
  278. {"LON_INT32DEG", XT_LON_INT32DEG},
  279. #line 87 "xcsv_tokens.in"
  280. {"UTM_NORTHING", XT_UTM_NORTHING},
  281. #line 26 "xcsv_tokens.in"
  282. {"GPS_HDOP", XT_GPS_HDOP},
  283. #line 27 "xcsv_tokens.in"
  284. {"GPS_PDOP", XT_GPS_PDOP}
  285. };
  286. static signed char lookup[] =
  287. {
  288. -1, -1, -1, -1, -1, -1, -1, 0, -1, -1, 1, 2, 3, -1,
  289. 4, -1, 5, -1, -1, 6, -1, -1, -1, 7, -1, 8, 9, 10,
  290. 11, -1, 12, 13, -1, 14, -1, 15, -1, -1, 16, -1, 17, -1,
  291. -1, 18, 19, 20, -1, 21, 22, -1, 23, 24, -1, 25, -1, 26,
  292. 27, -1, 28, -1, -1, -1, -1, 29, 30, 31, -1, -1, 32, -1,
  293. 33, 34, -1, 35, -1, -1, 36, 37, 38, -1, 39, 40, -1, 41,
  294. 42, -1, -1, -1, 43, 44, -1, 45, -1, 46, -1, -1, -1, -1,
  295. 47, 48, 49, 50, -1, 51, 52, 53, -1, -1, 54, 55, -1, 56,
  296. -1, 57, 58, 59, 60, -1, 61, 62, -1, -1, -1, 63, 64, -1,
  297. 65, -1, 66, -1, -1, -1, -1, 67, 68, -1, -1, 69, -1, -1,
  298. -1, -1, -1, -1, -1, -1, -1, -1, 70, -1, 71, -1, -1, -1,
  299. -1, -1, -1, -1, -1, 72, -1, -1, -1, -1, 73, -1, 74, -1,
  300. 75, -1, 76, -1, 77, -1, 78, 79, 80, -1, -1, -1, -1, -1,
  301. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  302. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  303. -1, -1, -1, -1, -1, -1, -1, 81, -1, -1, -1, -1, 82, -1,
  304. -1, -1, -1, 83, 84, -1, -1, -1, -1, -1, -1, -1, -1, -1,
  305. -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 85
  306. };
  307. if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
  308. {
  309. register int key = hash (str, len);
  310. if (key <= MAX_HASH_VALUE && key >= 0)
  311. {
  312. register int index = lookup[key];
  313. if (index >= 0)
  314. {
  315. register const char *s = wordlist[index].name;
  316. if (*str == *s && !strcmp (str + 1, s + 1))
  317. return &wordlist[index];
  318. }
  319. }
  320. }
  321. return 0;
  322. }