From 2da3b081c47fe8fe7476da228323d2040e876f56 Mon Sep 17 00:00:00 2001 From: Joshua Haberman Date: Sun, 28 Jun 2009 09:31:46 -0700 Subject: More work on upb_context. --- upb.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'upb.h') diff --git a/upb.h b/upb.h index bb1563a..5197395 100644 --- a/upb.h +++ b/upb.h @@ -29,6 +29,9 @@ extern "C" { /* The maximum that any submessages can be nested. Matches proto2's limit. */ #define UPB_MAX_NESTING 64 +/* The maximum number of fields that any one .proto type can have. */ +#define UPB_MAX_FIELDS (1<<16) + /* Represents a string or bytes. */ struct upb_string { /* We expect the data to be 8-bit clean (uint8_t), but char* is such an @@ -97,6 +100,19 @@ struct upb_tag { upb_wire_type_t wire_type; }; +enum upb_symbol_type { + UPB_SYM_MESSAGE, + UPB_SYM_ENUM, + UPB_SYM_SERVICE, + UPB_SYM_EXTENSION +}; + +union upb_symbol_ref { + struct upb_msg *msg; + struct upb_enum *_enum; + struct upb_svc *svc; +}; + /* Status codes used as a return value. */ typedef enum upb_status { UPB_STATUS_OK = 0, -- cgit v1.2.3