From: Eugene Crosser Date: Mon, 11 Mar 2019 18:40:19 +0000 (+0100) Subject: add private header for structs X-Git-Url: http://www.average.org/gitweb/?p=psmb.git;a=commitdiff_plain;h=8309c3b0f167256776fb0cb96fc2c8becd4ed144 add private header for structs --- diff --git a/include/psmb.h b/include/psmb.h new file mode 100644 index 0000000..e975de4 --- /dev/null +++ b/include/psmb.h @@ -0,0 +1,27 @@ +#ifndef _PSMB_H + +#include +#include + +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 diff --git a/psmb.h b/psmb.h deleted file mode 100644 index afdb69d..0000000 --- a/psmb.h +++ /dev/null @@ -1,28 +0,0 @@ -#ifndef _PSMB_H - -#include -#include - -struct psmb_ctx; - -typedef struct _psmb_result psmb_result_t; - -struct psmb_ctx *psmb_new(void); -struct psmb_ctx *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(struct psmb_ctx * ctx, int pmtu); -psmb_result_t psmb_open(struct psmb_ctx *ctx); -void psmb_destroy(struct psmb_ctx *ctx); -int psmb_getfd(struct psmb_ctx *ctx); -bool psmb_need_write_wait(psmb_result_t result); -psmb_result_t psmb_ev_rd(struct psmb_ctx *ctx); -psmb_result_t psmb_ev_wr(struct psmb_ctx *ctx); -psmb_result_t psmb_ev_ex(struct psmb_ctx *ctx); -psmb_result_t psmb_subscribe(struct psmb_ctx * ctx, char *channel); -psmb_result_t psmb_publish(struct psmb_ctx * ctx, char *channel, - void *data, size_t size); -bool psmb_message(struct psmb_ctx * ctx, char **channel, - void **data, size_t *size); - -#endif diff --git a/src/psmb_priv.h b/src/psmb_priv.h new file mode 100644 index 0000000..9b57d39 --- /dev/null +++ b/src/psmb_priv.h @@ -0,0 +1,18 @@ +#ifndef _PSMB_PRIV_H + +#include + +struct _psmb_ctx psmb_ctx_t { + int fd; + void *(*malloc)(size_t size); + void (*free)(void *ptr); + void *(*realloc)(void *ptr, size_t size); + int pmtu; + /* data here */ +}; + +struct _psmb_result { + int code; +}; + +#endif