gtl-parsley-ruby 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (299) hide show
  1. data/CHANGELOG +3 -0
  2. data/README +32 -0
  3. data/Rakefile +57 -0
  4. data/VERSION +1 -0
  5. data/ext/cparsley.c +152 -0
  6. data/ext/extconf.rb +82 -0
  7. data/ext/parsley/.gitignore +32 -0
  8. data/ext/parsley/AUTHORS +1 -0
  9. data/ext/parsley/ChangeLog +0 -0
  10. data/ext/parsley/HACKING +4 -0
  11. data/ext/parsley/INSTALL +73 -0
  12. data/ext/parsley/INTRO +84 -0
  13. data/ext/parsley/Makefile.am +80 -0
  14. data/ext/parsley/Makefile.in +1009 -0
  15. data/ext/parsley/NEWS +0 -0
  16. data/ext/parsley/PAPER +36 -0
  17. data/ext/parsley/Portfile +18 -0
  18. data/ext/parsley/Portfile.in +17 -0
  19. data/ext/parsley/README.C-LANG +92 -0
  20. data/ext/parsley/README.markdown +1 -0
  21. data/ext/parsley/TODO +39 -0
  22. data/ext/parsley/VERSION +1 -0
  23. data/ext/parsley/aclocal.m4 +8918 -0
  24. data/ext/parsley/bootstrap.sh +6 -0
  25. data/ext/parsley/config.guess +1561 -0
  26. data/ext/parsley/config.sub +1686 -0
  27. data/ext/parsley/configure +13437 -0
  28. data/ext/parsley/configure.ac +46 -0
  29. data/ext/parsley/depcomp +630 -0
  30. data/ext/parsley/functions.c +368 -0
  31. data/ext/parsley/functions.h +19 -0
  32. data/ext/parsley/generate_bisect.sh +12 -0
  33. data/ext/parsley/hooks/prepare-commit-msg +16 -0
  34. data/ext/parsley/install-sh +520 -0
  35. data/ext/parsley/json-c-0.9/AUTHORS +2 -0
  36. data/ext/parsley/json-c-0.9/COPYING +19 -0
  37. data/ext/parsley/json-c-0.9/ChangeLog +103 -0
  38. data/ext/parsley/json-c-0.9/INSTALL +302 -0
  39. data/ext/parsley/json-c-0.9/Makefile.am +43 -0
  40. data/ext/parsley/json-c-0.9/Makefile.in +800 -0
  41. data/ext/parsley/json-c-0.9/NEWS +1 -0
  42. data/ext/parsley/json-c-0.9/README +20 -0
  43. data/ext/parsley/json-c-0.9/README-WIN32.html +57 -0
  44. data/ext/parsley/json-c-0.9/README.html +32 -0
  45. data/ext/parsley/json-c-0.9/aclocal.m4 +8909 -0
  46. data/ext/parsley/json-c-0.9/arraylist.c +94 -0
  47. data/ext/parsley/json-c-0.9/arraylist.h +53 -0
  48. data/ext/parsley/json-c-0.9/bits.h +27 -0
  49. data/ext/parsley/json-c-0.9/config.guess +1561 -0
  50. data/ext/parsley/json-c-0.9/config.h +125 -0
  51. data/ext/parsley/json-c-0.9/config.h.in +124 -0
  52. data/ext/parsley/json-c-0.9/config.h.win32 +94 -0
  53. data/ext/parsley/json-c-0.9/config.sub +1686 -0
  54. data/ext/parsley/json-c-0.9/configure +13084 -0
  55. data/ext/parsley/json-c-0.9/configure.in +33 -0
  56. data/ext/parsley/json-c-0.9/debug.c +98 -0
  57. data/ext/parsley/json-c-0.9/debug.h +50 -0
  58. data/ext/parsley/json-c-0.9/depcomp +630 -0
  59. data/ext/parsley/json-c-0.9/doc/html/annotated.html +40 -0
  60. data/ext/parsley/json-c-0.9/doc/html/arraylist_8h.html +240 -0
  61. data/ext/parsley/json-c-0.9/doc/html/bits_8h.html +150 -0
  62. data/ext/parsley/json-c-0.9/doc/html/classes.html +36 -0
  63. data/ext/parsley/json-c-0.9/doc/html/config_8h.html +612 -0
  64. data/ext/parsley/json-c-0.9/doc/html/debug_8h.html +392 -0
  65. data/ext/parsley/json-c-0.9/doc/html/doxygen.css +441 -0
  66. data/ext/parsley/json-c-0.9/doc/html/doxygen.png +0 -0
  67. data/ext/parsley/json-c-0.9/doc/html/files.html +42 -0
  68. data/ext/parsley/json-c-0.9/doc/html/functions.html +206 -0
  69. data/ext/parsley/json-c-0.9/doc/html/functions_vars.html +206 -0
  70. data/ext/parsley/json-c-0.9/doc/html/globals.html +459 -0
  71. data/ext/parsley/json-c-0.9/doc/html/globals_defs.html +202 -0
  72. data/ext/parsley/json-c-0.9/doc/html/globals_enum.html +50 -0
  73. data/ext/parsley/json-c-0.9/doc/html/globals_eval.html +135 -0
  74. data/ext/parsley/json-c-0.9/doc/html/globals_func.html +194 -0
  75. data/ext/parsley/json-c-0.9/doc/html/globals_type.html +70 -0
  76. data/ext/parsley/json-c-0.9/doc/html/globals_vars.html +50 -0
  77. data/ext/parsley/json-c-0.9/doc/html/index.html +25 -0
  78. data/ext/parsley/json-c-0.9/doc/html/json_8h.html +32 -0
  79. data/ext/parsley/json-c-0.9/doc/html/json__object_8h.html +1150 -0
  80. data/ext/parsley/json-c-0.9/doc/html/json__object__private_8h.html +75 -0
  81. data/ext/parsley/json-c-0.9/doc/html/json__tokener_8h.html +366 -0
  82. data/ext/parsley/json-c-0.9/doc/html/json__util_8h.html +106 -0
  83. data/ext/parsley/json-c-0.9/doc/html/linkhash_8h.html +740 -0
  84. data/ext/parsley/json-c-0.9/doc/html/printbuf_8h.html +214 -0
  85. data/ext/parsley/json-c-0.9/doc/html/structarray__list.html +104 -0
  86. data/ext/parsley/json-c-0.9/doc/html/structjson__object.html +141 -0
  87. data/ext/parsley/json-c-0.9/doc/html/structjson__object__iter.html +87 -0
  88. data/ext/parsley/json-c-0.9/doc/html/structjson__tokener.html +206 -0
  89. data/ext/parsley/json-c-0.9/doc/html/structjson__tokener__srec.html +104 -0
  90. data/ext/parsley/json-c-0.9/doc/html/structlh__entry.html +105 -0
  91. data/ext/parsley/json-c-0.9/doc/html/structlh__table.html +275 -0
  92. data/ext/parsley/json-c-0.9/doc/html/structprintbuf.html +87 -0
  93. data/ext/parsley/json-c-0.9/doc/html/tab_b.gif +0 -0
  94. data/ext/parsley/json-c-0.9/doc/html/tab_l.gif +0 -0
  95. data/ext/parsley/json-c-0.9/doc/html/tab_r.gif +0 -0
  96. data/ext/parsley/json-c-0.9/doc/html/tabs.css +105 -0
  97. data/ext/parsley/json-c-0.9/doc/html/unionjson__object_1_1data.html +140 -0
  98. data/ext/parsley/json-c-0.9/install-sh +520 -0
  99. data/ext/parsley/json-c-0.9/json.h +31 -0
  100. data/ext/parsley/json-c-0.9/json.pc +11 -0
  101. data/ext/parsley/json-c-0.9/json.pc.in +11 -0
  102. data/ext/parsley/json-c-0.9/json_object.c +512 -0
  103. data/ext/parsley/json-c-0.9/json_object.h +319 -0
  104. data/ext/parsley/json-c-0.9/json_object_private.h +52 -0
  105. data/ext/parsley/json-c-0.9/json_tokener.c +628 -0
  106. data/ext/parsley/json-c-0.9/json_tokener.h +98 -0
  107. data/ext/parsley/json-c-0.9/json_util.c +122 -0
  108. data/ext/parsley/json-c-0.9/json_util.h +31 -0
  109. data/ext/parsley/json-c-0.9/libjson.la +41 -0
  110. data/ext/parsley/json-c-0.9/libtool +8890 -0
  111. data/ext/parsley/json-c-0.9/linkhash.c +216 -0
  112. data/ext/parsley/json-c-0.9/linkhash.h +272 -0
  113. data/ext/parsley/json-c-0.9/ltmain.sh +8406 -0
  114. data/ext/parsley/json-c-0.9/missing +376 -0
  115. data/ext/parsley/json-c-0.9/printbuf.c +149 -0
  116. data/ext/parsley/json-c-0.9/printbuf.h +64 -0
  117. data/ext/parsley/json-c-0.9/stamp-h1 +1 -0
  118. data/ext/parsley/json-c-0.9/test1 +130 -0
  119. data/ext/parsley/json-c-0.9/test1.c +164 -0
  120. data/ext/parsley/json-c-0.9/test2 +130 -0
  121. data/ext/parsley/json-c-0.9/test2.c +20 -0
  122. data/ext/parsley/json-c-0.9/test3 +130 -0
  123. data/ext/parsley/json-c-0.9/test3.c +23 -0
  124. data/ext/parsley/libtool +8890 -0
  125. data/ext/parsley/ltmain.sh +8406 -0
  126. data/ext/parsley/missing +376 -0
  127. data/ext/parsley/parsed_xpath.c +168 -0
  128. data/ext/parsley/parsed_xpath.h +34 -0
  129. data/ext/parsley/parser.y +631 -0
  130. data/ext/parsley/parsley.c +793 -0
  131. data/ext/parsley/parsley.h +87 -0
  132. data/ext/parsley/parsley_main.c +185 -0
  133. data/ext/parsley/parsleyc_main.c +108 -0
  134. data/ext/parsley/regexp.c +359 -0
  135. data/ext/parsley/regexp.h +36 -0
  136. data/ext/parsley/scanner.l +221 -0
  137. data/ext/parsley/test/ambiguous.html +207 -0
  138. data/ext/parsley/test/ambiguous.json +1 -0
  139. data/ext/parsley/test/ambiguous.let +6 -0
  140. data/ext/parsley/test/array-regression.html +5 -0
  141. data/ext/parsley/test/array-regression.json +1 -0
  142. data/ext/parsley/test/array-regression.let +10 -0
  143. data/ext/parsley/test/backslash.html +5 -0
  144. data/ext/parsley/test/backslash.json +1 -0
  145. data/ext/parsley/test/backslash.let +3 -0
  146. data/ext/parsley/test/bang.html +17 -0
  147. data/ext/parsley/test/bang.json +1 -0
  148. data/ext/parsley/test/bang.let +6 -0
  149. data/ext/parsley/test/collate_regression.html +324 -0
  150. data/ext/parsley/test/collate_regression.json +1 -0
  151. data/ext/parsley/test/collate_regression.let +9 -0
  152. data/ext/parsley/test/contains.html +3 -0
  153. data/ext/parsley/test/contains.json +1 -0
  154. data/ext/parsley/test/contains.let +3 -0
  155. data/ext/parsley/test/content.html +13 -0
  156. data/ext/parsley/test/content.json +1 -0
  157. data/ext/parsley/test/content.let +7 -0
  158. data/ext/parsley/test/cool.html +575 -0
  159. data/ext/parsley/test/cool.json +1 -0
  160. data/ext/parsley/test/cool.let +9 -0
  161. data/ext/parsley/test/craigs-simple.html +207 -0
  162. data/ext/parsley/test/craigs-simple.json +1 -0
  163. data/ext/parsley/test/craigs-simple.let +6 -0
  164. data/ext/parsley/test/craigs.html +207 -0
  165. data/ext/parsley/test/craigs.json +1 -0
  166. data/ext/parsley/test/craigs.let +9 -0
  167. data/ext/parsley/test/crash.html +157 -0
  168. data/ext/parsley/test/crash.json +1 -0
  169. data/ext/parsley/test/crash.let +1 -0
  170. data/ext/parsley/test/css_attr.html +3 -0
  171. data/ext/parsley/test/css_attr.json +1 -0
  172. data/ext/parsley/test/css_attr.let +3 -0
  173. data/ext/parsley/test/default-namespace.json +1 -0
  174. data/ext/parsley/test/default-namespace.let +3 -0
  175. data/ext/parsley/test/default-namespace.xml +1493 -0
  176. data/ext/parsley/test/div.html +8 -0
  177. data/ext/parsley/test/div.json +1 -0
  178. data/ext/parsley/test/div.let +10 -0
  179. data/ext/parsley/test/empty.html +3 -0
  180. data/ext/parsley/test/empty.json +1 -0
  181. data/ext/parsley/test/empty.let +1 -0
  182. data/ext/parsley/test/emptyish.html +207 -0
  183. data/ext/parsley/test/emptyish.let +3 -0
  184. data/ext/parsley/test/fictional-opt.html +43 -0
  185. data/ext/parsley/test/fictional-opt.json +1 -0
  186. data/ext/parsley/test/fictional-opt.let +14 -0
  187. data/ext/parsley/test/fictional.html +43 -0
  188. data/ext/parsley/test/fictional.json +1 -0
  189. data/ext/parsley/test/fictional.let +14 -0
  190. data/ext/parsley/test/function-magic.html +9 -0
  191. data/ext/parsley/test/function-magic.json +1 -0
  192. data/ext/parsley/test/function-magic.let +8 -0
  193. data/ext/parsley/test/hn.html +32 -0
  194. data/ext/parsley/test/hn.json +1 -0
  195. data/ext/parsley/test/hn.let +8 -0
  196. data/ext/parsley/test/malformed-array.html +2329 -0
  197. data/ext/parsley/test/malformed-array.json +1 -0
  198. data/ext/parsley/test/malformed-array.let +22 -0
  199. data/ext/parsley/test/malformed-expr.html +2329 -0
  200. data/ext/parsley/test/malformed-expr.json +1 -0
  201. data/ext/parsley/test/malformed-expr.let +16 -0
  202. data/ext/parsley/test/malformed-function.html +845 -0
  203. data/ext/parsley/test/malformed-function.json +197 -0
  204. data/ext/parsley/test/malformed-function.let +8 -0
  205. data/ext/parsley/test/malformed-json.html +2329 -0
  206. data/ext/parsley/test/malformed-json.json +1 -0
  207. data/ext/parsley/test/malformed-json.let +6 -0
  208. data/ext/parsley/test/malformed-xpath.html +8 -0
  209. data/ext/parsley/test/malformed-xpath.json +1 -0
  210. data/ext/parsley/test/malformed-xpath.let +7 -0
  211. data/ext/parsley/test/match.json +1 -0
  212. data/ext/parsley/test/match.let +9 -0
  213. data/ext/parsley/test/match.xml +11 -0
  214. data/ext/parsley/test/math_ambiguity.html +9 -0
  215. data/ext/parsley/test/math_ambiguity.json +1 -0
  216. data/ext/parsley/test/math_ambiguity.let +5 -0
  217. data/ext/parsley/test/nth-regression.html +13 -0
  218. data/ext/parsley/test/nth-regression.json +1 -0
  219. data/ext/parsley/test/nth-regression.let +3 -0
  220. data/ext/parsley/test/optional.html +2328 -0
  221. data/ext/parsley/test/optional.json +1 -0
  222. data/ext/parsley/test/optional.let +8 -0
  223. data/ext/parsley/test/outer-xml.html +6 -0
  224. data/ext/parsley/test/outer-xml.json +1 -0
  225. data/ext/parsley/test/outer-xml.let +5 -0
  226. data/ext/parsley/test/position.html +8 -0
  227. data/ext/parsley/test/position.json +1 -0
  228. data/ext/parsley/test/position.let +6 -0
  229. data/ext/parsley/test/question_regressions.html +443 -0
  230. data/ext/parsley/test/question_regressions.json +1 -0
  231. data/ext/parsley/test/question_regressions.let +6 -0
  232. data/ext/parsley/test/quote.json +1 -0
  233. data/ext/parsley/test/quote.let +8 -0
  234. data/ext/parsley/test/quote.xml +11 -0
  235. data/ext/parsley/test/reddit.html +1 -0
  236. data/ext/parsley/test/reddit.json +1 -0
  237. data/ext/parsley/test/reddit.let +12 -0
  238. data/ext/parsley/test/remote-fail.json +1 -0
  239. data/ext/parsley/test/remote.html +3 -0
  240. data/ext/parsley/test/remote.json +1 -0
  241. data/ext/parsley/test/remote.let +4 -0
  242. data/ext/parsley/test/replace.json +1 -0
  243. data/ext/parsley/test/replace.let +9 -0
  244. data/ext/parsley/test/replace.xml +11 -0
  245. data/ext/parsley/test/scope.html +10 -0
  246. data/ext/parsley/test/scope.json +1 -0
  247. data/ext/parsley/test/scope.let +6 -0
  248. data/ext/parsley/test/segfault.html +5 -0
  249. data/ext/parsley/test/segfault.json +1 -0
  250. data/ext/parsley/test/segfault.let +9 -0
  251. data/ext/parsley/test/sg-wrap.html +5 -0
  252. data/ext/parsley/test/sg-wrap.json +1 -0
  253. data/ext/parsley/test/sg-wrap.let +3 -0
  254. data/ext/parsley/test/sg_off.html +5 -0
  255. data/ext/parsley/test/sg_off.json +1 -0
  256. data/ext/parsley/test/sg_off.let +3 -0
  257. data/ext/parsley/test/test.json +1 -0
  258. data/ext/parsley/test/test.let +6 -0
  259. data/ext/parsley/test/test.xml +11 -0
  260. data/ext/parsley/test/trivial.html +2329 -0
  261. data/ext/parsley/test/trivial.json +1 -0
  262. data/ext/parsley/test/trivial.let +4 -0
  263. data/ext/parsley/test/trivial2.html +2329 -0
  264. data/ext/parsley/test/trivial2.json +1 -0
  265. data/ext/parsley/test/trivial2.let +7 -0
  266. data/ext/parsley/test/unbang.html +17 -0
  267. data/ext/parsley/test/unbang.json +1 -0
  268. data/ext/parsley/test/unbang.let +6 -0
  269. data/ext/parsley/test/unicode.html +3 -0
  270. data/ext/parsley/test/unicode.json +1 -0
  271. data/ext/parsley/test/unicode.let +1 -0
  272. data/ext/parsley/test/whitespace.html +8 -0
  273. data/ext/parsley/test/whitespace.json +1 -0
  274. data/ext/parsley/test/whitespace.let +3 -0
  275. data/ext/parsley/test/whitespace_regression.html +4 -0
  276. data/ext/parsley/test/whitespace_regression.json +1 -0
  277. data/ext/parsley/test/whitespace_regression.let +3 -0
  278. data/ext/parsley/test/yelp-benchmark.rb +53 -0
  279. data/ext/parsley/test/yelp-home.html +1004 -0
  280. data/ext/parsley/test/yelp-home.json +1 -0
  281. data/ext/parsley/test/yelp-home.let +6 -0
  282. data/ext/parsley/test/yelp.html +2329 -0
  283. data/ext/parsley/test/yelp.json +1 -0
  284. data/ext/parsley/test/yelp.let +12 -0
  285. data/ext/parsley/test/youtube.html +1940 -0
  286. data/ext/parsley/test/youtube.let +11 -0
  287. data/ext/parsley/util.c +237 -0
  288. data/ext/parsley/util.h +34 -0
  289. data/ext/parsley/xml2json.c +47 -0
  290. data/ext/parsley/xml2json.h +14 -0
  291. data/ext/parsley/y.tab.h +222 -0
  292. data/ext/parsley/ylwrap +222 -0
  293. data/lib/parsley.rb +84 -0
  294. data/test/test_parsley.rb +120 -0
  295. data/test/yelp-benchmark.rb +53 -0
  296. data/test/yelp-home.html +1004 -0
  297. data/test/yelp-home.let +6 -0
  298. data/test/yelp.html +2329 -0
  299. metadata +366 -0
@@ -0,0 +1,376 @@
1
+ #! /bin/sh
2
+ # Common stub for a few missing GNU programs while installing.
3
+
4
+ scriptversion=2009-04-28.21; # UTC
5
+
6
+ # Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006,
7
+ # 2008, 2009 Free Software Foundation, Inc.
8
+ # Originally by Fran,cois Pinard <pinard@iro.umontreal.ca>, 1996.
9
+
10
+ # This program is free software; you can redistribute it and/or modify
11
+ # it under the terms of the GNU General Public License as published by
12
+ # the Free Software Foundation; either version 2, or (at your option)
13
+ # any later version.
14
+
15
+ # This program is distributed in the hope that it will be useful,
16
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
17
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
+ # GNU General Public License for more details.
19
+
20
+ # You should have received a copy of the GNU General Public License
21
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
22
+
23
+ # As a special exception to the GNU General Public License, if you
24
+ # distribute this file as part of a program that contains a
25
+ # configuration script generated by Autoconf, you may include it under
26
+ # the same distribution terms that you use for the rest of that program.
27
+
28
+ if test $# -eq 0; then
29
+ echo 1>&2 "Try \`$0 --help' for more information"
30
+ exit 1
31
+ fi
32
+
33
+ run=:
34
+ sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p'
35
+ sed_minuso='s/.* -o \([^ ]*\).*/\1/p'
36
+
37
+ # In the cases where this matters, `missing' is being run in the
38
+ # srcdir already.
39
+ if test -f configure.ac; then
40
+ configure_ac=configure.ac
41
+ else
42
+ configure_ac=configure.in
43
+ fi
44
+
45
+ msg="missing on your system"
46
+
47
+ case $1 in
48
+ --run)
49
+ # Try to run requested program, and just exit if it succeeds.
50
+ run=
51
+ shift
52
+ "$@" && exit 0
53
+ # Exit code 63 means version mismatch. This often happens
54
+ # when the user try to use an ancient version of a tool on
55
+ # a file that requires a minimum version. In this case we
56
+ # we should proceed has if the program had been absent, or
57
+ # if --run hadn't been passed.
58
+ if test $? = 63; then
59
+ run=:
60
+ msg="probably too old"
61
+ fi
62
+ ;;
63
+
64
+ -h|--h|--he|--hel|--help)
65
+ echo "\
66
+ $0 [OPTION]... PROGRAM [ARGUMENT]...
67
+
68
+ Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an
69
+ error status if there is no known handling for PROGRAM.
70
+
71
+ Options:
72
+ -h, --help display this help and exit
73
+ -v, --version output version information and exit
74
+ --run try to run the given command, and emulate it if it fails
75
+
76
+ Supported PROGRAM values:
77
+ aclocal touch file \`aclocal.m4'
78
+ autoconf touch file \`configure'
79
+ autoheader touch file \`config.h.in'
80
+ autom4te touch the output file, or create a stub one
81
+ automake touch all \`Makefile.in' files
82
+ bison create \`y.tab.[ch]', if possible, from existing .[ch]
83
+ flex create \`lex.yy.c', if possible, from existing .c
84
+ help2man touch the output file
85
+ lex create \`lex.yy.c', if possible, from existing .c
86
+ makeinfo touch the output file
87
+ tar try tar, gnutar, gtar, then tar without non-portable flags
88
+ yacc create \`y.tab.[ch]', if possible, from existing .[ch]
89
+
90
+ Version suffixes to PROGRAM as well as the prefixes \`gnu-', \`gnu', and
91
+ \`g' are ignored when checking the name.
92
+
93
+ Send bug reports to <bug-automake@gnu.org>."
94
+ exit $?
95
+ ;;
96
+
97
+ -v|--v|--ve|--ver|--vers|--versi|--versio|--version)
98
+ echo "missing $scriptversion (GNU Automake)"
99
+ exit $?
100
+ ;;
101
+
102
+ -*)
103
+ echo 1>&2 "$0: Unknown \`$1' option"
104
+ echo 1>&2 "Try \`$0 --help' for more information"
105
+ exit 1
106
+ ;;
107
+
108
+ esac
109
+
110
+ # normalize program name to check for.
111
+ program=`echo "$1" | sed '
112
+ s/^gnu-//; t
113
+ s/^gnu//; t
114
+ s/^g//; t'`
115
+
116
+ # Now exit if we have it, but it failed. Also exit now if we
117
+ # don't have it and --version was passed (most likely to detect
118
+ # the program). This is about non-GNU programs, so use $1 not
119
+ # $program.
120
+ case $1 in
121
+ lex*|yacc*)
122
+ # Not GNU programs, they don't have --version.
123
+ ;;
124
+
125
+ tar*)
126
+ if test -n "$run"; then
127
+ echo 1>&2 "ERROR: \`tar' requires --run"
128
+ exit 1
129
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
130
+ exit 1
131
+ fi
132
+ ;;
133
+
134
+ *)
135
+ if test -z "$run" && ($1 --version) > /dev/null 2>&1; then
136
+ # We have it, but it failed.
137
+ exit 1
138
+ elif test "x$2" = "x--version" || test "x$2" = "x--help"; then
139
+ # Could not run --version or --help. This is probably someone
140
+ # running `$TOOL --version' or `$TOOL --help' to check whether
141
+ # $TOOL exists and not knowing $TOOL uses missing.
142
+ exit 1
143
+ fi
144
+ ;;
145
+ esac
146
+
147
+ # If it does not exist, or fails to run (possibly an outdated version),
148
+ # try to emulate it.
149
+ case $program in
150
+ aclocal*)
151
+ echo 1>&2 "\
152
+ WARNING: \`$1' is $msg. You should only need it if
153
+ you modified \`acinclude.m4' or \`${configure_ac}'. You might want
154
+ to install the \`Automake' and \`Perl' packages. Grab them from
155
+ any GNU archive site."
156
+ touch aclocal.m4
157
+ ;;
158
+
159
+ autoconf*)
160
+ echo 1>&2 "\
161
+ WARNING: \`$1' is $msg. You should only need it if
162
+ you modified \`${configure_ac}'. You might want to install the
163
+ \`Autoconf' and \`GNU m4' packages. Grab them from any GNU
164
+ archive site."
165
+ touch configure
166
+ ;;
167
+
168
+ autoheader*)
169
+ echo 1>&2 "\
170
+ WARNING: \`$1' is $msg. You should only need it if
171
+ you modified \`acconfig.h' or \`${configure_ac}'. You might want
172
+ to install the \`Autoconf' and \`GNU m4' packages. Grab them
173
+ from any GNU archive site."
174
+ files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}`
175
+ test -z "$files" && files="config.h"
176
+ touch_files=
177
+ for f in $files; do
178
+ case $f in
179
+ *:*) touch_files="$touch_files "`echo "$f" |
180
+ sed -e 's/^[^:]*://' -e 's/:.*//'`;;
181
+ *) touch_files="$touch_files $f.in";;
182
+ esac
183
+ done
184
+ touch $touch_files
185
+ ;;
186
+
187
+ automake*)
188
+ echo 1>&2 "\
189
+ WARNING: \`$1' is $msg. You should only need it if
190
+ you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'.
191
+ You might want to install the \`Automake' and \`Perl' packages.
192
+ Grab them from any GNU archive site."
193
+ find . -type f -name Makefile.am -print |
194
+ sed 's/\.am$/.in/' |
195
+ while read f; do touch "$f"; done
196
+ ;;
197
+
198
+ autom4te*)
199
+ echo 1>&2 "\
200
+ WARNING: \`$1' is needed, but is $msg.
201
+ You might have modified some files without having the
202
+ proper tools for further handling them.
203
+ You can get \`$1' as part of \`Autoconf' from any GNU
204
+ archive site."
205
+
206
+ file=`echo "$*" | sed -n "$sed_output"`
207
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
208
+ if test -f "$file"; then
209
+ touch $file
210
+ else
211
+ test -z "$file" || exec >$file
212
+ echo "#! /bin/sh"
213
+ echo "# Created by GNU Automake missing as a replacement of"
214
+ echo "# $ $@"
215
+ echo "exit 0"
216
+ chmod +x $file
217
+ exit 1
218
+ fi
219
+ ;;
220
+
221
+ bison*|yacc*)
222
+ echo 1>&2 "\
223
+ WARNING: \`$1' $msg. You should only need it if
224
+ you modified a \`.y' file. You may need the \`Bison' package
225
+ in order for those modifications to take effect. You can get
226
+ \`Bison' from any GNU archive site."
227
+ rm -f y.tab.c y.tab.h
228
+ if test $# -ne 1; then
229
+ eval LASTARG="\${$#}"
230
+ case $LASTARG in
231
+ *.y)
232
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'`
233
+ if test -f "$SRCFILE"; then
234
+ cp "$SRCFILE" y.tab.c
235
+ fi
236
+ SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'`
237
+ if test -f "$SRCFILE"; then
238
+ cp "$SRCFILE" y.tab.h
239
+ fi
240
+ ;;
241
+ esac
242
+ fi
243
+ if test ! -f y.tab.h; then
244
+ echo >y.tab.h
245
+ fi
246
+ if test ! -f y.tab.c; then
247
+ echo 'main() { return 0; }' >y.tab.c
248
+ fi
249
+ ;;
250
+
251
+ lex*|flex*)
252
+ echo 1>&2 "\
253
+ WARNING: \`$1' is $msg. You should only need it if
254
+ you modified a \`.l' file. You may need the \`Flex' package
255
+ in order for those modifications to take effect. You can get
256
+ \`Flex' from any GNU archive site."
257
+ rm -f lex.yy.c
258
+ if test $# -ne 1; then
259
+ eval LASTARG="\${$#}"
260
+ case $LASTARG in
261
+ *.l)
262
+ SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'`
263
+ if test -f "$SRCFILE"; then
264
+ cp "$SRCFILE" lex.yy.c
265
+ fi
266
+ ;;
267
+ esac
268
+ fi
269
+ if test ! -f lex.yy.c; then
270
+ echo 'main() { return 0; }' >lex.yy.c
271
+ fi
272
+ ;;
273
+
274
+ help2man*)
275
+ echo 1>&2 "\
276
+ WARNING: \`$1' is $msg. You should only need it if
277
+ you modified a dependency of a manual page. You may need the
278
+ \`Help2man' package in order for those modifications to take
279
+ effect. You can get \`Help2man' from any GNU archive site."
280
+
281
+ file=`echo "$*" | sed -n "$sed_output"`
282
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
283
+ if test -f "$file"; then
284
+ touch $file
285
+ else
286
+ test -z "$file" || exec >$file
287
+ echo ".ab help2man is required to generate this page"
288
+ exit $?
289
+ fi
290
+ ;;
291
+
292
+ makeinfo*)
293
+ echo 1>&2 "\
294
+ WARNING: \`$1' is $msg. You should only need it if
295
+ you modified a \`.texi' or \`.texinfo' file, or any other file
296
+ indirectly affecting the aspect of the manual. The spurious
297
+ call might also be the consequence of using a buggy \`make' (AIX,
298
+ DU, IRIX). You might want to install the \`Texinfo' package or
299
+ the \`GNU make' package. Grab either from any GNU archive site."
300
+ # The file to touch is that specified with -o ...
301
+ file=`echo "$*" | sed -n "$sed_output"`
302
+ test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"`
303
+ if test -z "$file"; then
304
+ # ... or it is the one specified with @setfilename ...
305
+ infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'`
306
+ file=`sed -n '
307
+ /^@setfilename/{
308
+ s/.* \([^ ]*\) *$/\1/
309
+ p
310
+ q
311
+ }' $infile`
312
+ # ... or it is derived from the source name (dir/f.texi becomes f.info)
313
+ test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info
314
+ fi
315
+ # If the file does not exist, the user really needs makeinfo;
316
+ # let's fail without touching anything.
317
+ test -f $file || exit 1
318
+ touch $file
319
+ ;;
320
+
321
+ tar*)
322
+ shift
323
+
324
+ # We have already tried tar in the generic part.
325
+ # Look for gnutar/gtar before invocation to avoid ugly error
326
+ # messages.
327
+ if (gnutar --version > /dev/null 2>&1); then
328
+ gnutar "$@" && exit 0
329
+ fi
330
+ if (gtar --version > /dev/null 2>&1); then
331
+ gtar "$@" && exit 0
332
+ fi
333
+ firstarg="$1"
334
+ if shift; then
335
+ case $firstarg in
336
+ *o*)
337
+ firstarg=`echo "$firstarg" | sed s/o//`
338
+ tar "$firstarg" "$@" && exit 0
339
+ ;;
340
+ esac
341
+ case $firstarg in
342
+ *h*)
343
+ firstarg=`echo "$firstarg" | sed s/h//`
344
+ tar "$firstarg" "$@" && exit 0
345
+ ;;
346
+ esac
347
+ fi
348
+
349
+ echo 1>&2 "\
350
+ WARNING: I can't seem to be able to run \`tar' with the given arguments.
351
+ You may want to install GNU tar or Free paxutils, or check the
352
+ command line arguments."
353
+ exit 1
354
+ ;;
355
+
356
+ *)
357
+ echo 1>&2 "\
358
+ WARNING: \`$1' is needed, and is $msg.
359
+ You might have modified some files without having the
360
+ proper tools for further handling them. Check the \`README' file,
361
+ it often tells you about the needed prerequisites for installing
362
+ this package. You may also peek at any GNU archive site, in case
363
+ some other package would contain this missing \`$1' program."
364
+ exit 1
365
+ ;;
366
+ esac
367
+
368
+ exit 0
369
+
370
+ # Local variables:
371
+ # eval: (add-hook 'write-file-hooks 'time-stamp)
372
+ # time-stamp-start: "scriptversion="
373
+ # time-stamp-format: "%:y-%02m-%02d.%02H"
374
+ # time-stamp-time-zone: "UTC"
375
+ # time-stamp-end: "; # UTC"
376
+ # End:
@@ -0,0 +1,149 @@
1
+ /*
2
+ * $Id: printbuf.c,v 1.5 2006/01/26 02:16:28 mclark Exp $
3
+ *
4
+ * Copyright (c) 2004, 2005 Metaparadigm Pte. Ltd.
5
+ * Michael Clark <michael@metaparadigm.com>
6
+ *
7
+ * This library is free software; you can redistribute it and/or modify
8
+ * it under the terms of the MIT license. See COPYING for details.
9
+ *
10
+ *
11
+ * Copyright (c) 2008-2009 Yahoo! Inc. All rights reserved.
12
+ * The copyrights to the contents of this file are licensed under the MIT License
13
+ * (http://www.opensource.org/licenses/mit-license.php)
14
+ */
15
+
16
+ #include "config.h"
17
+
18
+ #include <stdio.h>
19
+ #include <stdlib.h>
20
+ #include <string.h>
21
+
22
+ #if HAVE_STDARG_H
23
+ # include <stdarg.h>
24
+ #else /* !HAVE_STDARG_H */
25
+ # error Not enough var arg support!
26
+ #endif /* HAVE_STDARG_H */
27
+
28
+ #include "bits.h"
29
+ #include "debug.h"
30
+ #include "printbuf.h"
31
+
32
+ struct printbuf* printbuf_new(void)
33
+ {
34
+ struct printbuf *p;
35
+
36
+ p = (struct printbuf*)calloc(1, sizeof(struct printbuf));
37
+ if(!p) return NULL;
38
+ p->size = 32;
39
+ p->bpos = 0;
40
+ if(!(p->buf = (char*)malloc(p->size))) {
41
+ free(p);
42
+ return NULL;
43
+ }
44
+ return p;
45
+ }
46
+
47
+
48
+ int printbuf_memappend(struct printbuf *p, const char *buf, int size)
49
+ {
50
+ char *t;
51
+ if(p->size - p->bpos <= size) {
52
+ int new_size = json_max(p->size * 2, p->bpos + size + 8);
53
+ #ifdef PRINTBUF_DEBUG
54
+ MC_DEBUG("printbuf_memappend: realloc "
55
+ "bpos=%d wrsize=%d old_size=%d new_size=%d\n",
56
+ p->bpos, size, p->size, new_size);
57
+ #endif /* PRINTBUF_DEBUG */
58
+ if(!(t = (char*)realloc(p->buf, new_size))) return -1;
59
+ p->size = new_size;
60
+ p->buf = t;
61
+ }
62
+ memcpy(p->buf + p->bpos, buf, size);
63
+ p->bpos += size;
64
+ p->buf[p->bpos]= '\0';
65
+ return size;
66
+ }
67
+
68
+ #if !HAVE_VSNPRINTF && defined(WIN32)
69
+ # define vsnprintf _vsnprintf
70
+ #elif !HAVE_VSNPRINTF /* !HAVE_VSNPRINTF */
71
+ # error Need vsnprintf!
72
+ #endif /* !HAVE_VSNPRINTF && defined(WIN32) */
73
+
74
+ #if !HAVE_VASPRINTF
75
+ /* CAW: compliant version of vasprintf */
76
+ static int vasprintf(char **buf, const char *fmt, va_list ap)
77
+ {
78
+ #ifndef WIN32
79
+ static char _T_emptybuffer = '\0';
80
+ #endif /* !defined(WIN32) */
81
+ int chars;
82
+ char *b;
83
+
84
+ if(!buf) { return -1; }
85
+
86
+ #ifdef WIN32
87
+ chars = _vscprintf(fmt, ap)+1;
88
+ #else /* !defined(WIN32) */
89
+ /* CAW: RAWR! We have to hope to god here that vsnprintf doesn't overwrite
90
+ our buffer like on some 64bit sun systems.... but hey, its time to move on */
91
+ chars = vsnprintf(&_T_emptybuffer, 0, fmt, ap)+1;
92
+ if(chars < 0) { chars *= -1; } /* CAW: old glibc versions have this problem */
93
+ #endif /* defined(WIN32) */
94
+
95
+ b = (char*)malloc(sizeof(char)*chars);
96
+ if(!b) { return -1; }
97
+
98
+ if((chars = vsprintf(b, fmt, ap)) < 0)
99
+ {
100
+ free(b);
101
+ } else {
102
+ *buf = b;
103
+ }
104
+
105
+ return chars;
106
+ }
107
+ #endif /* !HAVE_VASPRINTF */
108
+
109
+ int sprintbuf(struct printbuf *p, const char *msg, ...)
110
+ {
111
+ va_list ap;
112
+ char *t;
113
+ int size;
114
+ char buf[128];
115
+
116
+ /* user stack buffer first */
117
+ va_start(ap, msg);
118
+ size = vsnprintf(buf, 128, msg, ap);
119
+ va_end(ap);
120
+ /* if string is greater than stack buffer, then use dynamic string
121
+ with vasprintf. Note: some implementation of vsnprintf return -1
122
+ if output is truncated whereas some return the number of bytes that
123
+ would have been written - this code handles both cases. */
124
+ if(size == -1 || size > 127) {
125
+ va_start(ap, msg);
126
+ if((size = vasprintf(&t, msg, ap)) == -1) { va_end(ap); return -1; }
127
+ va_end(ap);
128
+ printbuf_memappend(p, t, size);
129
+ free(t);
130
+ return size;
131
+ } else {
132
+ printbuf_memappend(p, buf, size);
133
+ return size;
134
+ }
135
+ }
136
+
137
+ void printbuf_reset(struct printbuf *p)
138
+ {
139
+ p->buf[0] = '\0';
140
+ p->bpos = 0;
141
+ }
142
+
143
+ void printbuf_free(struct printbuf *p)
144
+ {
145
+ if(p) {
146
+ free(p->buf);
147
+ free(p);
148
+ }
149
+ }