dpkg-split.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. /*
  2. * dpkg-split - splitting and joining of multipart *.deb archives
  3. * dpkg-split.h - external definitions for this program
  4. *
  5. * Copyright (C) 1995 Ian Jackson <ian.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
  9. * published by the Free Software Foundation; either version 2,
  10. * or (at your option) any later version.
  11. *
  12. * This is distributed in the hope that it will be useful, but
  13. * 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
  18. * License along with dpkg; if not, write to the Free Software
  19. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  20. */
  21. #ifndef DPKG_SPLIT_H
  22. #define DPKG_SPLIT_H
  23. typedef void dofunction(const char *const *argv);
  24. dofunction do_split, do_join, do_info, do_auto, do_queue, do_discard;
  25. struct partinfo {
  26. const char *filename;
  27. const char *fmtversion;
  28. const char *package;
  29. const char *version;
  30. const char *md5sum;
  31. unsigned long orglength;
  32. unsigned int thispartn, maxpartn;
  33. unsigned long maxpartlen;
  34. unsigned long thispartoffset;
  35. size_t thispartlen;
  36. size_t headerlen; /* size of header in part file */
  37. off_t filesize;
  38. };
  39. struct partqueue {
  40. struct partqueue *nextinqueue;
  41. struct partinfo info;
  42. /* only fields filename, md5sum, maxpartlen, thispartn, maxpartn
  43. * are valid; the rest are null. If the file is not named correctly
  44. * to be a part file md5sum is null too and the numbers are zero.
  45. */
  46. };
  47. extern dofunction *action;
  48. extern const struct cmdinfo *cipaction;
  49. extern long maxpartsize;
  50. extern const char *depotdir, *outputfile;
  51. extern struct partqueue *queue;
  52. extern int npquiet, msdos;
  53. void rerr(const char *fn) NONRETURNING;
  54. void rerreof(FILE *f, const char *fn) NONRETURNING;
  55. void print_info(const struct partinfo *pi);
  56. struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir);
  57. void scandepot(void);
  58. void reassemble(struct partinfo **partlist, const char *outputfile);
  59. void mustgetpartinfo(const char *filename, struct partinfo *ri);
  60. void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
  61. #define PARTMAGIC "!<arch>\ndebian-split "
  62. #define HEADERALLOWANCE 1024
  63. #endif /* DPKG_SPLIT_H */