dpkg-split.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  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 <ian@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/deb-version.h>
  24. action_func do_split;
  25. action_func do_join;
  26. action_func do_info;
  27. action_func do_auto;
  28. action_func do_queue;
  29. action_func do_discard;
  30. struct partinfo {
  31. struct deb_version fmtversion;
  32. const char *filename;
  33. const char *package;
  34. const char *version;
  35. const char *arch;
  36. const char *md5sum;
  37. off_t orglength;
  38. unsigned int thispartn, maxpartn;
  39. off_t maxpartlen;
  40. off_t thispartoffset;
  41. off_t thispartlen;
  42. /** Size of header in part file. */
  43. off_t headerlen;
  44. off_t filesize;
  45. };
  46. struct partqueue {
  47. struct partqueue *nextinqueue;
  48. /** Only fields filename, md5sum, maxpartlen, thispartn, maxpartn
  49. * are valid; the rest are NULL. If the file is not named correctly
  50. * to be a part file md5sum is NULL too and the numbers are zero. */
  51. struct partinfo info;
  52. };
  53. extern off_t opt_maxpartsize;
  54. extern const char *opt_depotdir;
  55. extern const char *opt_outputfile;
  56. extern int opt_npquiet;
  57. extern int opt_msdos;
  58. void rerreof(FILE *f, const char *fn) DPKG_ATTR_NORET;
  59. void print_info(const struct partinfo *pi);
  60. struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir);
  61. void reassemble(struct partinfo **partlist, const char *outputfile);
  62. void mustgetpartinfo(const char *filename, struct partinfo *ri);
  63. void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
  64. #define SPLITVERSION "2.1"
  65. #define PARTSDIR "parts"
  66. #define PARTMAGIC "debian-split"
  67. #define HEADERALLOWANCE 1024
  68. #define SPLITPARTDEFMAX (450 * 1024)
  69. #endif /* DPKG_SPLIT_H */