diff options
Diffstat (limited to 'cgit.h')
-rw-r--r-- | cgit.h | 52 |
1 files changed, 50 insertions, 2 deletions
@@ -15,6 +15,7 @@ | |||
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 <string-list.h> | ||
18 | #include <xdiff-interface.h> | 19 | #include <xdiff-interface.h> |
19 | #include <xdiff/xdiff.h> | 20 | #include <xdiff/xdiff.h> |
20 | #include <utf8.h> | 21 | #include <utf8.h> |
@@ -48,6 +49,15 @@ typedef void (*configfn)(const char *name, const char *value); | |||
48 | typedef void (*filepair_fn)(struct diff_filepair *pair); | 49 | typedef void (*filepair_fn)(struct diff_filepair *pair); |
49 | typedef void (*linediff_fn)(char *line, int len); | 50 | typedef void (*linediff_fn)(char *line, int len); |
50 | 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 | |||
51 | struct cgit_repo { | 61 | struct cgit_repo { |
52 | char *url; | 62 | char *url; |
53 | char *name; | 63 | char *name; |
@@ -55,17 +65,23 @@ struct cgit_repo { | |||
55 | char *desc; | 65 | char *desc; |
56 | char *owner; | 66 | char *owner; |
57 | char *defbranch; | 67 | char *defbranch; |
58 | char *group; | ||
59 | char *module_link; | 68 | char *module_link; |
60 | char *readme; | 69 | char *readme; |
70 | char *section; | ||
61 | char *clone_url; | 71 | char *clone_url; |
62 | int snapshots; | 72 | int snapshots; |
63 | int enable_log_filecount; | 73 | int enable_log_filecount; |
64 | int enable_log_linecount; | 74 | int enable_log_linecount; |
65 | int max_stats; | 75 | int max_stats; |
66 | time_t mtime; | 76 | time_t mtime; |
77 | struct cgit_filter *about_filter; | ||
78 | struct cgit_filter *commit_filter; | ||
79 | struct cgit_filter *source_filter; | ||
67 | }; | 80 | }; |
68 | 81 | ||
82 | typedef void (*repo_config_fn)(struct cgit_repo *repo, const char *name, | ||
83 | const char *value); | ||
84 | |||
69 | struct cgit_repolist { | 85 | struct cgit_repolist { |
70 | int length; | 86 | int length; |
71 | int count; | 87 | int count; |
@@ -136,28 +152,33 @@ struct cgit_config { | |||
136 | char *css; | 152 | char *css; |
137 | char *favicon; | 153 | char *favicon; |
138 | char *footer; | 154 | char *footer; |
155 | char *head_include; | ||
139 | char *header; | 156 | char *header; |
140 | char *index_header; | 157 | char *index_header; |
141 | char *index_info; | 158 | char *index_info; |
142 | char *logo; | 159 | char *logo; |
143 | char *logo_link; | 160 | char *logo_link; |
144 | char *module_link; | 161 | char *module_link; |
145 | char *repo_group; | ||
146 | char *robots; | 162 | char *robots; |
147 | char *root_title; | 163 | char *root_title; |
148 | char *root_desc; | 164 | char *root_desc; |
149 | char *root_readme; | 165 | char *root_readme; |
150 | char *script_name; | 166 | char *script_name; |
167 | char *section; | ||
151 | char *virtual_root; | 168 | char *virtual_root; |
152 | int cache_size; | 169 | int cache_size; |
153 | int cache_dynamic_ttl; | 170 | int cache_dynamic_ttl; |
154 | int cache_max_create_time; | 171 | int cache_max_create_time; |
155 | int cache_repo_ttl; | 172 | int cache_repo_ttl; |
156 | int cache_root_ttl; | 173 | int cache_root_ttl; |
174 | int cache_scanrc_ttl; | ||
157 | int cache_static_ttl; | 175 | int cache_static_ttl; |
176 | int embedded; | ||
177 | int enable_filter_overrides; | ||
158 | int enable_index_links; | 178 | int enable_index_links; |
159 | int enable_log_filecount; | 179 | int enable_log_filecount; |
160 | int enable_log_linecount; | 180 | int enable_log_linecount; |
181 | int enable_tree_linenumbers; | ||
161 | int local_time; | 182 | int local_time; |
162 | int max_repo_count; | 183 | int max_repo_count; |
163 | int max_commit_count; | 184 | int max_commit_count; |
@@ -166,11 +187,17 @@ struct cgit_config { | |||
166 | int max_repodesc_len; | 187 | int max_repodesc_len; |
167 | int max_stats; | 188 | int max_stats; |
168 | int nocache; | 189 | int nocache; |
190 | int noplainemail; | ||
191 | int noheader; | ||
169 | int renamelimit; | 192 | int renamelimit; |
170 | int snapshots; | 193 | int snapshots; |
171 | int summary_branches; | 194 | int summary_branches; |
172 | int summary_log; | 195 | int summary_log; |
173 | int summary_tags; | 196 | int summary_tags; |
197 | struct string_list mimetypes; | ||
198 | struct cgit_filter *about_filter; | ||
199 | struct cgit_filter *commit_filter; | ||
200 | struct cgit_filter *source_filter; | ||
174 | }; | 201 | }; |
175 | 202 | ||
176 | struct cgit_page { | 203 | struct cgit_page { |
@@ -180,10 +207,27 @@ struct cgit_page { | |||
180 | char *mimetype; | 207 | char *mimetype; |
181 | char *charset; | 208 | char *charset; |
182 | char *filename; | 209 | char *filename; |
210 | char *etag; | ||
183 | char *title; | 211 | char *title; |
212 | int status; | ||
213 | char *statusmsg; | ||
214 | }; | ||
215 | |||
216 | struct cgit_environment { | ||
217 | char *cgit_config; | ||
218 | char *http_host; | ||
219 | char *https; | ||
220 | char *no_http; | ||
221 | char *path_info; | ||
222 | char *query_string; | ||
223 | char *request_method; | ||
224 | char *script_name; | ||
225 | char *server_name; | ||
226 | char *server_port; | ||
184 | }; | 227 | }; |
185 | 228 | ||
186 | struct cgit_context { | 229 | struct cgit_context { |
230 | struct cgit_environment env; | ||
187 | struct cgit_query qry; | 231 | struct cgit_query qry; |
188 | struct cgit_config cfg; | 232 | struct cgit_config cfg; |
189 | struct cgit_repo *repo; | 233 | struct cgit_repo *repo; |
@@ -242,5 +286,9 @@ extern const char *cgit_repobasename(const char *reponame); | |||
242 | 286 | ||
243 | extern int cgit_parse_snapshots_mask(const char *str); | 287 | extern int cgit_parse_snapshots_mask(const char *str); |
244 | 288 | ||
289 | extern int cgit_open_filter(struct cgit_filter *filter); | ||
290 | extern int cgit_close_filter(struct cgit_filter *filter); | ||
291 | |||
292 | extern int readfile(const char *path, char **buf, size_t *size); | ||
245 | 293 | ||
246 | #endif /* CGIT_H */ | 294 | #endif /* CGIT_H */ |