1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-05 21:42:47 -05:00

New helper function ptrlen_strcmp().

Compares strings with the same semantics as strcmp, but uses ptrlens
as input instead of zero-terminated strings.
This commit is contained in:
Simon Tatham
2019-01-01 19:07:00 +00:00
parent c02031ffd6
commit d169b04dba
2 changed files with 12 additions and 0 deletions

1
misc.h
View File

@ -157,6 +157,7 @@ static inline ptrlen ptrlen_from_strbuf(strbuf *sb)
bool ptrlen_eq_string(ptrlen pl, const char *str);
bool ptrlen_eq_ptrlen(ptrlen pl1, ptrlen pl2);
int ptrlen_strcmp(ptrlen pl1, ptrlen pl2);
bool ptrlen_startswith(ptrlen whole, ptrlen prefix, ptrlen *tail);
char *mkstr(ptrlen pl);
int string_length_for_printf(size_t);