Export format_commit_message()
[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;
11 time_t time;
12 const char **pathspec;
e0ffb248 13 unsigned int verbose : 1;
4df096a5
FBH
14 void *extra;
15};
16
17typedef int (*write_archive_fn_t)(struct archiver_args *);
18
19typedef void *(*parse_extra_args_fn_t)(int argc, const char **argv);
20
21struct archiver {
22 const char *name;
4df096a5
FBH
23 struct archiver_args args;
24 write_archive_fn_t write_archive;
25 parse_extra_args_fn_t parse_extra;
26};
27
4df096a5
FBH
28extern int parse_archive_args(int argc,
29 const char **argv,
30 struct archiver *ar);
31
32extern void parse_treeish_arg(const char **treeish,
33 struct archiver_args *ar_args,
34 const char *prefix);
35
36extern void parse_pathspec_arg(const char **pathspec,
37 struct archiver_args *args);
efd8696c
FBH
38/*
39 * Archive-format specific backends.
40 */
41extern int write_tar_archive(struct archiver_args *);
ec06bff5 42extern int write_zip_archive(struct archiver_args *);
854c4168 43extern void *parse_extra_zip_args(int argc, const char **argv);
4df096a5
FBH
44
45#endif /* ARCHIVE_H */