diff options
context:
space:
mode:
authorBryce Kwon <bryce@brycekwon.com>
committerBryce Kwon <bryce@brycekwon.com>
commit
parent
tree
download
Restyle the sources and fix the audit's findings
Diffstat (limited to 'source/cmd.h')
-rw-r--r--source/cmd.h16
1 file changed, 12 insertions, 4 deletions
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