diff options
Diffstat (limited to 'src/upb_array.h')
-rw-r--r-- | src/upb_array.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/upb_array.h b/src/upb_array.h index 4282a7f..0e5178f 100644 --- a/src/upb_array.h +++ b/src/upb_array.h @@ -34,6 +34,12 @@ INLINE union upb_value_ptr upb_array_getelementptr( return ptr; } +INLINE union upb_value upb_array_getelement( + struct upb_array *arr, uint32_t n, upb_field_type_t type) +{ + return upb_deref(upb_array_getelementptr(arr, n, type), type); +} + /* These are all overlays on upb_array, pointers between them can be cast. */ #define UPB_DEFINE_ARRAY_TYPE(name, type) \ struct name ## _array { \ |