Update draft release notes for 1.6.0
[git/jrn.git] / archive.h
blob96bb1cd85362e68ee42c81d5017222411e6bf669
1 #ifndef ARCHIVE_H
2 #define ARCHIVE_H
4 #define MAX_EXTRA_ARGS 32
5 #define MAX_ARGS (MAX_EXTRA_ARGS + 32)
7 struct archiver_args {
8 const char *base;
9 size_t baselen;
10 struct tree *tree;
11 const unsigned char *commit_sha1;
12 const struct commit *commit;
13 time_t time;
14 const char **pathspec;
15 unsigned int verbose : 1;
18 typedef int (*write_archive_fn_t)(struct archiver_args *);
20 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);
22 struct archiver {
23 const char *name;
24 write_archive_fn_t write_archive;
25 unsigned int flags;
28 extern int parse_archive_args(int argc, const char **argv, const struct archiver **ar, struct archiver_args *args);
30 extern void parse_treeish_arg(const char **treeish,
31 struct archiver_args *ar_args,
32 const char *prefix);
34 extern void parse_pathspec_arg(const char **pathspec,
35 struct archiver_args *args);
37 * Archive-format specific backends.
39 extern int write_tar_archive(struct archiver_args *);
40 extern int write_zip_archive(struct archiver_args *);
42 extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
44 #endif /* ARCHIVE_H */