diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/nng.c | 11 | ||||
| -rw-r--r-- | src/nng.h | 8 |
2 files changed, 16 insertions, 3 deletions
@@ -8,6 +8,7 @@ // found online at https://opensource.org/licenses/MIT. // +#include "nng.h" #include "core/nng_impl.h" // This file provides the "public" API. This is a thin wrapper around @@ -1212,3 +1213,13 @@ nng_url_clone(nng_url **dstp, const nng_url *src) { return (nni_url_clone(dstp, src)); } + +#define xstr(a) str(a) +#define str(a) #a + +const char * +nng_version(void) +{ + return (xstr(NNG_MAJOR_VERSION) "." xstr(NNG_MINOR_VERSION) "." xstr( + NNG_PATCH_VERSION)); +} @@ -47,9 +47,9 @@ extern "C" { // may not necessarily match the ABI versions. Right now at // version 0, you should not be making any forward compatibility // assumptions. -#define NNG_MAJOR_VERSION 0 -#define NNG_MINOR_VERSION 5 -#define NNG_PATCH_VERSION 0 +#define NNG_MAJOR_VERSION 0 +#define NNG_MINOR_VERSION 5 +#define NNG_PATCH_VERSION 0 // Types common to nng. typedef uint32_t nng_socket; @@ -698,6 +698,8 @@ NNG_DECL void nng_url_free(nng_url *); // nng_url_clone clones a URL structure. NNG_DECL int nng_url_clone(nng_url **, const nng_url *); +// nng_version returns the library version as a human readable string. +NNG_DECL const char *nng_version(void); #ifdef __cplusplus } #endif |
