ext/oj/oj.h in oj-2.3.0 vs ext/oj/oj.h in oj-2.4.0

- old
+ new

@@ -103,10 +103,16 @@ ArrayType = 'a', ObjectNew = 'O', ObjectType = 'o', } DumpType; +typedef enum { + STRING_IO = 'c', + STREAM_IO = 's', + FILE_IO = 'f', +} StreamWriterType; + typedef struct _DumpOpts { const char *indent; const char *before_sep; const char *after_sep; const char *hash_nl; @@ -155,10 +161,17 @@ int depth; char *types; // DumpType char *types_end; } *StrWriter; +typedef struct _StreamWriter { + struct _StrWriter sw; + StreamWriterType type; + VALUE stream; + int fd; +} *StreamWriter; + enum { STR_VAL = 0x00, COL_VAL = 0x01, RUBY_VAL = 0x02 }; @@ -184,12 +197,12 @@ extern VALUE oj_strict_parse(int argc, VALUE *argv, VALUE self); extern VALUE oj_compat_parse(int argc, VALUE *argv, VALUE self); extern VALUE oj_object_parse(int argc, VALUE *argv, VALUE self); -extern VALUE oj_strict_parse_cstr(int argc, VALUE *argv, char *json); -extern VALUE oj_compat_parse_cstr(int argc, VALUE *argv, char *json); -extern VALUE oj_object_parse_cstr(int argc, VALUE *argv, char *json); +extern VALUE oj_strict_parse_cstr(int argc, VALUE *argv, char *json, size_t len); +extern VALUE oj_compat_parse_cstr(int argc, VALUE *argv, char *json, size_t len); +extern VALUE oj_object_parse_cstr(int argc, VALUE *argv, char *json, size_t len); extern void oj_parse_options(VALUE ropts, Options copts); extern void oj_dump_obj_to_json(VALUE obj, Options copts, Out out); extern void oj_write_obj_to_file(VALUE obj, const char *path, Options copts);