Added gitignore and changed chapter 4...

This commit is contained in:
Ognjen Milan Robovic 2023-11-22 08:00:41 -05:00
parent 7290620674
commit f0f98e1b7a
4 changed files with 6 additions and 7 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*.o
xhartae

View File

@ -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);

View File

@ -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

View File

@ -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 ();