Beispiel #1
0
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;
}
Beispiel #2
0
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;
}
Beispiel #3
0
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;
}
Beispiel #4
0
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;
}