summaryrefslogtreecommitdiff
path: root/parapat.h
diff options
context:
space:
mode:
authorTom Harley2020-01-24 05:15:35 +0000
committerTom Harley2020-01-24 05:15:35 +0000
commitc9f0de12be31eea463bf022f3eee76490b30f8dc (patch)
treea80718ff00fa2dcb1c52c2af6828feffc7f89d8b /parapat.h
downloadparapat-c9f0de12be31eea463bf022f3eee76490b30f8dc.tar.gz
parapat-c9f0de12be31eea463bf022f3eee76490b30f8dc.zip

Initial commit

HEADmaster
Diffstat (limited to 'parapat.h')
-rw-r--r--parapat.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/parapat.h b/parapat.h
new file mode 100644
index 0000000..cdf6340
--- /dev/null
+++ b/parapat.h
@@ -0,0 +1,35 @@
+/*
+ * vim: ft=c
+ */
+
+#ifndef PARPAT_H
+#define PARPAT_H
+
+#include "queue.h"
+
+typedef int (emitter)(void **, void *);
+typedef void *(worker)(void *, void *);
+typedef void *(collector)(void *, void *, void *);
+
+typedef void *(queue_emitter)(queue *, void *);
+typedef void *(queue_worker)(queue *, queue *, void *);
+typedef void *(queue_collector)(queue *, void *);
+
+void *create_farm(emitter *efn, worker *wfn, collector *cfn, int n,
+ void *efn_arg, void *wfn_arg, void *cfn_arg);
+void *create_pipeline(emitter *efn, worker **wfns, int n, collector *cfn,
+ void *efn_arg, void **wfn_args, void *cfn_arg);
+
+void *install_farm(worker *wfn, int n, queue *in, queue *out, void *arg);
+void *install_pipeline(worker **wfns, int n, queue *in, queue *out,
+ void **args);
+
+void *install_farm_queue(queue_worker *wfn, int n, queue *in, queue *out,
+ void *arg);
+void *install_queue_pipeline(queue_worker **wfns, int n, queue *in,
+ queue *out, void **args);
+
+void *create_queue_base(queue_emitter *efn, queue_worker *wfn,
+ queue_collector *cfn, void *efn_arg, void *wfn_arg, void *cfn_arg);
+
+#endif /* PARPAT_H */