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