diff options
| author | Garrett D'Amore <garrett@damore.org> | 2025-04-27 23:35:25 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2025-04-27 23:35:25 -0700 |
| commit | 7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4 (patch) | |
| tree | 5a3036d609404ee5218b6189a89799e70f4623df /src/core/options.h | |
| parent | 70ae513e4dda50864f7d45b6676549ed5246144d (diff) | |
| download | nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.tar.gz nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.tar.bz2 nng-7bb5ab9c4f70c9fa0a67a22c4aee83b0109318c4.zip | |
Converted property functions to use nng_err.
Diffstat (limited to 'src/core/options.h')
| -rw-r--r-- | src/core/options.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/core/options.h b/src/core/options.h index 71fa4d36..fb326b6a 100644 --- a/src/core/options.h +++ b/src/core/options.h @@ -28,29 +28,29 @@ // 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, nni_type); -extern int nni_copyin_bool(bool *, const void *, size_t, nni_type); -extern int nni_copyin_int(int *, const void *, size_t, int, int, nni_type); -extern int nni_copyin_size( +extern nng_err nni_copyin_ms(nni_duration *, const void *, size_t, nni_type); +extern nng_err nni_copyin_bool(bool *, const void *, size_t, nni_type); +extern nng_err nni_copyin_int(int *, const void *, size_t, int, int, nni_type); +extern nng_err nni_copyin_size( size_t *, const void *, size_t, size_t, size_t, nni_type); -extern int nni_copyin_str(char *, const void *, size_t, nni_type); -extern int nni_copyin_ptr(void **, const void *, size_t, nni_type); -extern int nni_copyin_sockaddr(nng_sockaddr *, const void *, nni_type); +extern nng_err nni_copyin_str(char *, const void *, size_t, nni_type); +extern nng_err nni_copyin_ptr(void **, const void *, size_t, nni_type); +extern nng_err nni_copyin_sockaddr(nng_sockaddr *, const void *, nni_type); // nni_copyout_xxx copies out a type of the named value. It assumes that // the type is aligned and the size correct. -extern int nni_copyout(const void *, size_t, void *, size_t *); -extern int nni_copyout_bool(bool, void *, size_t *, nni_type); -extern int nni_copyout_int(int, void *, size_t *, nni_type); -extern int nni_copyout_ms(nng_duration, void *, size_t *, nni_type); -extern int nni_copyout_ptr(void *, void *, size_t *, nni_type); -extern int nni_copyout_size(size_t, void *, size_t *, nni_type); -extern int nni_copyout_sockaddr( +extern nng_err nni_copyout(const void *, size_t, void *, size_t *); +extern nng_err nni_copyout_bool(bool, void *, size_t *, nni_type); +extern nng_err nni_copyout_int(int, void *, size_t *, nni_type); +extern nng_err nni_copyout_ms(nng_duration, void *, size_t *, nni_type); +extern nng_err nni_copyout_ptr(void *, void *, size_t *, nni_type); +extern nng_err nni_copyout_size(size_t, void *, size_t *, nni_type); +extern nng_err nni_copyout_sockaddr( const nng_sockaddr *, void *, size_t *, nni_type); // nni_copyout_str copies out a string. If the type is NNI_TYPE_STRING, // then it passes through a pointer, created by nni_strdup(). -extern int nni_copyout_str(const char *, void *, size_t *, nni_type); +extern nng_err nni_copyout_str(const char *, void *, size_t *, nni_type); // nni_option is used for socket, protocol, transport, and similar options. // Note that only for transports, the o_set member may be called with a NULL @@ -66,20 +66,20 @@ struct nni_option_s { // the actual size of the object that would have been copied // is supplied by the function in the size. If the object did // not fit, then NNG_EINVAL is returned. - int (*o_get)(void *, void *, size_t *, nni_type); + nng_err (*o_get)(void *, void *, size_t *, nni_type); // o_set is used to set the value of the option. For transport // endpoints only, the instance parameter (first argument) may be // NULL, in which case only a generic validation of the parameters // is performed. (This is used when setting socket options before - int (*o_set)(void *, const void *, size_t, nni_type); + nng_err (*o_set)(void *, 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( +extern nng_err nni_getopt( const nni_option *, const char *, void *, void *, size_t *, nni_type); -extern int nni_setopt( +extern nng_err nni_setopt( const nni_option *, const char *, void *, const void *, size_t, nni_type); #endif // CORE_OPTIONS_H |
