page.h (853B)
1 struct user; 2 3 struct pagedata { 4 struct kreq req; 5 struct khtmlreq html; 6 struct sqlbox *db; 7 size_t dbid; 8 struct kvalid *keys; 9 char **pages; /* page names */ 10 size_t pagesz; /* number of pages */ 11 struct user *user; 12 size_t bodypos; /* for endpage() */ 13 }; 14 15 struct pagetemplate { 16 char *title; 17 char **css; 18 char **scripts; 19 }; 20 21 enum kcgi_err loadpagerequest(struct kfcgi *fcgi, struct pagedata *pd); 22 void freepagerequest(struct pagedata *pd); 23 enum kcgi_err startpage(struct pagedata *pd, struct pagetemplate *t, enum khttp status); 24 enum kcgi_err endpage(struct pagedata *pd, struct pagetemplate *t); 25 enum kcgi_err showpage(struct pagedata *pd, char **names, 26 enum kcgi_err (*functions[])(struct pagedata *), size_t len, 27 enum kcgi_err (*errorpage)(struct pagedata *, enum khttp)); 28 enum kcgi_err errorpage(struct pagedata *pd, enum khttp code);