From ebada91a1327da99f1827c7e4c15fc3bee527d58 Mon Sep 17 00:00:00 2001 From: Determinant Date: Tue, 4 Jun 2019 16:13:52 -0400 Subject: more bindings --- include/salticidae/type.h | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'include/salticidae/type.h') diff --git a/include/salticidae/type.h b/include/salticidae/type.h index 3ec202a..0ebcce7 100644 --- a/include/salticidae/type.h +++ b/include/salticidae/type.h @@ -35,6 +35,9 @@ #include #include +#include "config.h" + +#ifdef __cplusplus namespace salticidae { const auto _1 = std::placeholders::_1; @@ -89,10 +92,32 @@ inline auto generic_bind(ReturnType(ClassType::* f)(Args...), FArgs&&... fargs) } +#ifdef SALTICIDAE_CBINDINGS +using bytearray_t = salticidae::bytearray_t; +#endif + +#else + +#ifdef SALTICIDAE_CBINDINGS +typedef struct bytearray_t bytearray_t; +#endif + +#endif + #ifdef SALTICIDAE_CBINDINGS_STR_OP -using _opcode_t = std::string; +using _opcode_t = char *; #else using _opcode_t = uint8_t; #endif +#ifdef SALTICIDAE_CBINDINGS +extern "C" { + +uint8_t *bytearray_data(bytearray_t *arr); +size_t bytearray_size(bytearray_t *arr); +void bytearray_free(); + +} +#endif + #endif -- cgit v1.2.3