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