2
This file is part of the Free Pascal run time library.
4
utility definitions (V50) for MorphOS/PowerPC
5
Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
7
Free Pascal conversion, first part
8
Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
10
See the file COPYING.FPC, included in this distribution,
11
for details about the copyright.
13
This program is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17
**********************************************************************}
20
{ * utility.library date defines
21
*********************************************************************
26
PClockData = ^TClockData;
27
TClockData = packed record
39
{ * utility.library tagitem defines
40
*********************************************************************
48
PPTagItem = ^PTagItem;
50
TTagItem = packed record
71
MAP_REMOVE_NOT_FOUND = 0;
72
MAP_KEEP_NOT_FOUND = 1;
76
{ * utility.library namespace defines
77
*********************************************************************
82
PNamedObject = ^TNamedObject;
83
TNamedObject = packed record
97
NSF_NODUPS = 1 Shl NSB_NODUPS;
98
NSF_CASE = 1 Shl NSB_CASE;
102
{ * utility.library pack attributes and macros
103
*********************************************************************
113
PSTF_SIGNED = (1 Shl PSTB_SIGNED);
114
PSTF_UNPACK = (1 Shl PSTB_UNPACK);
115
PSTF_PACK = (1 Shl PSTB_PACK);
116
PSTF_EXISTS = (1 Shl PSTB_EXISTS);
119
PKCTRL_PACKUNPACK = $00000000;
120
PKCTRL_PACKONLY = $40000000;
121
PKCTRL_UNPACKONLY = $20000000;
123
PKCTRL_BYTE = $80000000;
124
PKCTRL_WORD = $88000000;
125
PKCTRL_LONG = $90000000;
127
PKCTRL_UBYTE = $00000000;
128
PKCTRL_UWORD = $08000000;
129
PKCTRL_ULONG = $10000000;
131
PKCTRL_BIT = $18000000;
132
PKCTRL_FLIPBIT = $98000000;
134
{$WARNING FIX ME!!! Some macros to convert}
136
PK_BITNUM1(flg) ((flg) == 0x01 ? 0 : (flg) == 0x02 ? 1 : (flg) == 0x04 ? 2 : (flg) == 0x08 ? 3 : (flg) == 0x10 ? 4 : (flg) == 0x20 ? 5 : (flg) == 0x40 ? 6 : 7)
137
PK_BITNUM2(flg) ((flg < 0x100 ? PK_BITNUM1(flg) : 8 + PK_BITNUM1(flg >> 8)))
138
PK_BITNUM(flg) ((flg < 0x10000 ? PK_BITNUM2(flg) : 16 + PK_BITNUM2(flg >> 16)))
139
PK_WORDOFFSET(flg) ((flg) < 0x100 ? 1 : 0)
140
PK_LONGOFFSET(flg) ((flg) < 0x100 ? 3 : (flg) < 0x10000 ? 2 : (flg) < 0x1000000 ? 1 : 0)
141
PK_CALCOFFSET(type,field) ((ULONG)(&((struct type *)0)->field))
144
PACK_STARTTABLE(tagbase) (tagbase)
145
PACK_NEWOFFSET(tagbase) (-1L),(tagbase)
147
PACK_ENTRY(tagbase,tag,type,field,control) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field))
148
PACK_BYTEBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field) | (PK_BITNUM(flags) << 13L))
149
PACK_WORDBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_WORDOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
150
PACK_LONGBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_LONGOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))