dpkg-split.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  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@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
  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 NONRETURNING;
  25. dofunction do_join, do_info, do_auto, do_queue, do_discard;
  26. struct partinfo {
  27. const char *filename;
  28. const char *fmtversion;
  29. const char *package;
  30. const char *version;
  31. const char *md5sum;
  32. unsigned long orglength;
  33. unsigned int thispartn, maxpartn;
  34. unsigned long maxpartlen;
  35. unsigned long thispartoffset;
  36. size_t thispartlen;
  37. size_t headerlen; /* size of header in part file */
  38. off_t filesize;
  39. };
  40. struct partqueue {
  41. struct partqueue *nextinqueue;
  42. struct partinfo info;
  43. /* only fields filename, md5sum, maxpartlen, thispartn, maxpartn
  44. * are valid; the rest are null. If the file is not named correctly
  45. * to be a part file md5sum is null too and the numbers are zero.
  46. */
  47. };
  48. extern dofunction *action;
  49. extern const struct cmdinfo *cipaction;
  50. extern long maxpartsize;
  51. extern const char *depotdir, *outputfile;
  52. extern struct partqueue *queue;
  53. extern int npquiet, msdos;
  54. void rerr(const char *fn) NONRETURNING;
  55. void rerreof(FILE *f, const char *fn) NONRETURNING;
  56. void print_info(const struct partinfo *pi);
  57. struct partinfo *read_info(FILE *partfile, const char *fn, struct partinfo *ir);
  58. void scandepot(void);
  59. void reassemble(struct partinfo **partlist, const char *outputfile);
  60. void mustgetpartinfo(const char *filename, struct partinfo *ri);
  61. void addtopartlist(struct partinfo**, struct partinfo*, struct partinfo *refi);
  62. #define PARTMAGIC "!<arch>\ndebian-split "
  63. #define HEADERALLOWANCE 1024
  64. #endif /* DPKG_SPLIT_H */