blob: 4bc898c7212b1bcf464a0f03e0f5de2c56dbd299 [file] [log] [blame]
nn_symbol(3)
============
NAME
----
nn_symbol - query the names and values of nanomsg symbols
SYNOPSIS
--------
*#include <nanomsg/nn.h>*
*const char *nn_symbol (int 'i', int '*value');*
DESCRIPTION
-----------
Retrieves the symbol name and value at index 'i'. Indices start at 0. An index
has no significance to its associated symbol; the mappings may change between
library versions.
Typically a client will iterate through the symbols until nn_symbol returns
NULL in order to collect all the symbols.
All symbols exposed by 'nn_symbol' are available directly in the C API,
generally as preprocessor macros. Thus, this function is useful mostly for
language bindings that can't parse the header file and rely on retrieving the
symbols in the runtime.
RETURN VALUE
------------
If 'i' is valid, returns the name of the symbol at that index. If the pointer
'value' is not NULL, the symbol's value is stored there.
If 'i' is out-of-range, nn_symbol returns NULL and sets 'errno' to EINVAL.
ERRORS
------
*EINVAL*::
The passed index 'i' was out-of-range; it was less than zero or greater-than-or-
equal-to the number of symbols.
EXAMPLE
-------
----
int value, i;
for (i = 0; ; ++i) {
const char* name = nn_symbol (i, &value);
if (name == NULL) break;
printf ("'%s' = %d\n", name, value);
}
----
SEE ALSO
--------
linknanomsg:nn_errno[3]
linknanomsg:nn_strerror[3]
linknanomsg:nanomsg[7]
AUTHORS
-------
Evan Wies <evan@neomantra.net>