/* * 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 typedef void (*cgit_cmd_fn)(void); struct cgit_cmd { const char *name; cgit_cmd_fn fn; unsigned int want_repo:1, want_vpath:1, is_clone:1; }; /* * The entry naming ctx.qry.page, or NULL when no page goes by that name. */ extern const struct cgit_cmd *cgit_get_cmd(void); #endif // CGIT_CMD_H