diff --git a/xyntax.c b/xyntax.c index 487f425..764b8f7 100644 --- a/xyntax.c +++ b/xyntax.c @@ -150,16 +150,20 @@ void syntax_define_default (int string_colour, int string_effect, int number_col (void) syntax_insert (1, 1, "0123456789", syntax_separator, '\0', number_colour, number_effect); } -void syntax_define_words (char * * word_array, int word_count, int word_colour, int word_effect) { +void syntax_define_words (int case_sensitive, char * * word_array, int word_count, int word_colour, int word_effect) { int word = 0; for (word = 0; word != word_count; ++word) { (void) syntax_insert (0, 1, word_array [word], syntax_separator, '\0', word_colour, word_effect); } - (void) syntax_insert (1, 1, "abcdefghijklmnopqrstuvwxyz", syntax_separator, '\0', COLOUR_WHITE, EFFECT_NORMAL); - (void) syntax_insert (1, 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", syntax_separator, '\0', COLOUR_WHITE, EFFECT_BOLD); - (void) syntax_insert (1, 1, "_", syntax_separator, '\0', COLOUR_PINK, EFFECT_BOLD); + if (case_sensitive != 0) { + (void) syntax_insert (1, 1, "abcdefghijklmnopqrstuvwxyz", syntax_separator, '\0', COLOUR_WHITE, EFFECT_NORMAL); + (void) syntax_insert (1, 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", syntax_separator, '\0', COLOUR_WHITE, EFFECT_BOLD); + (void) syntax_insert (1, 1, "_", syntax_separator, '\0', COLOUR_PINK, EFFECT_BOLD); + } else { + (void) syntax_insert (1, 1, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_", syntax_separator, '\0', COLOUR_WHITE, EFFECT_NORMAL); + } } void syntax_define_range (char * range_begin, char * range_end, char range_escape, int range_colour, int range_effect) { diff --git a/xyntax.h b/xyntax.h index 8edda8f..04666af 100644 --- a/xyntax.h +++ b/xyntax.h @@ -36,7 +36,7 @@ extern void syntax_define_separators (char *); extern void syntax_define_default (int, int, int, int); -extern void syntax_define_words (char * *, int, int, int); +extern void syntax_define_words (int, char * *, int, int, int); extern void syntax_define_range (char *, char *, char, int, int);