summaryrefslogtreecommitdiff
path: root/fpcsrc/packages/fcl-res/src/externaltypes.pp
blob: 8cb53dc131473f2f72c3c5a9ff88ff1a2eaa3202 (plain)
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
{
    This file is part of the Free Pascal run time library.
    Copyright (c) 2008 by Giulio Bernardi

    Types and constants used by external resource reader and writer

    See the file COPYING.FPC, included in this distribution,
    for details about the copyright.

    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.

 **********************************************************************}

unit externaltypes;

{$MODE OBJFPC} {$H+}

interface

type
  TExternalResMagic = array[1..6] of char;

type
  TExtHeader = packed record
    magic : TExternalResMagic;  //'FPCRES'
    version : byte;             //EXT_CURRENT_VERSION
    endianess : byte;           //EXT_ENDIAN_BIG or EXT_ENDIAN_LITTLE
    count : longword;           //resource count
    nodesize : longword;        //size of header (up to string table, excluded)
    hdrsize  : longword;        //size of header (up to string table, included)
    reserved1 : longword;
    reserved2 : longword;
    reserved3 : longword;
  end;

  TResInfoNode = packed record
    nameid : longword;          //name offset / integer ID / languageID
    ncount : longword;          //named sub-entries count
    idcountsize : longword;     //id sub-entries count / resource size
    subptr : longword;          //first sub-entry offset
  end;

const
  EXTERNAL_RESMAGIC : TExternalResMagic = 'FPCRES';
  
  EXT_CURRENT_VERSION = 1;
  
  EXT_ENDIAN_BIG = 1;
  EXT_ENDIAN_LITTLE = 2;


implementation

end.