typedef struct Event Event;
typedef struct Msgs Msgs;
typedef struct Window Window;
enum
{
Stack = 8192,
EVENTSIZE = 256,
NEVENT = 5,
/* mailbox types */
Mdir = 0,
Mfile,
};
struct Msgs
{
char* path;
char* month;
int type;
int edited;
int warned;
Window* win;
void (*list)(Msgs*);
};
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];
};
struct Window
{
/* file descriptors */
int ctl;
int event;
int addr;
int data;
Biobuf* body;
/* event input */
char buf[512];
char* bufp;
int nbuf;
Event e[NEVENT];
int id;
int open;
Channel*cevent;
};
char* cleanpath(char* file, char* dir);
void ctlprint(int fd, char *fmt, ...);
void* emalloc(uint n);
void* erealloc(void *p, uint n);
void error(char *fmt, ...);
char* esmprint(char *fmt, ...);
char* estrdup(char *s);
void main(int, char**);
Window* newwindow(void);
char* readfile(char *file, int *np);
char* tcmdoutput(char* cmd, long *noutp);
void winclean(Window *w);
void winclosebody(Window *w);
int windel(Window *w, int sure);
void windormant(Window *w);
void wineventproc(void *v);
void wingetevent(Window *w, Event *e);
void winname(Window *w, char *s);
void winopenbody(Window *w, int mode);
int winopenfile(Window *w, char *f);
void winread(Window *w, uint q0, uint q1, char *data);
char* winreadbody(Window *w, int *np);
char* winselection(Window *w);
int winsetaddr(Window *w, char *addr, int errok);
void wintagwrite(Window *w, char *s, int n);
void winwritebody(Window *w, char *s, int n);
int winwritedata(Window *w, char *addr, char *s, int n);
void winwriteevent(Window *w, Event *e);
#pragma varargck argpos error 1
#pragma varargck argpos ctlprint 2
#pragma varargck argpos esmprint 1
|