archives.h 3.0 KB

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