| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
#ifndef LIBCBOR_STACK_H |
| 9 |
#define LIBCBOR_STACK_H |
| 10 |
|
| 11 |
#include "cbor/common.h" |
| 12 |
|
| 13 |
#ifdef __cplusplus |
| 14 |
extern "C" { |
| 15 |
#endif |
| 16 |
|
| 17 |
|
| 18 |
struct _cbor_stack_record { |
| 19 |
|
| 20 |
struct _cbor_stack_record* lower; |
| 21 |
|
| 22 |
cbor_item_t* item; |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
|
| 27 |
|
| 28 |
|
| 29 |
|
| 30 |
|
| 31 |
size_t subitems; |
| 32 |
}; |
| 33 |
|
| 34 |
|
| 35 |
struct _cbor_stack { |
| 36 |
struct _cbor_stack_record* top; |
| 37 |
size_t size; |
| 38 |
}; |
| 39 |
|
| 40 |
_CBOR_NODISCARD |
| 41 |
struct _cbor_stack _cbor_stack_init(void); |
| 42 |
|
| 43 |
void _cbor_stack_pop(struct _cbor_stack*); |
| 44 |
|
| 45 |
_CBOR_NODISCARD |
| 46 |
struct _cbor_stack_record* _cbor_stack_push(struct _cbor_stack*, cbor_item_t*, |
| 47 |
size_t); |
| 48 |
|
| 49 |
#ifdef __cplusplus |
| 50 |
} |
| 51 |
#endif |
| 52 |
|
| 53 |
#endif |