~foura/libacme

libacme/acme.h -rw-r--r-- 782 bytes
14684c2djames palmer minor manpage oops 4 months ago
                                                                                
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
#pragma lib "libacme.a"

enum {
	AEventSz = 256 * UTFmax,
};

typedef struct AWin AWin;
typedef struct AEvent AEvent;

struct AWin {
	int id;
	
	int ctlfd;
	int addrfd;
	int datafd;
	int bodyfd;
	int eventfd;

	char buf[512];
	char *bufp;
	int nbuf;
	
	void *aux;
	
	AWin *next;
};

struct AEvent {
	AWin *win;

	char origin;
	char type;
	
	int p;
	int q0, q1;
	int flags;
	
	int ntext;
	char text[AEventSz + 1];
};

int		awinfsopen(AWin *, char *, int);
AWin *	awincreate(void);
void	awinclose(AWin *);
void	awincloseall(void);

int		awinload(AWin *, char *);
int		awinput(AWin *, char *);

int		awinaddtag(AWin *, char *);
int		awinsettag(AWin *, char *);

void	aeventopen(AWin *);
int		aeventread(AWin *, AEvent *);
int		aeventwrite(AWin *, AEvent *);
void	aeventclose(AWin *w);