* memeqstr - Is a byte array equal to a NUL terminated string? * @data: byte array * @length: length of @data in bytes * @string: NUL terminated string * * The '\0' byte is ignored when checking if @bytes == @string. * * Example: * if (memeqstr(somebytes, bytes_len, "foo")) { * printf("somebytes == 'foo'!\n"); * } */
| 144 | * } |
| 145 | */ |
| 146 | PURE_FUNCTION |
| 147 | static inline bool memeqstr(const void *data, size_t length, const char *string) |
| 148 | { |
| 149 | return memeq(data, length, string, strlen(string)); |
| 150 | } |
| 151 | |
| 152 | /** |
| 153 | * memeqzero - Is a byte array all zeroes? |