aboutsummaryrefslogtreecommitdiffstats
path: root/cgit.h
diff options
context:
space:
mode:
Diffstat (limited to 'cgit.h')
-rw-r--r--cgit.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 5f7af51..adb8da4 100644
--- a/cgit.h
+++ b/cgit.h
@@ -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);
48typedef void (*filepair_fn)(struct diff_filepair *pair); 49typedef void (*filepair_fn)(struct diff_filepair *pair);
49typedef void (*linediff_fn)(char *line, int len); 50typedef void (*linediff_fn)(char *line, int len);
50 51
52struct 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
51struct cgit_repo { 61struct cgit_repo {
52 char *url; 62 char *url;
53 char *name; 63 char *name;
@@ -64,6 +74,9 @@ struct cgit_repo {
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
69struct cgit_repolist { 82struct cgit_repolist {
@@ -136,6 +149,7 @@ struct cgit_config {
136 char *css; 149 char *css;
137 char *favicon; 150 char *favicon;
138 char *footer; 151 char *footer;
152 char *head_include;
139 char *header; 153 char *header;
140 char *index_header; 154 char *index_header;
141 char *index_info; 155 char *index_info;
@@ -155,6 +169,7 @@ struct cgit_config {
155 int cache_repo_ttl; 169 int cache_repo_ttl;
156 int cache_root_ttl; 170 int cache_root_ttl;
157 int cache_static_ttl; 171 int cache_static_ttl;
172 int embedded;
158 int enable_index_links; 173 int enable_index_links;
159 int enable_log_filecount; 174 int enable_log_filecount;
160 int enable_log_linecount; 175 int enable_log_linecount;
@@ -166,11 +181,17 @@ struct cgit_config {
166 int max_repodesc_len; 181 int max_repodesc_len;
167 int max_stats; 182 int max_stats;
168 int nocache; 183 int nocache;
184 int noplainemail;
185 int noheader;
169 int renamelimit; 186 int renamelimit;
170 int snapshots; 187 int snapshots;
171 int summary_branches; 188 int summary_branches;
172 int summary_log; 189 int summary_log;
173 int summary_tags; 190 int summary_tags;
191 struct string_list mimetypes;
192 struct cgit_filter *about_filter;
193 struct cgit_filter *commit_filter;
194 struct cgit_filter *source_filter;
174}; 195};
175 196
176struct cgit_page { 197struct cgit_page {
@@ -180,10 +201,27 @@ struct cgit_page {
180 char *mimetype; 201 char *mimetype;
181 char *charset; 202 char *charset;
182 char *filename; 203 char *filename;
204 char *etag;
183 char *title; 205 char *title;
206 int status;
207 char *statusmsg;
208};
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;
184}; 221};
185 222
186struct cgit_context { 223struct cgit_context {
224 struct cgit_environment env;
187 struct cgit_query qry; 225 struct cgit_query qry;
188 struct cgit_config cfg; 226 struct cgit_config cfg;
189 struct cgit_repo *repo; 227 struct cgit_repo *repo;
@@ -242,5 +280,9 @@ extern const char *cgit_repobasename(const char *reponame);
242 280
243extern int cgit_parse_snapshots_mask(const char *str); 281extern int cgit_parse_snapshots_mask(const char *str);
244 282
283extern int cgit_open_filter(struct cgit_filter *filter);
284extern int cgit_close_filter(struct cgit_filter *filter);
285
286extern int readfile(const char *path, char **buf, size_t *size);
245 287
246#endif /* CGIT_H */ 288#endif /* CGIT_H */