| summaryrefslogtreecommitdiff |
diff options
| author | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-01-18 19:09:16 +0100 |
|---|---|---|
| committer | Nathanael Sensfelder <SpamShield0@MultiAgentSystems.org> | 2017-01-18 19:09:16 +0100 |
| commit | 0d49fb74eadcf933f696420cd182077927680d26 (patch) | |
| tree | 9220d260ce878f369138da12dae0300cf9ade5c9 /src/core/char.c | |
| parent | 24afb3e60bafd98e6a83dcb41ee6a7f7d41e76bc (diff) | |
Done with 'core', starting to work on 'knowledge'.
Diffstat (limited to 'src/core/char.c')
| -rw-r--r-- | src/core/char.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/core/char.c b/src/core/char.c index 39ca72e..9297643 100644 --- a/src/core/char.c +++ b/src/core/char.c @@ -2,6 +2,18 @@ #include "char.h" +/* See: "char.c" */ +ZoO_char ZoO_char_to_lowercase (const ZoO_char c) +{ + if ((c >= 'A') && (c <= 'Z')) + { + return 'z' - ('Z' - c); + } + + return c; +} + +/* See: "char.c" */ int ZoO_char_is_banned (const ZoO_char c) { switch (c) @@ -21,6 +33,7 @@ int ZoO_char_is_banned (const ZoO_char c) } } +/* See: "char.c" */ int ZoO_char_is_punctuation (const ZoO_char c) { switch (c) @@ -38,11 +51,14 @@ int ZoO_char_is_punctuation (const ZoO_char c) } } +/* See: "char.c" */ int ZoO_word_cmp ( const ZoO_char word_a [const static 1], + const size_t word_a_size, const ZoO_char word_b [const static 1] ) { - return strcmp((const char *) word_a, (const char *) word_b); + return strncmp((const char *) word_a, (const char *) word_b, word_a_size); } + |


