]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink.h
Add a function to destroy a MeshLink instance.
[meshlink] / src / meshlink.h
index 1f4bb7262e6b3780e9fac55cea784fde8dd1bca1..cca5db1aae10c43c5c71ac1e42b4517045433cce 100644 (file)
@@ -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.