]> gitweb.ps.run Git - ps-cgit/blobdiff - cgit.h
Refactor snapshot support
[ps-cgit] / cgit.h
diff --git a/cgit.h b/cgit.h
index 40e2d40b43a9de331d63fd1ec44b342cfedc95fc..e2d5126035cf865657a87d9f83b106ac9a7d6061 100644 (file)
--- a/cgit.h
+++ b/cgit.h
 #include <utf8.h>
 
 
-/*
- * The valid cgit repo-commands
- */
-#define CMD_LOG      1
-#define CMD_COMMIT   2
-#define CMD_DIFF     3
-#define CMD_TREE     4
-#define CMD_BLOB     5
-#define CMD_SNAPSHOT 6
-#define CMD_TAG      7
-#define CMD_REFS     8
-#define CMD_PATCH    9
-
 /*
  * Dateformats used on misc. pages
  */
@@ -190,14 +177,21 @@ struct cgit_context {
        struct cgit_page page;
 };
 
+struct cgit_snapshot_format {
+       const char *suffix;
+       const char *mimetype;
+       write_archive_fn_t write_func;
+       int bit;
+};
+
 extern const char *cgit_version;
 
 extern struct cgit_repolist cgit_repolist;
 extern struct cgit_context ctx;
+extern const struct cgit_snapshot_format cgit_snapshot_formats[];
 extern int cgit_cmd;
 
 extern void cgit_prepare_context(struct cgit_context *ctx);
-extern int cgit_get_cmd_index(const char *cmd);
 extern struct cgit_repo *cgit_get_repoinfo(const char *url);
 extern void cgit_global_config_cb(const char *name, const char *value);
 extern void cgit_repo_config_cb(const char *name, const char *value);