improve behaviour under VPC, fixes from nicolas tittley.
[minix.git] / commands / yap / display.h
blobd917074df7767e29fce75a31870a4584aca82c3b
1 /* Copyright (c) 1985 Ceriel J.H. Jacobs */
3 /* $Header$ */
5 # ifndef _DISPLAY_
6 # define PUBLIC extern
7 # else
8 # define PUBLIC
9 # endif
11 # define MINPAGESIZE 5
13 PUBLIC int pagesize; /* How many lines on a page */
14 PUBLIC int maxpagesize; /* Maximum # of lines on a page */
15 PUBLIC int scrollsize; /* number of lines in a scroll */
16 struct scr_info {
17 struct linelist {
18 int cnt; /* # of screenlines for this line */
19 long line; /* lineno of this line */
20 # define firstline head->line
21 # define lastline tail->line
22 struct linelist *next;
23 struct linelist *prev;
24 } *tail, *head; /* Of all lines of the input file that are
25 * on the screen, remember how many
26 * screenlines they occupy. Keep this
27 * info in a doubly linked list.
29 int nf; /* How many screenlines of the first line
30 * on the screen are not on the screen?
32 int currentpos; /* Y coordinate of first free line */
33 struct linelist ssaavv; /* Mark */
34 # define savfirst ssaavv.line
35 # define savnf ssaavv.cnt
38 PUBLIC struct scr_info scr_info;
39 PUBLIC int status; /* EOFILE on end of file
40 * START on start of file
41 * logical "or" if both
43 /* Flags for status field */
45 # define EOFILE 01
46 # define START 02
48 VOID redraw();
50 * void redraw(flag)
51 * int flag; Either 0 or 1
53 * Redraws the screen. If flag = 1, the screen is redrawn as precisely
54 * as possible, otherwise one page is displayed (which possibly does not
55 * take a whole screen.
58 int display();
60 * int display(firstline, nodispl, nlines, really)
61 * long firstline; Line with which to start
62 * int nodispl; Do not display nodispl lines of it
63 * int nlines; Number of screen lines that must be displayed
64 * int really; Either 0 or 1
66 * Displays nlines as a page. if "really" = 0, the actual displaying is not
67 * performed. Only the computing associated with it is done.
70 int scrollf();
72 * int scrollf(nlines,really)
73 * int nlines; Number of lines to scroll
74 * int really; Either 0 or 1, see explanation above
76 * Scroll forwards "nlines" (screen)lines.
79 int scrollb();
81 * int scrollb(nlines,really)
82 * int nlines; Number of lines to scroll
83 * int really; Either 0 or 1, see explanation above
85 * Scroll backwards "nlines" (screen)lines.
88 int tomark();
90 * int tomark(cnt)
91 * long cnt; (Argument ignored)
93 * Display a page starting at the mark. If there was no
94 * mark, display the first page of the file.
95 * (There is always assumed to be a mark, the initial one is on the first page
96 * of the file).
99 int setmark();
101 * int setmark(cnt)
102 * long cnt; (Argument ignored)
104 * Sets a mark on the current page.
105 * It returns nothing (but the address is taken ...)
108 int exgmark();
110 * int exgmark(cnt)
111 * long cnt; (Argumewnt ignored)
113 * Sets the mark on the current page and displays the
114 * previously marked page.
117 VOID d_clean();
119 * void d_clean()
121 * Clean up and initialize. To be called before displaying a new file
124 # undef PUBLIC