Blob


1 #define SAMTERM
3 #define RUNESIZE sizeof(Rune)
4 #define MAXFILES 256
5 #define READBUFSIZE 8192
6 #define NL 5
8 enum{
9 Up,
10 Down
11 };
13 typedef struct Text Text;
14 typedef struct Section Section;
15 typedef struct Rasp Rasp;
16 typedef struct Readbuf Readbuf;
18 struct Section
19 {
20 long nrunes;
21 Rune *text; /* if null, we haven't got it */
22 Section *next;
23 };
25 struct Rasp
26 {
27 long nrunes;
28 Section *sect;
29 };
31 #define Untagged ((ushort)65535)
33 struct Text
34 {
35 Rasp rasp;
36 short nwin;
37 short front; /* input window */
38 ushort tag;
39 char lock;
40 Flayer l[NL]; /* screen storage */
41 };
43 struct Readbuf
44 {
45 short n; /* # bytes in buf */
46 uchar data[READBUFSIZE]; /* data bytes */
47 };
49 enum Resource
50 {
51 RHost,
52 RKeyboard,
53 RMouse,
54 RPlumb,
55 RResize,
56 NRes,
57 };
59 extern Text **text;
60 extern uchar **name;
61 extern ushort *tag;
62 extern int nname;
63 extern int mname;
64 extern Cursor bullseye;
65 extern Cursor deadmouse;
66 extern Cursor lockarrow;
67 extern Cursor *cursor;
68 extern Flayer *which;
69 extern Flayer *work;
70 extern Text cmd;
71 extern Rune *scratch;
72 extern long nscralloc;
73 extern char hostlock;
74 extern char hasunlocked;
75 extern long snarflen;
76 extern Mousectl* mousectl;
77 extern Keyboardctl* keyboardctl;
78 extern Mouse* mousep;
79 extern long modified;
80 extern int maxtab;
81 extern Readbuf hostbuf[2]; /* double buffer; it's synchronous communication */
82 extern Readbuf plumbbuf[2]; /* double buffer; it's synchronous communication */
83 extern Channel *plumbc;
84 extern Channel *hostc;
85 extern int hversion;
86 extern int plumbfd;
87 extern int hostfd[2];
89 Rune *gettext(Flayer*, long, ulong*);
90 void *alloc(ulong n);
92 void iconinit(void);
93 void getscreen(int, char**);
94 void initio(void);
95 void setlock(void);
96 void outcmd(void);
97 void rinit(Rasp*);
98 void startnewfile(int, Text*);
99 void getmouse(void);
100 void mouseunblock(void);
101 void kbdblock(void);
102 void extstart(void);
103 void hoststart(void);
104 int plumbstart(void);
105 int button(int but);
106 int load(char*, int);
107 int waitforio(void);
108 int rcvchar(void);
109 int getch(void);
110 int kbdchar(void);
111 int qpeekc(void);
112 void cut(Text*, int, int, int);
113 void paste(Text*, int);
114 void snarf(Text*, int);
115 int center(Flayer*, long);
116 int xmenuhit(int, Menu*);
117 void buttons(int);
118 int getr(Rectangle*);
119 void current(Flayer*);
120 void duplicate(Flayer*, Rectangle, Font*, int);
121 void startfile(Text*);
122 void panic(char*);
123 void panic1(Display*, char*);
124 void closeup(Flayer*);
125 void Strgrow(Rune**, long*, int);
126 int RESIZED(void);
127 void resize(void);
128 void rcv(void);
129 void type(Flayer*, int);
130 void menu2hit(void);
131 void menu3hit(void);
132 void scroll(Flayer*, int);
133 void hcheck(int);
134 void rclear(Rasp*);
135 int whichmenu(int);
136 void hcut(int, long, long);
137 void horigin(int, long);
138 void hgrow(int, long, long, int);
139 int hdata(int, long, uchar*, int);
140 int hdatarune(int, long, Rune*, int);
141 Rune *rload(Rasp*, ulong, ulong, ulong*);
142 void menuins(int, uchar*, Text*, int, int);
143 void menudel(int);
144 Text *sweeptext(int, int);
145 void setpat(char*);
146 void scrdraw(Flayer*, long tot);
147 int rcontig(Rasp*, ulong, ulong, int);
148 int rmissing(Rasp*, ulong, ulong);
149 void rresize(Rasp *, long, long, long);
150 void rdata(Rasp*, long, long, Rune*);
151 void rclean(Rasp*);
152 void scrorigin(Flayer*, int, long);
153 long scrtotal(Flayer*);
154 void flnewlyvisible(Flayer*);
155 char *rcvstring(void);
156 void Strcpy(Rune*, Rune*);
157 void Strncpy(Rune*, Rune*, long);
158 void flushtyping(int);
159 void dumperrmsg(int, int, int, int);
160 int screensize(int*,int*);
161 void getmouse(void);
163 #include "mesg.h"
165 void outTs(Tmesg, int);
166 void outT0(Tmesg);
167 void outTl(Tmesg, long);
168 void outTslS(Tmesg, int, long, Rune*);
169 void outTsll(Tmesg, int, long, long);
170 void outTsl(Tmesg, int, long);
171 void outTsv(Tmesg, int, void*);
172 void outTv(Tmesg, void*);
173 void outstart(Tmesg);
174 void outcopy(int, uchar*);
175 void outshort(int);
176 void outlong(long);
177 void outvlong(void*);
178 void outsend(void);