summaryrefslogtreecommitdiff
path: root/src/itc.h
diff options
context:
space:
mode:
authorPaweł Redman <pawel.redman@gmail.com>2016-03-30 21:20:07 +0200
committerPaweł Redman <pawel.redman@gmail.com>2016-03-30 21:20:07 +0200
commit523f6b460dcf1f864656a9a6ccc2a54d52f385c6 (patch)
treedd457448a2518ce45ac36ba427c12491f01d7e76 /src/itc.h
parent745d5a072d8669d1bc35e7c1f28b75b3484542e8 (diff)
Split common.h.
Diffstat (limited to 'src/itc.h')
-rw-r--r--src/itc.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/itc.h b/src/itc.h
new file mode 100644
index 0000000..485b1bb
--- /dev/null
+++ b/src/itc.h
@@ -0,0 +1,26 @@
+#ifndef _ITC_H
+#define _ITC_H
+
+#include "common.h"
+
+typedef struct itc_message_s itc_message;
+struct itc_message_s {
+ int number;
+ void *data;
+
+ itc_message *older, *newer;
+};
+
+typedef struct {
+ itc_message *newest, *oldest;
+ SDL_mutex *mutex;
+ SDL_sem *sem;
+} itc_chan;
+
+void itc_chan_create(itc_chan *chan);
+void itc_chan_destroy(itc_chan *chan);
+void itc_chan_push(itc_chan *chan, int number, void *data);
+int itc_chan_pop(itc_chan *chan, int *number, void **data);
+int itc_chan_pop_block(itc_chan *chan, int *number, void **data);
+
+#endif // _ITC_H