SL_FILE.H 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. /* Catacomb Apocalypse Source Code
  2. * Copyright (C) 1993-2014 Flat Rock Software
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation; either version 2 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License along
  15. * with this program; if not, write to the Free Software Foundation, Inc.,
  16. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
  17. */
  18. #ifndef _SL_FILE_H
  19. #define _SL_FILE_H
  20. //==========================================================================
  21. //
  22. // DEFINES
  23. //
  24. //==========================================================================
  25. #ifndef MakeID
  26. #define MakeID(a,b,c,d) (((long)(d)<<24L)|((long)(c)<<16L)|((long)(b)<<8L)|(long)(a))
  27. #endif
  28. #define ID_SLIB MakeID('S','L','I','B')
  29. #define SLIB ("SLIB")
  30. #define SOFTLIB_VER 2
  31. #define ID_CHUNK MakeID('C','U','N','K')
  32. //==========================================================================
  33. //
  34. // TYPES
  35. //
  36. //==========================================================================
  37. //--------------------------------------------------------------------------
  38. // SOFTLIB File Entry Types
  39. //--------------------------------------------------------------------------
  40. typedef enum LibFileTypes
  41. {
  42. lib_DATA =0, // Just streight raw data
  43. // lib_AUDIO, // Multi chunk audio file
  44. } LibFileTypes;
  45. //--------------------------------------------------------------------------
  46. // SOFTLIB Library File header..
  47. //
  48. // * This header will NEVER change! *
  49. //--------------------------------------------------------------------------
  50. typedef struct SoftLibHdr
  51. {
  52. unsigned Version; // Library Version Num
  53. unsigned FileCount;
  54. } SoftlibHdr;
  55. //--------------------------------------------------------------------------
  56. // SOFTLIB Directory Entry Hdr
  57. //
  58. // This can change according to Version of SoftLib (Make sure we are
  59. // always downward compatable!
  60. //--------------------------------------------------------------------------
  61. #define SL_FILENAMESIZE 16
  62. typedef struct FileEntryHdr
  63. {
  64. char FileName[SL_FILENAMESIZE]; // NOTE : May not be null terminated!
  65. unsigned long Offset;
  66. unsigned long ChunkLen;
  67. unsigned long OrginalLength;
  68. short Compression; // ct_TYPES
  69. } FileEntryHdr;
  70. //--------------------------------------------------------------------------
  71. // SOFTLIB Entry Chunk Header
  72. //--------------------------------------------------------------------------
  73. typedef struct ChunkHeader
  74. {
  75. unsigned long HeaderID;
  76. unsigned long OrginalLength;
  77. short Compression; // ct_TYPES
  78. } ChunkHeader;
  79. #endif