diff options
author | Tavian Barnes <tavianator@tavianator.com> | 2024-03-21 11:55:38 -0400 |
---|---|---|
committer | Tavian Barnes <tavianator@tavianator.com> | 2024-03-21 11:55:38 -0400 |
commit | a2a6ac8edd5d85398f6edb6afd02e683d9da9e7b (patch) | |
tree | 96402084c7a9184cb483aaee0fe8224a7f8871f1 /src/bfstd.h | |
parent | ef0aef16961508075249a6206dc0e9a9ac27d81c (diff) | |
download | bfs-a2a6ac8edd5d85398f6edb6afd02e683d9da9e7b.tar.xz |
bfstd: New asciilen() function
Diffstat (limited to 'src/bfstd.h')
-rw-r--r-- | src/bfstd.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/bfstd.h b/src/bfstd.h index d160c88..fc22971 100644 --- a/src/bfstd.h +++ b/src/bfstd.h @@ -178,6 +178,21 @@ int ynprompt(void); // #include <string.h> /** + * Get the length of the pure-ASCII prefix of a string. + */ +size_t asciilen(const char *str); + +/** + * Get the length of the pure-ASCII prefix of a string. + * + * @param str + * The string to check. + * @param n + * The maximum prefix length. + */ +size_t asciinlen(const char *str, size_t n); + +/** * Allocate a copy of a region of memory. * * @param src |