diff options
author | Joshua Haberman <joshua@reverberate.org> | 2011-02-23 10:14:53 -0800 |
---|---|---|
committer | Joshua Haberman <joshua@reverberate.org> | 2011-02-23 10:14:53 -0800 |
commit | 3a758132b402e2c4a346d1feb45d00300fed16e7 (patch) | |
tree | 804af5b367c9de0349660baac23371ca99544543 /src/upb_def.h | |
parent | 6b574175dd43735a26f171de6b34c3f15bb50f12 (diff) |
Added proper support for enum default values.
Diffstat (limited to 'src/upb_def.h')
-rw-r--r-- | src/upb_def.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/upb_def.h b/src/upb_def.h index 3f79895..4a2bcbd 100644 --- a/src/upb_def.h +++ b/src/upb_def.h @@ -227,10 +227,13 @@ INLINE upb_fielddef *upb_msg_iter_field(upb_msg_iter iter) { /* upb_enumdef ****************************************************************/ +typedef int32_t upb_enumval_t; + typedef struct _upb_enumdef { upb_def base; upb_strtable ntoi; upb_inttable iton; + upb_enumval_t default_value; // The first value listed in the enum. } upb_enumdef; typedef struct { @@ -243,8 +246,6 @@ typedef struct { upb_string *string; } upb_iton_ent; -typedef int32_t upb_enumval_t; - // Lookups from name to integer and vice-versa. bool upb_enumdef_ntoi(upb_enumdef *e, upb_string *name, upb_enumval_t *num); // Caller does not own a ref on the returned string. |