]> git.cameronkatri.com Git - cgit.git/commitdiff
Add ui-shared.h
authorLars Hjemli <hjemli@gmail.com>
Mon, 24 Mar 2008 15:50:57 +0000 (16:50 +0100)
committerLars Hjemli <hjemli@gmail.com>
Mon, 24 Mar 2008 15:50:57 +0000 (16:50 +0100)
This is finally a proper headerfile for the shared ui-functions which
used to reside in cgit.h

Signed-off-by: Lars Hjemli <hjemli@gmail.com>
13 files changed:
cgit.c
cgit.h
ui-blob.c
ui-commit.c
ui-diff.c
ui-log.c
ui-patch.c
ui-refs.c
ui-repolist.c
ui-shared.h [new file with mode: 0644]
ui-snapshot.c
ui-tag.c
ui-tree.c

diff --git a/cgit.c b/cgit.c
index 79e0e430db79691e1735dbeb2cf4d7400b7e5bc0..dbb023e62bd88b85bc4e488a785f0cd5e2375f4b 100644 (file)
--- a/cgit.c
+++ b/cgit.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "cmd.h"
+#include "ui-shared.h"
 
 static int cgit_prepare_cache(struct cacheitem *item)
 {
diff --git a/cgit.h b/cgit.h
index 1b23369c58e9cc549c68ea2808bf652e5a7f0162..c1a231d08390fdcc31dcb01b4abe3e5403b03d5a 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -237,40 +237,8 @@ extern int cache_cancel_lock(struct cacheitem *item);
 extern int cache_exist(struct cacheitem *item);
 extern int cache_expired(struct cacheitem *item);
 
-extern char *cgit_repourl(const char *reponame);
-extern char *cgit_fileurl(const char *reponame, const char *pagename,
-                         const char *filename, const char *query);
-extern char *cgit_pageurl(const char *reponame, const char *pagename,
-                         const char *query);
-
 extern const char *cgit_repobasename(const char *reponame);
 
-extern void cgit_tree_link(char *name, char *title, char *class, char *head,
-                          char *rev, char *path);
-extern void cgit_log_link(char *name, char *title, char *class, char *head,
-                         char *rev, char *path, int ofs, char *grep,
-                         char *pattern);
-extern void cgit_commit_link(char *name, char *title, char *class, char *head,
-                            char *rev);
-extern void cgit_refs_link(char *name, char *title, char *class, char *head,
-                          char *rev, char *path);
-extern void cgit_snapshot_link(char *name, char *title, char *class,
-                              char *head, char *rev, char *archivename);
-extern void cgit_diff_link(char *name, char *title, char *class, char *head,
-                          char *new_rev, char *old_rev, char *path);
-
-extern void cgit_object_link(struct object *obj);
-
-extern void cgit_print_error(char *msg);
-extern void cgit_print_date(time_t secs, char *format);
-extern void cgit_print_age(time_t t, time_t max_relative, char *format);
-extern void cgit_print_http_headers(struct cgit_context *ctx);
-extern void cgit_print_docstart(struct cgit_context *ctx);
-extern void cgit_print_docend();
-extern void cgit_print_pageheader(struct cgit_context *ctx);
-extern void cgit_print_filemode(unsigned short mode);
-extern void cgit_print_snapshot_links(const char *repo, const char *head,
-                                     const char *hex, int snapshots);
 extern int cgit_parse_snapshots_mask(const char *str);
 
 #endif /* CGIT_H */
index 3b291329a481f032fc8052e4b885aec2affbf695..11589db2bbc947ea79f651b7855502224f6ebfa9 100644 (file)
--- a/ui-blob.c
+++ b/ui-blob.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 void cgit_print_blob(const char *hex, char *path)
 {
index ed258243f17c1254e3fcc1b853a5930d307055d8..8019e3608f0fd35911024d2b8294e61e864831a2 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 static int files, slots;
 static int total_adds, total_rems, max_changes;
index 5c3bc98309650165237ca3edb791f5c8e5475408..2a2200900044d9fb66a80048c9f3f07aa3d45d62 100644 (file)
--- a/ui-diff.c
+++ b/ui-diff.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 unsigned char old_rev_sha1[20];
 unsigned char new_rev_sha1[20];
index e1d324d2bf406023f93d176f1e3e7e1b719b0518..60c92690e12ceceeaf8c85f323a0f133653c65ca 100644 (file)
--- a/ui-log.c
+++ b/ui-log.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 int files, add_lines, rem_lines;
 
index 68ebb152781bb1352c0003d2ae87f64c2537a7b9..36bfae4836df393cd1c24c94b58e15702e2bc134 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 static void print_line(char *line, int len)
 {
index fc82ca74227b4e518c1e5c33482b54c148970ef9..12533cd5f806fa522e80620ced42d18dcaf2beae 100644 (file)
--- a/ui-refs.c
+++ b/ui-refs.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 static int header;
 
index ad9b1bc4aa020c3bb7a3db4f178b207d65ff3fd2..eeeaf3d533d2be1546c42de9d769717a9f3350b8 100644 (file)
@@ -10,6 +10,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 time_t read_agefile(char *path)
 {
diff --git a/ui-shared.h b/ui-shared.h
new file mode 100644 (file)
index 0000000..94de884
--- /dev/null
@@ -0,0 +1,36 @@
+#ifndef UI_SHARED_H
+#define UI_SHARED_H
+
+extern char *cgit_repourl(const char *reponame);
+extern char *cgit_fileurl(const char *reponame, const char *pagename,
+                         const char *filename, const char *query);
+extern char *cgit_pageurl(const char *reponame, const char *pagename,
+                         const char *query);
+
+extern void cgit_tree_link(char *name, char *title, char *class, char *head,
+                          char *rev, char *path);
+extern void cgit_log_link(char *name, char *title, char *class, char *head,
+                         char *rev, char *path, int ofs, char *grep,
+                         char *pattern);
+extern void cgit_commit_link(char *name, char *title, char *class, char *head,
+                            char *rev);
+extern void cgit_refs_link(char *name, char *title, char *class, char *head,
+                          char *rev, char *path);
+extern void cgit_snapshot_link(char *name, char *title, char *class,
+                              char *head, char *rev, char *archivename);
+extern void cgit_diff_link(char *name, char *title, char *class, char *head,
+                          char *new_rev, char *old_rev, char *path);
+extern void cgit_object_link(struct object *obj);
+
+extern void cgit_print_error(char *msg);
+extern void cgit_print_date(time_t secs, char *format);
+extern void cgit_print_age(time_t t, time_t max_relative, char *format);
+extern void cgit_print_http_headers(struct cgit_context *ctx);
+extern void cgit_print_docstart(struct cgit_context *ctx);
+extern void cgit_print_docend();
+extern void cgit_print_pageheader(struct cgit_context *ctx);
+extern void cgit_print_filemode(unsigned short mode);
+extern void cgit_print_snapshot_links(const char *repo, const char *head,
+                                     const char *hex, int snapshots);
+
+#endif /* UI_SHARED_H */
index 512fcd2f069456f8c55ee30779995c68a3a7e552..966a14007414f35d0e04f862a593c93ba26421b5 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 static int write_compressed_tar_archive(struct archiver_args *args,const char *filter)
 {
index 2998d0277265ddd78780fb1723adf6f7e252ff3c..ab2c66d76eefada3f9655d3ba1689ac84445b711 100644 (file)
--- a/ui-tag.c
+++ b/ui-tag.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 static void print_tag_content(char *buf)
 {
index 79127840e0f029d3ae8c4ef2bf8c5b417f1cfda9..9be3140c40b7583bfa07a435735f958c6d39b723 100644 (file)
--- a/ui-tree.c
+++ b/ui-tree.c
@@ -8,6 +8,7 @@
 
 #include "cgit.h"
 #include "html.h"
+#include "ui-shared.h"
 
 char *curr_rev;
 char *match_path;