unix.c - sam - An updated version of the sam text editor. | |
git clone git://vernunftzentrum.de/sam.git | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
unix.c (1070B) | |
--- | |
1 /* Copyright (c) 1998 Lucent Technologies - All rights reserved. */ | |
2 #include <u.h> | |
3 #include <libg.h> | |
4 #include <frame.h> | |
5 #include "flayer.h" | |
6 #include "samterm.h" | |
7 | |
8 #include <sys/socket.h> | |
9 #include <sys/stat.h> | |
10 #include <sys/types.h> | |
11 #include <sys/un.h> | |
12 #include <errno.h> | |
13 #include <signal.h> | |
14 | |
15 static char *fallbacks[] = { | |
16 "*scrollForwardR: true", | |
17 "*geometry: 740x780", | |
18 NULL | |
19 }; | |
20 | |
21 void | |
22 getscreen(int argc, char **argv) | |
23 { | |
24 Rectangle r; | |
25 | |
26 signal(SIGINT, SIG_IGN); | |
27 xtbinit(0, "Sam", &argc, argv, fallbacks); | |
28 r = inset(screen.r, 4); | |
29 bitblt(&screen, r.min, &screen, r, 0); | |
30 } | |
31 | |
32 int | |
33 screensize(int *w, int *h) | |
34 { | |
35 return scrpix(w,h); | |
36 } | |
37 | |
38 void | |
39 dumperrmsg(int count, int type, int count0, int c) | |
40 { | |
41 uint8_t *cp; | |
42 int i; | |
43 | |
44 cp = (uint8_t *) rcvstring(); | |
45 fprintf(stderr, "samterm: host mesg: count %d %ux %ux %ux %s...ignor… | |
46 count, type, count0, c, cp); | |
47 i = 0; | |
48 while (*cp) { | |
49 fprintf(stderr, "%x ", *cp); | |
50 if (i++ >= 20) { | |
51 fprintf(stderr, "\n"); | |
52 i = 0; | |
53 } | |
54 cp++; | |
55 } | |
56 } |