diff --git a/README.md b/README.md index fc944b8..9538cb3 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,30 @@ # xighlight -Xighlight C source code... \ No newline at end of file +xighlight -- Program for highlighting C source code in terminal. + +- Quickly written program to test out xtandard and xyntax, doesn't handle files, instead it records from standard input... +- For now, 'xighlight' only works on ANSI C source code, without 'typedef' keyword, both will change in the future, and CLA will be added... +- Everything related to my libraries is clean of all warning options on Clang, GCC and Valgrind. + +Compiling: + +```bash +$ sh compile.sh +``` + +Installing: + +```bash +$ sudo sh install.sh +``` + +Using: + +```bash +$ cat my_c_program.c | xighlight +$ xighlight < my_c_program.c +``` + +This is what it prints to standard output, when standard input is C source code: + +![alternative text]("c_hello.png"); diff --git a/c_hello.png b/c_hello.png new file mode 100644 index 0000000..cf86da9 Binary files /dev/null and b/c_hello.png differ diff --git a/xighlight.c b/xighlight.c index 75d8d52..27bce9a 100644 --- a/xighlight.c +++ b/xighlight.c @@ -37,10 +37,10 @@ int main (void) { (void) syntax_define (0, 1, c_keywords [word], separator, '\0', COLOUR_BLUE, EFFECT_BOLD); } + (void) syntax_define (1, 1, "_", separator, '\0', COLOUR_GREY, EFFECT_BOLD); (void) syntax_define (1, 1, "0123456789", separator, '\0', COLOUR_CYAN, EFFECT_BOLD); (void) syntax_define (1, 1, "ABCDEFGHIJKLMNOPQRSTUVWXYZ", separator, '\0', COLOUR_PINK, EFFECT_ITALIC); (void) syntax_define (1, 1, "abcdefghijklmnopqrstuvwxyz", separator, '\0', COLOUR_WHITE, EFFECT_ITALIC); - (void) syntax_define (0, 1, "_", separator, '\0', COLOUR_PINK, EFFECT_BOLD); buffer = record ();