Win32: patch Windows environment on startup
[git/mingw/4msysgit/kblees.git] / archive.h
blob2b0884f1ef3123f26d9a7b3ba03e3d14ae1ccd57
1 #ifndef ARCHIVE_H
2 #define ARCHIVE_H
4 struct archiver_args {
5 const char *base;
6 size_t baselen;
7 struct tree *tree;
8 const unsigned char *commit_sha1;
9 const struct commit *commit;
10 time_t time;
11 const char **pathspec;
12 unsigned int verbose : 1;
13 unsigned int worktree_attributes : 1;
14 int compression_level;
17 #define ARCHIVER_WANT_COMPRESSION_LEVELS 1
18 #define ARCHIVER_REMOTE 2
19 struct archiver {
20 const char *name;
21 int (*write_archive)(const struct archiver *, struct archiver_args *);
22 unsigned flags;
23 void *data;
25 extern void register_archiver(struct archiver *);
27 extern void init_tar_archiver(void);
28 extern void init_zip_archiver(void);
30 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);
32 extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
33 extern int write_archive(int argc, const char **argv, const char *prefix, int setup_prefix, const char *name_hint, int remote);
35 const char *archive_format_from_filename(const char *filename);
37 #endif /* ARCHIVE_H */