From 305414df1246531baf0f2c959c2c61df4e93c526 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 18 May 2007 00:47:47 +0200 Subject: Move cgit_get_repoinfo into shared.c This function will be usefull when parsing url arguments. Signed-off-by: Lars Hjemli --- cgit.h | 1 + 1 file changed, 1 insertion(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index f3d783e..a38981d 100644 --- a/cgit.h +++ b/cgit.h @@ -112,6 +112,7 @@ extern int cgit_query_ofs; extern int htmlfd; +extern struct repoinfo *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); extern void cgit_querystring_cb(const char *name, const char *value); -- cgit v1.2.1 From 43d40f2b704151d145a1383b2b964210915ecae4 Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 18 May 2007 00:50:46 +0200 Subject: Add lookup-function for valid repo commands This will be usefull when parsing url arguments. Signed-off-by: Lars Hjemli --- cgit.h | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index a38981d..f402466 100644 --- a/cgit.h +++ b/cgit.h @@ -18,6 +18,17 @@ #include +/* + * The valid cgit repo-commands + */ +#define CMD_LOG = 1; +#define CMD_COMMIT = 1; +#define CMD_DIFF = 1; +#define CMD_TREE = 1; +#define CMD_VIEW = 1; +#define CMD_BLOB = 1; +#define CMD_SNAPSHOT = 1; + typedef void (*configfn)(const char *name, const char *value); typedef void (*filepair_fn)(struct diff_filepair *pair); typedef void (*linediff_fn)(char *line, int len); @@ -112,6 +123,7 @@ extern int cgit_query_ofs; extern int htmlfd; +extern int cgit_get_cmd_index(const char *cmd); extern struct repoinfo *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); -- cgit v1.2.1 From 30ccdcaa74ebc0aab2b7843b0db8251d0ddf56de Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Fri, 18 May 2007 03:00:54 +0200 Subject: Enable url=value querystring parameter This makes is possible to use repo-urls like '/pub/scm/git/git.git' and even add path specifications, like '/pub/scm/git/git.git/log/documentation'. Signed-off-by: Lars Hjemli --- cgit.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'cgit.h') diff --git a/cgit.h b/cgit.h index f402466..e5b3f5e 100644 --- a/cgit.h +++ b/cgit.h @@ -21,13 +21,13 @@ /* * The valid cgit repo-commands */ -#define CMD_LOG = 1; -#define CMD_COMMIT = 1; -#define CMD_DIFF = 1; -#define CMD_TREE = 1; -#define CMD_VIEW = 1; -#define CMD_BLOB = 1; -#define CMD_SNAPSHOT = 1; +#define CMD_LOG 1 +#define CMD_COMMIT 2 +#define CMD_DIFF 3 +#define CMD_TREE 4 +#define CMD_VIEW 5 +#define CMD_BLOB 6 +#define CMD_SNAPSHOT 7 typedef void (*configfn)(const char *name, const char *value); typedef void (*filepair_fn)(struct diff_filepair *pair); @@ -82,6 +82,7 @@ extern const char cgit_version[]; extern struct repolist cgit_repolist; extern struct repoinfo *cgit_repo; +extern int cgit_cmd; extern char *cgit_root_title; extern char *cgit_css; @@ -162,6 +163,7 @@ extern int cgit_read_config(const char *filename, configfn fn); extern int cgit_parse_query(char *txt, configfn fn); extern struct commitinfo *cgit_parse_commit(struct commit *commit); extern struct taginfo *cgit_parse_tag(struct tag *tag); +extern void cgit_parse_url(const char *url); extern char *cache_safe_filename(const char *unsafe); extern int cache_lock(struct cacheitem *item); -- cgit v1.2.1