diff options
author | Mattias Andrée <maandree@operamail.com> | 2015-10-31 05:01:07 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@operamail.com> | 2015-10-31 05:01:07 +0100 |
commit | 1cf6842543cbbea5564d2908791f3251c60f3d73 (patch) | |
tree | 2e71adc36358b7acccecf8ece8de99400ae3d8a3 /src/string/substring.h | |
parent | update todo (diff) | |
download | slibc-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.h | 12 |
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; |