aboutsummaryrefslogtreecommitdiff
path: root/src/core/defs.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-06-12 20:05:34 -0700
committerGarrett D'Amore <garrett@damore.org>2018-06-13 18:01:52 -0700
commitda2aac4a6eb10af88e3938068e24c58aea1832b1 (patch)
treefb0676be5426ed1510945b7e7fe3d09eb45333a7 /src/core/defs.h
parent61ffae5e3649897776c26799ccaaa35d578ba816 (diff)
downloadnng-da2aac4a6eb10af88e3938068e24c58aea1832b1.tar.gz
nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.tar.bz2
nng-da2aac4a6eb10af88e3938068e24c58aea1832b1.zip
fixes #540 nni_ep_opttype serves no purpose
fixes #538 setopt should have an explicit chkopt routine fixes #537 Internal TCP API needs better name separation fixes #524 Option types should be "typed" This is a rework of the option management code, to make it both clearer and to prepare for further work to break up endpoints. This reduces a certain amount of dead or redundant code, and actually saves cycles when setting options, as some loops were not terminated that should have been.
Diffstat (limited to 'src/core/defs.h')
-rw-r--r--src/core/defs.h34
1 files changed, 16 insertions, 18 deletions
diff --git a/src/core/defs.h b/src/core/defs.h
index 29d1b826..77078a7a 100644
--- a/src/core/defs.h
+++ b/src/core/defs.h
@@ -40,22 +40,20 @@ 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_ctx nni_ctx;
-typedef struct nni_ep nni_ep;
-typedef struct nni_pipe nni_pipe;
-typedef struct nni_tran nni_tran;
-typedef struct nni_tran_ep_ops nni_tran_ep_ops;
-typedef struct nni_tran_ep_option nni_tran_ep_option;
-typedef struct nni_tran_pipe_ops nni_tran_pipe_ops;
-typedef struct nni_tran_pipe_option nni_tran_pipe_option;
-
-typedef struct nni_proto_ctx_option nni_proto_ctx_option;
-typedef struct nni_proto_ctx_ops nni_proto_ctx_ops;
-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_socket nni_sock;
+typedef struct nni_ctx nni_ctx;
+typedef struct nni_ep nni_ep;
+typedef struct nni_pipe nni_pipe;
+typedef struct nni_tran nni_tran;
+typedef struct nni_tran_option nni_tran_option;
+typedef struct nni_tran_ep_ops nni_tran_ep_ops;
+typedef struct nni_tran_pipe_ops nni_tran_pipe_ops;
+
+typedef struct nni_proto_option nni_proto_option;
+typedef struct nni_proto_ctx_ops nni_proto_ctx_ops;
+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_plat_mtx nni_mtx;
typedef struct nni_plat_cv nni_cv;
@@ -140,7 +138,7 @@ typedef struct {
// Types. These are used to provide more structured access to options
// (and maybe later statistics). For now these are internal only.
-enum nni_type {
+typedef enum nni_opt_type {
NNI_TYPE_OPAQUE,
NNI_TYPE_BOOL,
NNI_TYPE_INT32,
@@ -152,6 +150,6 @@ enum nni_type {
NNI_TYPE_STRING,
NNI_TYPE_SOCKADDR,
NNI_TYPE_POINTER,
-};
+} nni_opt_type;
#endif // CORE_DEFS_H