diff options
author | Lars Hjemli | 2007-05-18 00:47:47 +0200 |
---|---|---|
committer | Lars Hjemli | 2007-05-18 22:51:01 +0200 |
commit | 305414df1246531baf0f2c959c2c61df4e93c526 (patch) | |
tree | 18f071e269f01b875fd0045723faab30345d93ae | |
parent | Remove unused extern declarations from cgit.h (diff) | |
download | cgit-305414df1246531baf0f2c959c2c61df4e93c526.tar.gz cgit-305414df1246531baf0f2c959c2c61df4e93c526.zip |
Move cgit_get_repoinfo into shared.c
This function will be usefull when parsing url arguments. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 14 | ||||
-rw-r--r-- | cgit.h | 1 | ||||
-rw-r--r-- | shared.c | 13 |
3 files changed, 14 insertions, 14 deletions
diff --git a/cgit.c b/cgit.c index 3e7e595..431e8fb 100644 --- a/cgit.c +++ b/cgit.c | |||
@@ -11,20 +11,6 @@ | |||
11 | const char cgit_version[] = CGIT_VERSION; | 11 | const char cgit_version[] = CGIT_VERSION; |
12 | 12 | ||
13 | 13 | ||
14 | static struct repoinfo *cgit_get_repoinfo(char *url) | ||
15 | { | ||
16 | int i; | ||
17 | struct repoinfo *repo; | ||
18 | |||
19 | for (i=0; i<cgit_repolist.count; i++) { | ||
20 | repo = &cgit_repolist.repos[i]; | ||
21 | if (!strcmp(repo->url, url)) | ||
22 | return repo; | ||
23 | } | ||
24 | return NULL; | ||
25 | } | ||
26 | |||
27 | |||
28 | static int cgit_prepare_cache(struct cacheitem *item) | 14 | static int cgit_prepare_cache(struct cacheitem *item) |
29 | { | 15 | { |
30 | if (!cgit_query_repo) { | 16 | if (!cgit_query_repo) { |
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; | |||
112 | 112 | ||
113 | extern int htmlfd; | 113 | extern int htmlfd; |
114 | 114 | ||
115 | extern struct repoinfo *cgit_get_repoinfo(const char *url); | ||
115 | extern void cgit_global_config_cb(const char *name, const char *value); | 116 | extern void cgit_global_config_cb(const char *name, const char *value); |
116 | extern void cgit_repo_config_cb(const char *name, const char *value); | 117 | extern void cgit_repo_config_cb(const char *name, const char *value); |
117 | extern void cgit_querystring_cb(const char *name, const char *value); | 118 | extern void cgit_querystring_cb(const char *name, const char *value); |
diff --git a/shared.c b/shared.c index 53cd9b0..b164d81 100644 --- a/shared.c +++ b/shared.c | |||
@@ -93,6 +93,19 @@ struct repoinfo *add_repo(const char *url) | |||
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
96 | struct repoinfo *cgit_get_repoinfo(const char *url) | ||
97 | { | ||
98 | int i; | ||
99 | struct repoinfo *repo; | ||
100 | |||
101 | for (i=0; i<cgit_repolist.count; i++) { | ||
102 | repo = &cgit_repolist.repos[i]; | ||
103 | if (!strcmp(repo->url, url)) | ||
104 | return repo; | ||
105 | } | ||
106 | return NULL; | ||
107 | } | ||
108 | |||
96 | void cgit_global_config_cb(const char *name, const char *value) | 109 | void cgit_global_config_cb(const char *name, const char *value) |
97 | { | 110 | { |
98 | if (!strcmp(name, "root-title")) | 111 | if (!strcmp(name, "root-title")) |