From da2aac4a6eb10af88e3938068e24c58aea1832b1 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 12 Jun 2018 20:05:34 -0700 Subject: 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. --- src/core/endpt.h | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/core/endpt.h') diff --git a/src/core/endpt.h b/src/core/endpt.h index 2511c1ff..bf251d41 100644 --- a/src/core/endpt.h +++ b/src/core/endpt.h @@ -26,12 +26,14 @@ 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, int); -extern int nni_ep_getopt(nni_ep *, const char *, void *, size_t *, int); -extern int nni_ep_opttype(nni_ep *, const char *, int *); -extern int nni_ep_pipe_add(nni_ep *ep, nni_pipe *); -extern void nni_ep_pipe_remove(nni_ep *, nni_pipe *); -extern int nni_ep_mode(nni_ep *); +extern int nni_ep_pipe_add(nni_ep *ep, nni_pipe *); +extern void nni_ep_pipe_remove(nni_ep *, nni_pipe *); +extern int nni_ep_mode(nni_ep *); + +extern int nni_ep_setopt( + nni_ep *, const char *, const void *, size_t, nni_opt_type); +extern int nni_ep_getopt( + nni_ep *, const char *, void *, size_t *, nni_opt_type); // Endpoint modes. Currently used by transports. Remove this when we make // transport dialers and listeners explicit. -- cgit v1.2.3-70-g09d2