aboutsummaryrefslogtreecommitdiff
path: root/include/acme.h
blob: 372a90957229fbc206ff89de13cd80f382a219f4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
AUTOLIB(acme);

typedef struct Event Event;
typedef struct Win Win;

#define	EVENTSIZE	256
struct Event
{
	int	c1;
	int	c2;
	int	oq0;
	int	oq1;
	int	q0;
	int	q1;
	int	flag;
	int	nb;
	int	nr;
	char	text[EVENTSIZE*UTFmax+1];
	char	arg[EVENTSIZE*UTFmax+1];
	char	loc[EVENTSIZE*UTFmax+1];
};

struct Win
{
	int id;
	CFid *ctl;
	CFid *tag;
	CFid *body;
	CFid *addr;
	CFid *event;
	CFid *data;
	CFid *xdata;
	Channel *c;	/* chan(Event) */
	Win *next;
	Win *prev;
	
	/* events */
	int nbuf;
	char buf[1024];
	char *bufp;
	jmp_buf jmp;
	Event e2;
	Event e3;
	Event e4;
};

Win *newwin(void);
Win *openwin(int, CFid*);

int eventfmt(Fmt*);
int pipewinto(Win *w, char *name, int, char *fmt, ...);
int pipetowin(Win *w, char *name, int, char *fmt, ...);
char *sysrun(char*, ...);
int winaddr(Win *w, char *fmt, ...);
int winctl(Win *w, char *fmt, ...);
int windel(Win *w, int sure);
int winfd(Win *w, char *name, int);
char *winmread(Win *w, char *file);
int winname(Win *w, char *fmt, ...);
int winprint(Win *w, char *name, char *fmt, ...);
int winread(Win *w, char *file, void *a, int n);
int winseek(Win *w, char *file, int n, int off);
int winreadaddr(Win *w, uint*);
int winreadevent(Win *w, Event *e);
int winwrite(Win *w, char *file, void *a, int n);
int winwriteevent(Win *w, Event *e);
int winopenfd(Win *w, char *name, int mode);
void windeleteall(void);
void winfree(Win *w);
void winclosefiles(Win *w);
Channel *wineventchan(Win *w);

void *erealloc(void*, uint);
void *emalloc(uint);
char *estrdup(char*);
char *evsmprint(char*, va_list);