wdvi

network DVI viewer
Log | Files | Refs

commit 6a631576bccc543dec23f3cf5e3a5c8d61af8b35
parent a439fc1a0184bb14b6a5acc677694d87960679e8
Author: Kyle Milz <krwmilz@gmail.com>
Date:   Sun, 12 Sep 2021 22:03:10 +0000

assume __STDC__

Diffstat:
Mdvi-draw.c | 32++++++++++++++++++++++----------
1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/dvi-draw.c b/dvi-draw.c @@ -214,18 +214,14 @@ xnum(size) } static long -xsnum(size) - ubyte size; +xsnum(ubyte size) { long x; -#if __STDC__ x = (signed char) xone(); -#else - x = xone(); - if (x & 0x80) x -= 0x100; -#endif - while (--size) x = (x << 8) | xone(); + + while (--size) + x = (x << 8) | xone(); return x; } @@ -251,9 +247,9 @@ tell_oops(const char *message, ...) va_end(args); if (currinf.virtual) - warnx("in virtual font '%s'", currinf.virtual->fontname); + warnx("in virtual font '%s'", currinf.virtual->fontname); else - warnx("offset %ld", xtell(currinf.pos - 1)); + warnx("offset %ld", xtell(currinf.pos - 1)); exit(1); } @@ -1276,6 +1272,22 @@ draw_part(minframe, current_dimconv) #undef xspell_conv void +draw_links() +{ + XTextItem *item = xmalloc(sizeof(XTextItem)); + + item->chars = "A"; + item->nchars = 1; + item->delta = -10; + item->font = None; + + XDrawText(DISP, mane.win, highGC, + page_info[current_page + 1].link.x, + page_info[current_page + 1].link.y, + item, 1); +} + +void draw_page() { /* Check for changes in dvi file. */