Ruby  2.0.0p648(2015-12-16revision53162)
Data Structures | Macros | Typedefs | Functions
fbuffer.h File Reference
#include "ruby.h"
#include "ruby/encoding.h"

Go to the source code of this file.

Data Structures

struct  FBufferStruct
 

Macros

#define RB_OBJ_CLASSNAME(obj)   rb_obj_class(obj)
 
#define RB_OBJ_STRING(obj)   (obj)
 
#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 FBufferfbuffer_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 60 of file fbuffer.h.

#define FBUFFER_INITIAL_LENGTH_DEFAULT   1024

Definition at line 56 of file fbuffer.h.

Referenced by cState_initialize(), and fbuffer_alloc().

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

Definition at line 59 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 61 of file fbuffer.h.

#define FBUFFER_PTR (   fb)    (fb->ptr)
#define FORCE_UTF8 (   obj)    rb_enc_associate((obj), rb_utf8_encoding())

Definition at line 39 of file fbuffer.h.

Referenced by convert_encoding(), and JSON_parse_string().

#define RB_OBJ_CLASSNAME (   obj)    rb_obj_class(obj)

Definition at line 29 of file fbuffer.h.

#define RB_OBJ_STRING (   obj)    (obj)

Definition at line 30 of file fbuffer.h.

Typedef Documentation

typedef struct FBufferStruct FBuffer

Function Documentation

static FBuffer * fbuffer_alloc ( unsigned long  initial_length)
static
static void fbuffer_append ( FBuffer fb,
const char *  newstr,
unsigned long  len 
)
static
static void fbuffer_append_char ( FBuffer fb,
char  newchr 
)
static
static void fbuffer_clear ( FBuffer fb)
static

Definition at line 92 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
static void fbuffer_inc_capa ( FBuffer fb,
unsigned long  requested 
)
static