From 5cf750697624d4fd63cfe26921209d7c30e1a2d2 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 21 Jan 2019 22:40:10 -0800 Subject: fixes #872 create unified nng_stream API This is a major change, and includes changes to use a polymorphic stream API for all transports. There have been related bugs fixed along the way. Additionally the man pages have changed. The old non-polymorphic APIs are removed now. This is a breaking change, but the old APIs were never part of any released public API. --- src/core/options.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/options.c') diff --git a/src/core/options.c b/src/core/options.c index 0b15d6e2..82735369 100644 --- a/src/core/options.c +++ b/src/core/options.c @@ -398,4 +398,20 @@ nni_setopt(const nni_option *opts, const char *nm, void *arg, const void *buf, opts++; } return (NNG_ENOTSUP); +} + +int +nni_chkopt(const nni_chkoption *opts, const char *nm, const void *buf, + size_t sz, nni_type t) +{ + while (opts->o_name != NULL) { + if (strcmp(opts->o_name, nm) == 0) { + if (opts->o_check == NULL) { + return (NNG_EREADONLY); + } + return (opts->o_check(buf, sz, t)); + } + opts++; + } + return (NNG_ENOTSUP); } \ No newline at end of file -- cgit v1.2.3-70-g09d2