summaryrefslogtreecommitdiff
path: root/archive.h
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-05 06:33:55 -0800
committerAnas Nashif <anas.nashif@intel.com>2012-11-05 06:33:55 -0800
commit189627cd588c2937de7b655595b8ed777f445c85 (patch)
treea705e86785a06f293aa255a0263ddc25ca1ba202 /archive.h
downloadgit-189627cd588c2937de7b655595b8ed777f445c85.tar.gz
git-189627cd588c2937de7b655595b8ed777f445c85.tar.bz2
git-189627cd588c2937de7b655595b8ed777f445c85.zip
Imported Upstream version 1.7.10.4upstream/1.7.10.4
Diffstat (limited to 'archive.h')
-rw-r--r--archive.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/archive.h b/archive.h
new file mode 100644
index 00000000..2b0884f1
--- /dev/null
+++ b/archive.h
@@ -0,0 +1,37 @@
+#ifndef ARCHIVE_H
+#define ARCHIVE_H
+
+struct archiver_args {
+ const char *base;
+ size_t baselen;
+ struct tree *tree;
+ const unsigned char *commit_sha1;
+ const struct commit *commit;
+ time_t time;
+ const char **pathspec;
+ unsigned int verbose : 1;
+ unsigned int worktree_attributes : 1;
+ int compression_level;
+};
+
+#define ARCHIVER_WANT_COMPRESSION_LEVELS 1
+#define ARCHIVER_REMOTE 2
+struct archiver {
+ const char *name;
+ int (*write_archive)(const struct archiver *, struct archiver_args *);
+ unsigned flags;
+ void *data;
+};
+extern void register_archiver(struct archiver *);
+
+extern void init_tar_archiver(void);
+extern void init_zip_archiver(void);
+
+typedef int (*write_archive_entry_fn_t)(struct archiver_args *args, const unsigned char *sha1, const char *path, size_t pathlen, unsigned int mode, void *buffer, unsigned long size);
+
+extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
+extern int write_archive(int argc, const char **argv, const char *prefix, int setup_prefix, const char *name_hint, int remote);
+
+const char *archive_format_from_filename(const char *filename);
+
+#endif /* ARCHIVE_H */