summaryrefslogtreecommitdiffstats
path: root/src/bfstd.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2024-03-21 11:55:38 -0400
committerTavian Barnes <tavianator@tavianator.com>2024-03-21 11:55:38 -0400
commita2a6ac8edd5d85398f6edb6afd02e683d9da9e7b (patch)
tree96402084c7a9184cb483aaee0fe8224a7f8871f1 /src/bfstd.h
parentef0aef16961508075249a6206dc0e9a9ac27d81c (diff)
downloadbfs-a2a6ac8edd5d85398f6edb6afd02e683d9da9e7b.tar.xz
bfstd: New asciilen() function
Diffstat (limited to 'src/bfstd.h')
-rw-r--r--src/bfstd.h15
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