MCPcopy Create free account
hub / github.com/ElementsProject/lightning / memeqstr

Function memeqstr

ccan/ccan/mem/mem.h:146–150  ·  view source on GitHub ↗

* 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"); * } */

Source from the content-addressed store, hash-verified

144 * }
145 */
146PURE_FUNCTION
147static 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?

Callers 7

string_to_forward_statusFunction · 0.85
mainFunction · 0.85
rune_alt_singleFunction · 0.85
plugin_opt_findFunction · 0.85
string_to_payment_statusFunction · 0.85
json_to_boolFunction · 0.85
json_to_subsystemFunction · 0.85

Calls 1

memeqFunction · 0.85

Tested by 1

mainFunction · 0.68