X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;ds=sidebyside;f=src%2Fmeshlink%2B%2B.h;h=1d6c986123c0dd119458c2a9778768cf622269ed;hb=9ff28ad77a6deee4db709c127c843f9fdd68e03b;hp=a1911affbdb1d949049e343b5cae5a4d732f0391;hpb=1d2f085a714b8264a05ed55ace2e9385bca0fef9;p=meshlink diff --git a/src/meshlink++.h b/src/meshlink++.h index a1911aff..1d6c9861 100644 --- a/src/meshlink++.h +++ b/src/meshlink++.h @@ -182,10 +182,11 @@ namespace meshlink { * @param nodes A pointer to an array of pointers to meshlink::node, which should be allocated by the application. * @param nmemb The maximum number of pointers that can be stored in the nodes array. * - * @return The number of known nodes. This can be larger than nmemb, in which case not all nodes were stored in the nodes array. + * @return The number of known nodes, or -1 in case of an error. + * This can be larger than nmemb, in which case not all nodes were stored in the nodes array. */ - size_t get_all_nodes(node **nodes, size_t nmemb) { - return meshlink_get_all_nodes(this, (meshlink_node_t **)nodes, nmemb); + node **get_all_nodes(node **nodes, size_t *nmemb) { + return (node **)meshlink_get_all_nodes(this, (meshlink_node_t **)nodes, nmemb); } /// Sign data using the local node's MeshLink key. @@ -319,7 +320,7 @@ namespace meshlink { * @return A handle for the channel, or NULL in case of an error. */ channel *channel_open(node *node, uint16_t port, channel_receive_cb_t cb, const void *data, size_t len) { - return (channel *)meshlink_channel_open(this, node, port, (meshlink_channel_receive_cb_t)recv, data, len); + return (channel *)meshlink_channel_open(this, node, port, (meshlink_channel_receive_cb_t)cb, data, len); } /// Partially close a reliable stream channel. @@ -387,6 +388,10 @@ namespace meshlink { static void close(mesh *mesh) { meshlink_close(mesh); } + + static const char *strerror(errno_t err = meshlink_errno) { + return meshlink_strerror(err); + } }; #endif // MESHLINKPP_H