plan9fox/sys/src/cmd/mothra/mothra.h
cinap_lenrek 01e3e719ed mothra: various improvements
* disallow snarf on password entries
* remove current title label as it is displayed in the page list (redundant)
* avoid redrawing page list just to update the title
* check if the chan changed for backup bitmap in pl_rtdraw()
2012-09-24 01:08:09 +02:00

107 lines
2.1 KiB
C

enum{
NWWW=64, /* # of pages we hold in the log */
NXPROC=5, /* # of parallel procs loading the pix */
NPIXMB=8, /* megabytes of image data to keep arround */
NNAME=512,
NLINE=256,
NAUTH=128,
NTITLE=81, /* length of title (including nul at end) */
NLABEL=50, /* length of option name in forms */
NREDIR=10, /* # of redirections we'll tolerate before declaring a loop */
};
typedef struct Action Action;
typedef struct Url Url;
typedef struct Www Www;
typedef struct Field Field;
struct Action{
char *image;
Field *field;
char *link;
char *name;
int ismap;
int width;
int height;
};
struct Url{
char fullname[NNAME];
char basename[NNAME];
char reltext[NNAME];
char tag[NNAME];
int map; /* is this an image map? */
};
struct Www{
Url *url;
void *pix;
void *form;
char title[NTITLE];
Rtext *text;
int yoffs;
int gottitle; /* title got drawn */
int changed; /* reader sets this every time it updates page */
int finished; /* reader sets this when done */
int alldone; /* page will not change further -- used to adjust cursor */
};
enum{
PLAIN,
HTML,
GIF,
JPEG,
PNG,
BMP,
ICO,
PAGE,
};
/*
* authentication types
*/
enum{
ANONE,
ABASIC,
};
Image *hrule, *bullet, *linespace;
char home[512]; /* where to put files */
int chrwidth; /* nominal width of characters in font */
Panel *text; /* Panel displaying the current www page */
int debug; /* command line flag */
/*
* HTTP methods
*/
enum{
GET=1,
POST,
};
void finish(Www *w);
void plrdhtml(char *, int, Www *);
void plrdplain(char *, int, Www *);
void htmlerror(char *, int, char *, ...); /* user-supplied routine */
void seturl(Url *, char *, char *);
Url *selurl(char *);
void getpix(Rtext *, Www *);
ulong countpix(void *p);
void freepix(void *p);
int pipeline(char *, int);
void getfonts(void);
void *emalloc(int);
void nstrcpy(char *to, char *from, int len);
void freeform(void *p);
int Ufmt(Fmt *f);
#pragma varargck type "U" char*
void message(char *, ...);
int filetype(int, char *, int);
int snooptype(int);
void mkfieldpanel(Rtext *);
void geturl(char *, int, int, int);
int urlpost(Url*, char*);
int urlget(Url*, int);
int urlresolve(Url *);
char version[];
Mouse mouse;