diff options
| author | Garrett D'Amore <garrett@damore.org> | 2018-03-20 18:38:54 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2018-03-20 18:42:23 -0700 |
| commit | 6df40cb6eea9a4220d61c4c927ce5a857a12a338 (patch) | |
| tree | ac4b7ecbcb41a456eb4d0429fc180047656371ba /src/protocol | |
| parent | 9ca901c1b70b17d851426483d9f54611cfa8e395 (diff) | |
| download | nng-6df40cb6eea9a4220d61c4c927ce5a857a12a338.tar.gz nng-6df40cb6eea9a4220d61c4c927ce5a857a12a338.tar.bz2 nng-6df40cb6eea9a4220d61c4c927ce5a857a12a338.zip | |
fixes #301 String option handling for getopt
Diffstat (limited to 'src/protocol')
| -rw-r--r-- | src/protocol/bus0/bus.c | 4 | ||||
| -rw-r--r-- | src/protocol/pair0/pair.c | 4 | ||||
| -rw-r--r-- | src/protocol/pair1/pair.c | 12 | ||||
| -rw-r--r-- | src/protocol/pipeline0/pull.c | 4 | ||||
| -rw-r--r-- | src/protocol/pipeline0/push.c | 4 | ||||
| -rw-r--r-- | src/protocol/pubsub0/pub.c | 4 | ||||
| -rw-r--r-- | src/protocol/pubsub0/sub.c | 4 | ||||
| -rw-r--r-- | src/protocol/reqrep0/rep.c | 8 | ||||
| -rw-r--r-- | src/protocol/reqrep0/req.c | 12 | ||||
| -rw-r--r-- | src/protocol/survey0/respond.c | 8 | ||||
| -rw-r--r-- | src/protocol/survey0/survey.c | 12 |
11 files changed, 38 insertions, 38 deletions
diff --git a/src/protocol/bus0/bus.c b/src/protocol/bus0/bus.c index 31b40fd5..00a9ca02 100644 --- a/src/protocol/bus0/bus.c +++ b/src/protocol/bus0/bus.c @@ -341,10 +341,10 @@ bus0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -bus0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +bus0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { bus0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static void diff --git a/src/protocol/pair0/pair.c b/src/protocol/pair0/pair.c index 476eadd6..bc8be866 100644 --- a/src/protocol/pair0/pair.c +++ b/src/protocol/pair0/pair.c @@ -239,10 +239,10 @@ pair0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -pair0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +pair0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { pair0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static void diff --git a/src/protocol/pair1/pair.c b/src/protocol/pair1/pair.c index 564118ae..ee67cf7b 100644 --- a/src/protocol/pair1/pair.c +++ b/src/protocol/pair1/pair.c @@ -408,10 +408,10 @@ pair1_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -pair1_sock_getopt_raw(void *arg, void *buf, size_t *szp) +pair1_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { pair1_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -426,10 +426,10 @@ pair1_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -pair1_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +pair1_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { pair1_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static int @@ -444,10 +444,10 @@ pair1_sock_setopt_poly(void *arg, const void *buf, size_t sz) } static int -pair1_sock_getopt_poly(void *arg, void *buf, size_t *szp) +pair1_sock_getopt_poly(void *arg, void *buf, size_t *szp, int typ) { pair1_sock *s = arg; - return (nni_getopt_bool(s->poly, buf, szp)); + return (nni_copyout_bool(s->poly, buf, szp, typ)); } static void diff --git a/src/protocol/pipeline0/pull.c b/src/protocol/pipeline0/pull.c index fec07c39..d8f4641f 100644 --- a/src/protocol/pipeline0/pull.c +++ b/src/protocol/pipeline0/pull.c @@ -188,10 +188,10 @@ pull0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -pull0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +pull0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { pull0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static void diff --git a/src/protocol/pipeline0/push.c b/src/protocol/pipeline0/push.c index b6f6a824..bbffb433 100644 --- a/src/protocol/pipeline0/push.c +++ b/src/protocol/pipeline0/push.c @@ -205,10 +205,10 @@ push0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -push0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +push0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { push0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static void diff --git a/src/protocol/pubsub0/pub.c b/src/protocol/pubsub0/pub.c index 36c27e7f..3f4ecea6 100644 --- a/src/protocol/pubsub0/pub.c +++ b/src/protocol/pubsub0/pub.c @@ -281,10 +281,10 @@ pub0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -pub0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +pub0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { pub0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static void diff --git a/src/protocol/pubsub0/sub.c b/src/protocol/pubsub0/sub.c index cb7b0509..d7e9aea4 100644 --- a/src/protocol/pubsub0/sub.c +++ b/src/protocol/pubsub0/sub.c @@ -283,10 +283,10 @@ sub0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -sub0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +sub0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { sub0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static void diff --git a/src/protocol/reqrep0/rep.c b/src/protocol/reqrep0/rep.c index 429d55e7..5ee6c1be 100644 --- a/src/protocol/reqrep0/rep.c +++ b/src/protocol/reqrep0/rep.c @@ -365,10 +365,10 @@ rep0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -rep0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +rep0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { rep0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -379,10 +379,10 @@ rep0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -rep0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +rep0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { rep0_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static nni_msg * diff --git a/src/protocol/reqrep0/req.c b/src/protocol/reqrep0/req.c index 63ae07a0..659578d4 100644 --- a/src/protocol/reqrep0/req.c +++ b/src/protocol/reqrep0/req.c @@ -257,10 +257,10 @@ req0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -req0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +req0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { req0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -271,10 +271,10 @@ req0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -req0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +req0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { req0_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static int @@ -285,10 +285,10 @@ req0_sock_setopt_resendtime(void *arg, const void *buf, size_t sz) } static int -req0_sock_getopt_resendtime(void *arg, void *buf, size_t *szp) +req0_sock_getopt_resendtime(void *arg, void *buf, size_t *szp, int typ) { req0_sock *s = arg; - return (nni_getopt_ms(s->retry, buf, szp)); + return (nni_copyout_ms(s->retry, buf, szp, typ)); } // Raw and cooked mode differ in the way they send messages out. diff --git a/src/protocol/survey0/respond.c b/src/protocol/survey0/respond.c index 42db2cb0..035e51b1 100644 --- a/src/protocol/survey0/respond.c +++ b/src/protocol/survey0/respond.c @@ -359,10 +359,10 @@ resp0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -resp0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +resp0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { resp0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -373,10 +373,10 @@ resp0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -resp0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +resp0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { resp0_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static void diff --git a/src/protocol/survey0/survey.c b/src/protocol/survey0/survey.c index 40ace91b..161a5002 100644 --- a/src/protocol/survey0/survey.c +++ b/src/protocol/survey0/survey.c @@ -290,10 +290,10 @@ surv0_sock_setopt_raw(void *arg, const void *buf, size_t sz) } static int -surv0_sock_getopt_raw(void *arg, void *buf, size_t *szp) +surv0_sock_getopt_raw(void *arg, void *buf, size_t *szp, int typ) { surv0_sock *s = arg; - return (nni_getopt_bool(s->raw, buf, szp)); + return (nni_copyout_bool(s->raw, buf, szp, typ)); } static int @@ -304,10 +304,10 @@ surv0_sock_setopt_maxttl(void *arg, const void *buf, size_t sz) } static int -surv0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp) +surv0_sock_getopt_maxttl(void *arg, void *buf, size_t *szp, int typ) { surv0_sock *s = arg; - return (nni_getopt_int(s->ttl, buf, szp)); + return (nni_copyout_int(s->ttl, buf, szp, typ)); } static int @@ -318,10 +318,10 @@ surv0_sock_setopt_surveytime(void *arg, const void *buf, size_t sz) } static int -surv0_sock_getopt_surveytime(void *arg, void *buf, size_t *szp) +surv0_sock_getopt_surveytime(void *arg, void *buf, size_t *szp, int typ) { surv0_sock *s = arg; - return (nni_getopt_ms(s->survtime, buf, szp)); + return (nni_copyout_ms(s->survtime, buf, szp, typ)); } static void |
