author | Lars Hjemli <hjemli@gmail.com> | 2007-05-20 20:09:55 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2007-05-20 20:09:55 (UTC) |
commit | dc3ac3f76077c5d612d42e8beb4878e43acfc58a (patch) (unidiff) | |
tree | dfb996c0ce9833841578e1f0accbb5a387c01237 /cgit.h | |
parent | 977a0b173df6fe1a4d362fe4c70f9badff1fd46c (diff) | |
parent | 3de63b264c36888dfd42dfdf3fc0aad4ce0c2b5c (diff) | |
download | cgit-dc3ac3f76077c5d612d42e8beb4878e43acfc58a.zip cgit-dc3ac3f76077c5d612d42e8beb4878e43acfc58a.tar.gz cgit-dc3ac3f76077c5d612d42e8beb4878e43acfc58a.tar.bz2 |
Merge branch 'virtual-url'
* virtual-url:
Don't be fooled by trailing '/' in url-parameter
cache_safe_filename() needs more buffers
Enable url=value querystring parameter
Add lookup-function for valid repo commands
Move cgit_get_repoinfo into shared.c
-rw-r--r-- | cgit.h | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -13,16 +13,27 @@ | |||
13 | #include <diffcore.h> | 13 | #include <diffcore.h> |
14 | #include <refs.h> | 14 | #include <refs.h> |
15 | #include <revision.h> | 15 | #include <revision.h> |
16 | #include <log-tree.h> | 16 | #include <log-tree.h> |
17 | #include <archive.h> | 17 | #include <archive.h> |
18 | #include <xdiff/xdiff.h> | 18 | #include <xdiff/xdiff.h> |
19 | 19 | ||
20 | 20 | ||
21 | /* | ||
22 | * The valid cgit repo-commands | ||
23 | */ | ||
24 | #define CMD_LOG 1 | ||
25 | #define CMD_COMMIT 2 | ||
26 | #define CMD_DIFF 3 | ||
27 | #define CMD_TREE 4 | ||
28 | #define CMD_VIEW 5 | ||
29 | #define CMD_BLOB 6 | ||
30 | #define CMD_SNAPSHOT 7 | ||
31 | |||
21 | typedef void (*configfn)(const char *name, const char *value); | 32 | typedef void (*configfn)(const char *name, const char *value); |
22 | typedef void (*filepair_fn)(struct diff_filepair *pair); | 33 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
23 | typedef void (*linediff_fn)(char *line, int len); | 34 | typedef void (*linediff_fn)(char *line, int len); |
24 | 35 | ||
25 | struct cacheitem { | 36 | struct cacheitem { |
26 | char *name; | 37 | char *name; |
27 | struct stat st; | 38 | struct stat st; |
28 | int ttl; | 39 | int ttl; |
@@ -66,16 +77,17 @@ struct taginfo { | |||
66 | int tagger_date; | 77 | int tagger_date; |
67 | char *msg; | 78 | char *msg; |
68 | }; | 79 | }; |
69 | 80 | ||
70 | extern const char cgit_version[]; | 81 | extern const char cgit_version[]; |
71 | 82 | ||
72 | extern struct repolist cgit_repolist; | 83 | extern struct repolist cgit_repolist; |
73 | extern struct repoinfo *cgit_repo; | 84 | extern struct repoinfo *cgit_repo; |
85 | extern int cgit_cmd; | ||
74 | 86 | ||
75 | extern char *cgit_root_title; | 87 | extern char *cgit_root_title; |
76 | extern char *cgit_css; | 88 | extern char *cgit_css; |
77 | extern char *cgit_logo; | 89 | extern char *cgit_logo; |
78 | extern char *cgit_index_header; | 90 | extern char *cgit_index_header; |
79 | extern char *cgit_logo_link; | 91 | extern char *cgit_logo_link; |
80 | extern char *cgit_module_link; | 92 | extern char *cgit_module_link; |
81 | extern char *cgit_virtual_root; | 93 | extern char *cgit_virtual_root; |
@@ -108,16 +120,18 @@ extern char *cgit_query_head; | |||
108 | extern char *cgit_query_sha1; | 120 | extern char *cgit_query_sha1; |
109 | extern char *cgit_query_sha2; | 121 | extern char *cgit_query_sha2; |
110 | extern char *cgit_query_path; | 122 | extern char *cgit_query_path; |
111 | extern char *cgit_query_name; | 123 | extern char *cgit_query_name; |
112 | extern int cgit_query_ofs; | 124 | extern int cgit_query_ofs; |
113 | 125 | ||
114 | extern int htmlfd; | 126 | extern int htmlfd; |
115 | 127 | ||
128 | extern int cgit_get_cmd_index(const char *cmd); | ||
129 | extern struct repoinfo *cgit_get_repoinfo(const char *url); | ||
116 | extern void cgit_global_config_cb(const char *name, const char *value); | 130 | extern void cgit_global_config_cb(const char *name, const char *value); |
117 | extern void cgit_repo_config_cb(const char *name, const char *value); | 131 | extern void cgit_repo_config_cb(const char *name, const char *value); |
118 | extern void cgit_querystring_cb(const char *name, const char *value); | 132 | extern void cgit_querystring_cb(const char *name, const char *value); |
119 | 133 | ||
120 | extern int chk_zero(int result, char *msg); | 134 | extern int chk_zero(int result, char *msg); |
121 | extern int chk_positive(int result, char *msg); | 135 | extern int chk_positive(int result, char *msg); |
122 | 136 | ||
123 | extern int hextoint(char c); | 137 | extern int hextoint(char c); |
@@ -146,16 +160,17 @@ extern void html_link_open(char *url, char *title, char *class); | |||
146 | extern void html_link_close(void); | 160 | extern void html_link_close(void); |
147 | extern void html_filemode(unsigned short mode); | 161 | extern void html_filemode(unsigned short mode); |
148 | extern int html_include(const char *filename); | 162 | extern int html_include(const char *filename); |
149 | 163 | ||
150 | extern int cgit_read_config(const char *filename, configfn fn); | 164 | extern int cgit_read_config(const char *filename, configfn fn); |
151 | extern int cgit_parse_query(char *txt, configfn fn); | 165 | extern int cgit_parse_query(char *txt, configfn fn); |
152 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); | 166 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); |
153 | extern struct taginfo *cgit_parse_tag(struct tag *tag); | 167 | extern struct taginfo *cgit_parse_tag(struct tag *tag); |
168 | extern void cgit_parse_url(const char *url); | ||
154 | 169 | ||
155 | extern char *cache_safe_filename(const char *unsafe); | 170 | extern char *cache_safe_filename(const char *unsafe); |
156 | extern int cache_lock(struct cacheitem *item); | 171 | extern int cache_lock(struct cacheitem *item); |
157 | extern int cache_unlock(struct cacheitem *item); | 172 | extern int cache_unlock(struct cacheitem *item); |
158 | extern int cache_cancel_lock(struct cacheitem *item); | 173 | extern int cache_cancel_lock(struct cacheitem *item); |
159 | extern int cache_exist(struct cacheitem *item); | 174 | extern int cache_exist(struct cacheitem *item); |
160 | extern int cache_expired(struct cacheitem *item); | 175 | extern int cache_expired(struct cacheitem *item); |
161 | 176 | ||