Example #1
0
upb_sflow_t upb_stdmsg_startsubmsg_r(void *a, upb_value fval) {
  assert(a != NULL);
  const upb_fielddef *f = upb_value_getfielddef(fval);
  void **subm = upb_stdarray_append((upb_stdarray*)a, sizeof(void*));
  upb_stdmsg_recycle(subm, upb_downcast_msgdef(f->def));
  return UPB_CONTINUE_WITH(*subm);
}
Example #2
0
File: upb.c Project: chenbk85/upb
static upb_flow_t PyUpb_Message_AppendStringValue(
    void *a, upb_value fval, upb_value val) {
  (void)fval;
  PyObject **elem = upb_stdarray_append(a, sizeof(void*));
  *elem = PyString_FromStringAndSize(NULL, upb_value_getstrref(val)->len);
  upb_strref_read(upb_value_getstrref(val), PyString_AsString(*elem));
  return UPB_CONTINUE;
}
Example #3
0
File: upb.c Project: chenbk85/upb
static upb_sflow_t PyUpb_Message_StartRepeatedSubmessage(
    void *a, upb_value fval) {
  (void)fval;
  PyObject **elem = upb_stdarray_append(a, sizeof(void*));
  PyTypeObject *type = ((PyUpb_MessageType*)Py_TYPE(a))->alt_type;
  if (!*elem) *elem = type->tp_alloc(type, 0);
  return UPB_CONTINUE_WITH(*elem);
}
Example #4
0
upb_flow_t upb_stdmsg_setstr_r(void *a, upb_value fval, upb_value val) {
  assert(a != NULL);
  (void)fval;
  _upb_stdmsg_setstr(upb_stdarray_append((upb_stdarray*)a, sizeof(void*)), val);
  return UPB_CONTINUE;
}