author | Lars Hjemli <hjemli@gmail.com> | 2008-02-23 21:45:33 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2008-03-18 07:13:10 (UTC) |
commit | b1f9b9c1459cb9a30ebf80721aff6ef788d1f891 (patch) (unidiff) | |
tree | 05796a741faef90c12aadd3a5c92b702ec870c48 /cgit.h | |
parent | b88fb016d0209f7041ac7d3b4d2c077318407a4d (diff) | |
download | cgit-b1f9b9c1459cb9a30ebf80721aff6ef788d1f891.zip cgit-b1f9b9c1459cb9a30ebf80721aff6ef788d1f891.tar.gz cgit-b1f9b9c1459cb9a30ebf80721aff6ef788d1f891.tar.bz2 |
Introduce html.h
All html-functions can be quite easily separated from the rest of cgit, so
lets do it; the only issue was html_filemode which uses some git-defined
macros so the function is moved into ui-shared.c::cgit_print_filemode().
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.h | 15 |
1 files changed, 1 insertions, 14 deletions
@@ -173,34 +173,32 @@ struct cgit_config { | |||
173 | int summary_log; | 173 | int summary_log; |
174 | int summary_tags; | 174 | int summary_tags; |
175 | }; | 175 | }; |
176 | 176 | ||
177 | struct cgit_context { | 177 | struct cgit_context { |
178 | struct cgit_query qry; | 178 | struct cgit_query qry; |
179 | struct cgit_config cfg; | 179 | struct cgit_config cfg; |
180 | struct cgit_repo *repo; | 180 | struct cgit_repo *repo; |
181 | }; | 181 | }; |
182 | 182 | ||
183 | extern const char *cgit_version; | 183 | extern const char *cgit_version; |
184 | 184 | ||
185 | extern struct cgit_repolist cgit_repolist; | 185 | extern struct cgit_repolist cgit_repolist; |
186 | extern struct cgit_context ctx; | 186 | extern struct cgit_context ctx; |
187 | extern int cgit_cmd; | 187 | extern int cgit_cmd; |
188 | 188 | ||
189 | extern int htmlfd; | ||
190 | |||
191 | extern void cgit_prepare_context(struct cgit_context *ctx); | 189 | extern void cgit_prepare_context(struct cgit_context *ctx); |
192 | extern int cgit_get_cmd_index(const char *cmd); | 190 | extern int cgit_get_cmd_index(const char *cmd); |
193 | extern struct cgit_repo *cgit_get_repoinfo(const char *url); | 191 | extern struct cgit_repo *cgit_get_repoinfo(const char *url); |
194 | 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); |
195 | 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); |
196 | extern void cgit_querystring_cb(const char *name, const char *value); | 194 | extern void cgit_querystring_cb(const char *name, const char *value); |
197 | 195 | ||
198 | extern int chk_zero(int result, char *msg); | 196 | extern int chk_zero(int result, char *msg); |
199 | extern int chk_positive(int result, char *msg); | 197 | extern int chk_positive(int result, char *msg); |
200 | extern int chk_non_negative(int result, char *msg); | 198 | extern int chk_non_negative(int result, char *msg); |
201 | 199 | ||
202 | extern int hextoint(char c); | 200 | extern int hextoint(char c); |
203 | extern char *trim_end(const char *str, char c); | 201 | extern char *trim_end(const char *str, char c); |
204 | extern char *strlpart(char *txt, int maxlen); | 202 | extern char *strlpart(char *txt, int maxlen); |
205 | extern char *strrpart(char *txt, int maxlen); | 203 | extern char *strrpart(char *txt, int maxlen); |
206 | 204 | ||
@@ -209,44 +207,32 @@ extern int cgit_refs_cb(const char *refname, const unsigned char *sha1, | |||
209 | int flags, void *cb_data); | 207 | int flags, void *cb_data); |
210 | 208 | ||
211 | extern void *cgit_free_commitinfo(struct commitinfo *info); | 209 | extern void *cgit_free_commitinfo(struct commitinfo *info); |
212 | 210 | ||
213 | extern int cgit_diff_files(const unsigned char *old_sha1, | 211 | extern int cgit_diff_files(const unsigned char *old_sha1, |
214 | const unsigned char *new_sha1, | 212 | const unsigned char *new_sha1, |
215 | linediff_fn fn); | 213 | linediff_fn fn); |
216 | 214 | ||
217 | extern void cgit_diff_tree(const unsigned char *old_sha1, | 215 | extern void cgit_diff_tree(const unsigned char *old_sha1, |
218 | const unsigned char *new_sha1, | 216 | const unsigned char *new_sha1, |
219 | filepair_fn fn, const char *prefix); | 217 | filepair_fn fn, const char *prefix); |
220 | 218 | ||
221 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); | 219 | extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); |
222 | 220 | ||
223 | extern char *fmt(const char *format,...); | 221 | extern char *fmt(const char *format,...); |
224 | 222 | ||
225 | extern void html(const char *txt); | ||
226 | extern void htmlf(const char *format,...); | ||
227 | extern void html_txt(char *txt); | ||
228 | extern void html_ntxt(int len, char *txt); | ||
229 | extern void html_attr(char *txt); | ||
230 | extern void html_hidden(char *name, char *value); | ||
231 | extern void html_option(char *value, char *text, char *selected_value); | ||
232 | extern void html_link_open(char *url, char *title, char *class); | ||
233 | extern void html_link_close(void); | ||
234 | extern void html_filemode(unsigned short mode); | ||
235 | extern int html_include(const char *filename); | ||
236 | |||
237 | extern int cgit_read_config(const char *filename, configfn fn); | 223 | extern int cgit_read_config(const char *filename, configfn fn); |
238 | extern int cgit_parse_query(char *txt, configfn fn); | 224 | extern int cgit_parse_query(char *txt, configfn fn); |
239 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); | 225 | extern struct commitinfo *cgit_parse_commit(struct commit *commit); |
240 | extern struct taginfo *cgit_parse_tag(struct tag *tag); | 226 | extern struct taginfo *cgit_parse_tag(struct tag *tag); |
241 | extern void cgit_parse_url(const char *url); | 227 | extern void cgit_parse_url(const char *url); |
242 | 228 | ||
243 | extern char *cache_safe_filename(const char *unsafe); | 229 | extern char *cache_safe_filename(const char *unsafe); |
244 | extern int cache_lock(struct cacheitem *item); | 230 | extern int cache_lock(struct cacheitem *item); |
245 | extern int cache_unlock(struct cacheitem *item); | 231 | extern int cache_unlock(struct cacheitem *item); |
246 | extern int cache_cancel_lock(struct cacheitem *item); | 232 | extern int cache_cancel_lock(struct cacheitem *item); |
247 | extern int cache_exist(struct cacheitem *item); | 233 | extern int cache_exist(struct cacheitem *item); |
248 | extern int cache_expired(struct cacheitem *item); | 234 | extern int cache_expired(struct cacheitem *item); |
249 | 235 | ||
250 | extern char *cgit_repourl(const char *reponame); | 236 | extern char *cgit_repourl(const char *reponame); |
251 | extern char *cgit_fileurl(const char *reponame, const char *pagename, | 237 | extern char *cgit_fileurl(const char *reponame, const char *pagename, |
252 | const char *filename, const char *query); | 238 | const char *filename, const char *query); |
@@ -267,32 +253,33 @@ extern void cgit_refs_link(char *name, char *title, char *class, char *head, | |||
267 | extern void cgit_snapshot_link(char *name, char *title, char *class, | 253 | extern void cgit_snapshot_link(char *name, char *title, char *class, |
268 | char *head, char *rev, char *archivename); | 254 | char *head, char *rev, char *archivename); |
269 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, | 255 | extern void cgit_diff_link(char *name, char *title, char *class, char *head, |
270 | char *new_rev, char *old_rev, char *path); | 256 | char *new_rev, char *old_rev, char *path); |
271 | 257 | ||
272 | extern void cgit_object_link(struct object *obj); | 258 | extern void cgit_object_link(struct object *obj); |
273 | 259 | ||
274 | extern void cgit_print_error(char *msg); | 260 | extern void cgit_print_error(char *msg); |
275 | extern void cgit_print_date(time_t secs, char *format); | 261 | extern void cgit_print_date(time_t secs, char *format); |
276 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); | 262 | extern void cgit_print_age(time_t t, time_t max_relative, char *format); |
277 | extern void cgit_print_docstart(char *title, struct cacheitem *item); | 263 | extern void cgit_print_docstart(char *title, struct cacheitem *item); |
278 | extern void cgit_print_docend(); | 264 | extern void cgit_print_docend(); |
279 | extern void cgit_print_pageheader(char *title, int show_search); | 265 | extern void cgit_print_pageheader(char *title, int show_search); |
280 | extern void cgit_print_snapshot_start(const char *mimetype, | 266 | extern void cgit_print_snapshot_start(const char *mimetype, |
281 | const char *filename, | 267 | const char *filename, |
282 | struct cacheitem *item); | 268 | struct cacheitem *item); |
269 | extern void cgit_print_filemode(unsigned short mode); | ||
283 | extern void cgit_print_branches(int maxcount); | 270 | extern void cgit_print_branches(int maxcount); |
284 | extern void cgit_print_tags(int maxcount); | 271 | extern void cgit_print_tags(int maxcount); |
285 | 272 | ||
286 | extern void cgit_print_repolist(struct cacheitem *item); | 273 | extern void cgit_print_repolist(struct cacheitem *item); |
287 | extern void cgit_print_summary(); | 274 | extern void cgit_print_summary(); |
288 | extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, | 275 | extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep, |
289 | char *pattern, char *path, int pager); | 276 | char *pattern, char *path, int pager); |
290 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); | 277 | extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); |
291 | extern void cgit_print_tree(const char *rev, char *path); | 278 | extern void cgit_print_tree(const char *rev, char *path); |
292 | extern void cgit_print_commit(char *hex); | 279 | extern void cgit_print_commit(char *hex); |
293 | extern void cgit_print_refs(); | 280 | extern void cgit_print_refs(); |
294 | extern void cgit_print_tag(char *revname); | 281 | extern void cgit_print_tag(char *revname); |
295 | extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix); | 282 | extern void cgit_print_diff(const char *new_hex, const char *old_hex, const char *prefix); |
296 | extern void cgit_print_patch(char *hex, struct cacheitem *item); | 283 | extern void cgit_print_patch(char *hex, struct cacheitem *item); |
297 | extern void cgit_print_snapshot(struct cacheitem *item, const char *head, | 284 | extern void cgit_print_snapshot(struct cacheitem *item, const char *head, |
298 | const char *hex, const char *prefix, | 285 | const char *hex, const char *prefix, |