diff options
author | Determinant <[email protected]> | 2019-06-28 15:37:22 -0400 |
---|---|---|
committer | Determinant <[email protected]> | 2019-06-28 15:37:22 -0400 |
commit | 710e9e8961cf5039b425e66d2042942b7e4af0c8 (patch) | |
tree | f69db46552945e945b5603d1d254df7e77d17b26 /src/netaddr.cpp | |
parent | d28bf1b0c8baec3c5ab40cfb988ff974f98da439 (diff) |
clean up code
Diffstat (limited to 'src/netaddr.cpp')
-rw-r--r-- | src/netaddr.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/netaddr.cpp b/src/netaddr.cpp index cb8a3d2..736d606 100644 --- a/src/netaddr.cpp +++ b/src/netaddr.cpp @@ -2,22 +2,33 @@ #ifdef SALTICIDAE_CBINDINGS #include "salticidae/netaddr.h" +using namespace salticidae; + extern "C" { netaddr_t *netaddr_new() { return new netaddr_t(); } void netaddr_free(const netaddr_t *self) { delete self; } -netaddr_t *netaddr_new_from_ip_port(uint32_t ip, uint16_t port) { +netaddr_t *netaddr_new_from_ip_port(uint32_t ip, uint16_t port, SalticidaeCError *cerror) { + SALTICIDAE_CERROR_TRY(cerror) return new netaddr_t(ip, port); + SALTICIDAE_CERROR_CATCH(cerror) + return nullptr; } -netaddr_t *netaddr_new_from_sip_port(const char *ip, uint16_t port) { +netaddr_t *netaddr_new_from_sip_port(const char *ip, uint16_t port, SalticidaeCError *cerror) { + SALTICIDAE_CERROR_TRY(cerror) return new netaddr_t(ip, port); + SALTICIDAE_CERROR_CATCH(cerror) + return nullptr; } -netaddr_t *netaddr_new_from_sipport(const char *ip_port_addr) { +netaddr_t *netaddr_new_from_sipport(const char *ip_port_addr, SalticidaeCError *cerror) { + SALTICIDAE_CERROR_TRY(cerror) return new netaddr_t(ip_port_addr); + SALTICIDAE_CERROR_CATCH(cerror) + return nullptr; } netaddr_t *netaddr_copy(const netaddr_t *self) { |