diff options
Diffstat (limited to 'src/core/options.h')
| -rw-r--r-- | src/core/options.h | 38 |
1 files changed, 13 insertions, 25 deletions
diff --git a/src/core/options.h b/src/core/options.h index 35c3232f..dfc15d31 100644 --- a/src/core/options.h +++ b/src/core/options.h @@ -11,39 +11,27 @@ #ifndef CORE_OPTIONS_H #define CORE_OPTIONS_H -// Option helpers. These can be called from protocols or transports -// in their own option handling, centralizing the logic for dealing with -// variable sized options. - -// nni_setopt_buf sets the queue size for the message queue. -extern int nni_setopt_buf(nni_msgq *, const void *, size_t); - -// nni_setopt_duration sets the duration. Durations must be legal, -// either a positive value, 0, or -1 to indicate forever. -extern int nni_setopt_ms(nni_duration *, const void *, size_t); - -// nni_setopt_bool sets a bool, or _Bool -extern int nni_setopt_bool(bool *, const void *, size_t); - -// nni_setopt_int sets an integer, which must be between the minimum and -// maximum values (inclusive). -extern int nni_setopt_int(int *, const void *, size_t, int, int); - +// Integer limits. #define NNI_MAXINT ((int) 2147483647) #define NNI_MININT ((int) -2147483648) -// nni_setopt_size sets a size_t option. -extern int nni_setopt_size(size_t *, const void *, size_t, size_t, size_t); - // We limit the maximum size to 4GB. That's intentional because some of the // underlying protocols cannot cope with anything bigger than 32-bits. #define NNI_MINSZ (0) #define NNI_MAXSZ ((size_t) 0xffffffff) -extern int nni_chkopt_bool(size_t); -extern int nni_chkopt_ms(const void *, size_t); -extern int nni_chkopt_int(const void *, size_t, int, int); -extern int nni_chkopt_size(const void *, size_t, size_t, size_t); +// Option helpers. These can be called from protocols or transports +// in their own option handling, centralizing the logic for dealing with +// variable sized options. + +extern int nni_copyin_ms(nni_duration *, const void *, size_t, int); +extern int nni_copyin_bool(bool *, const void *, size_t, int); +extern int nni_copyin_int(int *, const void *, size_t, int, int, int); +extern int nni_copyin_size( + size_t *, const void *, size_t, size_t, size_t, int); +extern int nni_copyin_str(char *, const void *, size_t, size_t, int); +extern int nni_copyin_ptr(void **, const void *, size_t, int); +extern int nni_copyin_u64(uint64_t *, const void *, size_t, int); // nni_copyout_xxx copies out a type of the named value. It assumes that // the type is aligned and the size correct, unless NNI_TYPE_OPAQUE is passed. |
