From c9f0de12be31eea463bf022f3eee76490b30f8dc Mon Sep 17 00:00:00 2001 From: Tom Harley Date: Fri, 24 Jan 2020 05:15:35 +0000 Subject: Initial commit --- parapat.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 parapat.h (limited to 'parapat.h') 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 */ -- cgit v1.2.1