2011-09-04 17:16:30 +00:00
|
|
|
enum{
|
|
|
|
NWWW=64, /* # of pages we hold in the log */
|
2011-09-05 01:29:26 +00:00
|
|
|
NXPROC=5, /* # of parallel procs loading the pix */
|
2011-11-14 11:59:48 +00:00
|
|
|
NPIXMB=8, /* megabytes of image data to keep arround */
|
2011-09-04 17:16:30 +00:00
|
|
|
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];
|
2011-09-05 01:29:26 +00:00
|
|
|
char basename[NNAME];
|
2011-09-04 17:16:30 +00:00
|
|
|
char reltext[NNAME];
|
|
|
|
char tag[NNAME];
|
2011-10-03 18:40:43 +00:00
|
|
|
int map; /* is this an image map? */
|
2011-09-04 17:16:30 +00:00
|
|
|
};
|
|
|
|
struct Www{
|
|
|
|
Url *url;
|
|
|
|
void *pix;
|
|
|
|
void *form;
|
|
|
|
char title[NTITLE];
|
|
|
|
Rtext *text;
|
|
|
|
int yoffs;
|
2012-09-23 23:08:09 +00:00
|
|
|
int gottitle; /* title got drawn */
|
2011-09-04 17:16:30 +00:00
|
|
|
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{
|
2011-10-03 18:40:43 +00:00
|
|
|
PLAIN,
|
2011-09-04 17:16:30 +00:00
|
|
|
HTML,
|
2011-10-04 16:48:31 +00:00
|
|
|
|
2011-10-03 18:40:43 +00:00
|
|
|
GIF,
|
2011-09-04 17:16:30 +00:00
|
|
|
JPEG,
|
|
|
|
PNG,
|
2011-10-03 18:40:43 +00:00
|
|
|
BMP,
|
2012-04-01 02:57:11 +00:00
|
|
|
ICO,
|
2011-10-04 16:48:31 +00:00
|
|
|
|
2011-10-03 18:40:43 +00:00
|
|
|
PAGE,
|
2011-09-04 17:16:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 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,
|
|
|
|
};
|
|
|
|
|
2012-01-01 15:59:42 +00:00
|
|
|
void finish(Www *w);
|
2011-09-04 17:16:30 +00:00
|
|
|
void plrdhtml(char *, int, Www *);
|
|
|
|
void plrdplain(char *, int, Www *);
|
|
|
|
void htmlerror(char *, int, char *, ...); /* user-supplied routine */
|
2011-09-05 01:29:26 +00:00
|
|
|
void seturl(Url *, char *, char *);
|
2012-05-25 08:52:10 +00:00
|
|
|
Url *selurl(char *);
|
2011-09-04 17:16:30 +00:00
|
|
|
void getpix(Rtext *, Www *);
|
2011-11-14 11:59:48 +00:00
|
|
|
ulong countpix(void *p);
|
|
|
|
void freepix(void *p);
|
2011-09-04 17:16:30 +00:00
|
|
|
int pipeline(char *, int);
|
|
|
|
void getfonts(void);
|
|
|
|
void *emalloc(int);
|
2012-04-03 17:03:44 +00:00
|
|
|
void nstrcpy(char *to, char *from, int len);
|
2011-11-14 11:59:48 +00:00
|
|
|
void freeform(void *p);
|
2012-06-18 06:00:36 +00:00
|
|
|
int Ufmt(Fmt *f);
|
|
|
|
#pragma varargck type "U" char*
|
2011-09-04 17:16:30 +00:00
|
|
|
void message(char *, ...);
|
2012-06-18 19:26:28 +00:00
|
|
|
int filetype(int, char *, int);
|
|
|
|
int snooptype(int);
|
2011-09-04 17:16:30 +00:00
|
|
|
void mkfieldpanel(Rtext *);
|
2012-05-25 08:52:10 +00:00
|
|
|
void geturl(char *, int, int, int);
|
|
|
|
int urlpost(Url*, char*);
|
|
|
|
int urlget(Url*, int);
|
2012-07-17 05:21:22 +00:00
|
|
|
int urlresolve(Url *);
|
2011-09-04 17:16:30 +00:00
|
|
|
char version[];
|
2012-06-18 19:26:28 +00:00
|
|
|
Mouse mouse;
|