THIS IS A TEST INSTANCE ONLY! REPOSITORIES CAN BE DELETED AT ANY TIME!

Git Source Code Mirror - This is a publish-only repository and all pull requests are ignored. Please follow Documentation/SubmittingPatches procedure for any of your improvements.
git
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

60 lines
1.5KB

  1. #ifndef ARCHIVE_H
  2. #define ARCHIVE_H
  3. #include "cache.h"
  4. #include "pathspec.h"
  5. struct repository;
  6. struct archiver_args {
  7. struct repository *repo;
  8. const char *base;
  9. size_t baselen;
  10. struct tree *tree;
  11. const struct object_id *commit_oid;
  12. const struct commit *commit;
  13. timestamp_t time;
  14. struct pathspec pathspec;
  15. unsigned int verbose : 1;
  16. unsigned int worktree_attributes : 1;
  17. unsigned int convert : 1;
  18. int compression_level;
  19. };
  20. /* main api */
  21. int write_archive(int argc, const char **argv, const char *prefix,
  22. struct repository *repo,
  23. const char *name_hint, int remote);
  24. const char *archive_format_from_filename(const char *filename);
  25. /* archive backend stuff */
  26. #define ARCHIVER_WANT_COMPRESSION_LEVELS 1
  27. #define ARCHIVER_REMOTE 2
  28. struct archiver {
  29. const char *name;
  30. int (*write_archive)(const struct archiver *, struct archiver_args *);
  31. unsigned flags;
  32. void *data;
  33. };
  34. void register_archiver(struct archiver *);
  35. void init_tar_archiver(void);
  36. void init_zip_archiver(void);
  37. void init_archivers(void);
  38. typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,
  39. const struct object_id *oid,
  40. const char *path, size_t pathlen,
  41. unsigned int mode);
  42. int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
  43. void *object_file_to_archive(const struct archiver_args *args,
  44. const char *path, const struct object_id *oid,
  45. unsigned int mode, enum object_type *type,
  46. unsigned long *sizep);
  47. #endif /* ARCHIVE_H */