archive: move parameter parsing code to archive.c
[git/jnareb-git/bp-gitweb.git] / archive.h
blobf6ceaebc8fb8694349ee9e755dd50e366c33d5ce
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;
16 int compression_level;
19 typedef int (*write_archive_fn_t)(struct archiver_args *);
21 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);
23 struct archiver {
24 const char *name;
25 write_archive_fn_t write_archive;
26 unsigned int flags;
30 * Archive-format specific backends.
32 extern int write_tar_archive(struct archiver_args *);
33 extern int write_zip_archive(struct archiver_args *);
35 extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
36 extern int write_archive(int argc, const char **argv, const char *prefix, int setup_prefix);
38 #endif /* ARCHIVE_H */