aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDeterminant <[email protected]>2019-06-16 23:24:49 -0400
committerDeterminant <[email protected]>2019-06-16 23:24:49 -0400
commit74e4246565ba5814a92ed9f84b13b17226f219d1 (patch)
tree161a15482225dce9a3940e70bfd3b5e1a50cf497 /include
parent77a765023bff4fa3d41001bdc1de9d106e35f348 (diff)
do not free the moved pointer for C API; misc changes
Diffstat (limited to 'include')
-rw-r--r--include/salticidae/event.h10
-rw-r--r--include/salticidae/netaddr.h1
2 files changed, 10 insertions, 1 deletions
diff --git a/include/salticidae/event.h b/include/salticidae/event.h
index 4dd00d7..c4f65ba 100644
--- a/include/salticidae/event.h
+++ b/include/salticidae/event.h
@@ -235,6 +235,8 @@ class TimerEvent {
}
operator bool() const { return ev_timer != nullptr; }
+
+ const EventContext &get_ec() const { return ec; }
};
class TimedFdEvent: public FdEvent, public TimerEvent {
@@ -412,6 +414,8 @@ class SigEvent {
}
operator bool() const { return ev_sig != nullptr; }
+
+ const EventContext &get_ec() const { return ec; }
};
template<typename T>
@@ -681,12 +685,15 @@ typedef void (*threadcall_callback_t)(threadcall_handle_t *handle, void *userdat
threadcall_t *threadcall_new(const eventcontext_t *ec);
void threadcall_free(threadcall_t *self);
void threadcall_async_call(threadcall_t *self, threadcall_callback_t callback, void *userdata);
-eventcontext_t *threadcall_get_ec(threadcall_t *self);
+const eventcontext_t *threadcall_get_ec(const threadcall_t *self);
typedef void (*sigev_callback_t)(int signum, void *);
sigev_t *sigev_new(const eventcontext_t *ec, sigev_callback_t cb, void *userdata);
void sigev_free(sigev_t *self);
void sigev_add(sigev_t *self, int signum);
+void sigev_del(sigev_t *self);
+void sigev_clear(sigev_t *self);
+const eventcontext_t *sigev_get_ec(const sigev_t *self);
typedef void (*timerev_callback_t)(timerev_t *, void *);
timerev_t *timerev_new(const eventcontext_t *ec, timerev_callback_t callback, void *);
@@ -695,6 +702,7 @@ void timerev_free(timerev_t *self);
void timerev_add(timerev_t *self, double t_sec);
void timerev_del(timerev_t *self);
void timerev_clear(timerev_t *self);
+const eventcontext_t *timerev_get_ec(const timerev_t *self);
#ifdef __cplusplus
}
diff --git a/include/salticidae/netaddr.h b/include/salticidae/netaddr.h
index a25bf6f..bff4cb7 100644
--- a/include/salticidae/netaddr.h
+++ b/include/salticidae/netaddr.h
@@ -147,6 +147,7 @@ uint32_t netaddr_get_ip(const netaddr_t *self);
uint16_t netaddr_get_port(const netaddr_t *self);
netaddr_array_t *netaddr_array_new();
netaddr_array_t *netaddr_array_new_from_addrs(const netaddr_t * const *paddrs, size_t naddrs);
+void netaddr_array_free(netaddr_array_t *self);
#ifdef __cplusplus
}