aboutsummaryrefslogtreecommitdiff
path: root/src/supplemental/util/platform.h
diff options
context:
space:
mode:
authorGarrett D'Amore <garrett@damore.org>2018-02-22 18:48:49 -0800
committerGarrett D'Amore <garrett@damore.org>2018-02-22 18:48:49 -0800
commit1ba0631ca545a69488f4a60e051476fea067a154 (patch)
tree009e8a0cde0b3bed8b61c0af221e9299ce724296 /src/supplemental/util/platform.h
parent6a344797283f05ac77e84be0312cf668f7953b6e (diff)
downloadnng-1ba0631ca545a69488f4a60e051476fea067a154.tar.gz
nng-1ba0631ca545a69488f4a60e051476fea067a154.tar.bz2
nng-1ba0631ca545a69488f4a60e051476fea067a154.zip
Add nng_opts_parse() API for handling command line options.
We have implemented this alternative to getopt() so that we can create nngcat. The reason we did not just use getopt() is that getopt() does not understand long options (which nanocat uses, and we want to preserve for compatibility) and getopt() is not available on Windows (and possibly other non-POSIX platforms.) This function handles long and short options, but does not have support for option clustering. It also is threadsafe & reentrant, unlike getopt.
Diffstat (limited to 'src/supplemental/util/platform.h')
-rw-r--r--src/supplemental/util/platform.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/supplemental/util/platform.h b/src/supplemental/util/platform.h
index 1383fe15..fd287713 100644
--- a/src/supplemental/util/platform.h
+++ b/src/supplemental/util/platform.h
@@ -20,13 +20,13 @@
// APIs or Windows APIs, then by all means please feel free to simply
// ignore this.
+#include <stddef.h>
+#include <stdint.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stddef.h>
-#include <stdint.h>
-
// nng_time represents an absolute time since some arbitrary point in the
// past, measured in milliseconds. The values are always positive.
typedef uint64_t nng_time;