libyajl2 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +25 -0
  3. data/.gitmodules +3 -0
  4. data/.kitchen.cloud.yml +87 -0
  5. data/.kitchen.yml +38 -0
  6. data/.reek.yml +3 -0
  7. data/.rspec +1 -0
  8. data/.rubocop.yml +38 -0
  9. data/.travis.yml +8 -0
  10. data/CONTRIBUTING.md +4 -0
  11. data/Gemfile +12 -0
  12. data/LICENSE +201 -0
  13. data/README.md +9 -0
  14. data/Rakefile +144 -0
  15. data/bootstrap.sh +60 -0
  16. data/ext/libyajl2/Makefile +7 -0
  17. data/ext/libyajl2/extconf.rb +66 -0
  18. data/ext/libyajl2/vendor/yajl/.gitignore +3 -0
  19. data/ext/libyajl2/vendor/yajl/BUILDING +23 -0
  20. data/ext/libyajl2/vendor/yajl/BUILDING.win32 +27 -0
  21. data/ext/libyajl2/vendor/yajl/CMakeLists.txt +81 -0
  22. data/ext/libyajl2/vendor/yajl/COPYING +13 -0
  23. data/ext/libyajl2/vendor/yajl/ChangeLog +189 -0
  24. data/ext/libyajl2/vendor/yajl/README +74 -0
  25. data/ext/libyajl2/vendor/yajl/TODO +9 -0
  26. data/ext/libyajl2/vendor/yajl/YAJLDoc.cmake +26 -0
  27. data/ext/libyajl2/vendor/yajl/configure +81 -0
  28. data/ext/libyajl2/vendor/yajl/example/CMakeLists.txt +23 -0
  29. data/ext/libyajl2/vendor/yajl/example/README.md +7 -0
  30. data/ext/libyajl2/vendor/yajl/example/parse_config.c +69 -0
  31. data/ext/libyajl2/vendor/yajl/example/sample.config +101 -0
  32. data/ext/libyajl2/vendor/yajl/perf/CMakeLists.txt +23 -0
  33. data/ext/libyajl2/vendor/yajl/perf/documents.c +1418 -0
  34. data/ext/libyajl2/vendor/yajl/perf/documents.h +28 -0
  35. data/ext/libyajl2/vendor/yajl/perf/perftest.c +134 -0
  36. data/ext/libyajl2/vendor/yajl/reformatter/CMakeLists.txt +43 -0
  37. data/ext/libyajl2/vendor/yajl/reformatter/json_reformat.c +210 -0
  38. data/ext/libyajl2/vendor/yajl/src/CMakeLists.txt +87 -0
  39. data/ext/libyajl2/vendor/yajl/src/YAJL.dxy +1258 -0
  40. data/ext/libyajl2/vendor/yajl/src/api/yajl_common.h +75 -0
  41. data/ext/libyajl2/vendor/yajl/src/api/yajl_gen.h +167 -0
  42. data/ext/libyajl2/vendor/yajl/src/api/yajl_parse.h +226 -0
  43. data/ext/libyajl2/vendor/yajl/src/api/yajl_tree.h +186 -0
  44. data/ext/libyajl2/vendor/yajl/src/api/yajl_version.h.cmake +23 -0
  45. data/ext/libyajl2/vendor/yajl/src/yajl +33 -0
  46. data/ext/libyajl2/vendor/yajl/src/yajl.c +175 -0
  47. data/ext/libyajl2/vendor/yajl/src/yajl.pc.cmake +9 -0
  48. data/ext/libyajl2/vendor/yajl/src/yajl_alloc.c +52 -0
  49. data/ext/libyajl2/vendor/yajl/src/yajl_alloc.h +34 -0
  50. data/ext/libyajl2/vendor/yajl/src/yajl_buf.c +103 -0
  51. data/ext/libyajl2/vendor/yajl/src/yajl_buf.h +57 -0
  52. data/ext/libyajl2/vendor/yajl/src/yajl_bytestack.h +69 -0
  53. data/ext/libyajl2/vendor/yajl/src/yajl_encode.c +220 -0
  54. data/ext/libyajl2/vendor/yajl/src/yajl_encode.h +34 -0
  55. data/ext/libyajl2/vendor/yajl/src/yajl_gen.c +362 -0
  56. data/ext/libyajl2/vendor/yajl/src/yajl_lex.c +763 -0
  57. data/ext/libyajl2/vendor/yajl/src/yajl_lex.h +117 -0
  58. data/ext/libyajl2/vendor/yajl/src/yajl_parser.c +498 -0
  59. data/ext/libyajl2/vendor/yajl/src/yajl_parser.h +78 -0
  60. data/ext/libyajl2/vendor/yajl/src/yajl_tree.c +503 -0
  61. data/ext/libyajl2/vendor/yajl/src/yajl_version.c +7 -0
  62. data/ext/libyajl2/vendor/yajl/test/CMakeLists.txt +16 -0
  63. data/ext/libyajl2/vendor/yajl/test/api/CMakeLists.txt +25 -0
  64. data/ext/libyajl2/vendor/yajl/test/api/gen-extra-close.c +19 -0
  65. data/ext/libyajl2/vendor/yajl/test/api/run_tests.sh +23 -0
  66. data/ext/libyajl2/vendor/yajl/test/parsing/CMakeLists.txt +23 -0
  67. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ac_difficult_json_c_test_case_with_comments.json +1 -0
  68. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ac_difficult_json_c_test_case_with_comments.json.gold +36 -0
  69. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ac_simple_with_comments.json +11 -0
  70. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ac_simple_with_comments.json.gold +9 -0
  71. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ag_false_then_garbage.json +1 -0
  72. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ag_false_then_garbage.json.gold +2 -0
  73. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ag_null_then_garbage.json +1 -0
  74. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ag_null_then_garbage.json.gold +2 -0
  75. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ag_true_then_garbage.json +1 -0
  76. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ag_true_then_garbage.json.gold +2 -0
  77. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_eof.json +1 -0
  78. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_eof.json.gold +4 -0
  79. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_integers.json +1 -0
  80. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_integers.json.gold +3 -0
  81. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_multiple.json +3 -0
  82. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_multiple.json.gold +5 -0
  83. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_stuff.json +7 -0
  84. data/ext/libyajl2/vendor/yajl/test/parsing/cases/am_stuff.json.gold +14 -0
  85. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_array_open.json +1 -0
  86. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_array_open.json.gold +2 -0
  87. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_eof_str.json +1 -0
  88. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_eof_str.json.gold +1 -0
  89. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_map_open.json +1 -0
  90. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_map_open.json.gold +2 -0
  91. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_partial_ok.json +1 -0
  92. data/ext/libyajl2/vendor/yajl/test/parsing/cases/ap_partial_ok.json.gold +4 -0
  93. data/ext/libyajl2/vendor/yajl/test/parsing/cases/array.json +6 -0
  94. data/ext/libyajl2/vendor/yajl/test/parsing/cases/array.json.gold +22 -0
  95. data/ext/libyajl2/vendor/yajl/test/parsing/cases/array_close.json +1 -0
  96. data/ext/libyajl2/vendor/yajl/test/parsing/cases/array_close.json.gold +2 -0
  97. data/ext/libyajl2/vendor/yajl/test/parsing/cases/bignums.json +1 -0
  98. data/ext/libyajl2/vendor/yajl/test/parsing/cases/bignums.json.gold +5 -0
  99. data/ext/libyajl2/vendor/yajl/test/parsing/cases/bogus_char.json +4 -0
  100. data/ext/libyajl2/vendor/yajl/test/parsing/cases/bogus_char.json.gold +10 -0
  101. data/ext/libyajl2/vendor/yajl/test/parsing/cases/codepoints_from_unicode_org.json +1 -0
  102. data/ext/libyajl2/vendor/yajl/test/parsing/cases/codepoints_from_unicode_org.json.gold +2 -0
  103. data/ext/libyajl2/vendor/yajl/test/parsing/cases/deep_arrays.json +1 -0
  104. data/ext/libyajl2/vendor/yajl/test/parsing/cases/deep_arrays.json.gold +2049 -0
  105. data/ext/libyajl2/vendor/yajl/test/parsing/cases/difficult_json_c_test_case.json +1 -0
  106. data/ext/libyajl2/vendor/yajl/test/parsing/cases/difficult_json_c_test_case.json.gold +36 -0
  107. data/ext/libyajl2/vendor/yajl/test/parsing/cases/doubles.json +1 -0
  108. data/ext/libyajl2/vendor/yajl/test/parsing/cases/doubles.json.gold +7 -0
  109. data/ext/libyajl2/vendor/yajl/test/parsing/cases/doubles_in_array.json +1 -0
  110. data/ext/libyajl2/vendor/yajl/test/parsing/cases/doubles_in_array.json.gold +8 -0
  111. data/ext/libyajl2/vendor/yajl/test/parsing/cases/empty_array.json +1 -0
  112. data/ext/libyajl2/vendor/yajl/test/parsing/cases/empty_array.json.gold +3 -0
  113. data/ext/libyajl2/vendor/yajl/test/parsing/cases/empty_string.json +1 -0
  114. data/ext/libyajl2/vendor/yajl/test/parsing/cases/empty_string.json.gold +2 -0
  115. data/ext/libyajl2/vendor/yajl/test/parsing/cases/escaped_bulgarian.json +4 -0
  116. data/ext/libyajl2/vendor/yajl/test/parsing/cases/escaped_bulgarian.json.gold +7 -0
  117. data/ext/libyajl2/vendor/yajl/test/parsing/cases/escaped_foobar.json +1 -0
  118. data/ext/libyajl2/vendor/yajl/test/parsing/cases/escaped_foobar.json.gold +2 -0
  119. data/ext/libyajl2/vendor/yajl/test/parsing/cases/false.json +1 -0
  120. data/ext/libyajl2/vendor/yajl/test/parsing/cases/false.json.gold +2 -0
  121. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_false_then_garbage.json +1 -0
  122. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_false_then_garbage.json.gold +3 -0
  123. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_issue_7.json +1 -0
  124. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_issue_7.json.gold +3 -0
  125. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_null_then_garbage.json +1 -0
  126. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_null_then_garbage.json.gold +3 -0
  127. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_true_then_garbage.json +1 -0
  128. data/ext/libyajl2/vendor/yajl/test/parsing/cases/fg_true_then_garbage.json.gold +3 -0
  129. data/ext/libyajl2/vendor/yajl/test/parsing/cases/four_byte_utf8.json +2 -0
  130. data/ext/libyajl2/vendor/yajl/test/parsing/cases/four_byte_utf8.json.gold +5 -0
  131. data/ext/libyajl2/vendor/yajl/test/parsing/cases/high_overflow.json +1 -0
  132. data/ext/libyajl2/vendor/yajl/test/parsing/cases/high_overflow.json.gold +2 -0
  133. data/ext/libyajl2/vendor/yajl/test/parsing/cases/integers.json +3 -0
  134. data/ext/libyajl2/vendor/yajl/test/parsing/cases/integers.json.gold +14 -0
  135. data/ext/libyajl2/vendor/yajl/test/parsing/cases/invalid_utf8.json +1 -0
  136. data/ext/libyajl2/vendor/yajl/test/parsing/cases/invalid_utf8.json.gold +3 -0
  137. data/ext/libyajl2/vendor/yajl/test/parsing/cases/isolated_surrogate_marker.json +1 -0
  138. data/ext/libyajl2/vendor/yajl/test/parsing/cases/isolated_surrogate_marker.json.gold +2 -0
  139. data/ext/libyajl2/vendor/yajl/test/parsing/cases/leading_zero_in_number.json +1 -0
  140. data/ext/libyajl2/vendor/yajl/test/parsing/cases/leading_zero_in_number.json.gold +5 -0
  141. data/ext/libyajl2/vendor/yajl/test/parsing/cases/lonely_minus_sign.json +7 -0
  142. data/ext/libyajl2/vendor/yajl/test/parsing/cases/lonely_minus_sign.json.gold +9 -0
  143. data/ext/libyajl2/vendor/yajl/test/parsing/cases/lonely_number.json +1 -0
  144. data/ext/libyajl2/vendor/yajl/test/parsing/cases/lonely_number.json.gold +2 -0
  145. data/ext/libyajl2/vendor/yajl/test/parsing/cases/low_overflow.json +1 -0
  146. data/ext/libyajl2/vendor/yajl/test/parsing/cases/low_overflow.json.gold +2 -0
  147. data/ext/libyajl2/vendor/yajl/test/parsing/cases/map_close.json +1 -0
  148. data/ext/libyajl2/vendor/yajl/test/parsing/cases/map_close.json.gold +2 -0
  149. data/ext/libyajl2/vendor/yajl/test/parsing/cases/missing_integer_after_decimal_point.json +1 -0
  150. data/ext/libyajl2/vendor/yajl/test/parsing/cases/missing_integer_after_decimal_point.json.gold +2 -0
  151. data/ext/libyajl2/vendor/yajl/test/parsing/cases/missing_integer_after_exponent.json +1 -0
  152. data/ext/libyajl2/vendor/yajl/test/parsing/cases/missing_integer_after_exponent.json.gold +2 -0
  153. data/ext/libyajl2/vendor/yajl/test/parsing/cases/multiple.json +3 -0
  154. data/ext/libyajl2/vendor/yajl/test/parsing/cases/multiple.json.gold +4 -0
  155. data/ext/libyajl2/vendor/yajl/test/parsing/cases/non_utf8_char_in_string.json +1 -0
  156. data/ext/libyajl2/vendor/yajl/test/parsing/cases/non_utf8_char_in_string.json.gold +8 -0
  157. data/ext/libyajl2/vendor/yajl/test/parsing/cases/np_partial_bad.json +1 -0
  158. data/ext/libyajl2/vendor/yajl/test/parsing/cases/np_partial_bad.json.gold +5 -0
  159. data/ext/libyajl2/vendor/yajl/test/parsing/cases/null.json +1 -0
  160. data/ext/libyajl2/vendor/yajl/test/parsing/cases/null.json.gold +2 -0
  161. data/ext/libyajl2/vendor/yajl/test/parsing/cases/nulls_and_bools.json +5 -0
  162. data/ext/libyajl2/vendor/yajl/test/parsing/cases/nulls_and_bools.json.gold +9 -0
  163. data/ext/libyajl2/vendor/yajl/test/parsing/cases/simple.json +5 -0
  164. data/ext/libyajl2/vendor/yajl/test/parsing/cases/simple.json.gold +9 -0
  165. data/ext/libyajl2/vendor/yajl/test/parsing/cases/simple_with_comments.json +11 -0
  166. data/ext/libyajl2/vendor/yajl/test/parsing/cases/simple_with_comments.json.gold +5 -0
  167. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_invalid_escape.json +1 -0
  168. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_invalid_escape.json.gold +3 -0
  169. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_invalid_hex_char.json +1 -0
  170. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_invalid_hex_char.json.gold +2 -0
  171. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_with_escapes.json +3 -0
  172. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_with_escapes.json.gold +7 -0
  173. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_with_invalid_newline.json +2 -0
  174. data/ext/libyajl2/vendor/yajl/test/parsing/cases/string_with_invalid_newline.json.gold +2 -0
  175. data/ext/libyajl2/vendor/yajl/test/parsing/cases/three_byte_utf8.json +1 -0
  176. data/ext/libyajl2/vendor/yajl/test/parsing/cases/three_byte_utf8.json.gold +7 -0
  177. data/ext/libyajl2/vendor/yajl/test/parsing/cases/true.json +1 -0
  178. data/ext/libyajl2/vendor/yajl/test/parsing/cases/true.json.gold +2 -0
  179. data/ext/libyajl2/vendor/yajl/test/parsing/cases/unescaped_bulgarian.json +1 -0
  180. data/ext/libyajl2/vendor/yajl/test/parsing/cases/unescaped_bulgarian.json.gold +4 -0
  181. data/ext/libyajl2/vendor/yajl/test/parsing/cases/zerobyte.json +1 -0
  182. data/ext/libyajl2/vendor/yajl/test/parsing/cases/zerobyte.json.gold +0 -0
  183. data/ext/libyajl2/vendor/yajl/test/parsing/run_tests.sh +94 -0
  184. data/ext/libyajl2/vendor/yajl/test/parsing/yajl_test.c +291 -0
  185. data/ext/libyajl2/vendor/yajl/verify/CMakeLists.txt +37 -0
  186. data/ext/libyajl2/vendor/yajl/verify/json_verify.c +120 -0
  187. data/lib/libyajl2.rb +13 -0
  188. data/lib/libyajl2/version.rb +3 -0
  189. data/libyajl2.gemspec +29 -0
  190. data/spec/ffi_spec.rb +20 -0
  191. data/spec/path_spec.rb +15 -0
  192. data/spec/spec_helper.rb +13 -0
  193. metadata +296 -0
@@ -0,0 +1,189 @@
1
+ 2.1.0
2
+ * @nonodename, @patperry - fixed some compiler warnings
3
+ * @yep, @emaste - documentation improvements
4
+ * @sgravrock - build fix for NetBSD (and whenever sh != bash)
5
+ * @rotty, @brimstone3, @lloyd - allow client to reset generator
6
+ * @sgravrock - remove bash dependencies
7
+ * @lloyd - add api tests
8
+ * @rflynn - remove ruby dependency
9
+ * @cloderic - nmake install works on windows
10
+ * @shahbag - build fix for qnx
11
+ * @breese - debugging improvements
12
+ * @lloyd - json_verify supports -s flag for stream processing
13
+ * @lloyd - json_reformat supports -s flag for stream processing
14
+
15
+ 2.0.4
16
+ * @jcekstrom - additional checking in integer parsing
17
+ * @jcekstrom - fix a bug in yajl_tree that would cause valid json integersto fail to parse
18
+ * @plaguemorin - fix a memory leak in yajl_tree (error strings were being leaked)
19
+ * @7AC - reset errno
20
+ * @ConradIrwin - include flags to reformatter to allow toggling of escape solidus option
21
+
22
+ 2.0.3
23
+ * John Stamp generation of a pkgconfig file at build time.
24
+ * @robzuber bugfix in yajl_tree_get()
25
+ * @lloyd - fix for compilation on 64 bit windows
26
+
27
+ 2.0.2
28
+ * lth fix typos in yajl_tree.h macros YAJL_IS_INTEGER and YAJL_IS_DOUBLE,
29
+ contributed by Artem S Vybornov.
30
+ * lth add #ifdef __cplusplus wrappers to yajl_tree to allow proper
31
+ usage from many populer C++ compilers.
32
+
33
+ 2.0.1
34
+ * lth generator flag to allow client to specify they want
35
+ escaped solidi '/'. issue #28
36
+ * lth crash fix when yajl_parse() is never called. issue #27
37
+
38
+ 2.0.0
39
+ * lth YAJL is now ISC licensed: http://en.wikipedia.org/wiki/ISC_license
40
+ * lth 20-35% (osx and linux respectively) parsing performance
41
+ improvement attained by tweaking string scanning (idea: @michaelrhanson).
42
+ * Florian Forster & lth - yajl_tree interface introduced as a higher level
43
+ interface to the parser (eats JSON, poops a memory representation)
44
+ * lth require a C99 compiler
45
+ * lth integers are now represented with long long (64bit+) on all platforms.
46
+ * lth size_t now used throughout to represent buffer lengths, so you can
47
+ safely manage buffers greater than 4GB.
48
+ * gno semantic improvements to yajl's API regarding partial value parsing and
49
+ trailing garbage
50
+ * lth new configuration mechanism for yajl, see yajl_config() and
51
+ yajl_gen_config()
52
+ * gno more allocation checking in more places
53
+ * gno remove usage of strtol, replace with custom implementation that cares
54
+ not about your locale.
55
+ * lth yajl_parse_complete renamed to yajl_complete_parse.
56
+ * lth add a switch to validate utf8 strings as they are generated.
57
+ * lth tests are a lot quieter in their output.
58
+ * lth addition of a little in tree performance benchmark, `perftest` in
59
+ perf/perftest.c
60
+
61
+ 1.0.12
62
+ * Conrad Irwin - Parse null bytes correctly
63
+ * Mirek Rusin - fix LLVM warnings
64
+ * gno - Don't generate numbers for keys. closes #13
65
+ * lth - various win32 fixes, including build documentation improvements
66
+ * John Stamp - Don't export private symbols.
67
+ * John Stamp - Install yajl_version.h, not the template.
68
+ * John Stamp - Don't use -fPIC for static lib. Cmake will automatically add it for the shared.
69
+ * lth 0 fix paths embedded in dylib upon installation on osx. closes #11
70
+
71
+ 1.0.11
72
+ * lth remove -Wno-missing-field-initializers for greater gcc compat (3.4.6)
73
+
74
+ 1.0.10
75
+ * Brian Maher - yajl is now buildable without a c++ compiler present
76
+ * Brian Maher - fix header installation on OSX with cmake 2.8.0 installed
77
+ * lth & vitali - allow builder to specify alternate lib directory
78
+ for installation (i.e. lib64)
79
+ * Vitali Lovich - yajl version number now programatically accessible
80
+ * lth - prevent cmake from embedding rpaths in binaries. Static linking
81
+ makes this unneccesary.
82
+
83
+ 1.0.9
84
+ * lth - fix inverted logic causing yajl_gen_double() to always fail on
85
+ win32 (thanks to Fredrik Kihlander for the report)
86
+
87
+ 1.0.8
88
+ * Randall E. Barker - move dllexport defnitions so dlls with proper
89
+ exports can again be generated on windows
90
+ * lth - add yajl_get_bytes_consumed() which allows the client to
91
+ determine the offset as an error, as well as determine how
92
+ many bytes of an input buffer were consumed.
93
+ * lth - fixes to keep "error offset" up to date (like when the
94
+ client callback returns 0)
95
+ * Brian Maher - allow client to specify a printing function in
96
+ generation
97
+
98
+ 1.0.7
99
+ * lth fix win32 build (isinf and isnan)
100
+
101
+ 1.0.6
102
+ * lth fix several compiler warnings
103
+ * lth fix generation of invalid json from yajl_gen_double
104
+ (NaN is not JSON)
105
+ * jstamp support for combining short options in tools
106
+ * jstamp exit properly on errors from tools
107
+ * octo test success no longer depends on integer size
108
+ * max fix configure --prefix
109
+
110
+ 1.0.5
111
+ * lth several performance improvements related to function
112
+ inlinin'
113
+
114
+ 1.0.4
115
+ * lth fix broken utf8 validation for three & four byte represenations.
116
+ thanks to http://github.com/brianmario and
117
+ http://github.com/technoweenie
118
+
119
+ 1.0.3
120
+ * lth fix syntax error in cplusplus extern "C" statements for wider
121
+ compiler support
122
+
123
+ 1.0.2
124
+ * lth update doxygen documentation with new sample code, passing NULL
125
+ for allocation functions added in 1.0.0
126
+
127
+ 1.0.1
128
+ * lth resolve crash in json_reformatter due to incorrectly ordered
129
+ parameters.
130
+
131
+ 1.0.0
132
+ * lth add 'make install' rules, thaks to Andrei Soroker for the
133
+ contribution.
134
+ * lth client may override allocation routines at generator or parser
135
+ allocation time
136
+ * tjw add yajl_parse_complete routine to allow client to explicitly
137
+ specify end-of-input, solving the "lonely number" case, where
138
+ json text consists only of an element with no explicit syntactic
139
+ end.
140
+ * tjw many new test cases
141
+ * tjw cleanup of code for symmetry and ease of reading
142
+ * lth integration of patches from Robert Varga which cleanup
143
+ compilation warnings on 64 bit linux
144
+
145
+ 0.4.0
146
+ * lth buffer overflow bug in yajl_gen_double s/%lf/%g/ - thanks to
147
+ Eric Bergstrome
148
+ * lth yajl_number callback to allow passthrough of arbitrary precision
149
+ numbers to client. Thanks to Hatem Nassrat.
150
+ * lth yajl_integer now deals in long, instead of long long. This
151
+ combined with yajl_number improves compiler compatibility while
152
+ maintaining precision.
153
+ * lth better ./configure && make experience (still requires cmake and
154
+ ruby)
155
+ * lth fix handling of special characters hex 0F and 1F in yajl_encode
156
+ (thanks to Robert Geiger)
157
+ * lth allow leading zeros in exponents (thanks to Hatem Nassrat)
158
+
159
+ 0.3.0
160
+ * lth doxygen documentation (html & man) generated as part of the
161
+ build
162
+ * lth many documentation updates.
163
+ * lth fix to work with older versions of cmake (don't use LOOSE_LOOP
164
+ constructs)
165
+ * lth work around different behavior of freebsd 4 scanf. initialize
166
+ parameter to scanf to zero.
167
+ * lth all tests run 32x with ranging buffer sizes to stress stream
168
+ parsing
169
+ * lth yajl_test accepts -b option to allow read buffer size to be
170
+ set
171
+ * lth option to validate UTF8 added to parser (argument in
172
+ yajl_parser_cfg)
173
+ * lth fix buffer overrun when chunk ends inside \u escaped text
174
+ * lth support client cancelation
175
+
176
+ 0.2.2
177
+ * lth on windows build debug with C7 symbols and no pdb files.
178
+
179
+ 0.2.1
180
+ * fix yajl_reformat and yajl_verify to work on arbitrarily sized
181
+ inputs.
182
+ * fix win32 build break, clean up all errors and warnings.
183
+ * fix optimized build flags.
184
+
185
+ 0.2.0
186
+ * optionally support comments in input text
187
+
188
+ 0.1.0
189
+ * Initial release
@@ -0,0 +1,74 @@
1
+ **********************************************************************
2
+ This is YAJL 2. For the legacy version of YAJL see
3
+ https://github.com/lloyd/yajl/tree/1.x
4
+ **********************************************************************
5
+
6
+ Welcome to Yet Another JSON Library (YAJL)
7
+
8
+ ## Why does the world need another C library for parsing JSON?
9
+
10
+ Good question. In a review of current C JSON parsing libraries I was
11
+ unable to find one that satisfies my requirements. Those are,
12
+ 0. written in C
13
+ 1. portable
14
+ 2. robust -- as close to "crash proof" as possible
15
+ 3. data representation independent
16
+ 4. fast
17
+ 5. generates verbose, useful error messages including context of where
18
+ the error occurs in the input text.
19
+ 6. can parse JSON data off a stream, incrementally
20
+ 7. simple to use
21
+ 8. tiny
22
+
23
+ Numbers 3, 5, 6, and 7 were particularly hard to find, and were what
24
+ caused me to ultimately create YAJL. This document is a tour of some
25
+ of the more important aspects of YAJL.
26
+
27
+ ## YAJL is Free.
28
+
29
+ Permissive licensing means you can use it in open source and
30
+ commercial products alike without any fees. My request beyond the
31
+ licensing is that if you find bugs drop me a email, or better yet,
32
+ fork and fix.
33
+
34
+ Porting YAJL should be trivial, the implementation is ANSI C. If you
35
+ port to new systems I'd love to hear of it and integrate your patches.
36
+
37
+ ## YAJL is data representation independent.
38
+
39
+ BYODR! Many JSON libraries impose a structure based data representation
40
+ on you. This is a benefit in some cases and a drawback in others.
41
+ YAJL uses callbacks to remain agnostic of the in-memory representation.
42
+ So if you wish to build up an in-memory representation, you may do so
43
+ using YAJL, but you must bring the code that defines and populates the
44
+ in memory structure.
45
+
46
+ This also means that YAJL can be used by other (higher level) JSON
47
+ libraries if so desired.
48
+
49
+ ## YAJL supports stream parsing
50
+
51
+ This means you do not need to hold the whole JSON representation in
52
+ textual form in memory. This makes YAJL ideal for filtering projects,
53
+ where you're converting YAJL from one form to another (i.e. XML). The
54
+ included JSON pretty printer is an example of such a filter program.
55
+
56
+ ## YAJL is fast
57
+
58
+ Minimal memory copying is performed. YAJL, when possible, returns
59
+ pointers into the client provided text (i.e. for strings that have no
60
+ embedded escape chars, hopefully the common case). I've put a lot of
61
+ effort into profiling and tuning performance, but I have ignored a
62
+ couple possible performance improvements to keep the interface clean,
63
+ small, and flexible. My hope is that YAJL will perform comparably to
64
+ the fastest JSON parser out there.
65
+
66
+ YAJL should impose both minimal CPU and memory requirements on your
67
+ application.
68
+
69
+ ## YAJL is tiny.
70
+
71
+ Fat free. No whip.
72
+
73
+ enjoy,
74
+ Lloyd - July, 2007
@@ -0,0 +1,9 @@
1
+ * add a test for 0x1F bug
2
+ * numeric overflow in integers and double
3
+ * line and char offsets in the lexer and in error messages
4
+ * testing:
5
+ a. the permuter
6
+ b. some performance comparison against json_checker.
7
+ * investigate pull instead of push parsing
8
+ * Handle memory allocation failures gracefully
9
+ * cygwin/msys support on win32
@@ -0,0 +1,26 @@
1
+ FIND_PROGRAM(doxygenPath doxygen)
2
+
3
+ IF (doxygenPath)
4
+ SET (YAJL_VERSION ${YAJL_MAJOR}.${YAJL_MINOR}.${YAJL_MICRO})
5
+ SET(yajlDirName yajl-${YAJL_VERSION})
6
+ SET(docPath
7
+ "${CMAKE_CURRENT_BINARY_DIR}/${yajlDirName}/share/doc/${yajlDirName}")
8
+ MESSAGE("** using doxygen at: ${doxygenPath}")
9
+ MESSAGE("** documentation output to: ${docPath}")
10
+
11
+ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/src/YAJL.dxy
12
+ ${CMAKE_CURRENT_BINARY_DIR}/YAJL.dxy @ONLY)
13
+
14
+ FILE(MAKE_DIRECTORY "${docPath}")
15
+
16
+ ADD_CUSTOM_TARGET(doc
17
+ ${doxygenPath} YAJL.dxy
18
+ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
19
+
20
+ ELSE (doxygenPath)
21
+ MESSAGE("!! doxygen not found, not generating documentation")
22
+ ADD_CUSTOM_TARGET(
23
+ doc
24
+ echo doxygen not installed, not generating documentation
25
+ )
26
+ ENDIF (doxygenPath)
@@ -0,0 +1,81 @@
1
+ #!/bin/sh
2
+ #
3
+ # Copyright (c) 2007-2014, Lloyd Hilaiel <me@lloyd.io>
4
+ #
5
+ # Permission to use, copy, modify, and/or distribute this software for any
6
+ # purpose with or without fee is hereby granted, provided that the above
7
+ # copyright notice and this permission notice appear in all copies.
8
+ #
9
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16
+
17
+ prefix="/usr/local"
18
+ if [ "$1" = "--help" ]
19
+ then
20
+ cat <<EOS
21
+ Usage: configure [options]
22
+ -p, --prefix PATH Set installation prefix
23
+ -h, --help Output usage summary
24
+ EOS
25
+ exit 0
26
+ fi
27
+ if [ "$1" = "-p" ]; then
28
+ if [ "$#" != 2 ]; then
29
+ ./configure.sh --help
30
+ exit 1
31
+ fi
32
+ prefix="$2"
33
+ fi
34
+
35
+ echo "== removing old build files"
36
+ rm -rf build
37
+ rm -f Makefile
38
+ echo "== running CMake in build directory"
39
+ mkdir build || exit 1
40
+ cd build || exit 1
41
+ cmake -DCMAKE_INSTALL_PREFIX="$prefix" .. ||
42
+ {
43
+ echo "The \"cmake\" program is required to configure yajl."
44
+ echo "It's available from most ports/packaging systems and http://cmake.org"
45
+ exit 1
46
+ }
47
+ cd ..
48
+
49
+ echo "== Generating Makefile"
50
+ cat > ./Makefile <<EOS
51
+ .PHONY: all clean distclean install package test distro
52
+ all: distro doc test test-api
53
+
54
+ distro:
55
+ @cd build && make
56
+
57
+ doc:
58
+ @cd build && make doc
59
+
60
+ test:
61
+ @cd build && make test
62
+
63
+ test-api:
64
+ @cd build && make test-api
65
+
66
+ clean:
67
+ @cd build && make clean
68
+
69
+ distclean:
70
+ @rm -rf Makefile build
71
+ @rm -f yajl-*.tgz
72
+
73
+ install: distro doc
74
+ @cd build && make install
75
+
76
+ package: all
77
+ @echo \"compressing to $(basename build/yajl-*).tgz\"
78
+ @cd build && tar czf ../$(basename yajl-*).tgz yajl-*
79
+ EOS
80
+
81
+ echo "== Configured with installation prefix: $prefix"
@@ -0,0 +1,23 @@
1
+ # Copyright (c) 2007-2014, Lloyd Hilaiel <me@lloyd.io>
2
+ #
3
+ # Permission to use, copy, modify, and/or distribute this software for any
4
+ # purpose with or without fee is hereby granted, provided that the above
5
+ # copyright notice and this permission notice appear in all copies.
6
+ #
7
+ # THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
8
+ # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
9
+ # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
10
+ # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
11
+ # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
12
+ # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
13
+ # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
14
+
15
+ SET (SRCS parse_config.c)
16
+
17
+ # use the library we build, duh.
18
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/include)
19
+ LINK_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/../${YAJL_DIST_NAME}/lib)
20
+
21
+ ADD_EXECUTABLE(parse_config ${SRCS})
22
+
23
+ TARGET_LINK_LIBRARIES(parse_config yajl_s)
@@ -0,0 +1,7 @@
1
+ This directory holds an example of how one might use yajl in the
2
+ simplest possible way, to do something like parse and extract values
3
+ from a configuration file.
4
+
5
+ Note that use of the yajl_tree.h utility is completely optional, and
6
+ yajl_parse.h offers a lower level stream parsing API that is more
7
+ efficient and flexible at the cost of some complexity.
@@ -0,0 +1,69 @@
1
+ /*
2
+ * Copyright (c) 2007-2014, Lloyd Hilaiel <me@lloyd.io>
3
+ *
4
+ * Permission to use, copy, modify, and/or distribute this software for any
5
+ * purpose with or without fee is hereby granted, provided that the above
6
+ * copyright notice and this permission notice appear in all copies.
7
+ *
8
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9
+ * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10
+ * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11
+ * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13
+ * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14
+ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15
+ */
16
+
17
+ #include <stdio.h>
18
+ #include <string.h>
19
+
20
+ #include "yajl/yajl_tree.h"
21
+
22
+ static unsigned char fileData[65536];
23
+
24
+ int
25
+ main(void)
26
+ {
27
+ size_t rd;
28
+ yajl_val node;
29
+ char errbuf[1024];
30
+
31
+ /* null plug buffers */
32
+ fileData[0] = errbuf[0] = 0;
33
+
34
+ /* read the entire config file */
35
+ rd = fread((void *) fileData, 1, sizeof(fileData) - 1, stdin);
36
+
37
+ /* file read error handling */
38
+ if (rd == 0 && !feof(stdin)) {
39
+ fprintf(stderr, "error encountered on file read\n");
40
+ return 1;
41
+ } else if (rd >= sizeof(fileData) - 1) {
42
+ fprintf(stderr, "config file too big\n");
43
+ return 1;
44
+ }
45
+
46
+ /* we have the whole config file in memory. let's parse it ... */
47
+ node = yajl_tree_parse((const char *) fileData, errbuf, sizeof(errbuf));
48
+
49
+ /* parse error handling */
50
+ if (node == NULL) {
51
+ fprintf(stderr, "parse_error: ");
52
+ if (strlen(errbuf)) fprintf(stderr, " %s", errbuf);
53
+ else fprintf(stderr, "unknown error");
54
+ fprintf(stderr, "\n");
55
+ return 1;
56
+ }
57
+
58
+ /* ... and extract a nested value from the config file */
59
+ {
60
+ const char * path[] = { "Logging", "timeFormat", (const char *) 0 };
61
+ yajl_val v = yajl_tree_get(node, path, yajl_t_string);
62
+ if (v) printf("%s/%s: %s\n", path[0], path[1], YAJL_GET_STRING(v));
63
+ else printf("no such node: %s/%s\n", path[0], path[1]);
64
+ }
65
+
66
+ yajl_tree_free(node);
67
+
68
+ return 0;
69
+ }