Ruby: ext/json/generator/generator.h File Reference

Ruby 3.0.5p211 (2022-11-24 revision ba5cf0f7c52d4d35cc6a173c89eda98ceffa2dcf)

Data Structures | Macros | Typedefs
generator.h File Reference
`#include <math.h>`
`#include <ctype.h>`
`#include "ruby.h"`
`#include "ruby/re.h"`

Go to the source code of this file.

## Data Structures
struct | JSON_Generator_StateStruct

## Macros
#define | rb_intern_str(string) SYM2ID(rb_str_intern(string))
#define | rb_obj_instance_variables(object) rb_funcall(object, rb_intern("instance_variables"), 0)
#define | option_given_p(opts, key) RTEST(rb_funcall(opts, i_key_p, 1, key))
#define | UNI_STRICT_CONVERSION 1
#define | UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD
#define | UNI_MAX_BMP (UTF32)0x0000FFFF
#define | UNI_MAX_UTF16 (UTF32)0x0010FFFF
#define | UNI_MAX_UTF32 (UTF32)0x7FFFFFFF
#define | UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF
#define | UNI_SUR_HIGH_START (UTF32)0xD800
#define | UNI_SUR_HIGH_END (UTF32)0xDBFF
#define | UNI_SUR_LOW_START (UTF32)0xDC00
#define | UNI_SUR_LOW_END (UTF32)0xDFFF
#define | GET_STATE_TO(self, state) TypedData_Get_Struct(self, JSON_Generator_State, &JSON_Generator_State_type, state)
#define | GET_STATE(self)
#define | GENERATE_JSON(type)
#define | NEW_TYPEDDATA_WRAPPER 1

## Typedefs
typedef unsigned long | UTF32
typedef unsigned short | UTF16
typedef unsigned char | UTF8
typedef struct JSON_Generator_StateStruct | JSON_Generator_State

## Macro Definition Documentation

## ◆ GENERATE_JSON

#define GENERATE_JSON | ( |  | type | ) |

Value:
FBuffer *buffer; \
VALUE Vstate; \
JSON_Generator_State *state; \
\
rb_scan_args(argc, argv, "01", &Vstate); \
Vstate = cState_from_state_s(cState, Vstate); \
TypedData_Get_Struct(Vstate, JSON_Generator_State, &JSON_Generator_State_type, state); \
buffer = cState_prepare_buffer(Vstate); \
generate_json_##type(buffer, Vstate, state, self); \
return fbuffer_to_s(buffer)
ruby::backward::cxxanyargs::type
VALUE type(ANYARGS)
ANYARGS-ed function type.
Definition: cxxanyargs.hpp:56
argc
int argc
Definition: ruby.c:240
argv
char ** argv
Definition: ruby.c:241
FBufferStruct
Definition: fbuffer.h:46
JSON_Generator_StateStruct
Definition: generator.h:58
state
Definition: blast.c:41
VALUE
unsigned long VALUE
Definition: value.h:38

Definition at line 87 of file generator.h.

## ◆ GET_STATE

#define GET_STATE | ( |  | self | ) |

Value:
JSON_Generator_State *state; \
GET_STATE_TO(self, state)

Definition at line 83 of file generator.h.

## ◆ GET_STATE_TO

#define GET_STATE_TO | ( |  | self,
|  |  | state
| ) |  | TypedData_Get_Struct(self, JSON_Generator_State, &JSON_Generator_State_type, state)

Definition at line 80 of file generator.h.

## ◆ NEW_TYPEDDATA_WRAPPER

#define NEW_TYPEDDATA_WRAPPER 1

Definition at line 168 of file generator.h.

## ◆ option_given_p

#define option_given_p | ( |  | opts,
|  |  | key
| ) |  | RTEST(rb_funcall(opts, i_key_p, 1, key))

Definition at line 23 of file generator.h.

## ◆ rb_intern_str

#define rb_intern_str | ( |  | string | ) | SYM2ID(rb_str_intern(string))

Definition at line 16 of file generator.h.

## ◆ rb_obj_instance_variables

#define rb_obj_instance_variables | ( |  | object | ) | rb_funcall(object, rb_intern("instance_variables"), 0)

Definition at line 20 of file generator.h.

## ◆ UNI_MAX_BMP

#define UNI_MAX_BMP (UTF32)0x0000FFFF

Definition at line 34 of file generator.h.

## ◆ UNI_MAX_LEGAL_UTF32

#define UNI_MAX_LEGAL_UTF32 (UTF32)0x0010FFFF

Definition at line 37 of file generator.h.

## ◆ UNI_MAX_UTF16

#define UNI_MAX_UTF16 (UTF32)0x0010FFFF

Definition at line 35 of file generator.h.

## ◆ UNI_MAX_UTF32

#define UNI_MAX_UTF32 (UTF32)0x7FFFFFFF

Definition at line 36 of file generator.h.

## ◆ UNI_REPLACEMENT_CHAR

#define UNI_REPLACEMENT_CHAR (UTF32)0x0000FFFD

Definition at line 33 of file generator.h.

## ◆ UNI_STRICT_CONVERSION

#define UNI_STRICT_CONVERSION 1

Definition at line 27 of file generator.h.

## ◆ UNI_SUR_HIGH_END

#define UNI_SUR_HIGH_END (UTF32)0xDBFF

Definition at line 40 of file generator.h.

## ◆ UNI_SUR_HIGH_START

#define UNI_SUR_HIGH_START (UTF32)0xD800

Definition at line 39 of file generator.h.

## ◆ UNI_SUR_LOW_END

#define UNI_SUR_LOW_END (UTF32)0xDFFF

Definition at line 42 of file generator.h.

## ◆ UNI_SUR_LOW_START

#define UNI_SUR_LOW_START (UTF32)0xDC00

Definition at line 41 of file generator.h.

## Typedef Documentation

## ◆ JSON_Generator_State

typedef struct JSON_Generator_StateStruct JSON_Generator_State

## ◆ UTF16

typedef unsigned short UTF16

Definition at line 30 of file generator.h.

## ◆ UTF32

typedef unsigned long UTF32

Definition at line 29 of file generator.h.

## ◆ UTF8

typedef unsigned char UTF8

Definition at line 31 of file generator.h.