shithub: libacme

ref: 14684c2d7066633e502b00bbaa26b1f816f02751
dir: /acme.h/

View raw version
#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);