Browse Source

Added gitignore and changed chapter 4...

master
Ognjen Milan Robovic 5 months ago
parent
commit
f0f98e1b7a
4 changed files with 6 additions and 7 deletions
  1. +2
    -0
      .gitignore
  2. +2
    -3
      chapter/chapter_4.c
  3. +1
    -1
      chapter/chapter_4.h
  4. +1
    -3
      xhartae.c

+ 2
- 0
.gitignore View File

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

+ 2
- 3
chapter/chapter_4.c 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);


+ 1
- 1
chapter/chapter_4.h 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

+ 1
- 3
xhartae.c 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 ();



Loading…
Cancel
Save