Add command dispatcher

This simplifies the code in cgit.c and makes it easier to extend cgit with
new pages/commands.

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
This commit is contained in:
Lars Hjemli
2008-03-24 01:09:39 +01:00
부모 b608e88adb
커밋 e0e4478e7b
7개의 변경된 파일172개의 추가작업 그리고 113개의 파일을 삭제

14
cgit.h
파일 보기

@@ -19,19 +19,6 @@
#include <utf8.h>
/*
* The valid cgit repo-commands
*/
#define CMD_LOG 1
#define CMD_COMMIT 2
#define CMD_DIFF 3
#define CMD_TREE 4
#define CMD_BLOB 5
#define CMD_SNAPSHOT 6
#define CMD_TAG 7
#define CMD_REFS 8
#define CMD_PATCH 9
/*
* Dateformats used on misc. pages
*/
@@ -197,7 +184,6 @@ extern struct cgit_context ctx;
extern int cgit_cmd;
extern void cgit_prepare_context(struct cgit_context *ctx);
extern int cgit_get_cmd_index(const char *cmd);
extern struct cgit_repo *cgit_get_repoinfo(const char *url);
extern void cgit_global_config_cb(const char *name, const char *value);
extern void cgit_repo_config_cb(const char *name, const char *value);