From ebada91a1327da99f1827c7e4c15fc3bee527d58 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 4 Jun 2019 16:13:52 -0400 Subject: more bindings --- src/type.cpp | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 src/type.cpp (limited to 'src/type.cpp') diff --git a/src/type.cpp b/src/type.cpp new file mode 100644 index 0000000..8290a07 --- /dev/null +++ b/src/type.cpp @@ -0,0 +1,20 @@ +#ifdef SALTICIDAE_CBINDINGS +#include "salticidae/type.h" + +extern "C" { + +uint8_t *bytearray_data(bytearray_t *arr) { + return &(*arr)[0]; +} + +size_t bytearray_size(bytearray_t *arr) { + return arr->size(); +} + +void bytearray_free(bytearray_t *arr) { + delete arr; +} + +} + +#endif -- cgit v1.2.3