diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2022-03-26 19:42:13 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2022-03-26 19:42:13 -0400 |
commit | c2139e2e03cbcee9a1ae03956b1f06d3a9c269b0 (patch) | |
tree | b6bda303b95d1f783fa9ae885e14c864943a94ea /util.h | |
parent | 5026a144add526567771a75b414a4d9873054620 (diff) | |
download | bfs-c2139e2e03cbcee9a1ae03956b1f06d3a9c269b0.tar.xz |
util: New xstrwidth() function
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -208,6 +208,16 @@ int xfaccessat(int fd, const char *path, int amode); int xstrtofflags(const char **str, unsigned long long *set, unsigned long long *clear); /** + * wcswidth() variant that works on narrow strings. + * + * @param str + * The string to measure. + * @return + * The likely width of that string in a terminal. + */ +size_t xstrwidth(const char *str); + +/** * Return whether an error code is due to a path not existing. */ bool is_nonexistence_error(int error); |