diff options
| author | Laytan Laats <laytanlaats@hotmail.com> | 2023-12-23 20:02:04 +0100 |
|---|---|---|
| committer | Laytan Laats <laytanlaats@hotmail.com> | 2024-03-04 17:26:19 +0100 |
| commit | c1cf6c1a95bb489525e329280be735d7a5ce966b (patch) | |
| tree | 6775a9519a9332917c94a3dcdd0b6f43243b7799 /core/encoding/cbor/coding.odin | |
| parent | 317931a3c5179e10db941157a994c8e89b7080c2 (diff) | |
encoding/cbor: add general docs and example
Diffstat (limited to 'core/encoding/cbor/coding.odin')
| -rw-r--r-- | core/encoding/cbor/coding.odin | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/core/encoding/cbor/coding.odin b/core/encoding/cbor/coding.odin index 9dd6d2639..a9bb6e408 100644 --- a/core/encoding/cbor/coding.odin +++ b/core/encoding/cbor/coding.odin @@ -121,7 +121,7 @@ decode_from_decoder :: proc(d: Decoder, allocator := context.allocator) -> (v: V d := d - DECODE_PROGRESS_GUARD(&d) + _DECODE_PROGRESS_GUARD(&d) v, err = _decode_from_decoder(d) // Normal EOF does not exist here, we try to read the exact amount that is said to be provided. @@ -228,7 +228,7 @@ encode_into_writer :: proc(w: io.Writer, v: Value, flags := ENCODE_SMALL) -> Enc encode_into_encoder :: proc(e: Encoder, v: Value) -> Encode_Error { e := e - ENCODE_PROGRESS_GUARD(&e) or_return + _ENCODE_PROGRESS_GUARD(&e) or_return switch v_spec in v { case u8: return _encode_u8(e.writer, v_spec, .Unsigned) @@ -256,7 +256,7 @@ encode_into_encoder :: proc(e: Encoder, v: Value) -> Encode_Error { } @(deferred_in_out=_decode_progress_end) -DECODE_PROGRESS_GUARD :: proc(d: ^Decoder) -> (is_begin: bool, tmp: runtime.Arena_Temp) { +_DECODE_PROGRESS_GUARD :: proc(d: ^Decoder) -> (is_begin: bool, tmp: runtime.Arena_Temp) { if ._In_Progress in d.flags { return } @@ -286,7 +286,7 @@ _decode_progress_end :: proc(d: ^Decoder, is_begin: bool, tmp: runtime.Arena_Tem } @(deferred_in_out=_encode_progress_end) -ENCODE_PROGRESS_GUARD :: proc(e: ^Encoder) -> (is_begin: bool, tmp: runtime.Arena_Temp, err: Encode_Error) { +_ENCODE_PROGRESS_GUARD :: proc(e: ^Encoder) -> (is_begin: bool, tmp: runtime.Arena_Temp, err: Encode_Error) { if ._In_Progress in e.flags { return } |