asciidoctor-extensions.rb: handle "book" doctype in linkgit
[git/git.git] / archive.h
CommitLineData
4df096a5
FBH
1#ifndef ARCHIVE_H
2#define ARCHIVE_H
3
ef3ca954 4#include "cache.h"
f3e743a0
NTND
5#include "pathspec.h"
6
b612ee20
NTND
7struct repository;
8
4df096a5 9struct archiver_args {
b612ee20 10 struct repository *repo;
4df096a5 11 const char *base;
d53fe818 12 size_t baselen;
4df096a5 13 struct tree *tree;
bbf05cf7 14 const struct object_id *commit_oid;
8460b2fc 15 const struct commit *commit;
dddbad72 16 timestamp_t time;
f3e743a0 17 struct pathspec pathspec;
e0ffb248 18 unsigned int verbose : 1;
ba053ea9 19 unsigned int worktree_attributes : 1;
9cb513b7 20 unsigned int convert : 1;
3a176c6c 21 int compression_level;
4df096a5
FBH
22};
23
b612ee20
NTND
24/* main api */
25
55454427 26int write_archive(int argc, const char **argv, const char *prefix,
ad6dad09
DL
27 struct repository *repo,
28 const char *name_hint, int remote);
b612ee20
NTND
29
30const char *archive_format_from_filename(const char *filename);
31
32/* archive backend stuff */
33
13e0f88d 34#define ARCHIVER_WANT_COMPRESSION_LEVELS 1
7b97730b 35#define ARCHIVER_REMOTE 2
13e0f88d
JK
36struct archiver {
37 const char *name;
4d7c9898 38 int (*write_archive)(const struct archiver *, struct archiver_args *);
13e0f88d 39 unsigned flags;
4d7c9898 40 void *data;
13e0f88d 41};
55454427 42void register_archiver(struct archiver *);
4df096a5 43
55454427
DL
44void init_tar_archiver(void);
45void init_zip_archiver(void);
46void init_archivers(void);
562e25ab 47
9cb513b7 48typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,
015ff4f8 49 const struct object_id *oid,
9cb513b7
NTND
50 const char *path, size_t pathlen,
51 unsigned int mode);
4df096a5 52
55454427
DL
53int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
54void *object_file_to_archive(const struct archiver_args *args,
ad6dad09
DL
55 const char *path, const struct object_id *oid,
56 unsigned int mode, enum object_type *type,
57 unsigned long *sizep);
562e25ab 58
4df096a5 59#endif /* ARCHIVE_H */