]> git.meshlink.io Git - meshlink/blobdiff - src/meshlink++.h
Add meshlink_get_self().
[meshlink] / src / meshlink++.h
index f1a3b96270e44fb084c1a7648df4bef50a45832e..346549013e010aa3bcb28292395a2dd45b1258ca 100644 (file)
@@ -274,6 +274,15 @@ namespace meshlink {
                        return (node *)meshlink_get_node(handle, name);
                }
 
+               /// Get a handle for our own node.
+               /** This function returns a handle for the local node.
+                *
+                *  @return             A pointer to a meshlink::node which represents the local node.
+                */
+               node *get_self() {
+                       return (node *)meshlink_get_self(handle);
+               }
+
                /// Get a list of all nodes.
                /** This function returns a list with handles for all known nodes.
                 *
@@ -540,6 +549,19 @@ namespace meshlink {
                return meshlink_strerror(err);
        }
 
+       /// 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.
+        */
+       static bool destroy(const char *confbase) {
+               return meshlink_destroy(confbase);
+       }
 }
 
 #endif // MESHLINKPP_H