]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.h
Add shared diff-handling functions
[ps-cgit] / cgit.h
diff --git a/cgit.h b/cgit.h
index 03c2fdb7cf3f1cbb446aeb2dd7812e7face6b4f9..24b02d74b45ad07475557474e3eebf4c28decb48 100644 (file)
--- a/cgit.h
+++ b/cgit.h
@@ -1,12 +1,25 @@
 #ifndef CGIT_H
 #define CGIT_H
 
-#include "git.h"
-#include <openssl/sha.h>
-#include <ctype.h>
-#include <sched.h>
+
+#include <git-compat-util.h>
+#include <cache.h>
+#include <grep.h>
+#include <object.h>
+#include <tree.h>
+#include <commit.h>
+#include <tag.h>
+#include <diff.h>
+#include <diffcore.h>
+#include <refs.h>
+#include <revision.h>
+#include <log-tree.h>
+#include <archive.h>
+#include <xdiff/xdiff.h>
+
 
 typedef void (*configfn)(const char *name, const char *value);
+typedef void (*filepair_fn)(struct diff_filepair *pair);
 
 struct cacheitem {
        char *name;
@@ -21,6 +34,8 @@ struct repoinfo {
        char *path;
        char *desc;
        char *owner;
+       char *module_link;
+       int snapshots;
 };
 
 struct repolist {
@@ -57,10 +72,12 @@ extern char *cgit_root_title;
 extern char *cgit_css;
 extern char *cgit_logo;
 extern char *cgit_logo_link;
+extern char *cgit_module_link;
 extern char *cgit_virtual_root;
 extern char *cgit_cache_root;
 
 extern int cgit_nocache;
+extern int cgit_snapshots;
 extern int cgit_max_lock_attempts;
 extern int cgit_cache_root_ttl;
 extern int cgit_cache_repo_ttl;
@@ -100,6 +117,10 @@ extern int chk_positive(int result, char *msg);
 extern int hextoint(char c);
 
 extern void *cgit_free_commitinfo(struct commitinfo *info);
+extern void cgit_diff_tree(const unsigned char *old_sha1,
+                          const unsigned char *new_sha1,
+                          filepair_fn fn);
+extern void cgit_diff_commit(struct commit *commit, filepair_fn fn);
 
 extern char *fmt(const char *format,...);
 
@@ -141,7 +162,8 @@ extern void cgit_print_snapshot_start(const char *mimetype,
 extern void cgit_print_repolist(struct cacheitem *item);
 extern void cgit_print_summary();
 extern void cgit_print_log(const char *tip, int ofs, int cnt, char *grep);
-extern void cgit_print_view(const char *hex);
+extern void cgit_print_view(const char *hex, char *path);
+extern void cgit_print_blob(struct cacheitem *item, const char *hex, char *path);
 extern void cgit_print_tree(const char *hex, char *path);
 extern void cgit_print_commit(const char *hex);
 extern void cgit_print_diff(const char *old_hex, const char *new_hex);