diff options
| author | Garrett D'Amore <garrett@damore.org> | 2024-11-03 08:57:35 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2024-11-03 08:57:56 -0800 |
| commit | fb7f83b4c6f371372f742ff45f5efb8e83374f8c (patch) | |
| tree | 1dd5d7be8fdb4c47881051f3511f0932160c9619 /src | |
| parent | 4367013d8b56105edd0d27d0b9b6da2becab9717 (diff) | |
| download | nng-fb7f83b4c6f371372f742ff45f5efb8e83374f8c.tar.gz nng-fb7f83b4c6f371372f742ff45f5efb8e83374f8c.tar.bz2 nng-fb7f83b4c6f371372f742ff45f5efb8e83374f8c.zip | |
Remove nng_ctx untyped option functions
Diffstat (limited to 'src')
| -rw-r--r-- | src/nng.c | 24 |
1 files changed, 4 insertions, 20 deletions
@@ -410,10 +410,8 @@ ctx_get(nng_ctx id, const char *n, void *v, size_t *szp, nni_type t) nni_ctx *ctx; int rv; - if ((rv = nni_init()) != 0) { - return (rv); - } - if ((rv = nni_ctx_find(&ctx, id.id, false)) != 0) { + if (((rv = nni_init()) != 0) || + ((rv = nni_ctx_find(&ctx, id.id, false)) != 0)) { return (rv); } rv = nni_ctx_getopt(ctx, n, v, szp, t); @@ -422,12 +420,6 @@ ctx_get(nng_ctx id, const char *n, void *v, size_t *szp, nni_type t) } int -nng_ctx_get(nng_ctx id, const char *n, void *v, size_t *szp) -{ - return (ctx_get(id, n, v, szp, NNI_TYPE_OPAQUE)); -} - -int nng_ctx_get_int(nng_ctx id, const char *n, int *v) { return (ctx_get(id, n, v, NULL, NNI_TYPE_INT32)); @@ -475,10 +467,8 @@ ctx_set(nng_ctx id, const char *n, const void *v, size_t sz, nni_type t) nni_ctx *ctx; int rv; - if ((rv = nni_init()) != 0) { - return (rv); - } - if ((rv = nni_ctx_find(&ctx, id.id, false)) != 0) { + if (((rv = nni_init()) != 0) || + ((rv = nni_ctx_find(&ctx, id.id, false)) != 0)) { return (rv); } rv = nni_ctx_setopt(ctx, n, v, sz, t); @@ -487,12 +477,6 @@ ctx_set(nng_ctx id, const char *n, const void *v, size_t sz, nni_type t) } int -nng_ctx_set(nng_ctx id, const char *n, const void *v, size_t sz) -{ - return (ctx_set(id, n, v, sz, NNI_TYPE_OPAQUE)); -} - -int nng_ctx_set_int(nng_ctx id, const char *n, int v) { return (ctx_set(id, n, &v, sizeof(v), NNI_TYPE_INT32)); |
