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. *
  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 DPKG_SPLIT_H
  21. #define DPKG_SPLIT_H
  22. action_func do_split;
  23. action_func do_join;
  24. action_func do_info;
  25. action_func do_auto;
  26. action_func do_queue;
  27. action_func do_discard;
  28. struct partinfo {
  29. const char *filename;
  30. const char *fmtversion;
  31. const char *package;
  32. const char *version;
  33. const char *arch;
  34. const char *md5sum;
  35. off_t orglength;
  36. unsigned int thispartn, maxpartn;
  37. off_t maxpartlen;
  38. off_t thispartoffset;
  39. off_t thispartlen;
  40. /* Size of header in part file. */
  41. off_t headerlen;
  42. off_t filesize;
  43. };
  44. struct partqueue {
  45. struct partqueue *nextinqueue;
  46. /* Only fields filename, md5sum, maxpartlen, thispartn, maxpartn
  47. * are valid; the rest are NULL. If the file is not named correctly
  48. * to be a part file md5sum is NULL too and the numbers are zero. */
  49. struct partinfo info;
  50. };
  51. extern struct partqueue *queue;
  52. extern off_t opt_maxpartsize;
  53. extern const char *opt_depotdir;
  54. extern const char *opt_outputfile;
  55. extern int opt_npquiet;
  56. extern int opt_msdos;
  57. void rerreof(FILE *f, const char *fn) DPKG_ATTR_NORET;
  58. void print_info(const struct partinfo *pi);
  59. struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir);
  60. void scandepot(void);
  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 */