summaryrefslogtreecommitdiff
path: root/upb_context.h
diff options
context:
space:
mode:
Diffstat (limited to 'upb_context.h')
-rw-r--r--upb_context.h20
1 files changed, 12 insertions, 8 deletions
diff --git a/upb_context.h b/upb_context.h
index 51afed1..ffff214 100644
--- a/upb_context.h
+++ b/upb_context.h
@@ -2,8 +2,7 @@
* upb - a minimalist implementation of protocol buffers.
*
* A context represents a namespace of proto definitions, sort of like an
- * interpreter's symbol table. It is empty when first constructed, with the
- * exception of built-in types (those defined in descriptor.proto). Clients
+ * interpreter's symbol table. It is empty when first constructed. Clients
* add definitions to the context by supplying unserialized or serialized
* descriptors (as defined in descriptor.proto).
*
@@ -22,6 +21,16 @@ struct google_protobuf_FileDescriptorProto;
extern "C" {
#endif
+/* Definitions. ***************************************************************/
+
+/* The symbol table maps names to various kinds of symbols. */
+enum upb_symbol_type {
+ UPB_SYM_MESSAGE,
+ UPB_SYM_ENUM,
+ UPB_SYM_SERVICE,
+ UPB_SYM_EXTENSION
+};
+
struct upb_symtab_entry {
struct upb_strtable_entry e;
enum upb_symbol_type type;
@@ -39,17 +48,12 @@ struct upb_context {
struct google_protobuf_FileDescriptorSet **fds;
};
-/* Initializes and frees a upb_context, respectively. Newly initialized
- * contexts will always have the types in descriptor.proto defined. */
+/* Initializes and frees a upb_context, respectively. */
bool upb_context_init(struct upb_context *c);
void upb_context_free(struct upb_context *c);
/* Looking up symbols. ********************************************************/
-/* Nested type names are separated by periods. */
-#define UPB_CONTEXT_SEPARATOR '.'
-#define UPB_SYM_MAX_LENGTH 256
-
/* Resolves the given symbol using the rules described in descriptor.proto,
* namely:
*
generated by cgit on debian on lair
contact matthew@masot.net with questions or feedback