diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-09-25 12:49:10 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-09-27 14:38:12 -0700 |
| commit | 64db0f085be0c9efc6dca8d9e72d3e5a47cb792e (patch) | |
| tree | 475520498d8ebe9e47e9785d8f9d209c87582400 /src/core/endpt.h | |
| parent | 86a96e5bf1b207a8b1aa925e1d9f73ce834505b8 (diff) | |
| download | nng-64db0f085be0c9efc6dca8d9e72d3e5a47cb792e.tar.gz nng-64db0f085be0c9efc6dca8d9e72d3e5a47cb792e.tar.bz2 nng-64db0f085be0c9efc6dca8d9e72d3e5a47cb792e.zip | |
Refactor option handling APIs.
This makes the APIs use string keys, and largely eliminates the use of
integer option IDs altogether. The underlying registration for options
is also now a bit richer, letting protcols and transports declare the
actual options they use, rather than calling down into each entry point
carte blanche and relying on ENOTSUP.
This code may not be as fast as the integers was, but it is more intuitive,
easier to extend, and is not on any hot code paths. (If you're diddling
options on a hot code path you're doing something wrong.)
Diffstat (limited to 'src/core/endpt.h')
| -rw-r--r-- | src/core/endpt.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/core/endpt.h b/src/core/endpt.h index 161c030f..d12d661f 100644 --- a/src/core/endpt.h +++ b/src/core/endpt.h @@ -11,25 +11,25 @@ #ifndef CORE_ENDPT_H #define CORE_ENDPT_H -extern int nni_ep_sys_init(void); -extern void nni_ep_sys_fini(void); -extern nni_tran * nni_ep_tran(nni_ep *); -extern nni_sock * nni_ep_sock(nni_ep *); -extern int nni_ep_find(nni_ep **, uint32_t); -extern int nni_ep_hold(nni_ep *); -extern void nni_ep_rele(nni_ep *); -extern uint32_t nni_ep_id(nni_ep *); -extern int nni_ep_create_dialer(nni_ep **, nni_sock *, const char *); -extern int nni_ep_create_listener(nni_ep **, nni_sock *, const char *); -extern void nni_ep_stop(nni_ep *); -extern int nni_ep_shutdown(nni_ep *); -extern void nni_ep_close(nni_ep *); -extern int nni_ep_dial(nni_ep *, int); -extern int nni_ep_listen(nni_ep *, int); -extern void nni_ep_list_init(nni_list *); -extern int nni_ep_setopt(nni_ep *, int, const void *, size_t, int); -extern int nni_ep_getopt(nni_ep *, int, void *, size_t *); -extern int nni_ep_pipe_add(nni_ep *ep, nni_pipe *); +extern int nni_ep_sys_init(void); +extern void nni_ep_sys_fini(void); +extern nni_tran *nni_ep_tran(nni_ep *); +extern nni_sock *nni_ep_sock(nni_ep *); +extern int nni_ep_find(nni_ep **, uint32_t); +extern int nni_ep_hold(nni_ep *); +extern void nni_ep_rele(nni_ep *); +extern uint32_t nni_ep_id(nni_ep *); +extern int nni_ep_create_dialer(nni_ep **, nni_sock *, const char *); +extern int nni_ep_create_listener(nni_ep **, nni_sock *, const char *); +extern void nni_ep_stop(nni_ep *); +extern int nni_ep_shutdown(nni_ep *); +extern void nni_ep_close(nni_ep *); +extern int nni_ep_dial(nni_ep *, int); +extern int nni_ep_listen(nni_ep *, int); +extern void nni_ep_list_init(nni_list *); +extern int nni_ep_setopt(nni_ep *, const char *, const void *, size_t); +extern int nni_ep_getopt(nni_ep *, const char *, void *, size_t *); +extern int nni_ep_pipe_add(nni_ep *ep, nni_pipe *); extern void nni_ep_pipe_remove(nni_ep *, nni_pipe *); extern const char *nni_ep_url(nni_ep *); |
