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

Function strends

ccan/ccan/str/str.h:43–49  ·  view source on GitHub ↗

* strends - Does this string end with this postfix? * @str: string to test * @postfix: postfix to look for at end of str * * Example: * if (strends(somestring, "foo")) * printf("String %s end with 'foo'!\n", somestring); */

Source from the content-addressed store, hash-verified

41 * printf("String %s end with 'foo'!\n", somestring);
42 */
43static inline bool strends(const char *str, const char *postfix)
44{
45 if (strlen(str) < strlen(postfix))
46 return false;
47
48 return streq(str + strlen(str) - strlen(postfix), postfix);
49}
50
51/**
52 * stringify - Turn expression into a string literal

Callers 15

get_filesFunction · 0.85
secret_from_hexFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
path_simplifyFunction · 0.85
mainFunction · 0.85
mainFunction · 0.85
promote_missing_filesFunction · 0.85
add_configFunction · 0.85
add_reqFunction · 0.85
get_reqFunction · 0.85

Calls

no outgoing calls

Tested by 7

secret_from_hexFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68
mainFunction · 0.68