vlist: constify key argument to vlist_add
[project/libubox.git] / vlist.h
diff --git a/vlist.h b/vlist.h
index 19c1c20..9e188e2 100644 (file)
--- a/vlist.h
+++ b/vlist.h
@@ -14,6 +14,9 @@
  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
  */
 
+#ifndef __LIBUBOX_VLIST_H
+#define __LIBUBOX_VLIST_H
+
 #include "avl.h"
 
 struct vlist_tree;
@@ -48,7 +51,7 @@ static inline void vlist_update(struct vlist_tree *tree)
        tree->version++;
 }
 
-void vlist_add(struct vlist_tree *tree, struct vlist_node *node, void *key);
+void vlist_add(struct vlist_tree *tree, struct vlist_node *node, const void *key);
 void vlist_delete(struct vlist_tree *tree, struct vlist_node *node);
 void vlist_flush(struct vlist_tree *tree);
 void vlist_flush_all(struct vlist_tree *tree);
@@ -56,3 +59,4 @@ void vlist_flush_all(struct vlist_tree *tree);
 #define vlist_for_each_element(tree, element, node_member) \
        avl_for_each_element(&(tree)->avl, element, node_member.avl)
 
+#endif