5 #include <openssl/sha.h>
9 typedef void (*configfn
)(const char *name
, const char *value
);
29 struct repoinfo
*repos
;
33 struct commit
*commit
;
36 unsigned long author_date
;
38 char *committer_email
;
39 unsigned long committer_date
;
51 extern const char cgit_version
[];
53 extern struct repolist cgit_repolist
;
54 extern struct repoinfo
*cgit_repo
;
56 extern char *cgit_root_title
;
57 extern char *cgit_css
;
58 extern char *cgit_logo
;
59 extern char *cgit_logo_link
;
60 extern char *cgit_virtual_root
;
61 extern char *cgit_cache_root
;
63 extern int cgit_nocache
;
64 extern int cgit_max_lock_attempts
;
65 extern int cgit_cache_root_ttl
;
66 extern int cgit_cache_repo_ttl
;
67 extern int cgit_cache_dynamic_ttl
;
68 extern int cgit_cache_static_ttl
;
69 extern int cgit_cache_max_create_time
;
71 extern int cgit_max_msg_len
;
73 extern char *cgit_repo_name
;
74 extern char *cgit_repo_desc
;
75 extern char *cgit_repo_owner
;
77 extern int cgit_query_has_symref
;
78 extern int cgit_query_has_sha1
;
80 extern char *cgit_querystring
;
81 extern char *cgit_query_repo
;
82 extern char *cgit_query_page
;
83 extern char *cgit_query_search
;
84 extern char *cgit_query_head
;
85 extern char *cgit_query_sha1
;
86 extern char *cgit_query_sha2
;
87 extern char *cgit_query_path
;
88 extern int cgit_query_ofs
;
92 extern void cgit_global_config_cb(const char *name
, const char *value
);
93 extern void cgit_repo_config_cb(const char *name
, const char *value
);
94 extern void cgit_querystring_cb(const char *name
, const char *value
);
96 extern int hextoint(char c
);
98 extern void *cgit_free_commitinfo(struct commitinfo
*info
);
100 extern char *fmt(const char *format
,...);
102 extern void html(const char *txt
);
103 extern void htmlf(const char *format
,...);
104 extern void html_txt(char *txt
);
105 extern void html_ntxt(int len
, char *txt
);
106 extern void html_attr(char *txt
);
107 extern void html_hidden(char *name
, char *value
);
108 extern void html_link_open(char *url
, char *title
, char *class);
109 extern void html_link_close(void);
110 extern void html_filemode(unsigned short mode
);
112 extern int cgit_read_config(const char *filename
, configfn fn
);
113 extern int cgit_parse_query(char *txt
, configfn fn
);
114 extern struct commitinfo
*cgit_parse_commit(struct commit
*commit
);
115 extern struct taginfo
*cgit_parse_tag(struct tag
*tag
);
117 extern char *cache_safe_filename(const char *unsafe
);
118 extern int cache_lock(struct cacheitem
*item
);
119 extern int cache_unlock(struct cacheitem
*item
);
120 extern int cache_cancel_lock(struct cacheitem
*item
);
121 extern int cache_exist(struct cacheitem
*item
);
122 extern int cache_expired(struct cacheitem
*item
);
124 extern char *cgit_repourl(const char *reponame
);
125 extern char *cgit_pageurl(const char *reponame
, const char *pagename
,
128 extern void cgit_print_error(char *msg
);
129 extern void cgit_print_date(unsigned long secs
);
130 extern void cgit_print_docstart(char *title
, struct cacheitem
*item
);
131 extern void cgit_print_docend();
132 extern void cgit_print_pageheader(char *title
, int show_search
);
134 extern void cgit_print_repolist(struct cacheitem
*item
);
135 extern void cgit_print_summary();
136 extern void cgit_print_log(const char *tip
, int ofs
, int cnt
, char *grep
);
137 extern void cgit_print_view(const char *hex
);
138 extern void cgit_print_tree(const char *hex
, char *path
);
139 extern void cgit_print_commit(const char *hex
);
140 extern void cgit_print_diff(const char *old_hex
, const char *new_hex
);