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,64 @@
1
+ /*
2
+ * $Id: printbuf.h,v 1.4 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
+ #ifndef _printbuf_h_
17
+ #define _printbuf_h_
18
+
19
+ #ifdef __cplusplus
20
+ extern "C" {
21
+ #endif
22
+
23
+ #undef PRINTBUF_DEBUG
24
+
25
+ struct printbuf {
26
+ char *buf;
27
+ int bpos;
28
+ int size;
29
+ };
30
+
31
+ extern struct printbuf*
32
+ printbuf_new(void);
33
+
34
+ /* As an optimization, printbuf_memappend is defined as a macro that
35
+ * handles copying data if the buffer is large enough; otherwise it
36
+ * invokes printbuf_memappend_real() which performs the heavy lifting
37
+ * of realloc()ing the buffer and copying data.
38
+ */
39
+ extern int
40
+ printbuf_memappend(struct printbuf *p, const char *buf, int size);
41
+
42
+ #define printbuf_memappend_fast(p, bufptr, bufsize) \
43
+ do { \
44
+ if ((p->size - p->bpos) > bufsize) { \
45
+ memcpy(p->buf + p->bpos, (bufptr), bufsize); \
46
+ p->bpos += bufsize; \
47
+ p->buf[p->bpos]= '\0'; \
48
+ } else { printbuf_memappend(p, (bufptr), bufsize); } \
49
+ } while (0)
50
+
51
+ extern int
52
+ sprintbuf(struct printbuf *p, const char *msg, ...);
53
+
54
+ extern void
55
+ printbuf_reset(struct printbuf *p);
56
+
57
+ extern void
58
+ printbuf_free(struct printbuf *p);
59
+
60
+ #ifdef __cplusplus
61
+ }
62
+ #endif
63
+
64
+ #endif
@@ -0,0 +1 @@
1
+ timestamp for config.h
@@ -0,0 +1,130 @@
1
+ #! /bin/sh
2
+
3
+ # test1 - temporary wrapper script for .libs/test1
4
+ # Generated by ltmain.sh (GNU libtool) 2.2.6
5
+ #
6
+ # The test1 program cannot be directly executed until all the libtool
7
+ # libraries that it depends on are installed.
8
+ #
9
+ # This wrapper script should never be moved out of the build directory.
10
+ # If it is, it will not operate correctly.
11
+
12
+ # Sed substitution that helps us do robust quoting. It backslashifies
13
+ # metacharacters that are still active within double-quoted strings.
14
+ Xsed='/opt/local/bin/gsed -e 1s/^X//'
15
+ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
16
+
17
+ # Be Bourne compatible
18
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19
+ emulate sh
20
+ NULLCMD=:
21
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
22
+ # is contrary to our usage. Disable this feature.
23
+ alias -g '${1+"$@"}'='"$@"'
24
+ setopt NO_GLOB_SUBST
25
+ else
26
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
27
+ fi
28
+ BIN_SH=xpg4; export BIN_SH # for Tru64
29
+ DUALCASE=1; export DUALCASE # for MKS sh
30
+
31
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
32
+ # if CDPATH is set.
33
+ (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
34
+
35
+ relink_command=""
36
+
37
+ # This environment variable determines our operation mode.
38
+ if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
39
+ # install mode needs the following variables:
40
+ generated_by_libtool_version='2.2.6'
41
+ notinst_deplibs=' libjson.la'
42
+ else
43
+ # When we are sourced in execute mode, $file and $ECHO are already set.
44
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
45
+ ECHO="/bin/echo"
46
+ file="$0"
47
+ # Make sure echo works.
48
+ if test "X$1" = X--no-reexec; then
49
+ # Discard the --no-reexec flag, and continue.
50
+ shift
51
+ elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
52
+ # Yippee, $ECHO works!
53
+ :
54
+ else
55
+ # Restart under the correct shell, and then maybe $ECHO will work.
56
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
57
+ fi
58
+ fi
59
+
60
+ # Find the directory that this script lives in.
61
+ thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
62
+ test "x$thisdir" = "x$file" && thisdir=.
63
+
64
+ # Follow symbolic links until we get to the real thisdir.
65
+ file=`ls -ld "$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
66
+ while test -n "$file"; do
67
+ destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
68
+
69
+ # If there was a directory component, then change thisdir.
70
+ if test "x$destdir" != "x$file"; then
71
+ case "$destdir" in
72
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
73
+ *) thisdir="$thisdir/$destdir" ;;
74
+ esac
75
+ fi
76
+
77
+ file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
78
+ file=`ls -ld "$thisdir/$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
79
+ done
80
+
81
+
82
+ # Usually 'no', except on cygwin/mingw when embedded into
83
+ # the cwrapper.
84
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
85
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
86
+ # special case for '.'
87
+ if test "$thisdir" = "."; then
88
+ thisdir=`pwd`
89
+ fi
90
+ # remove .libs from thisdir
91
+ case "$thisdir" in
92
+ *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
93
+ .libs ) thisdir=. ;;
94
+ esac
95
+ fi
96
+
97
+ # Try to get the absolute directory name.
98
+ absdir=`cd "$thisdir" && pwd`
99
+ test -n "$absdir" && thisdir="$absdir"
100
+
101
+ program='test1'
102
+ progdir="$thisdir/.libs"
103
+
104
+
105
+ if test -f "$progdir/$program"; then
106
+ # Add our own library path to DYLD_LIBRARY_PATH
107
+ DYLD_LIBRARY_PATH="/Users/kyle/Git/parsley/json-c-0.9/.libs:$DYLD_LIBRARY_PATH"
108
+
109
+ # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH
110
+ # The second colon is a workaround for a bug in BeOS R4 sed
111
+ DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'`
112
+
113
+ export DYLD_LIBRARY_PATH
114
+
115
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
116
+ # Run the actual program with our arguments.
117
+
118
+ exec "$progdir/$program" ${1+"$@"}
119
+
120
+ $ECHO "$0: cannot exec $program $*" 1>&2
121
+ exit 1
122
+ fi
123
+ else
124
+ # The program doesn't exist.
125
+ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
126
+ $ECHO "This script is just a wrapper for $program." 1>&2
127
+ /bin/echo "See the libtool documentation for more information." 1>&2
128
+ exit 1
129
+ fi
130
+ fi
@@ -0,0 +1,164 @@
1
+ #include <stdio.h>
2
+ #include <stdlib.h>
3
+ #include <stddef.h>
4
+ #include <string.h>
5
+
6
+ #include "json.h"
7
+
8
+ int main(int argc, char **argv)
9
+ {
10
+ json_tokener *tok;
11
+ json_object *my_string, *my_int, *my_object, *my_array;
12
+ json_object *new_obj;
13
+ int i;
14
+
15
+ MC_SET_DEBUG(1);
16
+
17
+ my_string = json_object_new_string("\t");
18
+ printf("my_string=%s\n", json_object_get_string(my_string));
19
+ printf("my_string.to_string()=%s\n", json_object_to_json_string(my_string));
20
+ json_object_put(my_string);
21
+
22
+ my_string = json_object_new_string("\\");
23
+ printf("my_string=%s\n", json_object_get_string(my_string));
24
+ printf("my_string.to_string()=%s\n", json_object_to_json_string(my_string));
25
+ json_object_put(my_string);
26
+
27
+ my_string = json_object_new_string("foo");
28
+ printf("my_string=%s\n", json_object_get_string(my_string));
29
+ printf("my_string.to_string()=%s\n", json_object_to_json_string(my_string));
30
+
31
+ my_int = json_object_new_int(9);
32
+ printf("my_int=%d\n", json_object_get_int(my_int));
33
+ printf("my_int.to_string()=%s\n", json_object_to_json_string(my_int));
34
+
35
+ my_array = json_object_new_array();
36
+ json_object_array_add(my_array, json_object_new_int(1));
37
+ json_object_array_add(my_array, json_object_new_int(2));
38
+ json_object_array_add(my_array, json_object_new_int(3));
39
+ json_object_array_put_idx(my_array, 4, json_object_new_int(5));
40
+ printf("my_array=\n");
41
+ for(i=0; i < json_object_array_length(my_array); i++) {
42
+ json_object *obj = json_object_array_get_idx(my_array, i);
43
+ printf("\t[%d]=%s\n", i, json_object_to_json_string(obj));
44
+ }
45
+ printf("my_array.to_string()=%s\n", json_object_to_json_string(my_array));
46
+
47
+ my_object = json_object_new_object();
48
+ json_object_object_add(my_object, "abc", json_object_new_int(12));
49
+ json_object_object_add(my_object, "foo", json_object_new_string("bar"));
50
+ json_object_object_add(my_object, "bool0", json_object_new_boolean(0));
51
+ json_object_object_add(my_object, "bool1", json_object_new_boolean(1));
52
+ json_object_object_add(my_object, "baz", json_object_new_string("bang"));
53
+ json_object_object_add(my_object, "baz", json_object_new_string("fark"));
54
+ json_object_object_del(my_object, "baz");
55
+ /*json_object_object_add(my_object, "arr", my_array);*/
56
+ printf("my_object=\n");
57
+ json_object_object_foreach(my_object, key, val) {
58
+ printf("\t%s: %s\n", key, json_object_to_json_string(val));
59
+ }
60
+ printf("my_object.to_string()=%s\n", json_object_to_json_string(my_object));
61
+
62
+ new_obj = json_tokener_parse("\"\003\"");
63
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
64
+ json_object_put(new_obj);
65
+
66
+ new_obj = json_tokener_parse("/* hello */\"foo\"");
67
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
68
+ json_object_put(new_obj);
69
+
70
+ new_obj = json_tokener_parse("// hello\n\"foo\"");
71
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
72
+ json_object_put(new_obj);
73
+
74
+ new_obj = json_tokener_parse("\"\\u0041\\u0042\\u0043\"");
75
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
76
+ json_object_put(new_obj);
77
+
78
+ new_obj = json_tokener_parse("null");
79
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
80
+ json_object_put(new_obj);
81
+
82
+ new_obj = json_tokener_parse("True");
83
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
84
+ json_object_put(new_obj);
85
+
86
+ new_obj = json_tokener_parse("12");
87
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
88
+ json_object_put(new_obj);
89
+
90
+ new_obj = json_tokener_parse("12.3");
91
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
92
+ json_object_put(new_obj);
93
+
94
+ new_obj = json_tokener_parse("[\"\\n\"]");
95
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
96
+ json_object_put(new_obj);
97
+
98
+ new_obj = json_tokener_parse("[\"\\nabc\\n\"]");
99
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
100
+ json_object_put(new_obj);
101
+
102
+ new_obj = json_tokener_parse("[null]");
103
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
104
+ json_object_put(new_obj);
105
+
106
+ new_obj = json_tokener_parse("[]");
107
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
108
+ json_object_put(new_obj);
109
+
110
+ new_obj = json_tokener_parse("[false]");
111
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
112
+ json_object_put(new_obj);
113
+
114
+ new_obj = json_tokener_parse("[\"abc\",null,\"def\",12]");
115
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
116
+ json_object_put(new_obj);
117
+
118
+ new_obj = json_tokener_parse("{}");
119
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
120
+ json_object_put(new_obj);
121
+
122
+ new_obj = json_tokener_parse("{ \"foo\": \"bar\" }");
123
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
124
+ json_object_put(new_obj);
125
+
126
+ new_obj = json_tokener_parse("{ \"foo\": \"bar\", \"baz\": null, \"bool0\": true }");
127
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
128
+ json_object_put(new_obj);
129
+
130
+ new_obj = json_tokener_parse("{ \"foo\": [null, \"foo\"] }");
131
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
132
+ json_object_put(new_obj);
133
+
134
+ new_obj = json_tokener_parse("{ \"abc\": 12, \"foo\": \"bar\", \"bool0\": false, \"bool1\": true, \"arr\": [ 1, 2, 3, null, 5 ] }");
135
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
136
+ json_object_put(new_obj);
137
+
138
+ new_obj = json_tokener_parse("{ foo }");
139
+ if(is_error(new_obj)) printf("got error as expected\n");
140
+
141
+ new_obj = json_tokener_parse("foo");
142
+ if(is_error(new_obj)) printf("got error as expected\n");
143
+
144
+ new_obj = json_tokener_parse("{ \"foo");
145
+ if(is_error(new_obj)) printf("got error as expected\n");
146
+
147
+ /* test incremental parsing */
148
+ tok = json_tokener_new();
149
+ new_obj = json_tokener_parse_ex(tok, "{ \"foo", 6);
150
+ if(is_error(new_obj)) printf("got error as expected\n");
151
+ new_obj = json_tokener_parse_ex(tok, "\": {\"bar", 8);
152
+ if(is_error(new_obj)) printf("got error as expected\n");
153
+ new_obj = json_tokener_parse_ex(tok, "\":13}}", 6);
154
+ printf("new_obj.to_string()=%s\n", json_object_to_json_string(new_obj));
155
+ json_object_put(new_obj);
156
+ json_tokener_free(tok);
157
+
158
+ json_object_put(my_string);
159
+ json_object_put(my_int);
160
+ json_object_put(my_object);
161
+ //json_object_put(my_array);
162
+
163
+ return 0;
164
+ }
@@ -0,0 +1,130 @@
1
+ #! /bin/sh
2
+
3
+ # test2 - temporary wrapper script for .libs/test2
4
+ # Generated by ltmain.sh (GNU libtool) 2.2.6
5
+ #
6
+ # The test2 program cannot be directly executed until all the libtool
7
+ # libraries that it depends on are installed.
8
+ #
9
+ # This wrapper script should never be moved out of the build directory.
10
+ # If it is, it will not operate correctly.
11
+
12
+ # Sed substitution that helps us do robust quoting. It backslashifies
13
+ # metacharacters that are still active within double-quoted strings.
14
+ Xsed='/opt/local/bin/gsed -e 1s/^X//'
15
+ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
16
+
17
+ # Be Bourne compatible
18
+ if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
19
+ emulate sh
20
+ NULLCMD=:
21
+ # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
22
+ # is contrary to our usage. Disable this feature.
23
+ alias -g '${1+"$@"}'='"$@"'
24
+ setopt NO_GLOB_SUBST
25
+ else
26
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
27
+ fi
28
+ BIN_SH=xpg4; export BIN_SH # for Tru64
29
+ DUALCASE=1; export DUALCASE # for MKS sh
30
+
31
+ # The HP-UX ksh and POSIX shell print the target directory to stdout
32
+ # if CDPATH is set.
33
+ (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
34
+
35
+ relink_command=""
36
+
37
+ # This environment variable determines our operation mode.
38
+ if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then
39
+ # install mode needs the following variables:
40
+ generated_by_libtool_version='2.2.6'
41
+ notinst_deplibs=' libjson.la'
42
+ else
43
+ # When we are sourced in execute mode, $file and $ECHO are already set.
44
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
45
+ ECHO="/bin/echo"
46
+ file="$0"
47
+ # Make sure echo works.
48
+ if test "X$1" = X--no-reexec; then
49
+ # Discard the --no-reexec flag, and continue.
50
+ shift
51
+ elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then
52
+ # Yippee, $ECHO works!
53
+ :
54
+ else
55
+ # Restart under the correct shell, and then maybe $ECHO will work.
56
+ exec /bin/sh "$0" --no-reexec ${1+"$@"}
57
+ fi
58
+ fi
59
+
60
+ # Find the directory that this script lives in.
61
+ thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
62
+ test "x$thisdir" = "x$file" && thisdir=.
63
+
64
+ # Follow symbolic links until we get to the real thisdir.
65
+ file=`ls -ld "$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
66
+ while test -n "$file"; do
67
+ destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'`
68
+
69
+ # If there was a directory component, then change thisdir.
70
+ if test "x$destdir" != "x$file"; then
71
+ case "$destdir" in
72
+ [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;;
73
+ *) thisdir="$thisdir/$destdir" ;;
74
+ esac
75
+ fi
76
+
77
+ file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'`
78
+ file=`ls -ld "$thisdir/$file" | /opt/local/bin/gsed -n 's/.*-> //p'`
79
+ done
80
+
81
+
82
+ # Usually 'no', except on cygwin/mingw when embedded into
83
+ # the cwrapper.
84
+ WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no
85
+ if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then
86
+ # special case for '.'
87
+ if test "$thisdir" = "."; then
88
+ thisdir=`pwd`
89
+ fi
90
+ # remove .libs from thisdir
91
+ case "$thisdir" in
92
+ *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;;
93
+ .libs ) thisdir=. ;;
94
+ esac
95
+ fi
96
+
97
+ # Try to get the absolute directory name.
98
+ absdir=`cd "$thisdir" && pwd`
99
+ test -n "$absdir" && thisdir="$absdir"
100
+
101
+ program='test2'
102
+ progdir="$thisdir/.libs"
103
+
104
+
105
+ if test -f "$progdir/$program"; then
106
+ # Add our own library path to DYLD_LIBRARY_PATH
107
+ DYLD_LIBRARY_PATH="/Users/kyle/Git/parsley/json-c-0.9/.libs:$DYLD_LIBRARY_PATH"
108
+
109
+ # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH
110
+ # The second colon is a workaround for a bug in BeOS R4 sed
111
+ DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'`
112
+
113
+ export DYLD_LIBRARY_PATH
114
+
115
+ if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then
116
+ # Run the actual program with our arguments.
117
+
118
+ exec "$progdir/$program" ${1+"$@"}
119
+
120
+ $ECHO "$0: cannot exec $program $*" 1>&2
121
+ exit 1
122
+ fi
123
+ else
124
+ # The program doesn't exist.
125
+ $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2
126
+ $ECHO "This script is just a wrapper for $program." 1>&2
127
+ /bin/echo "See the libtool documentation for more information." 1>&2
128
+ exit 1
129
+ fi
130
+ fi