add context pointer to read_tree_recursive()
[git/git.git] / archive.h
CommitLineData
4df096a5
FBH
1#ifndef ARCHIVE_H
2#define ARCHIVE_H
3
4#define MAX_EXTRA_ARGS 32
5#define MAX_ARGS (MAX_EXTRA_ARGS + 32)
6
7struct archiver_args {
8 const char *base;
9 struct tree *tree;
10 const unsigned char *commit_sha1;
8460b2fc 11 const struct commit *commit;
4df096a5
FBH
12 time_t time;
13 const char **pathspec;
e0ffb248 14 unsigned int verbose : 1;
4df096a5
FBH
15 void *extra;
16};
17
18typedef int (*write_archive_fn_t)(struct archiver_args *);
19
20typedef void *(*parse_extra_args_fn_t)(int argc, const char **argv);
21
22struct archiver {
23 const char *name;
4df096a5
FBH
24 write_archive_fn_t write_archive;
25 parse_extra_args_fn_t parse_extra;
26};
27
34533004 28extern int parse_archive_args(int argc, const char **argv, const struct archiver **ar, struct archiver_args *args);
4df096a5
FBH
29
30extern void parse_treeish_arg(const char **treeish,
31 struct archiver_args *ar_args,
32 const char *prefix);
33
34extern void parse_pathspec_arg(const char **pathspec,
35 struct archiver_args *args);
efd8696c
FBH
36/*
37 * Archive-format specific backends.
38 */
39extern int write_tar_archive(struct archiver_args *);
ec06bff5 40extern int write_zip_archive(struct archiver_args *);
854c4168 41extern void *parse_extra_zip_args(int argc, const char **argv);
4df096a5 42
8460b2fc 43extern void *sha1_file_to_archive(const char *path, const unsigned char *sha1, unsigned int mode, enum object_type *type, unsigned long *size, const struct commit *commit);
008d896d 44extern int is_archive_path_ignored(const char *path);
8460b2fc 45
4df096a5 46#endif /* ARCHIVE_H */