root/git/git.h
/*INCLUDED FROM
1 #ifndef __git_main__ 2 #define __git_main__ 1 3 4 #include <git2.h> 5 #include <time.h> 6 7 #include "cgi.h" 8 9 extern const char *repo; 10 extern const char *clone_url; 11 12 extern const char *repo_dir; 13 14 struct q { /* must be hash-able */ 15 enum { 16 T_LOG = 'l', 17 T_COMMIT = 'c', 18 T_TREE = 't', 19 T_BLOB = 'b', 20 T_REFS = 'r', 21 22 T_PATCH = 'p', 23 T_TARGZ = 'z', 24 T_ZIP = 'Z' 25 } tool; 26 char path[MINB]; /* tree path */ 27 char repn[MINB]; /* repository name */ 28 char trev[MINB]; /* target revision id */ 29 30 struct { /* update manually */ 31 char rpath[MINB]; /* repository path */ 32 char mpath[MINB]; /* path to current executable */ 33 34 struct timespec mtime; /* executable last update */ 35 struct timespec rtime; /* repository last update */ 36 } self; 37 38 int can_compress; 39 }; 40 41 extern int has_page; 42 extern int binary_xfer; 43 extern int git_init; 44 extern char rname[MINB], 45 title[MINB]; 46 47 extern struct q query; 48 49 #define T_ALREADY_COMPRESSED "zZ" 50 #define T_USES_PAGE "lctr" 51 #define T_IS(c) (strchr(c, query.tool)) 52 53 extern git_repository *grepo; 54 extern const git_oid *gbase; 55 56 void cleanup(int); 57 void page_setup(int); 58 int check_gerr(int, const char *); 59 #define check_sgerr(op) check_gerr(op, #op) 60 void *check_ptr(void *, const char *); 61 #define check_sptr(op) check_ptr(op, #op) 62 char *make_query(struct q *); 63 char *make_query_simple(int, const git_oid *, const char *); 64 char *make_snapshot_name(const char *); 65 char *make_tag_summary(git_commit *); 66 git_diff *commit_to_diff(git_commit *, git_commit *); 67 char *line_conv_tab(const char *); 68 69 #define my_html_encode(s) check_sptr(html_encode(s)) 70 #define my_html_make_link(h, t) check_sptr(html_make_link(h, t)) 71 72 #endif
/*