tbx  0.7.6
resstruct.h
1 /*
2  * tbx RISC OS toolbox library
3  *
4  * Copyright (C) 2010 Alan Buckley All Rights Reserved.
5  *
6  * Permission is hereby granted, free of charge, to any person obtaining a
7  * copy of this software and associated documentation files (the "Software"),
8  * to deal in the Software without restriction, including without limitation
9  * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10  * and/or sell copies of the Software, and to permit persons to whom the
11  * Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included
14  * in all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22  * THE SOFTWARE.
23  */
24 
25 #ifndef TBX_RES_RESSTRUCT_H_
26 #define TBX_RES_RESSTRUCT_H_
27 
28 #include "resobject.h"
29 
30 namespace tbx
31 {
32 
33 namespace res
34 {
35 
36 // Low level structure for dealing with resources files
37 const int RESF_MARKER = 0x46534552;// 'RESF'
38 
43 {
44  int file_id;
45  unsigned int version;
47 };
48 
53 {
57 };
58 
59 
64 {
68  enum Type {STRING_REF = 1, MESSAGE_REF, SPRITE_AREA_REF, OBJECT_REF};
69  int offset;
71 };
72 
77 {
78  int class_id;
79  int flags;
80  int version;
81  char name[12];
82  int total_size;
83  char *body;
84  int body_size;
85 };
86 
87 
88 }
89 }
90 
91 #endif
tbx::res::ResObjectHeader::total_size
int total_size
Total size of object including tables.
Definition: resstruct.h:82
tbx::res::ResObjectHeader::body_size
int body_size
Size of header and body only.
Definition: resstruct.h:84
tbx
A library for creating RISC OS toolbox applications.
Definition: abouttobeshownlistener.cc:35
tbx::res::ResFileHeader::file_id
int file_id
Magic number should be RESF_MARKER.
Definition: resstruct.h:44
tbx::res::ResObjectHeader::version
int version
version * 100
Definition: resstruct.h:80
tbx::res::ResObjectHeader
Common header for all resource objects.
Definition: resstruct.h:77
tbx::res::ResObjectHeader::name
char name[12]
Null terminated name.
Definition: resstruct.h:81
tbx::res::ResRelocation::Type
Type
Relocation type enumeration.
Definition: resstruct.h:68
tbx::res::ResFileHeader::object_offset
int object_offset
Offset to first object in the file or -1 for no objects.
Definition: resstruct.h:46
tbx::res::ResDataHeader::string_table_offset
int string_table_offset
Offset to string table.
Definition: resstruct.h:54
tbx::res::ResRelocation::type
Type type
Type of relocation.
Definition: resstruct.h:70
tbx::res::ResFileHeader::version
unsigned int version
Version number * 100.
Definition: resstruct.h:45
tbx::res::ResDataHeader::relocations_table_offset
int relocations_table_offset
Offset to relocations table.
Definition: resstruct.h:56
tbx::res::ResObjectHeader::flags
int flags
flags
Definition: resstruct.h:79
tbx::res::ResObjectHeader::class_id
int class_id
Object class.
Definition: resstruct.h:78
tbx::res::ResDataHeader::messages_table_offset
int messages_table_offset
Offset to messages table.
Definition: resstruct.h:55
tbx::res::ResFileHeader
Structure representing the header of a resource file.
Definition: resstruct.h:43
tbx::res::ResDataHeader
This structure proceeds a resource object in a file to give its data.
Definition: resstruct.h:53
tbx::res::ResRelocation
Structure for one relocation record.
Definition: resstruct.h:64
tbx::res::ResRelocation::offset
int offset
Offset in object to relocation.
Definition: resstruct.h:69
tbx::res::ResObjectHeader::body
char * body
Pointer to body.
Definition: resstruct.h:83