Teach git-index-pack how to keep a pack file.
[git/dkf.git] / archive.h
blob16dcdb875c3715556ce8561e9ee9f7ae8b3766da
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 struct tree *tree;
10 const unsigned char *commit_sha1;
11 time_t time;
12 const char **pathspec;
13 unsigned int verbose : 1;
14 void *extra;
17 typedef int (*write_archive_fn_t)(struct archiver_args *);
19 typedef void *(*parse_extra_args_fn_t)(int argc, const char **argv);
21 struct archiver {
22 const char *name;
23 struct archiver_args args;
24 write_archive_fn_t write_archive;
25 parse_extra_args_fn_t parse_extra;
28 extern struct archiver archivers[];
30 extern int parse_archive_args(int argc,
31 const char **argv,
32 struct archiver *ar);
34 extern void parse_treeish_arg(const char **treeish,
35 struct archiver_args *ar_args,
36 const char *prefix);
38 extern void parse_pathspec_arg(const char **pathspec,
39 struct archiver_args *args);
41 * Archive-format specific backends.
43 extern int write_tar_archive(struct archiver_args *);
44 extern int write_zip_archive(struct archiver_args *);
45 extern void *parse_extra_zip_args(int argc, const char **argv);
47 #endif /* ARCHIVE_H */