X-Git-Url: http://git.meshlink.io/?a=blobdiff_plain;f=src%2Fmeshlink.h;h=651f05c8bd355f54002c90881322f029d303337d;hb=e80127addf7a0a0a67e54bac9b19d0922b50e67e;hp=88ec23573de2613fb700ad71ad7410c15bc3c8c0;hpb=fe1a9111456a73a6e690927e90d8bfa1e1d0ad22;p=meshlink diff --git a/src/meshlink.h b/src/meshlink.h index 88ec2357..651f05c8 100644 --- a/src/meshlink.h +++ b/src/meshlink.h @@ -26,7 +26,7 @@ #include #if defined(_WIN32) -#include +#include #else #include #include @@ -196,6 +196,18 @@ extern void meshlink_stop(meshlink_handle_t *mesh); */ extern void meshlink_close(meshlink_handle_t *mesh); +/// Destroy a MeshLink instance. +/** This function remove all configuration files of a MeshLink instance. It should only be called when the application + * does not have an open handle to this instance. Afterwards, a call to meshlink_open() will create a completely + * new instance. + * + * @param confbase The directory in which MeshLink stores its configuration files. + * After the function returns, the application is free to overwrite or free @a confbase @a. + * + * @return This function will return true if the MeshLink instance was succesfully destroyed, false otherwise. + */ +extern bool meshlink_destroy(const char *confbase); + /// A callback for receiving data from the mesh. /** @param mesh A handle which represents an instance of MeshLink. * @param source A pointer to a meshlink_node_t describing the source of the data. @@ -317,6 +329,16 @@ extern bool meshlink_send(meshlink_handle_t *mesh, meshlink_node_t *destination, */ extern ssize_t meshlink_get_pmtu(meshlink_handle_t *mesh, meshlink_node_t *destination); +/// Get a handle for our own node. +/** This function returns a handle for the local node. + * + * @param mesh A handle which represents an instance of MeshLink. + * + * @return A pointer to a meshlink_node_t which represents the local node. + * The pointer is guaranteed to be valid until meshlink_close() is called. + */ +extern meshlink_node_t *meshlink_get_self(meshlink_handle_t *mesh); + /// Get a handle for a specific node. /** This function returns a handle for the node with the given name. *