rpm.h 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. /* vi: set sw=4 ts=4: */
  2. /*
  3. * RPM structs and consts
  4. *
  5. * Copyright (C) 2001 by Laurence Anderson
  6. *
  7. * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  8. */
  9. /* RPM file starts with this struct: */
  10. struct rpm_lead {
  11. uint32_t magic;
  12. uint8_t major, minor;
  13. uint16_t type;
  14. uint16_t archnum;
  15. char name[66];
  16. uint16_t osnum;
  17. uint16_t signature_type;
  18. char reserved[16];
  19. };
  20. struct BUG_rpm_lead {
  21. char bug[sizeof(struct rpm_lead) == 96 ? 1 : -1];
  22. };
  23. #define RPM_LEAD_MAGIC 0xedabeedb
  24. #define RPM_LEAD_MAGIC_STR "\355\253\356\333"
  25. /* Then follows the header: */
  26. struct rpm_header {
  27. uint32_t magic_and_ver; /* 3 byte magic: 0x8e 0xad 0xe8; 1 byte version: 0x01 */
  28. uint32_t reserved; /* 4 bytes reserved */
  29. uint32_t entries; /* Number of entries in header (4 bytes) */
  30. uint32_t size; /* Size of store (4 bytes) */
  31. };
  32. struct BUG_rpm_header {
  33. char bug[sizeof(struct rpm_header) == 16 ? 1 : -1];
  34. };
  35. #define RPM_HEADER_MAGICnVER 0x8eade801
  36. #define RPM_HEADER_MAGIC_STR "\216\255\350"