oj 2.0.0 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/LICENSE +17 -23
- data/README.md +74 -425
- data/ext/oj/buf.h +103 -0
- data/ext/oj/cache8.c +4 -0
- data/ext/oj/circarray.c +68 -0
- data/ext/oj/circarray.h +23 -0
- data/ext/oj/code.c +227 -0
- data/ext/oj/code.h +40 -0
- data/ext/oj/compat.c +243 -0
- data/ext/oj/custom.c +1097 -0
- data/ext/oj/dump.c +766 -1534
- data/ext/oj/dump.h +92 -0
- data/ext/oj/dump_compat.c +937 -0
- data/ext/oj/dump_leaf.c +254 -0
- data/ext/oj/dump_object.c +810 -0
- data/ext/oj/dump_rails.c +329 -0
- data/ext/oj/dump_strict.c +416 -0
- data/ext/oj/encode.h +51 -0
- data/ext/oj/err.c +57 -0
- data/ext/oj/err.h +70 -0
- data/ext/oj/extconf.rb +17 -7
- data/ext/oj/fast.c +213 -180
- data/ext/oj/hash.c +163 -0
- data/ext/oj/hash.h +46 -0
- data/ext/oj/hash_test.c +512 -0
- data/ext/oj/mimic_json.c +817 -0
- data/ext/oj/mimic_rails.c +806 -0
- data/ext/oj/mimic_rails.h +17 -0
- data/ext/oj/object.c +752 -0
- data/ext/oj/odd.c +230 -0
- data/ext/oj/odd.h +44 -0
- data/ext/oj/oj.c +1288 -929
- data/ext/oj/oj.h +240 -69
- data/ext/oj/parse.c +1014 -0
- data/ext/oj/parse.h +92 -0
- data/ext/oj/reader.c +223 -0
- data/ext/oj/reader.h +151 -0
- data/ext/oj/resolve.c +127 -0
- data/ext/oj/{cache.h → resolve.h} +6 -13
- data/ext/oj/rxclass.c +133 -0
- data/ext/oj/rxclass.h +27 -0
- data/ext/oj/saj.c +77 -175
- data/ext/oj/scp.c +224 -0
- data/ext/oj/sparse.c +911 -0
- data/ext/oj/stream_writer.c +301 -0
- data/ext/oj/strict.c +162 -0
- data/ext/oj/string_writer.c +480 -0
- data/ext/oj/val_stack.c +98 -0
- data/ext/oj/val_stack.h +188 -0
- data/lib/oj/active_support_helper.rb +41 -0
- data/lib/oj/bag.rb +6 -10
- data/lib/oj/easy_hash.rb +52 -0
- data/lib/oj/json.rb +172 -0
- data/lib/oj/mimic.rb +260 -5
- data/lib/oj/saj.rb +13 -10
- data/lib/oj/schandler.rb +142 -0
- data/lib/oj/state.rb +131 -0
- data/lib/oj/version.rb +1 -1
- data/lib/oj.rb +11 -23
- data/pages/Advanced.md +22 -0
- data/pages/Compatibility.md +25 -0
- data/pages/Custom.md +23 -0
- data/pages/Encoding.md +65 -0
- data/pages/JsonGem.md +79 -0
- data/pages/Modes.md +140 -0
- data/pages/Options.md +250 -0
- data/pages/Rails.md +60 -0
- data/pages/Security.md +20 -0
- data/test/_test_active.rb +76 -0
- data/test/_test_active_mimic.rb +96 -0
- data/test/_test_mimic_rails.rb +126 -0
- data/test/activesupport4/decoding_test.rb +105 -0
- data/test/activesupport4/encoding_test.rb +531 -0
- data/test/activesupport4/test_helper.rb +41 -0
- data/test/activesupport5/decoding_test.rb +125 -0
- data/test/activesupport5/encoding_test.rb +483 -0
- data/test/activesupport5/encoding_test_cases.rb +90 -0
- data/test/activesupport5/test_helper.rb +50 -0
- data/test/activesupport5/time_zone_test_helpers.rb +24 -0
- data/test/helper.rb +27 -0
- data/test/isolated/shared.rb +310 -0
- data/test/isolated/test_mimic_after.rb +13 -0
- data/test/isolated/test_mimic_alone.rb +12 -0
- data/test/isolated/test_mimic_as_json.rb +45 -0
- data/test/isolated/test_mimic_before.rb +13 -0
- data/test/isolated/test_mimic_define.rb +28 -0
- data/test/isolated/test_mimic_rails_after.rb +22 -0
- data/test/isolated/test_mimic_rails_before.rb +21 -0
- data/test/isolated/test_mimic_redefine.rb +15 -0
- data/test/json_gem/json_addition_test.rb +216 -0
- data/test/json_gem/json_common_interface_test.rb +143 -0
- data/test/json_gem/json_encoding_test.rb +109 -0
- data/test/json_gem/json_ext_parser_test.rb +20 -0
- data/test/json_gem/json_fixtures_test.rb +35 -0
- data/test/json_gem/json_generator_test.rb +383 -0
- data/test/json_gem/json_generic_object_test.rb +90 -0
- data/test/json_gem/json_parser_test.rb +470 -0
- data/test/json_gem/json_string_matching_test.rb +42 -0
- data/test/json_gem/test_helper.rb +18 -0
- data/test/perf_compat.rb +130 -0
- data/test/perf_fast.rb +9 -9
- data/test/perf_file.rb +64 -0
- data/test/{perf_obj.rb → perf_object.rb} +24 -10
- data/test/perf_scp.rb +151 -0
- data/test/perf_strict.rb +32 -113
- data/test/sample.rb +2 -3
- data/test/test_compat.rb +474 -0
- data/test/test_custom.rb +355 -0
- data/test/test_debian.rb +53 -0
- data/test/test_fast.rb +66 -16
- data/test/test_file.rb +237 -0
- data/test/test_gc.rb +49 -0
- data/test/test_hash.rb +29 -0
- data/test/test_null.rb +376 -0
- data/test/test_object.rb +1010 -0
- data/test/test_saj.rb +16 -16
- data/test/test_scp.rb +417 -0
- data/test/test_strict.rb +410 -0
- data/test/test_various.rb +815 -0
- data/test/test_writer.rb +308 -0
- data/test/tests.rb +9 -902
- data/test/tests_mimic.rb +14 -0
- data/test/tests_mimic_addition.rb +7 -0
- metadata +253 -38
- data/ext/oj/cache.c +0 -148
- data/ext/oj/foo.rb +0 -6
- data/ext/oj/load.c +0 -1049
- data/test/a.rb +0 -38
- data/test/perf1.rb +0 -64
- data/test/perf2.rb +0 -76
- data/test/perf_obj_old.rb +0 -213
- data/test/test_mimic.rb +0 -208
data/ext/oj/oj.h
CHANGED
@@ -1,31 +1,6 @@
|
|
1
1
|
/* oj.h
|
2
2
|
* Copyright (c) 2011, Peter Ohler
|
3
3
|
* All rights reserved.
|
4
|
-
*
|
5
|
-
* Redistribution and use in source and binary forms, with or without
|
6
|
-
* modification, are permitted provided that the following conditions are met:
|
7
|
-
*
|
8
|
-
* - Redistributions of source code must retain the above copyright notice, this
|
9
|
-
* list of conditions and the following disclaimer.
|
10
|
-
*
|
11
|
-
* - Redistributions in binary form must reproduce the above copyright notice,
|
12
|
-
* this list of conditions and the following disclaimer in the documentation
|
13
|
-
* and/or other materials provided with the distribution.
|
14
|
-
*
|
15
|
-
* - Neither the name of Peter Ohler nor the names of its contributors may be
|
16
|
-
* used to endorse or promote products derived from this software without
|
17
|
-
* specific prior written permission.
|
18
|
-
*
|
19
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
20
|
-
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
21
|
-
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
22
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
23
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
24
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
25
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
26
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
27
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
28
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
29
4
|
*/
|
30
5
|
|
31
6
|
#ifndef __OJ_H__
|
@@ -45,11 +20,13 @@ extern "C" {
|
|
45
20
|
#include "ruby/encoding.h"
|
46
21
|
#endif
|
47
22
|
|
48
|
-
#include
|
49
|
-
#
|
23
|
+
#include <stdint.h>
|
24
|
+
#include <stdbool.h>
|
25
|
+
|
26
|
+
#if USE_PTHREAD_MUTEX
|
50
27
|
#include <pthread.h>
|
51
28
|
#endif
|
52
|
-
#include "
|
29
|
+
#include "cache8.h"
|
53
30
|
|
54
31
|
#ifdef RUBINIUS_RUBY
|
55
32
|
#undef T_RATIONAL
|
@@ -64,9 +41,12 @@ enum st_retval {ST_CONTINUE = 0, ST_STOP = 1, ST_DELETE = 2, ST_CHECK};
|
|
64
41
|
#endif
|
65
42
|
#endif
|
66
43
|
|
67
|
-
#
|
44
|
+
#include "rxclass.h"
|
45
|
+
#include "err.h"
|
68
46
|
|
69
|
-
#define
|
47
|
+
#define INF_VAL "3.0e14159265358979323846"
|
48
|
+
#define NINF_VAL "-3.0e14159265358979323846"
|
49
|
+
#define NAN_VAL "3.3e14159265358979323846"
|
70
50
|
|
71
51
|
typedef enum {
|
72
52
|
Yes = 'y',
|
@@ -78,53 +58,165 @@ typedef enum {
|
|
78
58
|
StrictMode = 's',
|
79
59
|
ObjectMode = 'o',
|
80
60
|
NullMode = 'n',
|
81
|
-
CompatMode = 'c'
|
61
|
+
CompatMode = 'c',
|
62
|
+
RailsMode = 'r',
|
63
|
+
CustomMode = 'C',
|
82
64
|
} Mode;
|
83
65
|
|
84
66
|
typedef enum {
|
85
67
|
UnixTime = 'u',
|
68
|
+
UnixZTime = 'z',
|
86
69
|
XmlTime = 'x',
|
87
70
|
RubyTime = 'r'
|
88
71
|
} TimeFormat;
|
89
72
|
|
73
|
+
typedef enum {
|
74
|
+
NLEsc = 'n',
|
75
|
+
JSONEsc = 'j',
|
76
|
+
XSSEsc = 'x',
|
77
|
+
ASCIIEsc = 'a',
|
78
|
+
JXEsc = 'r', // json
|
79
|
+
RailsEsc = 'R', // rails non escape
|
80
|
+
} Encoding;
|
81
|
+
|
82
|
+
typedef enum {
|
83
|
+
BigDec = 'b',
|
84
|
+
FloatDec = 'f',
|
85
|
+
AutoDec = 'a'
|
86
|
+
} BigLoad;
|
87
|
+
|
88
|
+
typedef enum {
|
89
|
+
ArrayNew = 'A',
|
90
|
+
ArrayType = 'a',
|
91
|
+
ObjectNew = 'O',
|
92
|
+
ObjectType = 'o',
|
93
|
+
} DumpType;
|
94
|
+
|
95
|
+
typedef enum {
|
96
|
+
AutoNan = 'a',
|
97
|
+
NullNan = 'n',
|
98
|
+
HugeNan = 'h',
|
99
|
+
WordNan = 'w',
|
100
|
+
RaiseNan = 'r',
|
101
|
+
} NanDump;
|
102
|
+
|
103
|
+
typedef enum {
|
104
|
+
STRING_IO = 'c',
|
105
|
+
STREAM_IO = 's',
|
106
|
+
FILE_IO = 'f',
|
107
|
+
} StreamWriterType;
|
108
|
+
|
109
|
+
typedef enum {
|
110
|
+
CALLER_DUMP = 'd',
|
111
|
+
CALLER_TO_JSON = 't',
|
112
|
+
CALLER_GENERATE = 'g',
|
113
|
+
// Add the fast versions if necessary. Maybe unparse as well if needed.
|
114
|
+
} DumpCaller;
|
115
|
+
|
90
116
|
typedef struct _DumpOpts {
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
117
|
+
bool use;
|
118
|
+
char indent_str[16];
|
119
|
+
char before_sep[16];
|
120
|
+
char after_sep[16];
|
121
|
+
char hash_nl[16];
|
122
|
+
char array_nl[16];
|
96
123
|
uint8_t indent_size;
|
97
124
|
uint8_t before_size;
|
98
125
|
uint8_t after_size;
|
99
126
|
uint8_t hash_size;
|
100
127
|
uint8_t array_size;
|
128
|
+
char nan_dump; // NanDump
|
129
|
+
bool omit_nil;
|
130
|
+
int max_depth;
|
101
131
|
} *DumpOpts;
|
102
132
|
|
103
133
|
typedef struct _Options {
|
104
|
-
int
|
105
|
-
char
|
106
|
-
char
|
107
|
-
char
|
108
|
-
char
|
109
|
-
char
|
110
|
-
char
|
111
|
-
|
112
|
-
|
113
|
-
|
134
|
+
int indent; // indention for dump, default 2
|
135
|
+
char circular; // YesNo
|
136
|
+
char auto_define; // YesNo
|
137
|
+
char sym_key; // YesNo
|
138
|
+
char escape_mode; // Escape_Mode
|
139
|
+
char mode; // Mode
|
140
|
+
char class_cache; // YesNo
|
141
|
+
char time_format; // TimeFormat
|
142
|
+
char bigdec_as_num; // YesNo
|
143
|
+
char bigdec_load; // BigLoad
|
144
|
+
char to_hash; // YesNo
|
145
|
+
char to_json; // YesNo
|
146
|
+
char as_json; // YesNo
|
147
|
+
char nilnil; // YesNo
|
148
|
+
char empty_string; // YesNo
|
149
|
+
char allow_gc; // allow GC during parse
|
150
|
+
char quirks_mode; // allow single JSON values instead of documents
|
151
|
+
char allow_invalid; // YesNo - allow invalid unicode
|
152
|
+
char create_ok; // YesNo allow create_id
|
153
|
+
char allow_nan; // YEsyNo for parsing only
|
154
|
+
const char *create_id; // 0 or string
|
155
|
+
size_t create_id_len; // length of create_id
|
156
|
+
int sec_prec; // second precision when dumping time
|
157
|
+
char float_prec; // float precision, linked to float_fmt
|
158
|
+
char float_fmt[7]; // float format for dumping, if empty use Ruby
|
159
|
+
VALUE hash_class; // class to use in place of Hash on load
|
160
|
+
VALUE array_class; // class to use in place of Array on load
|
161
|
+
struct _DumpOpts dump_opts;
|
162
|
+
struct _RxClass str_rx;
|
114
163
|
} *Options;
|
115
164
|
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
165
|
+
struct _Out;
|
166
|
+
typedef void (*DumpFunc)(VALUE obj, int depth, struct _Out *out, bool as_ok);
|
167
|
+
|
168
|
+
// rails optimize
|
169
|
+
typedef struct _ROpt {
|
170
|
+
VALUE clas;
|
171
|
+
bool on;
|
172
|
+
DumpFunc dump;
|
173
|
+
} *ROpt;
|
174
|
+
|
175
|
+
typedef struct _ROptTable {
|
176
|
+
int len;
|
177
|
+
int alen;
|
178
|
+
ROpt table;
|
179
|
+
} *ROptTable;
|
180
|
+
|
181
|
+
typedef struct _Out {
|
182
|
+
char *buf;
|
183
|
+
char *end;
|
184
|
+
char *cur;
|
185
|
+
Cache8 circ_cache;
|
186
|
+
slot_t circ_cnt;
|
187
|
+
int indent;
|
188
|
+
int depth; // used by dump_hash
|
189
|
+
Options opts;
|
190
|
+
uint32_t hash_cnt;
|
191
|
+
int allocated;
|
192
|
+
bool omit_nil;
|
193
|
+
int argc;
|
194
|
+
VALUE *argv;
|
195
|
+
DumpCaller caller; // used for the mimic json only
|
196
|
+
ROptTable ropts;
|
197
|
+
} *Out;
|
198
|
+
|
199
|
+
typedef struct _StrWriter {
|
200
|
+
struct _Out out;
|
201
|
+
struct _Options opts;
|
202
|
+
int depth;
|
203
|
+
char *types; // DumpType
|
204
|
+
char *types_end;
|
205
|
+
int keyWritten;
|
206
|
+
} *StrWriter;
|
207
|
+
|
208
|
+
typedef struct _StreamWriter {
|
209
|
+
struct _StrWriter sw;
|
210
|
+
StreamWriterType type;
|
211
|
+
VALUE stream;
|
212
|
+
int fd;
|
213
|
+
} *StreamWriter;
|
123
214
|
|
124
215
|
enum {
|
125
|
-
|
126
|
-
|
127
|
-
|
216
|
+
NO_VAL = 0x00,
|
217
|
+
STR_VAL = 0x01,
|
218
|
+
COL_VAL = 0x02,
|
219
|
+
RUBY_VAL = 0x03
|
128
220
|
};
|
129
221
|
|
130
222
|
typedef struct _Leaf {
|
@@ -134,56 +226,129 @@ typedef struct _Leaf {
|
|
134
226
|
size_t index; // array index, 0 is not set
|
135
227
|
};
|
136
228
|
union {
|
137
|
-
char *str; // pointer to location in json string
|
229
|
+
char *str; // pointer to location in json string or allocated
|
138
230
|
struct _Leaf *elements; // array and hash elements
|
139
231
|
VALUE value;
|
140
232
|
};
|
141
|
-
uint8_t
|
233
|
+
uint8_t rtype;
|
142
234
|
uint8_t parent_type;
|
143
235
|
uint8_t value_type;
|
144
236
|
} *Leaf;
|
145
237
|
|
146
|
-
extern VALUE
|
147
|
-
extern
|
238
|
+
extern VALUE oj_saj_parse(int argc, VALUE *argv, VALUE self);
|
239
|
+
extern VALUE oj_sc_parse(int argc, VALUE *argv, VALUE self);
|
240
|
+
|
241
|
+
extern VALUE oj_strict_parse(int argc, VALUE *argv, VALUE self);
|
242
|
+
extern VALUE oj_strict_sparse(int argc, VALUE *argv, VALUE self);
|
243
|
+
extern VALUE oj_compat_parse(int argc, VALUE *argv, VALUE self);
|
244
|
+
extern VALUE oj_object_parse(int argc, VALUE *argv, VALUE self);
|
245
|
+
extern VALUE oj_custom_parse(int argc, VALUE *argv, VALUE self);
|
148
246
|
|
149
|
-
extern
|
247
|
+
extern VALUE oj_strict_parse_cstr(int argc, VALUE *argv, char *json, size_t len);
|
248
|
+
extern VALUE oj_compat_parse_cstr(int argc, VALUE *argv, char *json, size_t len);
|
249
|
+
extern VALUE oj_object_parse_cstr(int argc, VALUE *argv, char *json, size_t len);
|
250
|
+
extern VALUE oj_custom_parse_cstr(int argc, VALUE *argv, char *json, size_t len);
|
251
|
+
|
252
|
+
extern void oj_parse_options(VALUE ropts, Options copts);
|
253
|
+
|
254
|
+
extern void oj_dump_obj_to_json(VALUE obj, Options copts, Out out);
|
255
|
+
extern void oj_dump_obj_to_json_using_params(VALUE obj, Options copts, Out out, int argc, VALUE *argv);
|
150
256
|
extern void oj_write_obj_to_file(VALUE obj, const char *path, Options copts);
|
151
|
-
extern
|
257
|
+
extern void oj_write_obj_to_stream(VALUE obj, VALUE stream, Options copts);
|
258
|
+
extern void oj_dump_leaf_to_json(Leaf leaf, Options copts, Out out);
|
152
259
|
extern void oj_write_leaf_to_file(Leaf leaf, const char *path, Options copts);
|
153
260
|
|
154
|
-
extern void
|
261
|
+
extern void oj_str_writer_push_key(StrWriter sw, const char *key);
|
262
|
+
extern void oj_str_writer_push_object(StrWriter sw, const char *key);
|
263
|
+
extern void oj_str_writer_push_array(StrWriter sw, const char *key);
|
264
|
+
extern void oj_str_writer_push_value(StrWriter sw, VALUE val, const char *key);
|
265
|
+
extern void oj_str_writer_push_json(StrWriter sw, const char *json, const char *key);
|
266
|
+
extern void oj_str_writer_pop(StrWriter sw);
|
267
|
+
extern void oj_str_writer_pop_all(StrWriter sw);
|
155
268
|
|
156
269
|
extern void oj_init_doc(void);
|
270
|
+
extern void oj_string_writer_init();
|
271
|
+
extern void oj_stream_writer_init();
|
272
|
+
extern void oj_str_writer_init(StrWriter sw);
|
273
|
+
extern VALUE oj_define_mimic_json(int argc, VALUE *argv, VALUE self);
|
274
|
+
extern VALUE oj_mimic_generate(int argc, VALUE *argv, VALUE self);
|
275
|
+
extern VALUE oj_mimic_pretty_generate(int argc, VALUE *argv, VALUE self);
|
276
|
+
extern void oj_parse_mimic_dump_options(VALUE ropts, Options copts);
|
277
|
+
|
278
|
+
extern VALUE oj_mimic_parse(int argc, VALUE *argv, VALUE self);
|
279
|
+
extern VALUE oj_get_json_err_class(const char *err_classname);
|
280
|
+
extern void oj_parse_opt_match_string(RxClass rc, VALUE ropts);
|
157
281
|
|
158
|
-
extern
|
282
|
+
extern VALUE oj_rails_encode(int argc, VALUE *argv, VALUE self);
|
159
283
|
|
160
284
|
extern VALUE Oj;
|
161
285
|
extern struct _Options oj_default_options;
|
162
286
|
#if HAS_ENCODING_SUPPORT
|
163
287
|
extern rb_encoding *oj_utf8_encoding;
|
288
|
+
#else
|
289
|
+
extern VALUE oj_utf8_encoding;
|
164
290
|
#endif
|
165
291
|
|
166
292
|
extern VALUE oj_bag_class;
|
167
293
|
extern VALUE oj_bigdecimal_class;
|
294
|
+
extern VALUE oj_cstack_class;
|
295
|
+
extern VALUE oj_date_class;
|
296
|
+
extern VALUE oj_datetime_class;
|
168
297
|
extern VALUE oj_doc_class;
|
169
|
-
extern VALUE
|
298
|
+
extern VALUE oj_enumerable_class;
|
299
|
+
extern VALUE oj_json_generator_error_class;
|
300
|
+
extern VALUE oj_json_parser_error_class;
|
301
|
+
extern VALUE oj_stream_writer_class;
|
302
|
+
extern VALUE oj_string_writer_class;
|
170
303
|
extern VALUE oj_stringio_class;
|
171
304
|
extern VALUE oj_struct_class;
|
172
|
-
|
305
|
+
|
306
|
+
extern VALUE oj_allow_nan_sym;
|
307
|
+
extern VALUE oj_array_class_sym;
|
308
|
+
extern VALUE oj_array_nl_sym;
|
309
|
+
extern VALUE oj_ascii_only_sym;
|
310
|
+
extern VALUE oj_create_additions_sym;
|
311
|
+
extern VALUE oj_hash_class_sym;
|
312
|
+
extern VALUE oj_indent_sym;
|
313
|
+
extern VALUE oj_max_nesting_sym;
|
314
|
+
extern VALUE oj_object_class_sym;
|
315
|
+
extern VALUE oj_object_nl_sym;
|
316
|
+
extern VALUE oj_quirks_mode_sym;
|
317
|
+
extern VALUE oj_space_before_sym;
|
318
|
+
extern VALUE oj_space_sym;
|
173
319
|
|
174
320
|
extern VALUE oj_slash_string;
|
175
321
|
|
176
322
|
extern ID oj_add_value_id;
|
323
|
+
extern ID oj_array_append_id;
|
177
324
|
extern ID oj_array_end_id;
|
178
325
|
extern ID oj_array_start_id;
|
179
326
|
extern ID oj_as_json_id;
|
327
|
+
extern ID oj_begin_id;
|
328
|
+
extern ID oj_end_id;
|
180
329
|
extern ID oj_error_id;
|
330
|
+
extern ID oj_exclude_end_id;
|
331
|
+
extern ID oj_file_id;
|
332
|
+
extern ID oj_fileno_id;
|
333
|
+
extern ID oj_ftype_id;
|
334
|
+
extern ID oj_has_key_id;
|
181
335
|
extern ID oj_hash_end_id;
|
336
|
+
extern ID oj_hash_key_id;
|
337
|
+
extern ID oj_hash_set_id;
|
182
338
|
extern ID oj_hash_start_id;
|
339
|
+
extern ID oj_iconv_id;
|
183
340
|
extern ID oj_instance_variables_id;
|
184
341
|
extern ID oj_json_create_id;
|
342
|
+
extern ID oj_length_id;
|
185
343
|
extern ID oj_new_id;
|
344
|
+
extern ID oj_parse_id;
|
345
|
+
extern ID oj_pos_id;
|
346
|
+
extern ID oj_read_id;
|
347
|
+
extern ID oj_readpartial_id;
|
348
|
+
extern ID oj_replace_id;
|
349
|
+
extern ID oj_stat_id;
|
186
350
|
extern ID oj_string_id;
|
351
|
+
extern ID oj_to_h_id;
|
187
352
|
extern ID oj_to_hash_id;
|
188
353
|
extern ID oj_to_json_id;
|
189
354
|
extern ID oj_to_s_id;
|
@@ -192,14 +357,20 @@ extern ID oj_to_time_id;
|
|
192
357
|
extern ID oj_tv_nsec_id;
|
193
358
|
extern ID oj_tv_sec_id;
|
194
359
|
extern ID oj_tv_usec_id;
|
360
|
+
extern ID oj_utc_id;
|
195
361
|
extern ID oj_utc_offset_id;
|
362
|
+
extern ID oj_utcq_id;
|
363
|
+
extern ID oj_write_id;
|
196
364
|
|
197
|
-
extern
|
198
|
-
extern
|
365
|
+
extern bool oj_use_hash_alt;
|
366
|
+
extern bool oj_use_array_alt;
|
199
367
|
|
200
|
-
#if
|
368
|
+
#if USE_PTHREAD_MUTEX
|
201
369
|
extern pthread_mutex_t oj_cache_mutex;
|
370
|
+
#elif USE_RB_MUTEX
|
371
|
+
extern VALUE oj_cache_mutex;
|
202
372
|
#endif
|
373
|
+
|
203
374
|
#if defined(__cplusplus)
|
204
375
|
#if 0
|
205
376
|
{ /* satisfy cc-mode */
|