]> git.lizzy.rs Git - dragonstd.git/blobdiff - array.h
Add array_idx
[dragonstd.git] / array.h
diff --git a/array.h b/array.h
index deeea1cdb76e47ee40bb5ddc37b487455a39d25e..1c5178d11119aeb736cc249d5c7786c800e5ea80 100644 (file)
--- a/array.h
+++ b/array.h
@@ -96,6 +96,13 @@ void array_apd(Array *array, const void *ptr);
                but it is slightly faster since it saves unnecessary calls.
 */
 
+ssize_t array_idx(Array *array, const void *ptr);
+/*
+       Returns the index of the first element that equals ptr, or none if no matches.
+
+       Uses memcmp to compare the elements.
+*/
+
 void array_cpy(Array *array, void **ptr, size_t *n);
 /*
        Allocates a buffer big enough to fit the array's used size.