summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2008-03-24 15:00:27 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2008-03-24 15:00:27 (UTC)
commitf34478cbe0214a201e7ecef3e79ed6c957b7beee (patch) (unidiff)
tree1ee05da742488cab51a06e083d26b7b58d829b43 /cgit.h
parente0e4478e7b4812f822d60a13a33525f8e529e1e8 (diff)
downloadcgit-f34478cbe0214a201e7ecef3e79ed6c957b7beee.zip
cgit-f34478cbe0214a201e7ecef3e79ed6c957b7beee.tar.gz
cgit-f34478cbe0214a201e7ecef3e79ed6c957b7beee.tar.bz2
Refactor snapshot support
The snapshot support needs to be split between output- and config-related functions to get the layering between shared.c and ui-*.c right. There is also some codestyle-issues which needs fixing to make the snapshot functions more similar to the rest of the cgit code. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 295441b..e2d5126 100644
--- a/cgit.h
+++ b/cgit.h
@@ -168,28 +168,36 @@ struct cgit_page {
168 char *charset; 168 char *charset;
169 char *filename; 169 char *filename;
170 char *title; 170 char *title;
171}; 171};
172 172
173struct cgit_context { 173struct cgit_context {
174 struct cgit_query qry; 174 struct cgit_query qry;
175 struct cgit_config cfg; 175 struct cgit_config cfg;
176 struct cgit_repo *repo; 176 struct cgit_repo *repo;
177 struct cgit_page page; 177 struct cgit_page page;
178}; 178};
179 179
180struct cgit_snapshot_format {
181 const char *suffix;
182 const char *mimetype;
183 write_archive_fn_t write_func;
184 int bit;
185};
186
180extern const char *cgit_version; 187extern const char *cgit_version;
181 188
182extern struct cgit_repolist cgit_repolist; 189extern struct cgit_repolist cgit_repolist;
183extern struct cgit_context ctx; 190extern struct cgit_context ctx;
191extern const struct cgit_snapshot_format cgit_snapshot_formats[];
184extern int cgit_cmd; 192extern int cgit_cmd;
185 193
186extern void cgit_prepare_context(struct cgit_context *ctx); 194extern void cgit_prepare_context(struct cgit_context *ctx);
187extern struct cgit_repo *cgit_get_repoinfo(const char *url); 195extern struct cgit_repo *cgit_get_repoinfo(const char *url);
188extern void cgit_global_config_cb(const char *name, const char *value); 196extern void cgit_global_config_cb(const char *name, const char *value);
189extern void cgit_repo_config_cb(const char *name, const char *value); 197extern void cgit_repo_config_cb(const char *name, const char *value);
190extern void cgit_querystring_cb(const char *name, const char *value); 198extern void cgit_querystring_cb(const char *name, const char *value);
191 199
192extern int chk_zero(int result, char *msg); 200extern int chk_zero(int result, char *msg);
193extern int chk_positive(int result, char *msg); 201extern int chk_positive(int result, char *msg);
194extern int chk_non_negative(int result, char *msg); 202extern int chk_non_negative(int result, char *msg);
195 203