MIXFILE.H 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. /*
  2. ** Command & Conquer Red Alert(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #ifndef VQMMIXFILE_H
  19. #define VQMMIXFILE_H
  20. /****************************************************************************
  21. *
  22. * C O N F I D E N T I A L -- W E S T W O O D S T U D I O S
  23. *
  24. *----------------------------------------------------------------------------
  25. *
  26. * FILE
  27. * mixfile.h
  28. *
  29. * DESCRIPTION
  30. * A mix file is basically a group of files concatinated together
  31. * proceeded by a header describing where in the file each individual
  32. * entry is located. These definitions are provided to simplify the access
  33. * to these file entries.
  34. *
  35. * PROGRAMMER
  36. * Denzil E. Long, Jr.
  37. *
  38. * DATE
  39. * January 26, 1995
  40. *
  41. ****************************************************************************/
  42. /* Disable structure alignment.*/
  43. #ifdef __WATCOMC__
  44. #pragma pack(1);
  45. #endif
  46. /*---------------------------------------------------------------------------
  47. * STRUCTURE DEFINITIONS
  48. *-------------------------------------------------------------------------*/
  49. /* MIXHeader: Mix file data header.
  50. *
  51. * Count - Number of entries contained in this mix file.
  52. * Size - Size of Mix file.
  53. */
  54. typedef struct _MIXHeader {
  55. short Count;
  56. long Size;
  57. } MIXHeader;
  58. /* MIXSubBlock: Mix file entry descriptor.
  59. *
  60. * CRC - Unique entry identifier.
  61. * Offset - Offset from beginning of data segment to entry.
  62. * Size - Size of entry.
  63. */
  64. typedef struct _MIXSubBlock {
  65. long CRC;
  66. long Offset;
  67. long Size;
  68. } MIXSubBlock;
  69. /* MIXHandle: Mix file handle.
  70. *
  71. * Name - Pointer to the name of the mix file this handle is for.
  72. * Size - Size of entire mix file.
  73. * FH - DOS file handle of opened entry.
  74. * Count - Number of files contained in this mix.
  75. * Entries - Array of 'Count' MIXSubBlock structure entries.
  76. */
  77. typedef struct _MIXHandle {
  78. char *Name;
  79. long Size;
  80. long FH;
  81. long Count;
  82. MIXSubBlock Entries[];
  83. } MIXHandle;
  84. /*---------------------------------------------------------------------------
  85. * PROTOTYPES
  86. *-------------------------------------------------------------------------*/
  87. MIXHandle *OpenMix(char *name);
  88. void CloseMix(MIXHandle *mix);
  89. long OpenMixEntry(MIXHandle *mix, char *name);
  90. /* Restore original alignment */
  91. #ifdef __WATCOMC__
  92. #pragma pack();
  93. #endif
  94. #endif /* VQMMIXFILE_H */