diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-01-21 22:40:10 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-02-16 19:22:27 -0800 |
| commit | 5cf750697624d4fd63cfe26921209d7c30e1a2d2 (patch) | |
| tree | bf11695e5f1ec5e400c87da0cc6ff23935a2eeff /src/core/options.h | |
| parent | ca655b9db689ee0e655248b1a9f166b8db6cc984 (diff) | |
| download | nng-5cf750697624d4fd63cfe26921209d7c30e1a2d2.tar.gz nng-5cf750697624d4fd63cfe26921209d7c30e1a2d2.tar.bz2 nng-5cf750697624d4fd63cfe26921209d7c30e1a2d2.zip | |
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.
Diffstat (limited to 'src/core/options.h')
| -rw-r--r-- | src/core/options.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/core/options.h b/src/core/options.h index 9c5d4817..7b66dbfb 100644 --- a/src/core/options.h +++ b/src/core/options.h @@ -74,11 +74,20 @@ struct nni_option_s { int (*o_set)(void *, const void *, size_t, nni_type); }; +typedef struct nni_chkoption_s nni_chkoption; +struct nni_chkoption_s { + const char *o_name; + // o_check can be NULL for read-only options + int (*o_check)(const void *, size_t, nni_type); +}; + // nni_getopt and nni_setopt are helper functions to implement options // based on arrays of nni_option structures. extern int nni_getopt( const nni_option *, const char *, void *, void *, size_t *, nni_type); extern int nni_setopt( const nni_option *, const char *, void *, const void *, size_t, nni_type); +extern int nni_chkopt( + const nni_chkoption *, const char *, const void *, size_t, nni_type); #endif // CORE_OPTIONS_H |
