]> www.average.org Git - psmb.git/blobdiff - include/psmb.h
add private header for structs
[psmb.git] / include / psmb.h
diff --git a/include/psmb.h b/include/psmb.h
new file mode 100644 (file)
index 0000000..e975de4
--- /dev/null
@@ -0,0 +1,27 @@
+#ifndef _PSMB_H
+
+#include <stdlib.h>
+#include <stdbool.h>
+
+typedef struct _psmb_ctx psmb_ctx_t;
+typedef struct _psmb_result psmb_result_t;
+
+psmb_ctx_t *psmb_new(void);
+psmb_ctx_t *psmb_new_mm(void *(*malloc)(size_t size),
+                       void (*free)(void *ptr),
+                       void *(*realloc)(void *ptr, size_t size));
+psmb_result_t psmb_set_pmtu(psmb_ctx_t *ctx, int pmtu);
+psmb_result_t psmb_open(psmb_ctx_t *ctx);
+void psmb_destroy(psmb_ctx_t *ctx);
+int psmb_getfd(psmb_ctx_t *ctx);
+bool psmb_need_write_wait(psmb_result_t result);
+psmb_result_t psmb_ev_rd(psmb_ctx_t *ctx);
+psmb_result_t psmb_ev_wr(psmb_ctx_t *ctx);
+psmb_result_t psmb_ev_ex(psmb_ctx_t *ctx);
+psmb_result_t psmb_subscribe(psmb_ctx_t *ctx, char *channel);
+psmb_result_t psmb_publish(psmb_ctx_t *ctx, char *channel,
+                               void *data, size_t size);
+bool psmb_message(psmb_ctx_t *ctx, char **channel,
+                               void **data, size_t *size);
+
+#endif