dpkg-split.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. /*
  2. * dpkg-split - splitting and joining of multipart *.deb archives
  3. * dpkg-split.h - external definitions for this program
  4. *
  5. * Copyright © 1995 Ian Jackson <ijackson@chiark.greenend.org.uk>
  6. * Copyright © 2008-2012 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 DPKG_SPLIT_H
  22. #define DPKG_SPLIT_H
  23. #include <dpkg/ar.h>
  24. #include <dpkg/deb-version.h>
  25. action_func do_split;
  26. action_func do_join;
  27. action_func do_info;
  28. action_func do_auto;
  29. action_func do_queue;
  30. action_func do_discard;
  31. struct partinfo {
  32. struct deb_version fmtversion;
  33. const char *filename;
  34. const char *package;
  35. const char *version;
  36. const char *arch;
  37. const char *md5sum;
  38. off_t orglength;
  39. unsigned int thispartn, maxpartn;
  40. off_t maxpartlen;
  41. off_t thispartoffset;
  42. off_t thispartlen;
  43. /** Size of header in part file. */
  44. off_t headerlen;
  45. off_t filesize;
  46. };
  47. struct partqueue {
  48. struct partqueue *nextinqueue;
  49. /** Only fields filename, md5sum, maxpartlen, thispartn, maxpartn
  50. * are valid; the rest are NULL. If the file is not named correctly
  51. * to be a part file md5sum is NULL too and the numbers are zero. */
  52. struct partinfo info;
  53. };
  54. extern off_t opt_maxpartsize;
  55. extern const char *opt_depotdir;
  56. extern const char *opt_outputfile;
  57. extern int opt_npquiet;
  58. extern int opt_msdos;
  59. void read_fail(int rc, const char *filename, const char *what) DPKG_ATTR_NORET;
  60. void print_info(const struct partinfo *pi);
  61. struct partinfo *read_info(struct dpkg_ar *ar, struct partinfo *ir);
  62. void reassemble(struct partinfo **partlist, const char *outputfile);
  63. void mustgetpartinfo(const char *filename, struct partinfo *ri);
  64. void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
  65. #define SPLITVERSION "2.1"
  66. #define PARTSDIR "parts"
  67. #define PARTMAGIC "debian-split"
  68. #define HEADERALLOWANCE 1024
  69. #define SPLITPARTDEFMAX (450 * 1024)
  70. #endif /* DPKG_SPLIT_H */