summaryrefslogtreecommitdiffabout
path: root/cgit.h
authorLars Hjemli <hjemli@gmail.com>2007-05-13 15:15:06 (UTC)
committer Lars Hjemli <hjemli@gmail.com>2007-05-13 15:15:06 (UTC)
commitc6cf3a424a0860d69b290254d9b19d35527b2d27 (patch) (unidiff)
tree2874f2c42e907cba1187ae32ee686daebc2de59e /cgit.h
parent80e577c3ef2a73becabff7e9c9c242f317a87de9 (diff)
downloadcgit-c6cf3a424a0860d69b290254d9b19d35527b2d27.zip
cgit-c6cf3a424a0860d69b290254d9b19d35527b2d27.tar.gz
cgit-c6cf3a424a0860d69b290254d9b19d35527b2d27.tar.bz2
Add max-commit-count parameter to cgitrc
This enabled customizing number of commits shown per page in log view. It also changes the default from 100 to 50, mainly due to the more cpu intensive log pages (number of files/lines changed) but also since 100 log messages requires excessive scrolling. Signed-off-by: Lars Hjemli <hjemli@gmail.com>
Diffstat (limited to 'cgit.h') (more/less context) (ignore whitespace changes)
-rw-r--r--cgit.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/cgit.h b/cgit.h
index 43de375..46f3173 100644
--- a/cgit.h
+++ b/cgit.h
@@ -1,181 +1,182 @@
1#ifndef CGIT_H 1#ifndef CGIT_H
2#define CGIT_H 2#define CGIT_H
3 3
4 4
5#include <git-compat-util.h> 5#include <git-compat-util.h>
6#include <cache.h> 6#include <cache.h>
7#include <grep.h> 7#include <grep.h>
8#include <object.h> 8#include <object.h>
9#include <tree.h> 9#include <tree.h>
10#include <commit.h> 10#include <commit.h>
11#include <tag.h> 11#include <tag.h>
12#include <diff.h> 12#include <diff.h>
13#include <diffcore.h> 13#include <diffcore.h>
14#include <refs.h> 14#include <refs.h>
15#include <revision.h> 15#include <revision.h>
16#include <log-tree.h> 16#include <log-tree.h>
17#include <archive.h> 17#include <archive.h>
18#include <xdiff/xdiff.h> 18#include <xdiff/xdiff.h>
19 19
20 20
21typedef void (*configfn)(const char *name, const char *value); 21typedef void (*configfn)(const char *name, const char *value);
22typedef void (*filepair_fn)(struct diff_filepair *pair); 22typedef void (*filepair_fn)(struct diff_filepair *pair);
23typedef void (*linediff_fn)(char *line, int len); 23typedef void (*linediff_fn)(char *line, int len);
24 24
25struct cacheitem { 25struct cacheitem {
26 char *name; 26 char *name;
27 struct stat st; 27 struct stat st;
28 int ttl; 28 int ttl;
29 int fd; 29 int fd;
30}; 30};
31 31
32struct repoinfo { 32struct repoinfo {
33 char *url; 33 char *url;
34 char *name; 34 char *name;
35 char *path; 35 char *path;
36 char *desc; 36 char *desc;
37 char *owner; 37 char *owner;
38 char *module_link; 38 char *module_link;
39 int snapshots; 39 int snapshots;
40}; 40};
41 41
42struct repolist { 42struct repolist {
43 int length; 43 int length;
44 int count; 44 int count;
45 struct repoinfo *repos; 45 struct repoinfo *repos;
46}; 46};
47 47
48struct commitinfo { 48struct commitinfo {
49 struct commit *commit; 49 struct commit *commit;
50 char *author; 50 char *author;
51 char *author_email; 51 char *author_email;
52 unsigned long author_date; 52 unsigned long author_date;
53 char *committer; 53 char *committer;
54 char *committer_email; 54 char *committer_email;
55 unsigned long committer_date; 55 unsigned long committer_date;
56 char *subject; 56 char *subject;
57 char *msg; 57 char *msg;
58}; 58};
59 59
60struct taginfo { 60struct taginfo {
61 char *tagger; 61 char *tagger;
62 char *tagger_email; 62 char *tagger_email;
63 int tagger_date; 63 int tagger_date;
64 char *msg; 64 char *msg;
65}; 65};
66 66
67extern const char cgit_version[]; 67extern const char cgit_version[];
68 68
69extern struct repolist cgit_repolist; 69extern struct repolist cgit_repolist;
70extern struct repoinfo *cgit_repo; 70extern struct repoinfo *cgit_repo;
71 71
72extern char *cgit_root_title; 72extern char *cgit_root_title;
73extern char *cgit_css; 73extern char *cgit_css;
74extern char *cgit_logo; 74extern char *cgit_logo;
75extern char *cgit_logo_link; 75extern char *cgit_logo_link;
76extern char *cgit_module_link; 76extern char *cgit_module_link;
77extern char *cgit_virtual_root; 77extern char *cgit_virtual_root;
78extern char *cgit_cache_root; 78extern char *cgit_cache_root;
79 79
80extern int cgit_nocache; 80extern int cgit_nocache;
81extern int cgit_snapshots; 81extern int cgit_snapshots;
82extern int cgit_max_lock_attempts; 82extern int cgit_max_lock_attempts;
83extern int cgit_cache_root_ttl; 83extern int cgit_cache_root_ttl;
84extern int cgit_cache_repo_ttl; 84extern int cgit_cache_repo_ttl;
85extern int cgit_cache_dynamic_ttl; 85extern int cgit_cache_dynamic_ttl;
86extern int cgit_cache_static_ttl; 86extern int cgit_cache_static_ttl;
87extern int cgit_cache_max_create_time; 87extern int cgit_cache_max_create_time;
88 88
89extern int cgit_max_msg_len; 89extern int cgit_max_msg_len;
90extern int cgit_max_commit_count;
90 91
91extern char *cgit_repo_name; 92extern char *cgit_repo_name;
92extern char *cgit_repo_desc; 93extern char *cgit_repo_desc;
93extern char *cgit_repo_owner; 94extern char *cgit_repo_owner;
94 95
95extern int cgit_query_has_symref; 96extern int cgit_query_has_symref;
96extern int cgit_query_has_sha1; 97extern int cgit_query_has_sha1;
97 98
98extern char *cgit_querystring; 99extern char *cgit_querystring;
99extern char *cgit_query_repo; 100extern char *cgit_query_repo;
100extern char *cgit_query_page; 101extern char *cgit_query_page;
101extern char *cgit_query_search; 102extern char *cgit_query_search;
102extern char *cgit_query_head; 103extern char *cgit_query_head;
103extern char *cgit_query_sha1; 104extern char *cgit_query_sha1;
104extern char *cgit_query_sha2; 105extern char *cgit_query_sha2;
105extern char *cgit_query_path; 106extern char *cgit_query_path;
106extern char *cgit_query_name; 107extern char *cgit_query_name;
107extern int cgit_query_ofs; 108extern int cgit_query_ofs;
108 109
109extern int htmlfd; 110extern int htmlfd;
110 111
111extern void cgit_global_config_cb(const char *name, const char *value); 112extern void cgit_global_config_cb(const char *name, const char *value);
112extern void cgit_repo_config_cb(const char *name, const char *value); 113extern void cgit_repo_config_cb(const char *name, const char *value);
113extern void cgit_querystring_cb(const char *name, const char *value); 114extern void cgit_querystring_cb(const char *name, const char *value);
114 115
115extern int chk_zero(int result, char *msg); 116extern int chk_zero(int result, char *msg);
116extern int chk_positive(int result, char *msg); 117extern int chk_positive(int result, char *msg);
117 118
118extern int hextoint(char c); 119extern int hextoint(char c);
119 120
120extern void *cgit_free_commitinfo(struct commitinfo *info); 121extern void *cgit_free_commitinfo(struct commitinfo *info);
121 122
122extern int cgit_diff_files(const unsigned char *old_sha1, 123extern int cgit_diff_files(const unsigned char *old_sha1,
123 const unsigned char *new_sha1, 124 const unsigned char *new_sha1,
124 linediff_fn fn); 125 linediff_fn fn);
125 126
126extern void cgit_diff_tree(const unsigned char *old_sha1, 127extern void cgit_diff_tree(const unsigned char *old_sha1,
127 const unsigned char *new_sha1, 128 const unsigned char *new_sha1,
128 filepair_fn fn); 129 filepair_fn fn);
129 130
130extern void cgit_diff_commit(struct commit *commit, filepair_fn fn); 131extern void cgit_diff_commit(struct commit *commit, filepair_fn fn);
131 132
132extern char *fmt(const char *format,...); 133extern char *fmt(const char *format,...);
133 134
134extern void html(const char *txt); 135extern void html(const char *txt);
135extern void htmlf(const char *format,...); 136extern void htmlf(const char *format,...);
136extern void html_txt(char *txt); 137extern void html_txt(char *txt);
137extern void html_ntxt(int len, char *txt); 138extern void html_ntxt(int len, char *txt);
138extern void html_attr(char *txt); 139extern void html_attr(char *txt);
139extern void html_hidden(char *name, char *value); 140extern void html_hidden(char *name, char *value);
140extern void html_link_open(char *url, char *title, char *class); 141extern void html_link_open(char *url, char *title, char *class);
141extern void html_link_close(void); 142extern void html_link_close(void);
142extern void html_filemode(unsigned short mode); 143extern void html_filemode(unsigned short mode);
143 144
144extern int cgit_read_config(const char *filename, configfn fn); 145extern int cgit_read_config(const char *filename, configfn fn);
145extern int cgit_parse_query(char *txt, configfn fn); 146extern int cgit_parse_query(char *txt, configfn fn);
146extern struct commitinfo *cgit_parse_commit(struct commit *commit); 147extern struct commitinfo *cgit_parse_commit(struct commit *commit);
147extern struct taginfo *cgit_parse_tag(struct tag *tag); 148extern struct taginfo *cgit_parse_tag(struct tag *tag);
148 149
149extern char *cache_safe_filename(const char *unsafe); 150extern char *cache_safe_filename(const char *unsafe);
150extern int cache_lock(struct cacheitem *item); 151extern int cache_lock(struct cacheitem *item);
151extern int cache_unlock(struct cacheitem *item); 152extern int cache_unlock(struct cacheitem *item);
152extern int cache_cancel_lock(struct cacheitem *item); 153extern int cache_cancel_lock(struct cacheitem *item);
153extern int cache_exist(struct cacheitem *item); 154extern int cache_exist(struct cacheitem *item);
154extern int cache_expired(struct cacheitem *item); 155extern int cache_expired(struct cacheitem *item);
155 156
156extern char *cgit_repourl(const char *reponame); 157extern char *cgit_repourl(const char *reponame);
157extern char *cgit_pageurl(const char *reponame, const char *pagename, 158extern char *cgit_pageurl(const char *reponame, const char *pagename,
158 const char *query); 159 const char *query);
159 160
160extern void cgit_print_error(char *msg); 161extern void cgit_print_error(char *msg);
161extern void cgit_print_date(unsigned long secs); 162extern void cgit_print_date(unsigned long secs);
162extern void cgit_print_docstart(char *title, struct cacheitem *item); 163extern void cgit_print_docstart(char *title, struct cacheitem *item);
163extern void cgit_print_docend(); 164extern void cgit_print_docend();
164extern void cgit_print_pageheader(char *title, int show_search); 165extern void cgit_print_pageheader(char *title, int show_search);
165extern void cgit_print_snapshot_start(const char *mimetype, 166extern void cgit_print_snapshot_start(const char *mimetype,
166 const char *filename, 167 const char *filename,
167 struct cacheitem *item); 168 struct cacheitem *item);
168 169
169extern void cgit_print_repolist(struct cacheitem *item); 170extern void cgit_print_repolist(struct cacheitem *item);
170extern void cgit_print_summary(); 171extern void cgit_print_summary();
171extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep); 172extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep);
172extern void cgit_print_view(const char *hex, char *path); 173extern void cgit_print_view(const char *hex, char *path);
173extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path); 174extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path);
174extern void cgit_print_tree(const char *hex, char *path); 175extern void cgit_print_tree(const char *hex, char *path);
175extern void cgit_print_commit(const char *hex); 176extern void cgit_print_commit(const char *hex);
176extern void cgit_print_diff(const char *old_hex, const char *new_hex); 177extern void cgit_print_diff(const char *old_hex, const char *new_hex);
177extern void cgit_print_snapshot(struct cacheitem *item, const char *hex, 178extern void cgit_print_snapshot(struct cacheitem *item, const char *hex,
178 const char *format, const char *prefix, 179 const char *format, const char *prefix,
179 const char *filename); 180 const char *filename);
180 181
181#endif /* CGIT_H */ 182#endif /* CGIT_H */