aboutsummaryrefslogtreecommitdiffhomepage
path: root/iothread.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-15 11:33:41 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-02-15 11:33:41 -0800
commita92d9d442b5b4f8b3de0c2eef3a9d7a498a36aa8 (patch)
treee9043ac159a86c6c2da3e77149a309195fef43ff /iothread.h
parente2ff77b4ecd4a5555043c163df21906693a3b9cf (diff)
Initial work towards making autosuggestion smarter by recognizing paths
Diffstat (limited to 'iothread.h')
-rw-r--r--iothread.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/iothread.h b/iothread.h
index a4246fa4..7619501a 100644
--- a/iothread.h
+++ b/iothread.h
@@ -13,7 +13,7 @@
\param context A arbitary context pointer to pass to the handler and completion callback.
\return A sequence number, currently not very useful.
*/
-int iothread_perform(int (*handler)(void *), void (*completionCallback)(void *, int), void *context);
+int iothread_perform_base(int (*handler)(void *), void (*completionCallback)(void *, int), void *context);
/**
Gets the fd on which to listen for completion callbacks.
@@ -27,4 +27,10 @@ int iothread_port(void);
*/
void iothread_service_completion(void);
+/** Helper template */
+template<typename T>
+int iothread_perform(int (*handler)(T *), void (*completionCallback)(T *, int), T *context) {
+ return iothread_perform_base((int (*)(void *))handler, (void (*)(void *, int))completionCallback, static_cast<void *>(context));
+}
+
#endif