From 64db0f085be0c9efc6dca8d9e72d3e5a47cb792e Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 25 Sep 2017 12:49:10 -0700 Subject: 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.) --- src/core/defs.h | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src/core/defs.h') diff --git a/src/core/defs.h b/src/core/defs.h index 4d8e6ffb..ff02b28b 100644 --- a/src/core/defs.h +++ b/src/core/defs.h @@ -32,16 +32,19 @@ typedef struct nng_event nni_event; typedef struct nng_notify nni_notify; // These are our own names. -typedef struct nni_socket nni_sock; -typedef struct nni_ep nni_ep; -typedef struct nni_pipe nni_pipe; -typedef struct nni_tran nni_tran; -typedef struct nni_tran_ep nni_tran_ep; -typedef struct nni_tran_pipe nni_tran_pipe; - -typedef struct nni_proto_sock_ops nni_proto_sock_ops; -typedef struct nni_proto_pipe_ops nni_proto_pipe_ops; -typedef struct nni_proto nni_proto; +typedef struct nni_socket nni_sock; +typedef struct nni_ep nni_ep; +typedef struct nni_pipe nni_pipe; +typedef struct nni_tran nni_tran; +typedef struct nni_tran_ep nni_tran_ep; +typedef struct nni_tran_ep_option nni_tran_ep_option; +typedef struct nni_tran_pipe nni_tran_pipe; +typedef struct nni_tran_pipe_option nni_tran_pipe_option; + +typedef struct nni_proto_sock_ops nni_proto_sock_ops; +typedef struct nni_proto_pipe_ops nni_proto_pipe_ops; +typedef struct nni_proto_sock_option nni_proto_sock_option; +typedef struct nni_proto nni_proto; typedef struct nni_plat_mtx nni_mtx; typedef struct nni_plat_cv nni_cv; -- cgit v1.2.3-70-g09d2