From 80767bc9732bf6716697198e53ff2cb8d4ae96be Mon Sep 17 00:00:00 2001 From: Bryce Kwon Date: Wed, 12 Aug 2026 18:23:17 -1000 Subject: Restyle the sources and fix the audit's findings --- source/cmd.h | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'source/cmd.h') diff --git a/source/cmd.h b/source/cmd.h index 6249b1d..7299028 100644 --- a/source/cmd.h +++ b/source/cmd.h @@ -1,5 +1,12 @@ -#ifndef CMD_H -#define CMD_H +/* + * 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); @@ -11,6 +18,7 @@ struct cgit_cmd { is_clone:1; }; -extern struct cgit_cmd *cgit_get_cmd(void); +// 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 /* CMD_H */ +#endif // CGIT_CMD_H -- cgit v2.8.0