diff options
author | Determinant <[email protected]> | 2019-06-04 16:13:52 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-04 16:13:52 -0400 |
commit | ebada91a1327da99f1827c7e4c15fc3bee527d58 (patch) | |
tree | 904aeb2afbc54612b704f89a80c7a48953943220 /src/stream.cpp | |
parent | 9f294eb2e0ae0bed8120fc34fd9782f2f0a9ac74 (diff) |
more bindings
Diffstat (limited to 'src/stream.cpp')
-rw-r--r-- | src/stream.cpp | 27 |
1 files changed, 25 insertions, 2 deletions
diff --git a/src/stream.cpp b/src/stream.cpp index 8846414..f3dd322 100644 --- a/src/stream.cpp +++ b/src/stream.cpp @@ -1,9 +1,8 @@ +#ifdef SALTICIDAE_CBINDINGS #include "salticidae/stream.h" using namespace salticidae; -#ifdef __cplusplus - extern "C" { uint256_t *uint256_new() { return new uint256_t(); } @@ -56,6 +55,30 @@ void datastream_put_data(datastream_t *self, self->put_data(begin, end); } +uint8_t datastream_get_u8(datastream_t *self) { + uint8_t val; *self >> val; return val; +} + +uint16_t datastream_get_u16(datastream_t *self) { + uint16_t val; *self >> val; return val; +} + +uint32_t datastream_get_u32(datastream_t *self) { + uint32_t val; *self >> val; return val; +} + +int8_t datastream_get_i8(datastream_t *self) { + int8_t val; *self >> val; return val; +} + +int16_t datastream_get_i16(datastream_t *self) { + int16_t val; *self >> val; return val; +} + +int32_t datastream_get_i32(datastream_t *self) { + int32_t val; *self >> val; return val; +} + const uint8_t *datastream_get_data_inplace(datastream_t *self, size_t len) { return self->get_data_inplace(len); } |