diff options
author | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-04-22 10:48:30 -0300 |
---|---|---|
committer | Juan Manuel Tomás <jtomas1815@gmail.com> | 2020-04-22 10:48:30 -0300 |
commit | f9eaf742d894b0e6d2c5b1bc244ba17bd00a9e85 (patch) | |
tree | 70d1a8fed23029bde7348467d92a93b2026cc065 /jet.c | |
parent | 8b9d67da716c07f957eadd977059d74936c84a76 (diff) | |
download | jet-f9eaf742d894b0e6d2c5b1bc244ba17bd00a9e85.tar.gz jet-f9eaf742d894b0e6d2c5b1bc244ba17bd00a9e85.zip |
Move operations on point structures to point.c
Diffstat (limited to 'jet.c')
-rw-r--r-- | jet.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -6,6 +6,7 @@ #include <unistd.h> #include <curses.h> #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++; } } |