Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 185 lines (165 sloc) 5.494 kB
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
1 /* elvis.h */
2 /* Copyright 1995 by Steve Kirkendall */
3
4
5 #include <string.h>
6 #include <stdio.h>
7 #include <stdlib.h>
8
9 #include "config.h"
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
10 #include "version.h"
11 #include "osdef.h"
12
13 /* The FTP protocol requires HTTP */
14 #if defined(PROTOCOL_FTP) && !defined(PROTOCOL_HTTP)
15 # define PROTOCOL_HTTP
16 #endif
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
17
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
18 /* If any markup display mode is used, then define DISPLAY_ANYMARKUP */
19 #if defined(DISPLAY_HTML) || defined(DISPLAY_MAN) || defined(DISPLAY_TEX)
20 # define DISPLAY_ANYMARKUP
21 #endif
22
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
23 /* Some handy macros */
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
24 #define QTY(array) (sizeof(array) / sizeof((array)[0]))
25 #define ELVCTRL(ch) ((ch) ^ 0x40)
26
27 /* Names of some special buffers */
28 #define INIT_BUF "Elvis initialization"
29 #define CUSTOM_BUF "Elvis custom initialization"
30 #define BEFOREREAD_BUF "Elvis before reading"
31 #define AFTERREAD_BUF "Elvis after reading"
32 #define BEFOREWRITE_BUF "Elvis before writing"
33 #define AFTERWRITE_BUF "Elvis after writing"
34 #define MSG_BUF "Elvis messages"
35 #define MSGQUEUE_BUF "Elvis message queue"
36 #define UNTITLED_BUF "Elvis untitled #%d"
37 #define EX_BUF "Elvis ex history"
38 #define REGEXP_BUF "Elvis regexp history"
39 #define FILTER_BUF "Elvis filter history"
40 #define MORE_BUF "Elvis more"
41 #define CUTANON_BUF "Elvis cut buffer 1" /* anonymous cut buffer */
42 #define CUTNAMED_BUF "Elvis cut buffer %c" /* cut buffers a-z and 1-9 */
43 #define CUTEXTERN_BUF "Elvis clipboard" /* cut buffers < and > */
44 #define CUTINPUT_BUF "Elvis previous input" /* cut buffer . */
45 #define DEFAULT_BUF "Elvis default options"
46 #define HELP_BUF "Elvis documentation"
47 #define ERRLIST_BUF "Elvis error list"
48 #define TRACE_BUF "Elvis map log"
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
49 #define BBROWSE_BUF "Elvis buffer list"
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
50
51 /* Names of files that store default contents of buffers */
52 #define INIT_FILE "elvis.ini" /* executed before first file is loaded */
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
53 #if ANY_UNIX
54 # define CUSTOM_FILE ".exrc" /* custom file for each user */
55 #else
56 # define CUSTOM_FILE "elvis.rc" /* custom file for each user */
57 #endif
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
58 #define BEFOREREAD_FILE "elvis.brf" /* executed before each file is loaded */
59 #define AFTERREAD_FILE "elvis.arf" /* executed after each file is loaded */
60 #define BEFOREWRITE_FILE "elvis.bwf" /* executed before writing a file */
61 #define AFTERWRITE_FILE "elvis.awf" /* executed after writing a file */
62 #define MSG_FILE "elvis.msg" /* verbose message translations */
63 #define HELP_FILE "elvis.html" /* elvis online documentation */
64 #define SYNTAX_FILE "elvis.syn" /* descriptions of languages */
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
65 #define BROWSER_FILE "elvis.bro" /* prototype of browser document */
66 #define NET_FILE "elvis.net" /* network proxy list */
67 #define FTP_FILE "elvis.ftp" /* ftp account information */
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
68
69 /* a very large number */
70 #define INFINITY 2147483647L
71
72 /* default size of the tag stack (for each window) */
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
73 #ifndef TAGSTK
74 # define TAGSTK 10
75 #endif
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
76
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
77
78 /* Some useful data types */
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
79 typedef enum {False, True} BOOLEAN;
80 typedef enum { RESULT_COMPLETE, RESULT_MORE, RESULT_ERROR } RESULT;
81 typedef unsigned char CHAR;
82 typedef unsigned short COUNT;
83 typedef unsigned int _COUNT_;
84 typedef unsigned int _CHAR_;
85 typedef int _char_;
86
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
87
88 /* Include one version of the ctype macros. Elvis' versions have the advantage
89 * of automatically checking the digraph table.
90 */
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
91 #ifdef NEED_CTYPE
92 # include "elvctype.h"
93 #else
94 # include <ctype.h>
95 #endif
96
97 /* Character conversions, and other operations */
98 #define toCHAR(s) ((CHAR *)(s))
99 #define tochar8(s) ((char *)(s))
100 #define CHARcpy(d,s) ((void)strcpy((char *)(d), (char *)(s)))
101 #define CHARcat(d,s) ((void)strcat((char *)(d), (char *)(s)))
102 #define CHARncpy(d,s,n) ((void)strncpy((char *)(d), (char *)(s), (n)))
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
103 #define CHARncat(d,s,n) ((void)strncat((char *)(d), (char *)(s), (n)))
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
104 #define CHARlen(s) strlen((char *)(s))
105 #define CHARchr(s,c) ((CHAR *)strchr((char *)(s), (char)(c)))
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
106 #define CHARrchr(s,c) ((CHAR *)strrchr((char *)(s), (char)(c)))
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
107 #define CHARcmp(s,t) (strcmp((char *)(s), (char *)(t)))
108 #define CHARncmp(s,t,n) (strncmp((char *)(s), (char *)(t), (n)))
109 #define CHARdup(s) ((CHAR *)safedup(tochar8(s)))
110 #define CHARkdup(s) ((CHAR *)safekdup(tochar8(s)))
111 #define long2CHAR(s,l) ((void)sprintf((char *)(s), "%ld", (l)))
112 #define CHAR2long(s) (atol(tochar8(s)))
113
114 #ifndef USE_PROTOTYPES
115 # if defined(__STDC__) || defined(__cplusplus)
116 # define USE_PROTOTYPES 1
117 # else
118 # define USE_PROTOTYPES 0
119 # endif
120 #endif
121 #if USE_PROTOTYPES
122 # define P_(args) args
123 #else
124 # define P_(args) ()
125 #endif
126
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
127 /* Some macros to handle C++ in a graceful way */
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
128 #if defined (__cplusplus)
129 #define BEGIN_EXTERNC extern "C" {
130 #define END_EXTERNC }
131 #else
132 #define BEGIN_EXTERNC
133 #define END_EXTERNC
134 #endif
135
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
136 /* Header files for the modules */
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
137 #include "safe.h"
138 #include "options.h"
139 #include "optglob.h"
140 #include "session.h"
141 #include "lowbuf.h"
142 #include "message.h"
143 #include "buffer.h"
144 #include "mark.h"
145 #include "buffer2.h"
146 #include "scan.h"
147 #include "opsys.h"
148 #include "map.h"
149 #include "gui.h"
150 #include "display.h"
151 #include "draw.h"
152 #include "state.h"
153 #include "window.h"
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
154 #include "options2.h"
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
155 #include "gui2.h"
156 #include "display2.h"
157 #include "draw2.h"
158 #include "state2.h"
159 #include "event.h"
160 #include "input.h"
161 #include "vi.h"
162 #include "regexp.h"
163 #include "ex.h"
164 #include "move.h"
165 #include "vicmd.h"
166 #include "operator.h"
167 #include "cut.h"
168 #include "elvisio.h"
169 #include "lp.h"
170 #include "calc.h"
171 #include "more.h"
172 #include "digraph.h"
8d1ac0c @mbert Import Elvis 2.1 (written by Steve Kirkendall)
authored
173 #include "tag.h"
174 #include "tagsrch.h"
175 #include "tagelvis.h"
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
176 #include "need.h"
177 #include "misc.h"
3a9bb55 @mbert Import Elvis 2.1_3 (written by Steve Kirkendall)
authored
178 #include "message2.h"
cf92e3b @mbert Import Elvis 2.0 (written by Steve Kirkendall)
authored
179
180 /* The following are defined in main.c */
181 extern GUI *chosengui;
182 BEGIN_EXTERNC
183 extern void mainfirstcmd P_((WINDOW win));
184 END_EXTERNC
Something went wrong with that request. Please try again.