]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/mothra/mothra.h
mothra: remove debug code, dont create $home/lib/mothra/mothra.err file
[plan9front.git] / sys / src / cmd / mothra / mothra.h
1 enum{
2         NWWW=64,        /* # of pages we hold in the log */
3         NXPROC=5,       /* # of parallel procs loading the pix */
4         NPIXMB=8,       /* megabytes of image data to keep arround */
5         NNAME=512,
6         NLINE=256,
7         NAUTH=128,
8         NTITLE=81,      /* length of title (including nul at end) */
9         NLABEL=50,      /* length of option name in forms */
10         NREDIR=10,      /* # of redirections we'll tolerate before declaring a loop */
11 };
12
13 typedef struct Action Action;
14 typedef struct Url Url;
15 typedef struct Www Www;
16 typedef struct Field Field;
17 struct Action{
18         char *image;
19         Field *field;
20         char *link;
21         char *name;
22         int ismap;
23         int width;
24         int height;
25 };
26 struct Url{
27         char fullname[NNAME];
28         char basename[NNAME];
29         char reltext[NNAME];
30         char tag[NNAME];
31         int map;                /* is this an image map? */
32 };
33 struct Www{
34         Url *url;
35         void *pix;
36         void *form;
37         char title[NTITLE];
38         Rtext *text;
39         int yoffs;
40         int gottitle;           /* title got drawn */
41         int changed;            /* reader sets this every time it updates page */
42         int finished;           /* reader sets this when done */
43         int alldone;            /* page will not change further -- used to adjust cursor */
44 };
45
46 enum{
47         PLAIN,
48         HTML,
49
50         GIF,
51         JPEG,
52         PNG,
53         BMP,
54         ICO,
55
56         PAGE,
57 };
58
59 /*
60  *  authentication types
61  */
62 enum{
63         ANONE,
64         ABASIC,
65 };
66
67 Image *hrule, *bullet, *linespace;
68 int chrwidth;           /* nominal width of characters in font */
69 Panel *text;            /* Panel displaying the current www page */
70 int debug;              /* command line flag */
71
72 /*
73  * HTTP methods
74  */
75 enum{
76         GET=1,
77         POST,
78 };
79
80 void finish(Www *w);
81 void plrdhtml(char *, int, Www *);
82 void plrdplain(char *, int, Www *);
83 void htmlerror(char *, int, char *, ...);       /* user-supplied routine */
84 void seturl(Url *, char *, char *);
85 Url *selurl(char *);
86 void getpix(Rtext *, Www *);
87 ulong countpix(void *p);
88 void freepix(void *p);
89 void dupfds(int fd, ...);
90 int pipeline(int fd, char *fmt, ...);
91 void getfonts(void);
92 void *emalloc(int);
93 void nstrcpy(char *to, char *from, int len);
94 void freeform(void *p);
95 int Ufmt(Fmt *f);
96 #pragma varargck type "U" char*
97 void message(char *, ...);
98 int filetype(int, char *, int);
99 int snooptype(int);
100 void mkfieldpanel(Rtext *);
101 void geturl(char *, int, int, int);
102 int urlpost(Url*, char*);
103 int urlget(Url*, int);
104 int urlresolve(Url *);
105 char version[];
106 Mouse mouse;