]> www.average.org Git - psmb.git/blob - psmb.h
rename the project to 'psmb' before it's too late
[psmb.git] / psmb.h
1 #ifndef _PSMB_H
2
3 #include <stdlib.h>
4 #include <stdbool.h>
5
6 struct psmb_ctx;
7
8 typedef struct _psmb_result psmb_result_t;
9
10 struct psmb_ctx *psmb_new(void);
11 struct psmb_ctx *psmb_new_mm(void *(*malloc)(size_t size),
12        void (*free)(void *ptr),
13        void *(*realloc)(void *ptr, size_t size));
14 psmb_result_t psmb_set_pmtu(struct psmb_ctx * ctx, int pmtu);
15 psmb_result_t psmb_open(struct psmb_ctx *ctx);
16 void psmb_destroy(struct psmb_ctx *ctx);
17 int psmb_getfd(struct psmb_ctx *ctx);
18 bool psmb_need_write_wait(psmb_result_t result);
19 psmb_result_t psmb_ev_rd(struct psmb_ctx *ctx);
20 psmb_result_t psmb_ev_wr(struct psmb_ctx *ctx);
21 psmb_result_t psmb_ev_ex(struct psmb_ctx *ctx);
22 psmb_result_t psmb_subscribe(struct psmb_ctx * ctx, char *channel);
23 psmb_result_t psmb_publish(struct psmb_ctx * ctx, char *channel,
24         void *data, size_t size);
25 bool psmb_message(struct psmb_ctx * ctx, char **channel,
26         void **data, size_t *size);
27
28 #endif