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/msg.cpp | |
parent | 9f294eb2e0ae0bed8120fc34fd9782f2f0a9ac74 (diff) |
more bindings
Diffstat (limited to 'src/msg.cpp')
-rw-r--r-- | src/msg.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/msg.cpp b/src/msg.cpp index e69de29..e75d7d4 100644 --- a/src/msg.cpp +++ b/src/msg.cpp @@ -0,0 +1,23 @@ +#ifdef SALTICIDAE_CBINDINGS +#include "salticidae/msg.h" + +extern "C" { + +msg_t *msg_new(_opcode_t opcode, bytearray_t *_moved_payload) { + auto res = new msg_t(opcode, *payload); + bytearray_free(payload); +} + +datastream_t *msg_get_payload(msg_t *msg) { + return new datastream_t(msg->get_payload()); +} + +const _opcode_t msg_get_opcode(const msg_t *msg) { + return msg->get_opcode(); +} + +void msg_free(msg_t *msg) { delete msg; } + +} + +#endif |