Updated docs/README-ATTACHMENTS, mainly to reflect that no setup is
[mmh] / docs / historical / mh-6.8.5 / miscellany / less-177 / less.h
1 /*
2  * Standard include file for "less".
3  */
4
5 /*
6  * Include the file of compile-time options.
7  */
8 #include "defines.h"
9
10 /*
11  * Language details.
12  */
13 #if !VOID
14 #define void  int
15 #endif
16 #define public          /* PUBLIC FUNCTION */
17
18 /*
19  * Special types and constants.
20  */
21 typedef long            POSITION;
22 /*
23  * {{ Warning: if POSITION is changed to other than "long",
24  *    you may have to change some of the printfs which use "%ld"
25  *    to print a variable of type POSITION. }}
26  */
27
28 #define NULL_POSITION   ((POSITION)(-1))
29
30 /*
31  * The type of an interrupt handler.
32  */
33 #define HANDLER         void
34
35 /*
36  * An IFILE represents an input file.
37  */
38 #define IFILE           VOID_POINTER
39 #define NULL_IFILE      ((IFILE)NULL)
40
41 /*
42  * The structure used to represent a "screen position".
43  * This consists of a file position, and a screen line number.
44  * The meaning is that the line starting at the given file
45  * position is displayed on the ln-th line of the screen.
46  * (Screen lines before ln are empty.)
47  */
48 struct scrpos
49 {
50         POSITION pos;
51         int ln;
52 };
53
54 typedef union parg
55 {
56         char *p_string;
57         int p_int;
58 } PARG;
59
60 #define NULL_PARG       ((PARG *)NULL)
61
62 #define EOI             (-1)
63
64 #ifndef NULL
65 #define NULL            (0)
66 #endif
67
68 #define READ_INTR       (-2)
69
70 /* How quiet should we be? */
71 #define NOT_QUIET       0       /* Ring bell at eof and for errors */
72 #define LITTLE_QUIET    1       /* Ring bell only for errors */
73 #define VERY_QUIET      2       /* Never ring bell */
74
75 /* How should we prompt? */
76 #define PR_SHORT        0       /* Prompt with colon */
77 #define PR_MEDIUM       1       /* Prompt with message */
78 #define PR_LONG         2       /* Prompt with longer message */
79
80 /* How should we handle backspaces? */
81 #define BS_SPECIAL      0       /* Do special things for underlining and bold */
82 #define BS_NORMAL       1       /* \b treated as normal char; actually output */
83 #define BS_CONTROL      2       /* \b treated as control char; prints as ^H */
84
85 /* How should we search? */
86 #define SRCH_FORW       0       /* Search forward from current position */
87 #define SRCH_BACK       1       /* Search backward from current position */
88 #define SRCH_NOMATCH    0100    /* Search for non-matching lines */
89 #define SRCH_PAST_EOF   0200    /* Search past end-of-file, into next file */
90 #define SRCH_FIRST_FILE 0400    /* Search starting at the first file */
91
92 #define SRCH_DIR(t)     ((t) & 01)
93 #define SRCH_REVERSE(t) ((t) ^ 01)
94
95 /* Special chars used to tell put_line() to do something special */
96 #define NORMAL          (0)
97 #define UNDERLINE       (1)
98 #define BOLD            (2)
99 #define BLINK           (3)
100 #define INVIS           (4)
101
102 #define CONTROL(c)              ((c)&037)
103 #define ESC                     CONTROL('[')
104
105 #define SIGNAL(sig,func)        signal(sig,func)
106
107 /* Library function declarations */
108 offset_t lseek();
109 #define BAD_LSEEK       ((offset_t)-1)
110 VOID_POINTER calloc();
111
112 #define ch_zero()       ((POSITION)0)
113 #include "funcs.h"