Ruby
1.9.3p551(2014-11-13revision48407)
|
#include "generator.h"
Go to the source code of this file.
Macros | |
#define | PRIsVALUE "s" |
#define | RB_OBJ_CLASSNAME(obj) rb_obj_classname(obj) |
#define | RB_OBJ_STRING(obj) StringValueCStr(obj) |
#define PRIsVALUE "s" |
Definition at line 12 of file generator.c.
Referenced by generate_json_float().
#define RB_OBJ_CLASSNAME | ( | obj | ) | rb_obj_classname(obj) |
Definition at line 13 of file generator.c.
#define RB_OBJ_STRING | ( | obj | ) | StringValueCStr(obj) |
Definition at line 14 of file generator.c.
Referenced by generate_json_float().
Definition at line 232 of file generator.c.
References buf, c, end, fbuffer_append(), len, NULL, p, ptr, RSTRING_LEN, RSTRING_PTR, start, and unicode_escape().
Referenced by generate_json_string().
Definition at line 134 of file generator.c.
References buf, ch, fbuffer_append(), fbuffer_append_char(), halfBase, halfMask, halfShift, isLegalUTF8(), offsetsFromUTF8, rb_path2class(), rb_raise(), RSTRING_LEN, RSTRING_PTR, trailingBytesForUTF8, UNI_MAX_BMP, UNI_MAX_UTF16, UNI_REPLACEMENT_CHAR, UNI_SUR_HIGH_START, UNI_SUR_LOW_END, UNI_SUR_LOW_START, and unicode_escape_to_buffer().
Referenced by generate_json_string().
Definition at line 1300 of file generator.c.
References GET_STATE, Qfalse, and Qtrue.
Referenced by Init_generator().
Definition at line 743 of file generator.c.
References GET_STATE, i_respond_to_p, i_send, Qnil, rb_funcall(), and RTEST.
Referenced by Init_generator().
Definition at line 1226 of file generator.c.
References GET_STATE, and rb_str_new2().
Referenced by Init_generator().
Definition at line 1237 of file generator.c.
References Check_Type, GET_STATE, len, NULL, Qnil, RSTRING_LEN, RSTRING_PTR, ruby_xfree(), strdup, and T_STRING.
Referenced by Init_generator().
Definition at line 1312 of file generator.c.
References GET_STATE, Qfalse, and Qtrue.
Referenced by Init_generator().
Definition at line 1263 of file generator.c.
References GET_STATE, Qfalse, and Qtrue.
Referenced by Init_generator().
Definition at line 634 of file generator.c.
References Check_Type, depth, FIX2LONG, fstrndup(), GET_STATE, i_allow_nan, i_array_nl, i_ascii_only, i_depth, i_indent, i_max_nesting, i_object_nl, i_quirks_mode, i_space, i_space_before, ID2SYM, len, NIL_P, option_given_p, rb_convert_type(), rb_eArgError, rb_hash_aref(), rb_raise(), RSTRING_LEN, RSTRING_PTR, RTEST, T_FIXNUM, T_HASH, and T_STRING.
Referenced by cState_initialize(), and Init_generator().
Definition at line 1346 of file generator.c.
References GET_STATE, and LONG2FIX.
Referenced by Init_generator().
Definition at line 1358 of file generator.c.
References Check_Type, FIX2LONG, GET_STATE, and T_FIXNUM.
Referenced by Init_generator().
Definition at line 1060 of file generator.c.
References CJSON_SAFE_STATE_PROTOTYPE, i_dup, i_new, i_SAFE_STATE_PROTOTYPE, mJSON, NIL_P, opts, rb_cHash, rb_const_get(), rb_funcall(), and rb_obj_is_kind_of().
Referenced by Init_generator(), and mObject_to_json().
Definition at line 982 of file generator.c.
References args, CRegexp_MULTILINE, cState_partial_generate(), eGeneratorError, GET_STATE, i_match, NIL_P, rb_class_new_instance(), rb_cRegexp, rb_funcall(), rb_raise(), rb_str_new2(), and result.
Referenced by Init_generator().
Definition at line 1079 of file generator.c.
References GET_STATE, and rb_str_new2().
Referenced by Init_generator().
Definition at line 1090 of file generator.c.
References Check_Type, GET_STATE, len, NULL, Qnil, RSTRING_LEN, RSTRING_PTR, ruby_xfree(), strdup, and T_STRING.
Referenced by Init_generator().
Definition at line 1032 of file generator.c.
References JSON_Generator_StateStruct::array_delim, JSON_Generator_StateStruct::array_nl, JSON_Generator_StateStruct::array_nl_len, Data_Get_Struct, fbuffer_dup(), fstrndup(), JSON_Generator_StateStruct::indent, JSON_Generator_StateStruct::indent_len, MEMCPY, obj, JSON_Generator_StateStruct::object_delim, JSON_Generator_StateStruct::object_delim2, JSON_Generator_StateStruct::object_nl, JSON_Generator_StateStruct::object_nl_len, rb_eArgError, rb_raise(), JSON_Generator_StateStruct::space, JSON_Generator_StateStruct::space_before, JSON_Generator_StateStruct::space_before_len, and JSON_Generator_StateStruct::space_len.
Referenced by Init_generator().
Definition at line 1016 of file generator.c.
References cState_configure(), GET_STATE, NIL_P, opts, and rb_scan_args().
Referenced by Init_generator().
Definition at line 1275 of file generator.c.
References GET_STATE, and LONG2FIX.
Referenced by Init_generator().
Definition at line 1287 of file generator.c.
References Check_Type, FIX2LONG, GET_STATE, and T_FIXNUM.
Referenced by Init_generator().
Definition at line 1190 of file generator.c.
References GET_STATE, and rb_str_new2().
Referenced by Init_generator().
Definition at line 1202 of file generator.c.
References Check_Type, GET_STATE, len, NULL, Qnil, RSTRING_LEN, RSTRING_PTR, ruby_xfree(), strdup, and T_STRING.
Referenced by Init_generator().
Definition at line 967 of file generator.c.
References cState_prepare_buffer(), fbuffer_to_s(), generate_json(), and GET_STATE.
Referenced by cState_generate(), and mObject_to_json().
Definition at line 930 of file generator.c.
References fbuffer_alloc(), fbuffer_alloc_with_length(), fbuffer_append(), fbuffer_append_char(), fbuffer_clear(), and GET_STATE.
Referenced by cState_partial_generate().
Definition at line 1323 of file generator.c.
References GET_STATE, Qfalse, and Qtrue.
Referenced by Init_generator().
Definition at line 1334 of file generator.c.
References GET_STATE, Qnil, and RTEST.
Referenced by Init_generator().
Definition at line 622 of file generator.c.
References Data_Wrap_Struct(), NULL, State_allocate(), and State_free().
Referenced by Init_generator().
Definition at line 1116 of file generator.c.
References GET_STATE, and rb_str_new2().
Referenced by Init_generator().
Definition at line 1153 of file generator.c.
References GET_STATE, and rb_str_new2().
Referenced by Init_generator().
Definition at line 1164 of file generator.c.
References Check_Type, GET_STATE, len, NULL, Qnil, RSTRING_LEN, RSTRING_PTR, ruby_xfree(), strdup, and T_STRING.
Referenced by Init_generator().
Definition at line 1128 of file generator.c.
References Check_Type, GET_STATE, len, NULL, Qnil, RSTRING_LEN, RSTRING_PTR, ruby_xfree(), strdup, and T_STRING.
Referenced by Init_generator().
Definition at line 721 of file generator.c.
References GET_STATE, i_allow_nan, i_array_nl, i_ascii_only, i_depth, i_indent, i_max_nesting, i_object_nl, i_quirks_mode, i_space, i_space_before, ID2SYM, LONG2FIX, Qfalse, Qtrue, rb_hash_aset(), rb_hash_new(), rb_str_new(), and result.
Referenced by Init_generator().
|
static |
Definition at line 306 of file generator.c.
References ALLOC, FBUFFER_INITIAL_LENGTH, FBufferStruct::initial_length, and memset().
Referenced by cState_prepare_buffer(), and fbuffer_dup().
Definition at line 314 of file generator.c.
References ALLOC, assert, FBufferStruct::initial_length, and memset().
Referenced by cState_prepare_buffer(), and fbuffer_dup().
Definition at line 352 of file generator.c.
References fbuffer_inc_capa(), FBufferStruct::len, len, MEMCPY, and FBufferStruct::ptr.
Referenced by convert_UTF8_to_JSON(), convert_UTF8_to_JSON_ASCII(), cState_prepare_buffer(), fbuffer_append_long(), fbuffer_append_str(), fbuffer_dup(), generate_json_array(), generate_json_false(), generate_json_null(), generate_json_object(), generate_json_true(), and unicode_escape_to_buffer().
Definition at line 371 of file generator.c.
References fbuffer_inc_capa(), FBufferStruct::len, and FBufferStruct::ptr.
Referenced by convert_UTF8_to_JSON_ASCII(), cState_prepare_buffer(), generate_json_array(), generate_json_object(), and generate_json_string().
Definition at line 400 of file generator.c.
References buf, fbuffer_append(), fltoa(), and len.
Referenced by generate_json_fixnum().
Definition at line 361 of file generator.c.
References fbuffer_append(), len, RB_GC_GUARD, RSTRING_LEN, and StringValuePtr.
Referenced by generate_json(), generate_json_bignum(), and generate_json_float().
Definition at line 330 of file generator.c.
References FBufferStruct::len.
Referenced by cState_prepare_buffer().
Definition at line 407 of file generator.c.
References fbuffer_alloc(), fbuffer_alloc_with_length(), fbuffer_append(), FBUFFER_PAIR, FBufferStruct::len, len, and result.
Referenced by cState_init_copy().
Definition at line 324 of file generator.c.
References FBufferStruct::ptr, and ruby_xfree().
Referenced by fbuffer_to_s(), generate_json_array(), generate_json_float(), generate_json_object(), and State_free().
Definition at line 335 of file generator.c.
References ALLOC_N, FBufferStruct::capa, FBufferStruct::initial_length, FBufferStruct::len, FBufferStruct::ptr, and REALLOC_N.
Referenced by fbuffer_append(), and fbuffer_append_char().
Definition at line 959 of file generator.c.
References fbuffer_free(), FBUFFER_PAIR, FORCE_UTF8, rb_str_new(), and result.
Referenced by cState_partial_generate().
Definition at line 387 of file generator.c.
References buf, and freverse().
Referenced by fbuffer_append_long().
|
static |
Definition at line 296 of file generator.c.
References ALLOC_N, NULL, and result.
Referenced by cState_configure(), and cState_init_copy().
|
static |
Definition at line 897 of file generator.c.
References Check_Type, CLASS_OF, fbuffer_append_str(), generate_json_array(), generate_json_bignum(), generate_json_false(), generate_json_fixnum(), generate_json_float(), generate_json_null(), generate_json_object(), generate_json_string(), generate_json_true(), i_to_json, i_to_s, klass, Qfalse, Qnil, Qtrue, rb_cArray, rb_cBignum, rb_cFixnum, rb_cFloat, rb_cHash, rb_cString, rb_funcall(), rb_respond_to(), and T_STRING.
Referenced by cState_partial_generate(), generate_json_array(), and generate_json_object().
|
static |
Definition at line 802 of file generator.c.
References JSON_Generator_StateStruct::array_delim, JSON_Generator_StateStruct::array_nl, JSON_Generator_StateStruct::array_nl_len, JSON_Generator_StateStruct::depth, depth, eNestingError, fbuffer_append(), fbuffer_append_char(), fbuffer_free(), FBUFFER_LEN, FBUFFER_PTR, generate_json(), i, JSON_Generator_StateStruct::indent, JSON_Generator_StateStruct::indent_len, JSON_Generator_StateStruct::max_nesting, RARRAY_LEN, rb_ary_entry(), and rb_raise().
Referenced by generate_json().
|
static |
Definition at line 874 of file generator.c.
References fbuffer_append_str(), i_to_s, and rb_funcall().
Referenced by generate_json().
|
static |
Definition at line 859 of file generator.c.
References fbuffer_append().
Referenced by generate_json().
|
static |
Definition at line 869 of file generator.c.
References fbuffer_append_long(), and FIX2LONG.
Referenced by generate_json().
|
static |
Definition at line 880 of file generator.c.
References JSON_Generator_StateStruct::allow_nan, eGeneratorError, fbuffer_append_str(), fbuffer_free(), i_to_s, isinf(), isnan, PRIsVALUE, rb_funcall(), RB_OBJ_STRING, rb_raise(), RFLOAT_VALUE, and value.
Referenced by generate_json().
|
static |
Definition at line 854 of file generator.c.
References fbuffer_append().
Referenced by generate_json().
|
static |
Definition at line 753 of file generator.c.
References Check_Type, JSON_Generator_StateStruct::depth, depth, eNestingError, fbuffer_append(), fbuffer_append_char(), fbuffer_free(), FBUFFER_LEN, FBUFFER_PTR, generate_json(), i, i_keys, i_to_s, JSON_Generator_StateStruct::indent, JSON_Generator_StateStruct::indent_len, key, keys, JSON_Generator_StateStruct::max_nesting, JSON_Generator_StateStruct::object_delim, JSON_Generator_StateStruct::object_delim2, JSON_Generator_StateStruct::object_nl, JSON_Generator_StateStruct::object_nl_len, RARRAY_LEN, rb_ary_entry(), rb_funcall(), rb_hash_aref(), rb_raise(), and T_STRING.
Referenced by generate_json().
|
static |
Definition at line 840 of file generator.c.
References JSON_Generator_StateStruct::ascii_only, convert_UTF8_to_JSON(), convert_UTF8_to_JSON_ASCII(), fbuffer_append_char(), and rb_funcall().
Referenced by generate_json().
|
static |
Definition at line 864 of file generator.c.
References fbuffer_append().
Referenced by generate_json().
void Init_generator | ( | ) |
Definition at line 1368 of file generator.c.
References CJSON_SAFE_STATE_PROTOTYPE, CRegexp_MULTILINE, cState, cState_allow_nan_p(), cState_aref(), cState_array_nl(), cState_array_nl_set(), cState_ascii_only_p(), cState_check_circular_p(), cState_configure(), cState_depth(), cState_depth_set(), cState_from_state_s(), cState_generate(), cState_indent(), cState_indent_set(), cState_init_copy(), cState_initialize(), cState_max_nesting(), cState_max_nesting_set(), cState_object_nl(), cState_object_nl_set(), cState_quirks_mode_p(), cState_quirks_mode_set(), cState_s_allocate(), cState_space(), cState_space_before(), cState_space_before_set(), cState_space_set(), cState_to_h(), eGeneratorError, eNestingError, i_allow_nan, i_aref, i_array_nl, i_ascii_only, i_create_id, i_depth, i_dup, i_extend, i_indent, i_key_p, i_keys, i_match, i_max_nesting, i_new, i_object_nl, i_pack, i_quirks_mode, i_respond_to_p, i_SAFE_STATE_PROTOTYPE, i_send, i_space, i_space_before, i_to_json, i_to_s, i_unpack, mArray, mArray_to_json(), mBignum, mBignum_to_json(), mExt, mFalseClass, mFalseClass_to_json(), mFixnum, mFixnum_to_json(), mFloat, mFloat_to_json(), mGenerator, mGeneratorMethods, mHash, mHash_to_json(), mJSON, mNilClass, mNilClass_to_json(), mObject, mObject_to_json(), mString, mString_Extend, mString_Extend_json_create(), mString_included_s(), mString_to_json(), mString_to_json_raw(), mString_to_json_raw_object(), mTrueClass, mTrueClass_to_json(), Qnil, rb_cObject, rb_const_get(), rb_cRegexp, rb_define_alias(), rb_define_alloc_func(), rb_define_class_under(), rb_define_method(), rb_define_module(), rb_define_module_under(), rb_define_singleton_method(), rb_funcall(), rb_intern, rb_path2class(), rb_require(), and rb_str_new2().
Definition at line 86 of file generator.c.
Referenced by convert_UTF8_to_JSON_ASCII().
Definition at line 454 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 473 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 570 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 463 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 483 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 441 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator(), and mString_to_json_raw().
Definition at line 580 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 592 of file generator.c.
References Check_Type, cState, cState_from_state_s(), cState_partial_generate(), i_to_s, rb_funcall(), rb_scan_args(), and T_STRING.
Referenced by Init_generator().
Definition at line 547 of file generator.c.
References ary, Check_Type, i_pack, rb_funcall(), rb_hash_aref(), rb_str_new2(), and T_HASH.
Referenced by Init_generator().
Definition at line 493 of file generator.c.
References i_extend, mString_Extend, rb_funcall(), and result.
Referenced by Init_generator().
Definition at line 505 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
Definition at line 534 of file generator.c.
References Check_Type, mHash_to_json(), mString_to_json_raw_object(), obj, and T_HASH.
Referenced by Init_generator().
Definition at line 518 of file generator.c.
References ary, i_create_id, i_unpack, mJSON, rb_class_name(), rb_funcall(), rb_hash_aset(), rb_hash_new(), rb_obj_class(), rb_str_new2(), and result.
Referenced by Init_generator(), and mString_to_json_raw().
Definition at line 560 of file generator.c.
References GENERATE_JSON.
Referenced by Init_generator().
|
static |
Definition at line 615 of file generator.c.
References ALLOC, and MEMZERO.
Referenced by cState_s_allocate().
|
static |
Definition at line 602 of file generator.c.
References JSON_Generator_StateStruct::array_delim, JSON_Generator_StateStruct::array_nl, fbuffer_free(), JSON_Generator_StateStruct::indent, JSON_Generator_StateStruct::object_delim, JSON_Generator_StateStruct::object_delim2, JSON_Generator_StateStruct::object_nl, ruby_xfree(), JSON_Generator_StateStruct::space, and JSON_Generator_StateStruct::space_before.
Referenced by cState_s_allocate().
Definition at line 113 of file generator.c.
Referenced by convert_UTF8_to_JSON(), and unicode_escape_to_buffer().
Definition at line 125 of file generator.c.
References fbuffer_append(), and unicode_escape().
Referenced by convert_UTF8_to_JSON_ASCII().
|
static |
Definition at line 17 of file generator.c.
Referenced by cState_from_state_s(), and Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by cState_generate(), and Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator(), and mObject_to_json().
|
static |
Definition at line 17 of file generator.c.
Referenced by cState_generate(), generate_json_float(), and Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by generate_json_array(), generate_json_object(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by Init_generator(), and mString_to_json_raw_object().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_from_state_s(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by Init_generator(), and mString_included_s().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by generate_json_object(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_generate(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_from_state_s(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by Init_generator(), and mString_Extend_json_create().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_aref(), and Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by cState_from_state_s(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_aref(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by cState_configure(), cState_to_h(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by generate_json(), and Init_generator().
|
static |
Definition at line 23 of file generator.c.
Referenced by generate_json(), generate_json_bignum(), generate_json_float(), generate_json_object(), Init_generator(), and mObject_to_json().
|
static |
Definition at line 23 of file generator.c.
Referenced by Init_generator(), and mString_to_json_raw_object().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by cState_from_state_s(), Init_generator(), and mString_to_json_raw_object().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator(), and mString_included_s().
|
static |
Definition at line 17 of file generator.c.
Referenced by Init_generator().
Definition at line 73 of file generator.c.
Referenced by convert_UTF8_to_JSON_ASCII().
|
static |
Definition at line 57 of file generator.c.
Referenced by convert_UTF8_to_JSON_ASCII().