/*
* The dispatch table that maps the page name in a request to the function
* rendering it. Each entry also records what the request needs resolved
* first, so the caller can look up the repository or the path within the tree
* and reject a bad request once, rather than every page repeating the check.
*/#ifndef CGIT_CMD_H
#define CGIT_CMD_H
typedefvoid (*cgit_cmd_fn)(void);
struct cgit_cmd {
constchar *name;
cgit_cmd_fn fn;
unsignedint want_repo:1, want_vpath:1, is_clone:1;
};
/*
* The entry for the page named, or NULL when no page goes by that name.
*/externconststruct cgit_cmd *cgit_find_cmd(constchar *name);
/*
* The entry naming ctx.qry.page, after filling in the default page for the
* request, or NULL when no page goes by that name.
*/externconststruct cgit_cmd *cgit_get_cmd(void);
#endif// CGIT_CMD_H