]> git.ozlabs.org Git - ccan/blobdiff - ccan/mem/mem.h
mem: switch descriptions for memeqzero/memeqstr
[ccan] / ccan / mem / mem.h
index 68a4aa3c18885c207a9fd11828bc5174bead6905..a3403c4ee31dc8794f89acfd95836e5c17c4672a 100644 (file)
@@ -149,6 +149,19 @@ static inline bool memeqstr(const void *data, size_t length, const char *string)
        return memeq(data, length, string, strlen(string));
 }
 
+/**
+ * memeqzero - Is a byte array all zeroes?
+ * @data: byte array
+ * @length: length of @data in bytes
+ *
+ * Example:
+ *     if (memeqzero(somebytes, bytes_len)) {
+ *             printf("somebytes == 0!\n");
+ *     }
+ */
+PURE_FUNCTION
+bool memeqzero(const void *data, size_t length);
+
 /**
  * memstarts_str - Does this byte array start with a string prefix?
  * @a: byte array