diff options
author | Joshua Haberman <jhaberman@gmail.com> | 2011-07-16 14:14:13 -0700 |
---|---|---|
committer | Joshua Haberman <jhaberman@gmail.com> | 2011-07-16 14:14:13 -0700 |
commit | daf36f07473b627ef634f8f66379a45ac99d32fc (patch) | |
tree | 96212a3f25627b89ea7a1bab6fa576252c045a2e /upb/descriptor.h | |
parent | b6ca2718c8e9fcb601054b76af96e22920a2070e (diff) |
Get rid of upb_symtabtxn.
This type was nothing but a map of defs.
We can as easily just pass an array of defs
into upb_symtab_add().
Diffstat (limited to 'upb/descriptor.h')
-rw-r--r-- | upb/descriptor.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/upb/descriptor.h b/upb/descriptor.h index 4d658fb..2c279a5 100644 --- a/upb/descriptor.h +++ b/upb/descriptor.h @@ -36,7 +36,6 @@ typedef struct { typedef struct { upb_deflist defs; - upb_symtabtxn *txn; upb_descreader_frame stack[UPB_MAX_TYPE_DEPTH]; int stack_len; upb_status status; @@ -52,7 +51,7 @@ typedef struct { } upb_descreader; // Creates a new descriptor builder that will add defs to the given txn. -void upb_descreader_init(upb_descreader *r, upb_symtabtxn *txn); +void upb_descreader_init(upb_descreader *r); void upb_descreader_uninit(upb_descreader *r); // Registers handlers that will load descriptor data into a symtabtxn. @@ -60,6 +59,13 @@ void upb_descreader_uninit(upb_descreader *r); // upb_msgdef_layout() called on them before adding to the txn. upb_mhandlers *upb_descreader_reghandlers(upb_handlers *h); +// Gets the array of defs that have been parsed and removes them from the +// descreader. Ownership of the defs is passed to the caller, but the +// ownership of the returned array is retained and is invalidated by any other +// call into the descreader. The defs will not have been resolved, and are +// ready to be added to a symtab. +upb_def **upb_descreader_getdefs(upb_descreader *r, int *n); + #ifdef __cplusplus } /* extern "C" */ #endif |