Ruby 2.0.0p353(2013-11-22revision43784)

- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Macros | Typedefs | Functions
fbuffer.h File Reference
`#include "ruby.h"`
`#include "ruby/encoding.h"`
Include dependency graph for fbuffer.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Data Structures
struct | FBufferStruct

## Macros
#define | FORCE_UTF8(obj) rb_enc_associate((obj), rb_utf8_encoding())
#define | FBUFFER_INITIAL_LENGTH_DEFAULT 1024
#define | FBUFFER_PTR(fb) (fb->ptr)
#define | FBUFFER_LEN(fb) (fb->len)
#define | FBUFFER_CAPA(fb) (fb->capa)
#define | FBUFFER_PAIR(fb) FBUFFER_PTR(fb), FBUFFER_LEN(fb)

## Typedefs
typedef struct FBufferStruct | FBuffer

## Functions
static FBuffer * | fbuffer_alloc (unsigned long initial_length)
static void | fbuffer_free (FBuffer *fb)
static void | fbuffer_clear (FBuffer *fb)
static void | fbuffer_append (FBuffer *fb, const char *newstr, unsigned long len)
static void | fbuffer_append_char (FBuffer *fb, char newchr)
static void | fbuffer_inc_capa (FBuffer *fb, unsigned long requested)

## Macro Definition Documentation

#define FBUFFER_CAPA | ( |  | fb | ) | (fb->capa)

Definition at line 51 of file fbuffer.h.

#define FBUFFER_INITIAL_LENGTH_DEFAULT 1024

Definition at line 47 of file fbuffer.h.

Referenced by cState_initialize(), and fbuffer_alloc().

#define FBUFFER_LEN | ( |  | fb | ) | (fb->len)

Definition at line 50 of file fbuffer.h.

Referenced by generate_json_array(), and generate_json_object().

#define FBUFFER_PAIR | ( |  | fb | ) | FBUFFER_PTR(fb), FBUFFER_LEN(fb)

Definition at line 52 of file fbuffer.h.

#define FBUFFER_PTR | ( |  | fb | ) | (fb->ptr)

Definition at line 49 of file fbuffer.h.

Referenced by generate_json_array(), generate_json_object(), JSON_parse_float(), and JSON_parse_integer().

#define FORCE_UTF8 | ( |  | obj | ) | rb_enc_associate((obj), rb_utf8_encoding())

Definition at line 30 of file fbuffer.h.

Referenced by convert_encoding(), and JSON_parse_string().

## Typedef Documentation

typedef struct FBufferStruct FBuffer

## Function Documentation

static FBuffer * fbuffer_alloc | ( | unsigned long | initial_length | ) |
| static

Definition at line 67 of file fbuffer.h.

References ALLOC, FBUFFER_INITIAL_LENGTH_DEFAULT, FBufferStruct::initial_length, and memset().

Referenced by cState_prepare_buffer(), and JSON_allocate().

static void fbuffer_append | ( | FBuffer * | fb,
|  | const char * | newstr,
|  | unsigned long | len
| ) |  |
| static

Definition at line 105 of file fbuffer.h.

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(), generate_json_array(), generate_json_false(), generate_json_null(), generate_json_object(), generate_json_true(), JSON_parse_float(), JSON_parse_integer(), and unicode_escape_to_buffer().

static void fbuffer_append_char | ( | FBuffer * | fb,
|  | char | newchr
| ) |  |
| static

Definition at line 126 of file fbuffer.h.

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(), generate_json_string(), JSON_parse_float(), and JSON_parse_integer().

static void fbuffer_clear | ( | FBuffer * | fb | ) |
| static

Definition at line 83 of file fbuffer.h.

References FBufferStruct::len.

Referenced by cState_prepare_buffer(), JSON_parse_float(), and JSON_parse_integer().

static void fbuffer_free | ( | FBuffer * | fb | ) |
| static

Definition at line 77 of file fbuffer.h.

References FBufferStruct::ptr, and ruby_xfree().

Referenced by generate_json_array(), generate_json_float(), generate_json_object(), JSON_free(), and State_free().

static void fbuffer_inc_capa | ( | FBuffer * | fb,
|  | unsigned long | requested
| ) |  |
| static

Definition at line 88 of file fbuffer.h.

References ALLOC_N, FBufferStruct::capa, FBufferStruct::initial_length, FBufferStruct::len, FBufferStruct::ptr, and REALLOC_N.

Referenced by fbuffer_append(), and fbuffer_append_char().