static size_t file_onpackage(void *_r, void *fval, const char *buf, size_t n) { UPB_UNUSED(fval); upb_descreader *r = _r; // XXX: see comment at the top of the file. upb_descreader_setscopename(r, upb_strndup(buf, n)); return n; }
static size_t file_onpackage(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle) { UPB_UNUSED(hd); UPB_UNUSED(handle); upb_descreader *r = closure; // XXX: see comment at the top of the file. upb_descreader_setscopename(r, upb_strndup(buf, n)); return n; }
static size_t field_onname(void *_r, void *fval, const char *buf, size_t n) { UPB_UNUSED(fval); upb_descreader *r = _r; // XXX: see comment at the top of the file. char *name = upb_strndup(buf, n); upb_fielddef_setname(r->f, name); free(name); return n; }
static size_t enum_onname(void *_r, void *fval, const char *buf, size_t n) { UPB_UNUSED(fval); upb_descreader *r = _r; // XXX: see comment at the top of the file. char *fullname = upb_strndup(buf, n); upb_def_setfullname(upb_descreader_last(r), fullname); free(fullname); return n; }
static size_t enumval_onname(void *_r, void *fval, const char *buf, size_t n) { UPB_UNUSED(fval); upb_descreader *r = _r; // XXX: see comment at the top of the file. free(r->name); r->name = upb_strndup(buf, n); r->saw_name = true; return n; }
static size_t msg_onname(void *_r, void *fval, const char *buf, size_t n) { UPB_UNUSED(fval); upb_descreader *r = _r; upb_msgdef *m = upb_descreader_top(r); // XXX: see comment at the top of the file. char *name = upb_strndup(buf, n); upb_def_setfullname(upb_upcast(m), name); upb_descreader_setscopename(r, name); // Passes ownership of name. return n; }
static size_t field_onextendee(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle) { UPB_UNUSED(hd); UPB_UNUSED(handle); upb_descreader *r = closure; // XXX: see comment at the top of the file. char *name = upb_strndup(buf, n); upb_fielddef_setcontainingtypename(r->f, name, NULL); free(name); return n; }
static size_t enum_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle) { UPB_UNUSED(hd); UPB_UNUSED(handle); upb_descreader *r = closure; // XXX: see comment at the top of the file. char *fullname = upb_strndup(buf, n); upb_def_setfullname(upb_descreader_last(r), fullname, NULL); free(fullname); return n; }
static size_t enumval_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle) { UPB_UNUSED(hd); UPB_UNUSED(handle); upb_descreader *r = closure; // XXX: see comment at the top of the file. free(r->name); r->name = upb_strndup(buf, n); r->saw_name = true; return n; }
static size_t field_ondefaultval(void *_r, void *fval, const char *buf, size_t n) { UPB_UNUSED(fval); upb_descreader *r = _r; // Have to convert from string to the correct type, but we might not know the // type yet, so we save it as a string until the end of the field. // XXX: see comment at the top of the file. free(r->default_string); r->default_string = upb_strndup(buf, n); return n; }
static size_t msg_onname(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle) { UPB_UNUSED(hd); UPB_UNUSED(handle); upb_descreader *r = closure; upb_msgdef *m = upb_descreader_top(r); // XXX: see comment at the top of the file. char *name = upb_strndup(buf, n); upb_def_setfullname(UPB_UPCAST(m), name, NULL); upb_descreader_setscopename(r, name); // Passes ownership of name. return n; }
static size_t field_ondefaultval(void *closure, const void *hd, const char *buf, size_t n, const upb_bufhandle *handle) { UPB_UNUSED(hd); UPB_UNUSED(handle); upb_descreader *r = closure; // Have to convert from string to the correct type, but we might not know the // type yet, so we save it as a string until the end of the field. // XXX: see comment at the top of the file. free(r->default_string); r->default_string = upb_strndup(buf, n); return n; }