aboutsummaryrefslogtreecommitdiff
path: root/src/itc.h
blob: 44e38751d922a0d1c1682750730e6454f7ed9f8b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#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_retrieve(itc *ctx, int timeout_ms);
int itc_inject(itc *ctx, int timeout_ms, void *element);
void itc_wait_empty(itc *ctx);
void itc_discard_all(itc *ctx, itc_free_element free_element);

int itc_get_queued(itc *ctx);
int itc_get_slots(itc *ctx);

#endif //LIBTUBERIA_ITC_H__