Source

xplor9 / win.h

enum
{
	False,
	True,
	EVENTSIZE=256,
};


typedef struct Event Event;
struct Event
{
	int	c1;
	int	c2;
	int	q0;
	int	q1;
	int	flag;
	int	nb;
	int	nr;
	char	b[EVENTSIZE*UTFmax+1];
	Rune	r[EVENTSIZE+1];
};


typedef struct Win Win;
struct Win
{
	int	winid;
	int	addr;
	Biobuf *body;
	int	ctl;
	int	data;
	int	event;
	char	buf[512];
	char	*bufp;
	int	nbuf;
};

int     dead(Win*);
void	wnew(Win*);
void	wwritedata(Win*, char *s, int n);
void	wclean(Win*);
void	wname(Win*, char*);
void	wdormant(Win*);
void	wevent(Win*, Event*);
void	wtagwrite(Win*, char*, int);
void	wwriteevent(Win*, Event*);
void * erealloc(void *p, uint n);

void	ctlwrite(Win*, char*);
int	getec(Win*);
int	geten(Win*);
int	geter(Win*, char*, int*);
int	openfile(Win*, char*);