5 #include <openssl/sha.h>
9 typedef void (*configfn
)(const char *name
, const char *value
);
30 struct repoinfo
*repos
;
34 struct commit
*commit
;
37 unsigned long author_date
;
39 char *committer_email
;
40 unsigned long committer_date
;
52 extern const char cgit_version
[];
54 extern struct repolist cgit_repolist
;
55 extern struct repoinfo
*cgit_repo
;
57 extern char *cgit_root_title
;
58 extern char *cgit_css
;
59 extern char *cgit_logo
;
60 extern char *cgit_logo_link
;
61 extern char *cgit_virtual_root
;
62 extern char *cgit_cache_root
;
64 extern int cgit_nocache
;
65 extern int cgit_snapshots
;
66 extern int cgit_max_lock_attempts
;
67 extern int cgit_cache_root_ttl
;
68 extern int cgit_cache_repo_ttl
;
69 extern int cgit_cache_dynamic_ttl
;
70 extern int cgit_cache_static_ttl
;
71 extern int cgit_cache_max_create_time
;
73 extern int cgit_max_msg_len
;
75 extern char *cgit_repo_name
;
76 extern char *cgit_repo_desc
;
77 extern char *cgit_repo_owner
;
79 extern int cgit_query_has_symref
;
80 extern int cgit_query_has_sha1
;
82 extern char *cgit_querystring
;
83 extern char *cgit_query_repo
;
84 extern char *cgit_query_page
;
85 extern char *cgit_query_search
;
86 extern char *cgit_query_head
;
87 extern char *cgit_query_sha1
;
88 extern char *cgit_query_sha2
;
89 extern char *cgit_query_path
;
90 extern char *cgit_query_name
;
91 extern int cgit_query_ofs
;
95 extern void cgit_global_config_cb(const char *name
, const char *value
);
96 extern void cgit_repo_config_cb(const char *name
, const char *value
);
97 extern void cgit_querystring_cb(const char *name
, const char *value
);
99 extern int chk_zero(int result
, char *msg
);
100 extern int chk_positive(int result
, char *msg
);
102 extern int hextoint(char c
);
104 extern void *cgit_free_commitinfo(struct commitinfo
*info
);
106 extern char *fmt(const char *format
,...);
108 extern void html(const char *txt
);
109 extern void htmlf(const char *format
,...);
110 extern void html_txt(char *txt
);
111 extern void html_ntxt(int len
, char *txt
);
112 extern void html_attr(char *txt
);
113 extern void html_hidden(char *name
, char *value
);
114 extern void html_link_open(char *url
, char *title
, char *class);
115 extern void html_link_close(void);
116 extern void html_filemode(unsigned short mode
);
118 extern int cgit_read_config(const char *filename
, configfn fn
);
119 extern int cgit_parse_query(char *txt
, configfn fn
);
120 extern struct commitinfo
*cgit_parse_commit(struct commit
*commit
);
121 extern struct taginfo
*cgit_parse_tag(struct tag
*tag
);
123 extern char *cache_safe_filename(const char *unsafe
);
124 extern int cache_lock(struct cacheitem
*item
);
125 extern int cache_unlock(struct cacheitem
*item
);
126 extern int cache_cancel_lock(struct cacheitem
*item
);
127 extern int cache_exist(struct cacheitem
*item
);
128 extern int cache_expired(struct cacheitem
*item
);
130 extern char *cgit_repourl(const char *reponame
);
131 extern char *cgit_pageurl(const char *reponame
, const char *pagename
,
134 extern void cgit_print_error(char *msg
);
135 extern void cgit_print_date(unsigned long secs
);
136 extern void cgit_print_docstart(char *title
, struct cacheitem
*item
);
137 extern void cgit_print_docend();
138 extern void cgit_print_pageheader(char *title
, int show_search
);
139 extern void cgit_print_snapshot_start(const char *mimetype
,
140 const char *filename
,
141 struct cacheitem
*item
);
143 extern void cgit_print_repolist(struct cacheitem
*item
);
144 extern void cgit_print_summary();
145 extern void cgit_print_log(const char *tip
, int ofs
, int cnt
, char *grep
);
146 extern void cgit_print_view(const char *hex
);
147 extern void cgit_print_tree(const char *hex
, char *path
);
148 extern void cgit_print_commit(const char *hex
);
149 extern void cgit_print_diff(const char *old_hex
, const char *new_hex
);
150 extern void cgit_print_snapshot(struct cacheitem
*item
, const char *hex
,
151 const char *format
, const char *prefix
,
152 const char *filename
);