webkit  2cdf99a9e3038c7e01b3c37e8ad903ecbe5eecf1
https://github.com/WebKit/webkit
Classes | Macros | Functions
encode_decode.c File Reference
#include "protobuf.h"

Classes

struct  submsg_handlerdata_t
 
struct  oneof_handlerdata_t
 
struct  map_handlerdata_t
 
struct  map_parse_frame_t
 
struct  stackenv
 
struct  stringsink
 

Macros

#define DEREF(msg, ofs, type)   *(type*)(((uint8_t *)msg) + ofs)
 
#define DEFINE_APPEND_HANDLER(type, ctype)
 
#define DEFINE_ONEOF_HANDLER(type, ctype)
 
#define SET_HANDLER(utype, ltype)
 
#define SET_HANDLER(utype, ltype)
 
#define STACK_ENV_STACKBYTES   4096
 
#define T(upbtypeconst, upbtype, ctype)
 
#define T(upbtypeconst, upbtype, ctype, default_value)
 

Functions

VALUE noleak_rb_str_cat (VALUE rb_str, const char *str, long len)
 
const upb_handlersget_fill_handlers (Descriptor *desc)
 
const upb_pbdecodermethodnew_fillmsg_decodermethod (Descriptor *desc, const void *owner)
 
VALUE Message_decode (VALUE klass, VALUE data)
 
VALUE Message_decode_json (VALUE klass, VALUE data)
 
void stringsink_init (stringsink *sink)
 
void stringsink_uninit (stringsink *sink)
 
VALUE Message_encode (VALUE klass, VALUE msg_rb)
 
VALUE Message_encode_json (int argc, VALUE *argv, VALUE klass)
 

Macro Definition Documentation

◆ DEFINE_APPEND_HANDLER

#define DEFINE_APPEND_HANDLER (   type,
  ctype 
)
Value:
static bool append##type##_handler(void *closure, const void *hd, \
ctype val) { \
VALUE ary = (VALUE)closure; \
RepeatedField_push_native(ary, &val); \
return true; \
}
detail::append_impl< Ts... > append
Definition: Brigand.h:133
EGLenum type
Definition: eglext.h:63
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301

◆ DEFINE_ONEOF_HANDLER

#define DEFINE_ONEOF_HANDLER (   type,
  ctype 
)
Value:
static bool oneof##type##_handler(void *closure, const void *hd, \
ctype val) { \
const oneof_handlerdata_t *oneofdata = hd; \
DEREF(closure, oneofdata->case_ofs, uint32_t) = \
oneofdata->oneof_case_num; \
DEREF(closure, oneofdata->ofs, ctype) = val; \
return true; \
}
unsigned int uint32_t
Definition: ptypes.h:105
Definition: encode_decode.c:76
uint32_t oneof_case_num
Definition: encode_decode.c:79
EGLenum type
Definition: eglext.h:63
GLuint GLsizei GLsizei GLfloat * val
Definition: gl2ext.h:3301

◆ DEREF

#define DEREF (   msg,
  ofs,
  type 
)    *(type*)(((uint8_t *)msg) + ofs)

◆ SET_HANDLER [1/2]

#define SET_HANDLER (   utype,
  ltype 
)
Value:
case utype: \
upb_handlers_set##ltype(h, f, append##ltype##_handler, NULL); \
break;
detail::append_impl< Ts... > append
Definition: Brigand.h:133
GLfloat f
Definition: gl2.h:417
GLfloat GLfloat GLfloat GLfloat h
Definition: gl2ext.h:3060
#define NULL
Definition: common_types.h:41

◆ SET_HANDLER [2/2]

#define SET_HANDLER (   utype,
  ltype 
)
Value:
case utype: \
upb_handlers_set##ltype(h, f, oneof##ltype##_handler, &attr); \
break;
OPENSSL_EXPORT X509_ATTRIBUTE * attr
Definition: x509.h:1051
GLfloat f
Definition: gl2.h:417
GLfloat GLfloat GLfloat GLfloat h
Definition: gl2ext.h:3060

◆ STACK_ENV_STACKBYTES

#define STACK_ENV_STACKBYTES   4096

◆ T [1/2]

#define T (   upbtypeconst,
  upbtype,
  ctype 
)
Value:
case upbtypeconst: \
upb_sink_put##upbtype(&subsink, sel, *((ctype *)memory)); \
break;

◆ T [2/2]

#define T (   upbtypeconst,
  upbtype,
  ctype,
  default_value 
)
Value:
case upbtypeconst: { \
ctype value = DEREF(msg, offset, ctype); \
if (is_matching_oneof || value != default_value) { \
upb_sink_put##upbtype(sink, sel, value); \
} \
} \
break;
#define DEREF(msg, ofs, type)
Definition: encode_decode.c:51
rtc::CallSessionFileRotatingLogSink * sink
Definition: peerconnection_jni.cc:2350
EGLStreamKHR EGLint EGLint offset
Definition: eglext.h:984
EGLAttrib * value
Definition: eglext.h:120

Function Documentation

◆ get_fill_handlers()

const upb_handlers* get_fill_handlers ( Descriptor desc)

◆ Message_decode()

VALUE Message_decode ( VALUE  klass,
VALUE  data 
)

◆ Message_decode_json()

VALUE Message_decode_json ( VALUE  klass,
VALUE  data 
)

◆ Message_encode()

VALUE Message_encode ( VALUE  klass,
VALUE  msg_rb 
)

◆ Message_encode_json()

VALUE Message_encode_json ( int  argc,
VALUE *  argv,
VALUE  klass 
)

◆ new_fillmsg_decodermethod()

const upb_pbdecodermethod* new_fillmsg_decodermethod ( Descriptor desc,
const void owner 
)

◆ noleak_rb_str_cat()

VALUE noleak_rb_str_cat ( VALUE  rb_str,
const char *  str,
long  len 
)

◆ stringsink_init()

void stringsink_init ( stringsink sink)

◆ stringsink_uninit()

void stringsink_uninit ( stringsink sink)