diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..51a131c --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.o +xhartae diff --git a/chapter/chapter_4.c b/chapter/chapter_4.c index 19f8d14..ba2a0dd 100644 --- a/chapter/chapter_4.c +++ b/chapter/chapter_4.c @@ -236,7 +236,7 @@ well more than 24 line of code, we'd want to scroll it or modify it if we're mak function does its' work, and how we use 'syntax_*' functions in them. */ -void preview_c_file (char * text_file, int width, int height, int x, int y) { +void preview_c_file (char * text_file, int x, int y) { // Before we begin (Ada pun intended, remove this in final version), I won't (re)align 'separators' and 'keywords', because they fuck-up my comments, which I never write // in my "official" programs. I write comments only here, to explain stuff in more details. Have fun... Oh, and type of variable 'keywords' an array of string pointers of // automatic length, which we get with "sizeof (keywords) / sizeof (keywords [0])" part, for those keywords, it would be 32UL, and we cast it to integer. @@ -253,8 +253,7 @@ void preview_c_file (char * text_file, int width, int height, int x, int y) { int word, reset_x, reset_y; - (void) width; - (void) height; + curses_configure (); syntax_define (FALSE, FALSE, "/*", "*/", '\0', COLOUR_GREY, EFFECT_BOLD); // Below, we're simply using our 'syntax_define' function. syntax_define (FALSE, FALSE, "//", "\n", '\0', COLOUR_GREY, EFFECT_BOLD); diff --git a/chapter/chapter_4.h b/chapter/chapter_4.h index 4567c8a..292ab1b 100644 --- a/chapter/chapter_4.h +++ b/chapter/chapter_4.h @@ -33,6 +33,6 @@ long, that you'll walk miles and miles, and it ends up being short (you rage-qui coming from. For example, if you wrote Ada, you'll like chapter four, if you wrote C++, you'll like chapter five. */ -extern void preview_c_file (char * text_file, int width, int height, int x, int y); +extern void preview_c_file (char * text_file, int x, int y); #endif diff --git a/xhartae.c b/xhartae.c index 108766f..3ec4396 100644 --- a/xhartae.c +++ b/xhartae.c @@ -130,9 +130,7 @@ int main (int argc, char * * argv) { (void) argc; (void) argv; - curses_configure (); - - preview_c_file ("program/example.c", curses_screen_width, curses_screen_height, 0, 0); + preview_c_file ("program/example.c", 5, 1); play_game ();