dpkg-split.h 2.4 KB

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