X-Git-Url: https://git.danieliu.xyz/?a=blobdiff_plain;f=viewer.c;h=4e91b71390c6cec4b109c61b5dee5bb008beb68e;hb=b416f18295f7edcb5474396a6b26a59fd5ddb1f5;hp=2d64b4eb43d4c81c89fdec22af4950363fe43045;hpb=31eb213da6e050f77ccaf59626484a03f1b95af6;p=smdp.git diff --git a/viewer.c b/viewer.c index 2d64b4e..4e91b71 100644 --- a/viewer.c +++ b/viewer.c @@ -3,7 +3,6 @@ #include // strchr #include -#include "include/parser.h" #include "include/viewer.h" static short white_ramp[24] = { 16, 232, 233, 234, 235, 236, @@ -296,7 +295,7 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols) { if(strchr(special, *c)) { // closing special char (or second backslash) - if(is_attron(stack, *c)) { + if((stack->top)(stack, *c)) { switch(*c) { // print escaped backslash @@ -317,7 +316,7 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols) { (stack->pop)(stack); // treat special as regular char - } else if(is_attron(stack, '\\')) { + } else if((stack->top)(stack, '\\')) { wprintw(window, "%c", *c); // remove backslash from stack @@ -366,16 +365,6 @@ void add_line(WINDOW *window, int y, int x, line_t *line, int max_cols) { (stack->delete)(stack); } -int is_attron(cstack_t *stack, char c) { - // test if char is on top of stack - if(stack->head >= 0) { - if((stack->top)(stack) == c) { - return 1; - } - } - return 0; -} - void fade_out(WINDOW *window, int trans, int colors) { int i; // increment if(colors) {