]> git.lizzy.rs Git - plan9front.git/blob - sys/src/cmd/mothra/mothra.h
mothra: fix alt display resizing, filter control characters in panel entries, use...
[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         NNAME=512,
5         NLINE=256,
6         NAUTH=128,
7         NTITLE=81,      /* length of title (including nul at end) */
8         NLABEL=50,      /* length of option name in forms */
9         NREDIR=10,      /* # of redirections we'll tolerate before declaring a loop */
10 };
11
12 typedef struct Action Action;
13 typedef struct Url Url;
14 typedef struct Www Www;
15 typedef struct Field Field;
16 struct Action{
17         char *image;
18         Field *field;
19         char *link;
20         char *name;
21         int ismap;
22         int width;
23         int height;
24 };
25 struct Url{
26         char fullname[NNAME];
27         char basename[NNAME];
28         char reltext[NNAME];
29         char tag[NNAME];
30         int map;                /* is this an image map? */
31 };
32 struct Www{
33         Url *url;
34         void *pix;
35         void *form;
36         char title[NTITLE];
37         Rtext *text;
38         int yoffs;
39         int changed;            /* reader sets this every time it updates page */
40         int finished;           /* reader sets this when done */
41         int alldone;            /* page will not change further -- used to adjust cursor */
42 };
43
44 enum{
45         PLAIN,
46         HTML,
47
48         GIF,
49         JPEG,
50         PNG,
51         BMP,
52
53         GUNZIP,
54         COMPRESS,
55         PAGE,
56 };
57
58 /*
59  *  authentication types
60  */
61 enum{
62         ANONE,
63         ABASIC,
64 };
65
66 Image *hrule, *bullet, *linespace;
67 char home[512];         /* where to put files */
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 plrdhtml(char *, int, Www *);
81 void plrdplain(char *, int, Www *);
82 void htmlerror(char *, int, char *, ...);       /* user-supplied routine */
83 void seturl(Url *, char *, char *);
84 void getpix(Rtext *, Www *);
85 int pipeline(char *, int);
86 int urlopen(Url *, int, char *);
87 void getfonts(void);
88 void *emalloc(int);
89 void *emallocz(int, int);
90 void setbitmap(Rtext *);
91 void message(char *, ...);
92 int snooptype(int fd);
93 void mkfieldpanel(Rtext *);
94 void geturl(char *, int, char *, int, int);
95 char version[];