From f9eaf742d894b0e6d2c5b1bc244ba17bd00a9e85 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Manuel=20Tom=C3=A1s?= Date: Wed, 22 Apr 2020 10:48:30 -0300 Subject: Move operations on point structures to point.c --- jet.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'jet.c') diff --git a/jet.c b/jet.c index b539082..290b95e 100644 --- a/jet.c +++ b/jet.c @@ -6,6 +6,7 @@ #include #include #include "page.c" +#include "point.c" int main(int argc, char *argv[]) { initscr(); @@ -33,7 +34,7 @@ int main(int argc, char *argv[]) { int number_of_lines = 0; for (struct point i = {page, 0}; !at_eof(&i); move_point_forward(&i)) { - if (get_element(&i) == '\n') number_of_lines++; + if (element(&i) == '\n') number_of_lines++; } while (1) { @@ -42,8 +43,8 @@ int main(int argc, char *argv[]) { int iter_line = 0; for (struct point i = {page, 0}; !at_eof(&i) && iter_line < window_height + current_line; move_point_forward(&i)) { - if (iter_line >= current_line) addch(get_element(&i)); - if (get_element(&i) == '\n') iter_line++; + if (iter_line >= current_line) addch(element(&i)); + if (element(&i) == '\n') iter_line++; } } -- cgit v1.2.3