summaryrefslogtreecommitdiffabout
path: root/cgit.h
Unidiff
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 4c854ea..d90ccdc 100644
--- a/cgit.h
+++ b/cgit.h
@@ -146,128 +146,142 @@ struct cgit_config {
146 char *agefile; 146 char *agefile;
147 char *cache_root; 147 char *cache_root;
148 char *clone_prefix; 148 char *clone_prefix;
149 char *css; 149 char *css;
150 char *favicon; 150 char *favicon;
151 char *footer; 151 char *footer;
152 char *head_include; 152 char *head_include;
153 char *header; 153 char *header;
154 char *index_header; 154 char *index_header;
155 char *index_info; 155 char *index_info;
156 char *logo; 156 char *logo;
157 char *logo_link; 157 char *logo_link;
158 char *module_link; 158 char *module_link;
159 char *repo_group; 159 char *repo_group;
160 char *robots; 160 char *robots;
161 char *root_title; 161 char *root_title;
162 char *root_desc; 162 char *root_desc;
163 char *root_readme; 163 char *root_readme;
164 char *script_name; 164 char *script_name;
165 char *virtual_root; 165 char *virtual_root;
166 int cache_size; 166 int cache_size;
167 int cache_dynamic_ttl; 167 int cache_dynamic_ttl;
168 int cache_max_create_time; 168 int cache_max_create_time;
169 int cache_repo_ttl; 169 int cache_repo_ttl;
170 int cache_root_ttl; 170 int cache_root_ttl;
171 int cache_static_ttl; 171 int cache_static_ttl;
172 int embedded; 172 int embedded;
173 int enable_index_links; 173 int enable_index_links;
174 int enable_log_filecount; 174 int enable_log_filecount;
175 int enable_log_linecount; 175 int enable_log_linecount;
176 int local_time; 176 int local_time;
177 int max_repo_count; 177 int max_repo_count;
178 int max_commit_count; 178 int max_commit_count;
179 int max_lock_attempts; 179 int max_lock_attempts;
180 int max_msg_len; 180 int max_msg_len;
181 int max_repodesc_len; 181 int max_repodesc_len;
182 int max_stats; 182 int max_stats;
183 int nocache; 183 int nocache;
184 int noplainemail; 184 int noplainemail;
185 int noheader; 185 int noheader;
186 int renamelimit; 186 int renamelimit;
187 int snapshots; 187 int snapshots;
188 int summary_branches; 188 int summary_branches;
189 int summary_log; 189 int summary_log;
190 int summary_tags; 190 int summary_tags;
191 struct string_list mimetypes; 191 struct string_list mimetypes;
192 struct cgit_filter *about_filter; 192 struct cgit_filter *about_filter;
193 struct cgit_filter *commit_filter; 193 struct cgit_filter *commit_filter;
194 struct cgit_filter *source_filter; 194 struct cgit_filter *source_filter;
195}; 195};
196 196
197struct cgit_page { 197struct cgit_page {
198 time_t modified; 198 time_t modified;
199 time_t expires; 199 time_t expires;
200 size_t size; 200 size_t size;
201 char *mimetype; 201 char *mimetype;
202 char *charset; 202 char *charset;
203 char *filename; 203 char *filename;
204 char *etag; 204 char *etag;
205 char *title; 205 char *title;
206 int status; 206 int status;
207 char *statusmsg; 207 char *statusmsg;
208}; 208};
209 209
210struct cgit_environment {
211 char *cgit_config;
212 char *http_host;
213 char *https;
214 char *no_http;
215 char *path_info;
216 char *query_string;
217 char *request_method;
218 char *script_name;
219 char *server_name;
220 char *server_port;
221};
222
210struct cgit_context { 223struct cgit_context {
224 struct cgit_environment env;
211 struct cgit_query qry; 225 struct cgit_query qry;
212 struct cgit_config cfg; 226 struct cgit_config cfg;
213 struct cgit_repo *repo; 227 struct cgit_repo *repo;
214 struct cgit_page page; 228 struct cgit_page page;
215}; 229};
216 230
217struct cgit_snapshot_format { 231struct cgit_snapshot_format {
218 const char *suffix; 232 const char *suffix;
219 const char *mimetype; 233 const char *mimetype;
220 write_archive_fn_t write_func; 234 write_archive_fn_t write_func;
221 int bit; 235 int bit;
222}; 236};
223 237
224extern const char *cgit_version; 238extern const char *cgit_version;
225 239
226extern struct cgit_repolist cgit_repolist; 240extern struct cgit_repolist cgit_repolist;
227extern struct cgit_context ctx; 241extern struct cgit_context ctx;
228extern const struct cgit_snapshot_format cgit_snapshot_formats[]; 242extern const struct cgit_snapshot_format cgit_snapshot_formats[];
229 243
230extern struct cgit_repo *cgit_add_repo(const char *url); 244extern struct cgit_repo *cgit_add_repo(const char *url);
231extern struct cgit_repo *cgit_get_repoinfo(const char *url); 245extern struct cgit_repo *cgit_get_repoinfo(const char *url);
232extern void cgit_repo_config_cb(const char *name, const char *value); 246extern void cgit_repo_config_cb(const char *name, const char *value);
233 247
234extern int chk_zero(int result, char *msg); 248extern int chk_zero(int result, char *msg);
235extern int chk_positive(int result, char *msg); 249extern int chk_positive(int result, char *msg);
236extern int chk_non_negative(int result, char *msg); 250extern int chk_non_negative(int result, char *msg);
237 251
238extern char *trim_end(const char *str, char c); 252extern char *trim_end(const char *str, char c);
239extern char *strlpart(char *txt, int maxlen); 253extern char *strlpart(char *txt, int maxlen);
240extern char *strrpart(char *txt, int maxlen); 254extern char *strrpart(char *txt, int maxlen);
241 255
242extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); 256extern void cgit_add_ref(struct reflist *list, struct refinfo *ref);
243extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, 257extern int cgit_refs_cb(const char *refname, const unsigned char *sha1,
244 int flags, void *cb_data); 258 int flags, void *cb_data);
245 259
246extern void *cgit_free_commitinfo(struct commitinfo *info); 260extern void *cgit_free_commitinfo(struct commitinfo *info);
247 261
248extern int cgit_diff_files(const unsigned char *old_sha1, 262extern int cgit_diff_files(const unsigned char *old_sha1,
249 const unsigned char *new_sha1, 263 const unsigned char *new_sha1,
250 unsigned long *old_size, unsigned long *new_size, 264 unsigned long *old_size, unsigned long *new_size,
251 int *binary, linediff_fn fn); 265 int *binary, linediff_fn fn);
252 266
253extern void cgit_diff_tree(const unsigned char *old_sha1, 267extern void cgit_diff_tree(const unsigned char *old_sha1,
254 const unsigned char *new_sha1, 268 const unsigned char *new_sha1,
255 filepair_fn fn, const char *prefix); 269 filepair_fn fn, const char *prefix);
256 270
257extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); 271extern void cgit_diff_commit(struct commit *commit, filepair_fn fn);
258 272
259extern char *fmt(const char *format,...); 273extern char *fmt(const char *format,...);
260 274
261extern struct commitinfo *cgit_parse_commit(struct commit *commit); 275extern struct commitinfo *cgit_parse_commit(struct commit *commit);
262extern struct taginfo *cgit_parse_tag(struct tag *tag); 276extern struct taginfo *cgit_parse_tag(struct tag *tag);
263extern void cgit_parse_url(const char *url); 277extern void cgit_parse_url(const char *url);
264 278
265extern const char *cgit_repobasename(const char *reponame); 279extern const char *cgit_repobasename(const char *reponame);
266 280
267extern int cgit_parse_snapshots_mask(const char *str); 281extern int cgit_parse_snapshots_mask(const char *str);
268 282
269extern int cgit_open_filter(struct cgit_filter *filter); 283extern int cgit_open_filter(struct cgit_filter *filter);
270extern int cgit_close_filter(struct cgit_filter *filter); 284extern int cgit_close_filter(struct cgit_filter *filter);
271 285
272 286
273#endif /* CGIT_H */ 287#endif /* CGIT_H */