From 3c3935dc6d5ba6e4ed33bad1e969aa9888bd3a8a Mon Sep 17 00:00:00 2001 From: Nicolas Dato Date: Sun, 5 Nov 2023 15:07:12 -0300 Subject: Adding some initial code. utils.c for some auxiliary functions, and itc.c for intra-tuberia-communication --- src/itc.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/itc.h (limited to 'src/itc.h') diff --git a/src/itc.h b/src/itc.h new file mode 100644 index 0000000..0d43e3d --- /dev/null +++ b/src/itc.h @@ -0,0 +1,14 @@ +#ifndef __LIBTUBERIA_ITC_H__ +#define __LIBTUBERIA_ITC_H__ + +typedef struct itc itc; +typedef void (*itc_free_element)(void *element); + +itc *itc_alloc(int nslots); +void itc_free(itc **ctx, itc_free_element free_element); + +void *itc_retrive(itc *ctx, int timeout_ms); +int itc_inject(itc *ctx, int timeout_ms, void *element); +void itc_drop(itc *ctx, itc_free_element free_element); + +#endif //__LIBTUBERIA_ITC_H__ -- cgit v1.2.3