archives.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. /*
  2. * dpkg - main program for package management
  3. * archives.h - functions common to archives.c and processarc.c
  4. *
  5. * Copyright © 1995 Ian Jackson <ian@chiark.greenend.org.uk>
  6. *
  7. * This is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * This is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. */
  20. #ifndef ARCHIVES_H
  21. #define ARCHIVES_H
  22. #include <stdbool.h>
  23. #include <dpkg/tarfn.h>
  24. struct tarcontext {
  25. int backendpipe;
  26. struct pkginfo *pkg;
  27. struct fileinlist **newfilesp;
  28. /** Are all “Multi-arch: same” instances about to be in sync? */
  29. bool pkgset_getting_in_sync;
  30. };
  31. struct pkg_deconf_list {
  32. struct pkg_deconf_list *next;
  33. struct pkginfo *pkg;
  34. struct pkginfo *pkg_removal;
  35. };
  36. extern int fnameidlu;
  37. extern struct varbuf fnamevb;
  38. extern struct varbuf fnametmpvb;
  39. extern struct varbuf fnamenewvb;
  40. extern struct pkg_deconf_list *deconfigure;
  41. void clear_deconfigure_queue(void);
  42. void enqueue_deconfigure(struct pkginfo *pkg, struct pkginfo *pkg_removal);
  43. void enqueue_conflictor(struct pkginfo *pkg, struct pkginfo *pkg_fixbyrm);
  44. void cu_pathname(int argc, void **argv);
  45. void cu_cidir(int argc, void **argv);
  46. void cu_fileslist(int argc, void **argv);
  47. void cu_backendpipe(int argc, void **argv);
  48. void cu_installnew(int argc, void **argv);
  49. void cu_prermupgrade(int argc, void **argv);
  50. void cu_prerminfavour(int argc, void **argv);
  51. void cu_preinstverynew(int argc, void **argv);
  52. void cu_preinstnew(int argc, void **argv);
  53. void cu_preinstupgrade(int argc, void **argv);
  54. void cu_postrmupgrade(int argc, void **argv);
  55. void cu_prermdeconfigure(int argc, void **argv);
  56. void ok_prermdeconfigure(int argc, void **argv);
  57. void setupfnamevbs(const char *filename);
  58. int secure_remove(const char *filename);
  59. int tarobject(void *ctx, struct tar_entry *ti);
  60. int tarfileread(void *ud, char *buf, int len);
  61. void tar_deferred_extract(struct fileinlist *files, struct pkginfo *pkg);
  62. bool filesavespackage(struct fileinlist *, struct pkginfo *,
  63. struct pkginfo *pkgbeinginstalled);
  64. void check_conflict(struct dependency *dep, struct pkginfo *pkg,
  65. const char *pfilename);
  66. void check_breaks(struct dependency *dep, struct pkginfo *pkg,
  67. const char *pfilename);
  68. struct fileinlist *addfiletolist(struct tarcontext *tc,
  69. struct filenamenode *namenode);
  70. extern int cleanup_pkg_failed, cleanup_conflictor_failed;
  71. #endif /* ARCHIVES_H */