|
diff --git a/cgit.h b/cgit.h index 1194eb0..b8557ac 100644 --- a/ cgit.h+++ b/ cgit.h |
|
@@ -40,40 +40,51 @@ |
40 | #define TM_MONTH (TM_YEAR / 12.0) |
40 | #define TM_MONTH (TM_YEAR / 12.0) |
41 | |
41 | |
42 | |
42 | |
43 | /* |
43 | /* |
44 | * Default encoding |
44 | * Default encoding |
45 | */ |
45 | */ |
46 | #define PAGE_ENCODING "UTF-8" |
46 | #define PAGE_ENCODING "UTF-8" |
47 | |
47 | |
48 | typedef void (*configfn)(const char *name, const char *value); |
48 | typedef void (*configfn)(const char *name, const char *value); |
49 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
49 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
50 | typedef void (*linediff_fn)(char *line, int len); |
50 | typedef void (*linediff_fn)(char *line, int len); |
51 | |
51 | |
| |
52 | struct cgit_filter { |
| |
53 | char *cmd; |
| |
54 | char **argv; |
| |
55 | int old_stdout; |
| |
56 | int pipe_fh[2]; |
| |
57 | int pid; |
| |
58 | int exitstatus; |
| |
59 | }; |
| |
60 | |
52 | struct cgit_repo { |
61 | struct cgit_repo { |
53 | char *url; |
62 | char *url; |
54 | char *name; |
63 | char *name; |
55 | char *path; |
64 | char *path; |
56 | char *desc; |
65 | char *desc; |
57 | char *owner; |
66 | char *owner; |
58 | char *defbranch; |
67 | char *defbranch; |
59 | char *group; |
68 | char *group; |
60 | char *module_link; |
69 | char *module_link; |
61 | char *readme; |
70 | char *readme; |
62 | char *clone_url; |
71 | char *clone_url; |
63 | int snapshots; |
72 | int snapshots; |
64 | int enable_log_filecount; |
73 | int enable_log_filecount; |
65 | int enable_log_linecount; |
74 | int enable_log_linecount; |
66 | int max_stats; |
75 | int max_stats; |
67 | time_t mtime; |
76 | time_t mtime; |
| |
77 | struct cgit_filter *commit_filter; |
| |
78 | struct cgit_filter *source_filter; |
68 | }; |
79 | }; |
69 | |
80 | |
70 | struct cgit_repolist { |
81 | struct cgit_repolist { |
71 | int length; |
82 | int length; |
72 | int count; |
83 | int count; |
73 | struct cgit_repo *repos; |
84 | struct cgit_repo *repos; |
74 | }; |
85 | }; |
75 | |
86 | |
76 | struct commitinfo { |
87 | struct commitinfo { |
77 | struct commit *commit; |
88 | struct commit *commit; |
78 | char *author; |
89 | char *author; |
79 | char *author_email; |
90 | char *author_email; |
@@ -168,24 +179,26 @@ struct cgit_config { |
168 | int max_msg_len; |
179 | int max_msg_len; |
169 | int max_repodesc_len; |
180 | int max_repodesc_len; |
170 | int max_stats; |
181 | int max_stats; |
171 | int nocache; |
182 | int nocache; |
172 | int noplainemail; |
183 | int noplainemail; |
173 | int noheader; |
184 | int noheader; |
174 | int renamelimit; |
185 | int renamelimit; |
175 | int snapshots; |
186 | int snapshots; |
176 | int summary_branches; |
187 | int summary_branches; |
177 | int summary_log; |
188 | int summary_log; |
178 | int summary_tags; |
189 | int summary_tags; |
179 | struct string_list mimetypes; |
190 | struct string_list mimetypes; |
| |
191 | struct cgit_filter *commit_filter; |
| |
192 | struct cgit_filter *source_filter; |
180 | }; |
193 | }; |
181 | |
194 | |
182 | struct cgit_page { |
195 | struct cgit_page { |
183 | time_t modified; |
196 | time_t modified; |
184 | time_t expires; |
197 | time_t expires; |
185 | size_t size; |
198 | size_t size; |
186 | char *mimetype; |
199 | char *mimetype; |
187 | char *charset; |
200 | char *charset; |
188 | char *filename; |
201 | char *filename; |
189 | char *etag; |
202 | char *etag; |
190 | char *title; |
203 | char *title; |
191 | int status; |
204 | int status; |
@@ -242,14 +255,17 @@ extern void cgit_diff_tree(const unsigned char *old_sha1, |
242 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
255 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
243 | |
256 | |
244 | extern char *fmt(const char *format,...); |
257 | extern char *fmt(const char *format,...); |
245 | |
258 | |
246 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); |
259 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); |
247 | extern struct taginfo *cgit_parse_tag(struct tag *tag); |
260 | extern struct taginfo *cgit_parse_tag(struct tag *tag); |
248 | extern void cgit_parse_url(const char *url); |
261 | extern void cgit_parse_url(const char *url); |
249 | |
262 | |
250 | extern const char *cgit_repobasename(const char *reponame); |
263 | extern const char *cgit_repobasename(const char *reponame); |
251 | |
264 | |
252 | extern int cgit_parse_snapshots_mask(const char *str); |
265 | extern int cgit_parse_snapshots_mask(const char *str); |
253 | |
266 | |
| |
267 | extern int cgit_open_filter(struct cgit_filter *filter); |
| |
268 | extern int cgit_close_filter(struct cgit_filter *filter); |
| |
269 | |
254 | |
270 | |
255 | #endif /* CGIT_H */ |
271 | #endif /* CGIT_H */ |
|