]> git.cameronkatri.com Git - cgit.git/blobdiff - shared.c
introduce cgit_repobasename
[cgit.git] / shared.c
index 45db735ed39f1a7ba20dce0618f11eecfb08ddc2..65fc8b25d25a165a70ee49e2916cfd4cb69071ad 100644 (file)
--- a/shared.c
+++ b/shared.c
@@ -12,6 +12,8 @@ struct repolist cgit_repolist;
 struct repoinfo *cgit_repo;
 int cgit_cmd;
 
+const char *cgit_version = CGIT_VERSION;
+
 char *cgit_root_title   = "Git repository browser";
 char *cgit_css          = "/cgit.css";
 char *cgit_logo         = "/git-logo.png";
@@ -84,6 +86,13 @@ int chk_positive(int result, char *msg)
        return result;
 }
 
+int chk_non_negative(int result, char *msg)
+{
+       if (result < 0)
+               die("%s: %s",msg, strerror(errno));
+       return result;
+}
+
 struct repoinfo *add_repo(const char *url)
 {
        struct repoinfo *ret;