aboutsummaryrefslogtreecommitdiffstats
path: root/src/string/substring.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@operamail.com>2015-10-31 05:01:07 +0100
committerMattias Andrée <maandree@operamail.com>2015-10-31 05:01:07 +0100
commit1cf6842543cbbea5564d2908791f3251c60f3d73 (patch)
tree2e71adc36358b7acccecf8ece8de99400ae3d8a3 /src/string/substring.h
parentupdate todo (diff)
downloadslibc-1cf6842543cbbea5564d2908791f3251c60f3d73.tar.gz
slibc-1cf6842543cbbea5564d2908791f3251c60f3d73.tar.bz2
slibc-1cf6842543cbbea5564d2908791f3251c60f3d73.tar.xz
doc
Signed-off-by: Mattias Andrée <maandree@operamail.com>
Diffstat (limited to '')
-rw-r--r--src/string/substring.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/string/substring.h b/src/string/substring.h
index 9d6dbfe..05ef7cc 100644
--- a/src/string/substring.h
+++ b/src/string/substring.h
@@ -30,6 +30,16 @@
/* The Knuth–Morris–Pratt algorithm. */
+/**
+ * Test whether to characters are equal.
+ * Case-sensitivity depends on `CASE` being defined.
+ *
+ * @param a One of the characters.
+ * @param b The other character.
+ * @return 1 if `a` and `b` or equal, 0 otherwise.
+ * The comparison is case-insensitive if
+ * `CASE` is defined.
+ */
#if !defined(CASE)
# define CHREQ(a, b) (a == b)
#elif !defined(WIDE)
@@ -42,6 +52,8 @@
/* TODO add support for RIGHT */
+/* The implementation of the algorithm, read
+ * elsewhere for documentation/explanation. */
{
ssize_t* next_map = alloca((needle_length + 1) * sizeof(ssize_t));
ssize_t hay, ned, skp;