archive-tar: unindent write_tar_entry by one level
[git/git.git] / archive.h
CommitLineData
4df096a5
FBH
1#ifndef ARCHIVE_H
2#define ARCHIVE_H
3
4df096a5
FBH
4struct archiver_args {
5 const char *base;
d53fe818 6 size_t baselen;
4df096a5
FBH
7 struct tree *tree;
8 const unsigned char *commit_sha1;
8460b2fc 9 const struct commit *commit;
4df096a5
FBH
10 time_t time;
11 const char **pathspec;
e0ffb248 12 unsigned int verbose : 1;
ba053ea9 13 unsigned int worktree_attributes : 1;
3a176c6c 14 int compression_level;
4df096a5
FBH
15};
16
13e0f88d 17#define ARCHIVER_WANT_COMPRESSION_LEVELS 1
7b97730b 18#define ARCHIVER_REMOTE 2
13e0f88d
JK
19struct archiver {
20 const char *name;
4d7c9898 21 int (*write_archive)(const struct archiver *, struct archiver_args *);
13e0f88d 22 unsigned flags;
4d7c9898 23 void *data;
13e0f88d
JK
24};
25extern void register_archiver(struct archiver *);
4df096a5 26
13e0f88d
JK
27extern void init_tar_archiver(void);
28extern void init_zip_archiver(void);
562e25ab 29
13e0f88d 30typedef 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);
4df096a5 31
562e25ab 32extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
7b97730b 33extern int write_archive(int argc, const char **argv, const char *prefix, int setup_prefix, const char *name_hint, int remote);
56baa61d
JK
34
35const char *archive_format_from_filename(const char *filename);
562e25ab 36
4df096a5 37#endif /* ARCHIVE_H */