|
diff --git a/cgit.h b/cgit.h index 66c40b9..4576efb 100644 --- a/ cgit.h+++ b/ cgit.h |
|
@@ -78,150 +78,157 @@ struct repoinfo { |
78 | char *readme; |
78 | char *readme; |
79 | char *clone_url; |
79 | char *clone_url; |
80 | int snapshots; |
80 | int snapshots; |
81 | int enable_log_filecount; |
81 | int enable_log_filecount; |
82 | int enable_log_linecount; |
82 | int enable_log_linecount; |
83 | }; |
83 | }; |
84 | |
84 | |
85 | struct repolist { |
85 | struct repolist { |
86 | int length; |
86 | int length; |
87 | int count; |
87 | int count; |
88 | struct repoinfo *repos; |
88 | struct repoinfo *repos; |
89 | }; |
89 | }; |
90 | |
90 | |
91 | struct commitinfo { |
91 | struct commitinfo { |
92 | struct commit *commit; |
92 | struct commit *commit; |
93 | char *author; |
93 | char *author; |
94 | char *author_email; |
94 | char *author_email; |
95 | unsigned long author_date; |
95 | unsigned long author_date; |
96 | char *committer; |
96 | char *committer; |
97 | char *committer_email; |
97 | char *committer_email; |
98 | unsigned long committer_date; |
98 | unsigned long committer_date; |
99 | char *subject; |
99 | char *subject; |
100 | char *msg; |
100 | char *msg; |
101 | char *msg_encoding; |
101 | char *msg_encoding; |
102 | }; |
102 | }; |
103 | |
103 | |
104 | struct taginfo { |
104 | struct taginfo { |
105 | char *tagger; |
105 | char *tagger; |
106 | char *tagger_email; |
106 | char *tagger_email; |
107 | int tagger_date; |
107 | int tagger_date; |
108 | char *msg; |
108 | char *msg; |
109 | }; |
109 | }; |
110 | |
110 | |
111 | struct refinfo { |
111 | struct refinfo { |
112 | const char *refname; |
112 | const char *refname; |
113 | struct object *object; |
113 | struct object *object; |
114 | union { |
114 | union { |
115 | struct taginfo *tag; |
115 | struct taginfo *tag; |
116 | struct commitinfo *commit; |
116 | struct commitinfo *commit; |
117 | }; |
117 | }; |
118 | }; |
118 | }; |
119 | |
119 | |
120 | struct reflist { |
120 | struct reflist { |
121 | struct refinfo **refs; |
121 | struct refinfo **refs; |
122 | int alloc; |
122 | int alloc; |
123 | int count; |
123 | int count; |
124 | }; |
124 | }; |
125 | |
125 | |
| |
126 | struct cgit_query { |
| |
127 | int has_symref; |
| |
128 | int has_sha1; |
| |
129 | char *raw; |
| |
130 | char *repo; |
| |
131 | char *page; |
| |
132 | char *search; |
| |
133 | char *grep; |
| |
134 | char *head; |
| |
135 | char *sha1; |
| |
136 | char *sha2; |
| |
137 | char *path; |
| |
138 | char *name; |
| |
139 | int ofs; |
| |
140 | }; |
| |
141 | |
| |
142 | struct cgit_context { |
| |
143 | struct cgit_query qry; |
| |
144 | }; |
| |
145 | |
126 | extern const char *cgit_version; |
146 | extern const char *cgit_version; |
127 | |
147 | |
128 | extern struct repolist cgit_repolist; |
148 | extern struct repolist cgit_repolist; |
129 | extern struct repoinfo *cgit_repo; |
149 | extern struct repoinfo *cgit_repo; |
| |
150 | extern struct cgit_context ctx; |
130 | extern int cgit_cmd; |
151 | extern int cgit_cmd; |
131 | |
152 | |
132 | extern char *cgit_root_title; |
153 | extern char *cgit_root_title; |
133 | extern char *cgit_css; |
154 | extern char *cgit_css; |
134 | extern char *cgit_logo; |
155 | extern char *cgit_logo; |
135 | extern char *cgit_index_header; |
156 | extern char *cgit_index_header; |
136 | extern char *cgit_index_info; |
157 | extern char *cgit_index_info; |
137 | extern char *cgit_logo_link; |
158 | extern char *cgit_logo_link; |
138 | extern char *cgit_module_link; |
159 | extern char *cgit_module_link; |
139 | extern char *cgit_agefile; |
160 | extern char *cgit_agefile; |
140 | extern char *cgit_virtual_root; |
161 | extern char *cgit_virtual_root; |
141 | extern char *cgit_script_name; |
162 | extern char *cgit_script_name; |
142 | extern char *cgit_cache_root; |
163 | extern char *cgit_cache_root; |
143 | extern char *cgit_repo_group; |
164 | extern char *cgit_repo_group; |
144 | extern char *cgit_robots; |
165 | extern char *cgit_robots; |
145 | extern char *cgit_clone_prefix; |
166 | extern char *cgit_clone_prefix; |
146 | |
167 | |
147 | extern int cgit_nocache; |
168 | extern int cgit_nocache; |
148 | extern int cgit_snapshots; |
169 | extern int cgit_snapshots; |
149 | extern int cgit_enable_index_links; |
170 | extern int cgit_enable_index_links; |
150 | extern int cgit_enable_log_filecount; |
171 | extern int cgit_enable_log_filecount; |
151 | extern int cgit_enable_log_linecount; |
172 | extern int cgit_enable_log_linecount; |
152 | extern int cgit_max_lock_attempts; |
173 | extern int cgit_max_lock_attempts; |
153 | extern int cgit_cache_root_ttl; |
174 | extern int cgit_cache_root_ttl; |
154 | extern int cgit_cache_repo_ttl; |
175 | extern int cgit_cache_repo_ttl; |
155 | extern int cgit_cache_dynamic_ttl; |
176 | extern int cgit_cache_dynamic_ttl; |
156 | extern int cgit_cache_static_ttl; |
177 | extern int cgit_cache_static_ttl; |
157 | extern int cgit_cache_max_create_time; |
178 | extern int cgit_cache_max_create_time; |
158 | extern int cgit_summary_log; |
179 | extern int cgit_summary_log; |
159 | extern int cgit_summary_tags; |
180 | extern int cgit_summary_tags; |
160 | extern int cgit_summary_branches; |
181 | extern int cgit_summary_branches; |
161 | |
182 | |
162 | extern int cgit_max_msg_len; |
183 | extern int cgit_max_msg_len; |
163 | extern int cgit_max_repodesc_len; |
184 | extern int cgit_max_repodesc_len; |
164 | extern int cgit_max_commit_count; |
185 | extern int cgit_max_commit_count; |
165 | |
186 | |
166 | extern int cgit_query_has_symref; |
| |
167 | extern int cgit_query_has_sha1; |
| |
168 | |
| |
169 | extern char *cgit_querystring; |
| |
170 | extern char *cgit_query_repo; |
| |
171 | extern char *cgit_query_page; |
| |
172 | extern char *cgit_query_search; |
| |
173 | extern char *cgit_query_grep; |
| |
174 | extern char *cgit_query_head; |
| |
175 | extern char *cgit_query_sha1; |
| |
176 | extern char *cgit_query_sha2; |
| |
177 | extern char *cgit_query_path; |
| |
178 | extern char *cgit_query_name; |
| |
179 | extern int cgit_query_ofs; |
| |
180 | |
187 | |
181 | extern int htmlfd; |
188 | extern int htmlfd; |
182 | |
189 | |
183 | extern int cgit_get_cmd_index(const char *cmd); |
190 | extern int cgit_get_cmd_index(const char *cmd); |
184 | extern struct repoinfo *cgit_get_repoinfo(const char *url); |
191 | extern struct repoinfo *cgit_get_repoinfo(const char *url); |
185 | extern void cgit_global_config_cb(const char *name, const char *value); |
192 | extern void cgit_global_config_cb(const char *name, const char *value); |
186 | extern void cgit_repo_config_cb(const char *name, const char *value); |
193 | extern void cgit_repo_config_cb(const char *name, const char *value); |
187 | extern void cgit_querystring_cb(const char *name, const char *value); |
194 | extern void cgit_querystring_cb(const char *name, const char *value); |
188 | |
195 | |
189 | extern int chk_zero(int result, char *msg); |
196 | extern int chk_zero(int result, char *msg); |
190 | extern int chk_positive(int result, char *msg); |
197 | extern int chk_positive(int result, char *msg); |
191 | extern int chk_non_negative(int result, char *msg); |
198 | extern int chk_non_negative(int result, char *msg); |
192 | |
199 | |
193 | extern int hextoint(char c); |
200 | extern int hextoint(char c); |
194 | extern char *trim_end(const char *str, char c); |
201 | extern char *trim_end(const char *str, char c); |
195 | extern char *strlpart(char *txt, int maxlen); |
202 | extern char *strlpart(char *txt, int maxlen); |
196 | extern char *strrpart(char *txt, int maxlen); |
203 | extern char *strrpart(char *txt, int maxlen); |
197 | |
204 | |
198 | extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); |
205 | extern void cgit_add_ref(struct reflist *list, struct refinfo *ref); |
199 | extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, |
206 | extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, |
200 | int flags, void *cb_data); |
207 | int flags, void *cb_data); |
201 | |
208 | |
202 | extern void *cgit_free_commitinfo(struct commitinfo *info); |
209 | extern void *cgit_free_commitinfo(struct commitinfo *info); |
203 | |
210 | |
204 | extern int cgit_diff_files(const unsigned char *old_sha1, |
211 | extern int cgit_diff_files(const unsigned char *old_sha1, |
205 | const unsigned char *new_sha1, |
212 | const unsigned char *new_sha1, |
206 | linediff_fn fn); |
213 | linediff_fn fn); |
207 | |
214 | |
208 | extern void cgit_diff_tree(const unsigned char *old_sha1, |
215 | extern void cgit_diff_tree(const unsigned char *old_sha1, |
209 | const unsigned char *new_sha1, |
216 | const unsigned char *new_sha1, |
210 | filepair_fn fn, const char *prefix); |
217 | filepair_fn fn, const char *prefix); |
211 | |
218 | |
212 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
219 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
213 | |
220 | |
214 | extern char *fmt(const char *format,...); |
221 | extern char *fmt(const char *format,...); |
215 | |
222 | |
216 | extern void html(const char *txt); |
223 | extern void html(const char *txt); |
217 | extern void htmlf(const char *format,...); |
224 | extern void htmlf(const char *format,...); |
218 | extern void html_txt(char *txt); |
225 | extern void html_txt(char *txt); |
219 | extern void html_ntxt(int len, char *txt); |
226 | extern void html_ntxt(int len, char *txt); |
220 | extern void html_attr(char *txt); |
227 | extern void html_attr(char *txt); |
221 | extern void html_hidden(char *name, char *value); |
228 | extern void html_hidden(char *name, char *value); |
222 | extern void html_option(char *value, char *text, char *selected_value); |
229 | extern void html_option(char *value, char *text, char *selected_value); |
223 | extern void html_link_open(char *url, char *title, char *class); |
230 | extern void html_link_open(char *url, char *title, char *class); |
224 | extern void html_link_close(void); |
231 | extern void html_link_close(void); |
225 | extern void html_filemode(unsigned short mode); |
232 | extern void html_filemode(unsigned short mode); |
226 | extern int html_include(const char *filename); |
233 | extern int html_include(const char *filename); |
227 | |
234 | |
|