aboutsummaryrefslogtreecommitdiff
path: root/src/extlib.h
diff options
context:
space:
mode:
authoraxtloss <axtlos@getcryst.al>2024-06-24 21:50:48 +0200
committeraxtloss <axtlos@getcryst.al>2024-06-24 21:50:48 +0200
commita084dfa02d28a9372a7e406c9b101a43308a4937 (patch)
tree620d7fe5f55fa76572f5666465997f397b8bbd2a /src/extlib.h
parent1d4b6499993050876a453a3f96e2428fdfd42610 (diff)
downloadextlib-a084dfa02d28a9372a7e406c9b101a43308a4937.tar.gz
extlib-a084dfa02d28a9372a7e406c9b101a43308a4937.tar.bz2
Add new function memvcmp and unit tests
Diffstat (limited to 'src/extlib.h')
-rw-r--r--src/extlib.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/extlib.h b/src/extlib.h
index 1948352..15903c3 100644
--- a/src/extlib.h
+++ b/src/extlib.h
@@ -25,7 +25,7 @@
#define malloc(x) error - use malloc_secure
/// Automatically zero out a pointer before freeing it
-void free_secure (void *__ptr, size_t ptrlen);
+void free_secure (void **__ptr, size_t ptrlen);
/// Automatically initialise the allocated memory with zeros
void *malloc_secure (size_t len);
@@ -33,6 +33,10 @@ void *malloc_secure (size_t len);
/// Copy the data of one filestream to another
void fcopy(FILE *f1, FILE *f2);
+/// Compare the first n bytes of a memory area str to the value val.
+/// Returns 0 if the values the same, any other value if they are not the same.
+int memvcmp (void *str, char val, size_t n);
+
/// Convert a string to lowercase
char *strlwr(char *s);