diff options
author | nicm <nicm> | 2019-05-26 17:34:45 +0000 |
---|---|---|
committer | nicm <nicm> | 2019-05-26 17:34:45 +0000 |
commit | e90d4a6021a45e4f281c75e5513ede2d010ede32 (patch) | |
tree | fee53e188a26f7221239aee44cec4b383557d54e /utf8.c | |
parent | 64310051694fd5c82ccbcff9fda6488ea2dcfb96 (diff) | |
download | rtmux-e90d4a6021a45e4f281c75e5513ede2d010ede32.tar.gz rtmux-e90d4a6021a45e4f281c75e5513ede2d010ede32.tar.bz2 rtmux-e90d4a6021a45e4f281c75e5513ede2d010ede32.zip |
Add formats for word and line under the mouse and use them to add some
items to the pane menu.
Diffstat (limited to 'utf8.c')
-rw-r--r-- | utf8.c | 20 |
1 files changed, 20 insertions, 0 deletions
@@ -410,3 +410,23 @@ utf8_padcstr(const char *s, u_int width) out[slen] = '\0'; return (out); } + +int +utf8_cstrhas(const char *s, const struct utf8_data *ud) +{ + struct utf8_data *copy, *loop; + int found = 0; + + copy = utf8_fromcstr(s); + for (loop = copy; loop->size != 0; loop++) { + if (loop->size != ud->size) + continue; + if (memcmp(loop->data, ud->data, loop->size) == 0) { + found = 1; + break; + } + } + free(copy); + + return (found); +} |