From 8b979454d891b84da727a329906c4293fadc5f3c Mon Sep 17 00:00:00 2001
From: Garrett D'Amore <garrett@damore.org>
Date: Sun, 18 Mar 2018 12:46:31 -0700
Subject: fixes #295 boolean options should use C99 bool type fixes #275
 nng_pipe_getopt_ptr() missing? fixes #285 nng_setopt_ptr MIS fixes #297
 nng_listener/dialer_close does not validate mode

This change adds some missing APIs, and changes others.
In particular, certain options are now of type bool, with size
of just one.  This is a *breaking* change for code that uses those
options -- NNG_OPT_RAW, NNG_OPT_PAIR1_POLY, NNG_OPT_TLS_VERIFIED.
---
 docs/man/nng_getopt.3.adoc | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

(limited to 'docs/man/nng_getopt.3.adoc')

diff --git a/docs/man/nng_getopt.3.adoc b/docs/man/nng_getopt.3.adoc
index ef69103c..5bb151c8 100644
--- a/docs/man/nng_getopt.3.adoc
+++ b/docs/man/nng_getopt.3.adoc
@@ -21,6 +21,8 @@ nng_getopt - get socket option
 
 int nng_getopt(nng_socket s, const char *opt, void *val, size_t *valszp);
 
+int nng_getopt_bool(nng_socket s, const char *opt, bool *bvalp);
+
 int nng_getopt_int(nng_socket s, const char *opt, int *ivalp);
 
 int nng_getopt_ms(nng_socket s, const char *opt, nng_duration *durp);
@@ -72,11 +74,15 @@ It is acceptable to pass `NULL` for _val_ if the value in _valszp_ is zero.
 This can be used to determine the size of the buffer needed to receive
 the object.
 
+`nng_getopt_bool()`::
+
+This function is for options which take a boolean (`bool`).
+The value will be stored at _ivalp_.
+
 `nng_getopt_int()`::
 
-This function is for options which take an integer (`int`) or boolean (`bool`).
+This function is for options which take an integer (`int`).
 The value will be stored at _ivalp_.
-For booleans the value will be eiher 0 (`false`) or 1 (`true`).
 
 `nng_getopt_ms()`::
 This function is used to retrieve time durations
-- 
cgit v1.2.3-70-g09d2

