From daf36f07473b627ef634f8f66379a45ac99d32fc Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sat, 16 Jul 2011 14:14:13 -0700 Subject: 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(). --- upb/descriptor.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'upb/descriptor.h') 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 -- cgit v1.2.3