oj 3.7.4 → 3.13.21

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 (142) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +1352 -0
  3. data/README.md +29 -8
  4. data/RELEASE_NOTES.md +61 -0
  5. data/ext/oj/buf.h +53 -72
  6. data/ext/oj/cache.c +326 -0
  7. data/ext/oj/cache.h +21 -0
  8. data/ext/oj/cache8.c +61 -64
  9. data/ext/oj/cache8.h +12 -39
  10. data/ext/oj/circarray.c +37 -43
  11. data/ext/oj/circarray.h +16 -17
  12. data/ext/oj/code.c +165 -179
  13. data/ext/oj/code.h +27 -29
  14. data/ext/oj/compat.c +174 -194
  15. data/ext/oj/custom.c +809 -866
  16. data/ext/oj/debug.c +132 -0
  17. data/ext/oj/dump.c +848 -863
  18. data/ext/oj/dump.h +81 -67
  19. data/ext/oj/dump_compat.c +85 -123
  20. data/ext/oj/dump_leaf.c +100 -188
  21. data/ext/oj/dump_object.c +527 -656
  22. data/ext/oj/dump_strict.c +315 -338
  23. data/ext/oj/encode.h +7 -34
  24. data/ext/oj/encoder.c +43 -0
  25. data/ext/oj/err.c +40 -29
  26. data/ext/oj/err.h +48 -48
  27. data/ext/oj/extconf.rb +17 -4
  28. data/ext/oj/fast.c +1070 -1087
  29. data/ext/oj/intern.c +301 -0
  30. data/ext/oj/intern.h +26 -0
  31. data/ext/oj/mimic_json.c +469 -436
  32. data/ext/oj/object.c +525 -593
  33. data/ext/oj/odd.c +154 -138
  34. data/ext/oj/odd.h +37 -38
  35. data/ext/oj/oj.c +1325 -986
  36. data/ext/oj/oj.h +333 -316
  37. data/ext/oj/parse.c +1002 -846
  38. data/ext/oj/parse.h +92 -87
  39. data/ext/oj/parser.c +1557 -0
  40. data/ext/oj/parser.h +91 -0
  41. data/ext/oj/rails.c +888 -878
  42. data/ext/oj/rails.h +11 -14
  43. data/ext/oj/reader.c +141 -147
  44. data/ext/oj/reader.h +73 -89
  45. data/ext/oj/resolve.c +41 -62
  46. data/ext/oj/resolve.h +7 -9
  47. data/ext/oj/rxclass.c +71 -75
  48. data/ext/oj/rxclass.h +18 -19
  49. data/ext/oj/saj.c +443 -486
  50. data/ext/oj/saj2.c +602 -0
  51. data/ext/oj/scp.c +88 -113
  52. data/ext/oj/sparse.c +787 -709
  53. data/ext/oj/stream_writer.c +133 -159
  54. data/ext/oj/strict.c +127 -118
  55. data/ext/oj/string_writer.c +230 -249
  56. data/ext/oj/trace.c +34 -41
  57. data/ext/oj/trace.h +19 -19
  58. data/ext/oj/usual.c +1254 -0
  59. data/ext/oj/util.c +136 -0
  60. data/ext/oj/util.h +20 -0
  61. data/ext/oj/val_stack.c +59 -67
  62. data/ext/oj/val_stack.h +91 -129
  63. data/ext/oj/validate.c +46 -0
  64. data/ext/oj/wab.c +342 -353
  65. data/lib/oj/bag.rb +1 -0
  66. data/lib/oj/easy_hash.rb +5 -4
  67. data/lib/oj/error.rb +1 -1
  68. data/lib/oj/json.rb +1 -1
  69. data/lib/oj/mimic.rb +48 -14
  70. data/lib/oj/saj.rb +20 -6
  71. data/lib/oj/state.rb +8 -7
  72. data/lib/oj/version.rb +2 -2
  73. data/lib/oj.rb +0 -8
  74. data/pages/Compatibility.md +1 -1
  75. data/pages/JsonGem.md +15 -0
  76. data/pages/Modes.md +53 -46
  77. data/pages/Options.md +72 -11
  78. data/pages/Parser.md +309 -0
  79. data/pages/Rails.md +73 -22
  80. data/pages/Security.md +1 -1
  81. data/test/activerecord/result_test.rb +7 -2
  82. data/test/activesupport5/abstract_unit.rb +45 -0
  83. data/test/activesupport5/decoding_test.rb +68 -60
  84. data/test/activesupport5/encoding_test.rb +111 -96
  85. data/test/activesupport5/encoding_test_cases.rb +33 -25
  86. data/test/activesupport5/test_helper.rb +43 -21
  87. data/test/activesupport5/time_zone_test_helpers.rb +18 -3
  88. data/test/activesupport6/abstract_unit.rb +44 -0
  89. data/test/activesupport6/decoding_test.rb +133 -0
  90. data/test/activesupport6/encoding_test.rb +507 -0
  91. data/test/activesupport6/encoding_test_cases.rb +98 -0
  92. data/test/activesupport6/test_common.rb +17 -0
  93. data/test/activesupport6/test_helper.rb +163 -0
  94. data/test/activesupport6/time_zone_test_helpers.rb +39 -0
  95. data/test/activesupport7/abstract_unit.rb +49 -0
  96. data/test/activesupport7/decoding_test.rb +125 -0
  97. data/test/activesupport7/encoding_test.rb +486 -0
  98. data/test/activesupport7/encoding_test_cases.rb +104 -0
  99. data/test/activesupport7/time_zone_test_helpers.rb +47 -0
  100. data/test/bar.rb +6 -12
  101. data/test/baz.rb +16 -0
  102. data/test/bug.rb +16 -0
  103. data/test/foo.rb +69 -75
  104. data/test/helper.rb +16 -0
  105. data/test/json_gem/json_common_interface_test.rb +8 -3
  106. data/test/json_gem/json_generator_test.rb +18 -4
  107. data/test/json_gem/json_parser_test.rb +9 -0
  108. data/test/json_gem/test_helper.rb +12 -0
  109. data/test/mem.rb +33 -0
  110. data/test/perf.rb +1 -1
  111. data/test/perf_dump.rb +50 -0
  112. data/test/perf_once.rb +58 -0
  113. data/test/perf_parser.rb +189 -0
  114. data/test/perf_scp.rb +11 -10
  115. data/test/perf_strict.rb +17 -23
  116. data/test/prec.rb +23 -0
  117. data/test/sample_json.rb +1 -1
  118. data/test/test_compat.rb +46 -10
  119. data/test/test_custom.rb +147 -8
  120. data/test/test_fast.rb +62 -2
  121. data/test/test_file.rb +25 -2
  122. data/test/test_gc.rb +13 -0
  123. data/test/test_generate.rb +21 -0
  124. data/test/test_hash.rb +11 -1
  125. data/test/test_integer_range.rb +7 -2
  126. data/test/test_object.rb +85 -9
  127. data/test/test_parser.rb +27 -0
  128. data/test/test_parser_saj.rb +335 -0
  129. data/test/test_parser_usual.rb +217 -0
  130. data/test/test_rails.rb +35 -0
  131. data/test/test_saj.rb +1 -1
  132. data/test/test_scp.rb +5 -5
  133. data/test/test_strict.rb +26 -1
  134. data/test/test_various.rb +87 -65
  135. data/test/test_wab.rb +2 -0
  136. data/test/test_writer.rb +19 -2
  137. data/test/tests.rb +1 -1
  138. data/test/zoo.rb +13 -0
  139. metadata +60 -110
  140. data/ext/oj/hash.c +0 -163
  141. data/ext/oj/hash.h +0 -46
  142. data/ext/oj/hash_test.c +0 -512
data/ext/oj/code.c CHANGED
@@ -1,235 +1,221 @@
1
- /* code.c
2
- * Copyright (c) 2017, Peter Ohler
3
- * All rights reserved.
4
- */
1
+ // Copyright (c) 2017 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
5
3
 
6
4
  #include "code.h"
5
+
7
6
  #include "dump.h"
8
7
 
9
- inline static VALUE
10
- resolve_classname(VALUE mod, const char *classname) {
11
- VALUE clas = Qundef;
12
- ID ci = rb_intern(classname);
8
+ inline static VALUE resolve_classname(VALUE mod, const char *classname) {
9
+ VALUE clas = Qundef;
10
+ ID ci = rb_intern(classname);
13
11
 
14
12
  if (rb_const_defined_at(mod, ci)) {
15
- clas = rb_const_get_at(mod, ci);
13
+ clas = rb_const_get_at(mod, ci);
16
14
  }
17
15
  return clas;
18
16
  }
19
17
 
20
- static VALUE
21
- path2class(const char *name) {
22
- char class_name[1024];
23
- VALUE clas;
24
- char *end = class_name + sizeof(class_name) - 1;
25
- char *s;
26
- const char *n = name;
18
+ static VALUE path2class(const char *name) {
19
+ char class_name[1024];
20
+ VALUE clas;
21
+ char * end = class_name + sizeof(class_name) - 1;
22
+ char * s;
23
+ const char *n = name;
27
24
 
28
25
  clas = rb_cObject;
29
26
  for (s = class_name; '\0' != *n; n++) {
30
- if (':' == *n) {
31
- *s = '\0';
32
- n++;
33
- if (':' != *n) {
34
- return Qundef;
35
- }
36
- if (Qundef == (clas = resolve_classname(clas, class_name))) {
37
- return Qundef;
38
- }
39
- s = class_name;
40
- } else if (end <= s) {
41
- return Qundef;
42
- } else {
43
- *s++ = *n;
44
- }
27
+ if (':' == *n) {
28
+ *s = '\0';
29
+ n++;
30
+ if (':' != *n) {
31
+ return Qundef;
32
+ }
33
+ if (Qundef == (clas = resolve_classname(clas, class_name))) {
34
+ return Qundef;
35
+ }
36
+ s = class_name;
37
+ } else if (end <= s) {
38
+ return Qundef;
39
+ } else {
40
+ *s++ = *n;
41
+ }
45
42
  }
46
43
  *s = '\0';
47
44
 
48
45
  return resolve_classname(clas, class_name);
49
46
  }
50
47
 
51
- bool
52
- oj_code_dump(Code codes, VALUE obj, int depth, Out out) {
53
- VALUE clas = rb_obj_class(obj);
54
- Code c = codes;
48
+ bool oj_code_dump(Code codes, VALUE obj, int depth, Out out) {
49
+ VALUE clas = rb_obj_class(obj);
50
+ Code c = codes;
55
51
 
56
52
  for (; NULL != c->name; c++) {
57
- if (Qundef == c->clas) { // indicates not defined
58
- continue;
59
- }
60
- if (Qnil == c->clas) {
61
- c->clas = path2class(c->name);
62
- }
63
- if (clas == c->clas && c->active) {
64
- c->encode(obj, depth, out);
65
- return true;
66
- }
53
+ if (Qundef == c->clas) { // indicates not defined
54
+ continue;
55
+ }
56
+ if (Qnil == c->clas) {
57
+ c->clas = path2class(c->name);
58
+ }
59
+ if (clas == c->clas && c->active) {
60
+ c->encode(obj, depth, out);
61
+ return true;
62
+ }
67
63
  }
68
64
  return false;
69
65
  }
70
66
 
71
67
  VALUE
72
68
  oj_code_load(Code codes, VALUE clas, VALUE args) {
73
- Code c = codes;
69
+ Code c = codes;
74
70
 
75
71
  for (; NULL != c->name; c++) {
76
- if (Qundef == c->clas) { // indicates not defined
77
- continue;
78
- }
79
- if (Qnil == c->clas) {
80
- c->clas = path2class(c->name);
81
- }
82
- if (clas == c->clas) {
83
- if (NULL == c->decode) {
84
- break;
85
- }
86
- return c->decode(clas, args);
87
- }
72
+ if (Qundef == c->clas) { // indicates not defined
73
+ continue;
74
+ }
75
+ if (Qnil == c->clas) {
76
+ c->clas = path2class(c->name);
77
+ }
78
+ if (clas == c->clas) {
79
+ if (NULL == c->decode) {
80
+ break;
81
+ }
82
+ return c->decode(clas, args);
83
+ }
88
84
  }
89
85
  return Qnil;
90
86
  }
91
87
 
92
- void
93
- oj_code_set_active(Code codes, VALUE clas, bool active) {
94
- Code c = codes;
88
+ void oj_code_set_active(Code codes, VALUE clas, bool active) {
89
+ Code c = codes;
95
90
 
96
91
  for (; NULL != c->name; c++) {
97
- if (Qundef == c->clas) { // indicates not defined
98
- continue;
99
- }
100
- if (Qnil == c->clas) {
101
- c->clas = path2class(c->name);
102
- }
103
- if (clas == c->clas || Qnil == clas) {
104
- c->active = active;
105
- if (Qnil != clas) {
106
- break;
107
- }
108
- }
92
+ if (Qundef == c->clas) { // indicates not defined
93
+ continue;
94
+ }
95
+ if (Qnil == c->clas) {
96
+ c->clas = path2class(c->name);
97
+ }
98
+ if (clas == c->clas || Qnil == clas) {
99
+ c->active = active;
100
+ if (Qnil != clas) {
101
+ break;
102
+ }
103
+ }
109
104
  }
110
105
  }
111
106
 
112
- bool
113
- oj_code_has(Code codes, VALUE clas, bool encode) {
114
- Code c = codes;
107
+ bool oj_code_has(Code codes, VALUE clas, bool encode) {
108
+ Code c = codes;
115
109
 
116
110
  for (; NULL != c->name; c++) {
117
- if (Qundef == c->clas) { // indicates not defined
118
- continue;
119
- }
120
- if (Qnil == c->clas) {
121
- c->clas = path2class(c->name);
122
- }
123
- if (clas == c->clas) {
124
- if (encode) {
125
- return c->active && NULL != c->encode;
126
- } else {
127
- return c->active && NULL != c->decode;
128
- }
129
- }
111
+ if (Qundef == c->clas) { // indicates not defined
112
+ continue;
113
+ }
114
+ if (Qnil == c->clas) {
115
+ c->clas = path2class(c->name);
116
+ }
117
+ if (clas == c->clas) {
118
+ if (encode) {
119
+ return c->active && NULL != c->encode;
120
+ } else {
121
+ return c->active && NULL != c->decode;
122
+ }
123
+ }
130
124
  }
131
125
  return false;
132
126
  }
133
127
 
134
- void
135
- oj_code_attrs(VALUE obj, Attr attrs, int depth, Out out, bool with_class) {
136
- int d2 = depth + 1;
137
- int d3 = d2 + 1;
138
- size_t sep_len = out->opts->dump_opts.before_size + out->opts->dump_opts.after_size + 2;
139
- const char *classname = rb_obj_classname(obj);
140
- size_t len = strlen(classname);
141
- size_t size = d2 * out->indent + 10 + len + out->opts->create_id_len + sep_len;
142
- bool no_comma = true;
143
-
128
+ void oj_code_attrs(VALUE obj, Attr attrs, int depth, Out out, bool with_class) {
129
+ int d2 = depth + 1;
130
+ int d3 = d2 + 1;
131
+ size_t sep_len = out->opts->dump_opts.before_size + out->opts->dump_opts.after_size + 2;
132
+ const char *classname = rb_obj_classname(obj);
133
+ size_t len = strlen(classname);
134
+ size_t size = d2 * out->indent + 10 + len + out->opts->create_id_len + sep_len;
135
+ bool no_comma = true;
136
+
144
137
  assure_size(out, size);
145
138
  *out->cur++ = '{';
146
139
 
147
140
  if (with_class) {
148
- fill_indent(out, d2);
149
- *out->cur++ = '"';
150
- memcpy(out->cur, out->opts->create_id, out->opts->create_id_len);
151
- out->cur += out->opts->create_id_len;
152
- *out->cur++ = '"';
153
- if (0 < out->opts->dump_opts.before_size) {
154
- strcpy(out->cur, out->opts->dump_opts.before_sep);
155
- out->cur += out->opts->dump_opts.before_size;
156
- }
157
- *out->cur++ = ':';
158
- if (0 < out->opts->dump_opts.after_size) {
159
- strcpy(out->cur, out->opts->dump_opts.after_sep);
160
- out->cur += out->opts->dump_opts.after_size;
161
- }
162
- *out->cur++ = '"';
163
- memcpy(out->cur, classname, len);
164
- out->cur += len;
165
- *out->cur++ = '"';
166
- no_comma = false;
141
+ fill_indent(out, d2);
142
+ *out->cur++ = '"';
143
+ APPEND_CHARS(out->cur, out->opts->create_id, out->opts->create_id_len);
144
+ *out->cur++ = '"';
145
+ if (0 < out->opts->dump_opts.before_size) {
146
+ APPEND_CHARS(out->cur, out->opts->dump_opts.before_sep, out->opts->dump_opts.before_size);
147
+ }
148
+ *out->cur++ = ':';
149
+ if (0 < out->opts->dump_opts.after_size) {
150
+ APPEND_CHARS(out->cur, out->opts->dump_opts.after_sep, out->opts->dump_opts.after_size);
151
+ }
152
+ *out->cur++ = '"';
153
+ APPEND_CHARS(out->cur, classname, len);
154
+ *out->cur++ = '"';
155
+ no_comma = false;
167
156
  }
168
157
  size = d3 * out->indent + 2;
169
158
  for (; NULL != attrs->name; attrs++) {
170
- assure_size(out, size + attrs->len + sep_len + 2);
171
- if (no_comma) {
172
- no_comma = false;
173
- } else {
174
- *out->cur++ = ',';
175
- }
176
- fill_indent(out, d2);
177
- *out->cur++ = '"';
178
- memcpy(out->cur, attrs->name, attrs->len);
179
- out->cur += attrs->len;
180
- *out->cur++ = '"';
181
- if (0 < out->opts->dump_opts.before_size) {
182
- strcpy(out->cur, out->opts->dump_opts.before_sep);
183
- out->cur += out->opts->dump_opts.before_size;
184
- }
185
- *out->cur++ = ':';
186
- if (0 < out->opts->dump_opts.after_size) {
187
- strcpy(out->cur, out->opts->dump_opts.after_sep);
188
- out->cur += out->opts->dump_opts.after_size;
189
- }
190
- if (Qundef == attrs->value) {
191
- if (Qundef != attrs->time) {
192
- switch (out->opts->time_format) {
193
- case RubyTime: oj_dump_ruby_time(attrs->time, out); break;
194
- case XmlTime: oj_dump_xml_time(attrs->time, out); break;
195
- case UnixZTime: oj_dump_time(attrs->time, out, true); break;
196
- case UnixTime:
197
- default: oj_dump_time(attrs->time, out, false); break;
198
- }
199
- } else {
200
- char buf[32];
201
- char *b = buf + sizeof(buf) - 1;
202
- int neg = 0;
203
- long num = attrs->num;
204
-
205
- if (0 > num) {
206
- neg = 1;
207
- num = -num;
208
- }
209
- *b-- = '\0';
210
- if (0 < num) {
211
- for (; 0 < num; num /= 10, b--) {
212
- *b = (num % 10) + '0';
213
- }
214
- if (neg) {
215
- *b = '-';
216
- } else {
217
- b++;
218
- }
219
- } else {
220
- *b = '0';
221
- }
222
- assure_size(out, (sizeof(buf) - (b - buf)));
223
- for (; '\0' != *b; b++) {
224
- *out->cur++ = *b;
225
- }
226
- }
227
- } else {
228
- oj_dump_compat_val(attrs->value, d3, out, true);
229
- }
159
+ assure_size(out, size + attrs->len + sep_len + 2);
160
+ if (no_comma) {
161
+ no_comma = false;
162
+ } else {
163
+ *out->cur++ = ',';
164
+ }
165
+ fill_indent(out, d2);
166
+ *out->cur++ = '"';
167
+ APPEND_CHARS(out->cur, attrs->name, attrs->len);
168
+ *out->cur++ = '"';
169
+ if (0 < out->opts->dump_opts.before_size) {
170
+ APPEND_CHARS(out->cur, out->opts->dump_opts.before_sep, out->opts->dump_opts.before_size);
171
+ }
172
+ *out->cur++ = ':';
173
+ if (0 < out->opts->dump_opts.after_size) {
174
+ APPEND_CHARS(out->cur, out->opts->dump_opts.after_sep, out->opts->dump_opts.after_size);
175
+ }
176
+ if (Qundef == attrs->value) {
177
+ if (Qundef != attrs->time) {
178
+ switch (out->opts->time_format) {
179
+ case RubyTime: oj_dump_ruby_time(attrs->time, out); break;
180
+ case XmlTime: oj_dump_xml_time(attrs->time, out); break;
181
+ case UnixZTime: oj_dump_time(attrs->time, out, true); break;
182
+ case UnixTime:
183
+ default: oj_dump_time(attrs->time, out, false); break;
184
+ }
185
+ } else {
186
+ char buf[32];
187
+ char *b = buf + sizeof(buf) - 1;
188
+ int neg = 0;
189
+ long num = attrs->num;
190
+ size_t cnt = 0;
191
+
192
+ if (0 > num) {
193
+ neg = 1;
194
+ num = -num;
195
+ }
196
+ *b-- = '\0';
197
+ if (0 < num) {
198
+ for (; 0 < num; num /= 10, b--) {
199
+ *b = (num % 10) + '0';
200
+ }
201
+ if (neg) {
202
+ *b = '-';
203
+ } else {
204
+ b++;
205
+ }
206
+ } else {
207
+ *b = '0';
208
+ }
209
+ cnt = sizeof(buf) - (b - buf) - 1;
210
+ assure_size(out, cnt);
211
+ APPEND_CHARS(out->cur, b, cnt);
212
+ }
213
+ } else {
214
+ oj_dump_compat_val(attrs->value, d3, out, true);
215
+ }
230
216
  }
231
217
  assure_size(out, depth * out->indent + 2);
232
218
  fill_indent(out, depth);
233
219
  *out->cur++ = '}';
234
- *out->cur = '\0';
220
+ *out->cur = '\0';
235
221
  }
data/ext/oj/code.h CHANGED
@@ -1,42 +1,40 @@
1
- /* code.h
2
- * Copyright (c) 2017, Peter Ohler
3
- * All rights reserved.
4
- */
1
+ // Copyright (c) 2017 Peter Ohler. All rights reserved.
2
+ // Licensed under the MIT License. See LICENSE file in the project root for license details.
5
3
 
6
- #ifndef __OJ_CODE_H__
7
- #define __OJ_CODE_H__
4
+ #ifndef OJ_CODE_H
5
+ #define OJ_CODE_H
8
6
 
9
7
  #include <ruby.h>
10
8
 
11
9
  #include "oj.h"
12
10
 
13
- typedef void (*EncodeFunc)(VALUE obj, int depth, Out out);
14
- typedef VALUE (*DecodeFunc)(VALUE clas, VALUE args);
11
+ typedef void (*EncodeFunc)(VALUE obj, int depth, Out out);
12
+ typedef VALUE (*DecodeFunc)(VALUE clas, VALUE args);
15
13
 
16
- typedef struct _Code {
17
- const char *name;
18
- VALUE clas;
19
- EncodeFunc encode;
20
- DecodeFunc decode;
21
- bool active; // For compat mode.
22
- } *Code;
14
+ typedef struct _code {
15
+ const char *name;
16
+ VALUE clas;
17
+ EncodeFunc encode;
18
+ DecodeFunc decode;
19
+ bool active; // For compat mode.
20
+ } * Code;
23
21
 
24
22
  // Used by encode functions.
25
- typedef struct _Attr {
26
- const char *name;
27
- int len;
28
- VALUE value;
29
- long num;
30
- VALUE time;
31
- } *Attr;
23
+ typedef struct _attr {
24
+ const char *name;
25
+ int len;
26
+ VALUE value;
27
+ long num;
28
+ VALUE time;
29
+ } * Attr;
32
30
 
33
- extern bool oj_code_dump(Code codes, VALUE obj, int depth, Out out);
34
- extern VALUE oj_code_load(Code codes, VALUE clas, VALUE args);
35
- extern void oj_code_set_active(Code codes, VALUE clas, bool active);
36
- extern bool oj_code_has(Code codes, VALUE clas, bool encode);
31
+ extern bool oj_code_dump(Code codes, VALUE obj, int depth, Out out);
32
+ extern VALUE oj_code_load(Code codes, VALUE clas, VALUE args);
33
+ extern void oj_code_set_active(Code codes, VALUE clas, bool active);
34
+ extern bool oj_code_has(Code codes, VALUE clas, bool encode);
37
35
 
38
- extern void oj_code_attrs(VALUE obj, Attr attrs, int depth, Out out, bool with_class);
36
+ extern void oj_code_attrs(VALUE obj, Attr attrs, int depth, Out out, bool with_class);
39
37
 
40
- extern struct _Code oj_compat_codes[];
38
+ extern struct _code oj_compat_codes[];
41
39
 
42
- #endif /* __OJ_CODE_H__ */
40
+ #endif /* OJ_CODE_H */