1{ 2 This file is part of the Free Pascal run time library. 3 4 utility definitions (V50) for MorphOS/PowerPC 5 Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved. 6 7 Free Pascal conversion, first part 8 Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu> 9 10 See the file COPYING.FPC, included in this distribution, 11 for details about the copyright. 12 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. 16 17 **********************************************************************} 18 19 20{ * utility.library date defines 21 ********************************************************************* 22 * } 23 24 25type 26 PClockData = ^TClockData; 27 TClockData = packed record 28 sec : Word; 29 min : Word; 30 hour : Word; 31 mday : Word; 32 month: Word; 33 year : Word; 34 wday : Word; 35 end; 36 37 38 39{ * utility.library tagitem defines 40 ********************************************************************* 41 * } 42 43 44type 45 Tag = Cardinal; 46 47type 48 PPTagItem = ^PTagItem; 49 PTagItem = ^TTagItem; 50 TTagItem = packed record 51 ti_Tag : Tag; 52 ti_Data: Cardinal; 53 end; 54 55 56const 57 TAG_DONE = 0; 58 TAG_END = 0; 59 TAG_IGNORE = 1; 60 TAG_MORE = 2; 61 TAG_SKIP = 3; 62 63const 64 TAG_USER = 1 Shl 31; 65 66const 67 TAGFILTER_AND = 0; 68 TAGFILTER_NOT = 1; 69 70const 71 MAP_REMOVE_NOT_FOUND = 0; 72 MAP_KEEP_NOT_FOUND = 1; 73 74 75 76{ * utility.library namespace defines 77 ********************************************************************* 78 * } 79 80 81type 82 PNamedObject = ^TNamedObject; 83 TNamedObject = packed record 84 no_Object: Pointer; 85 end; 86 87 88const 89 ANO_NameSpace = 4000; 90 ANO_UserSpace = 4001; 91 ANO_Priority = 4002; 92 ANO_Flags = 4003; 93 94 NSB_NODUPS = 0; 95 NSB_CASE = 1; 96 97 NSF_NODUPS = 1 Shl NSB_NODUPS; 98 NSF_CASE = 1 Shl NSB_CASE; 99 100 101 102{ * utility.library pack attributes and macros 103 ********************************************************************* 104 * } 105 106 107const 108 PSTB_SIGNED = 31; 109 PSTB_UNPACK = 30; 110 PSTB_PACK = 29; 111 PSTB_EXISTS = 26; 112 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); 117 118const 119 PKCTRL_PACKUNPACK = $00000000; 120 PKCTRL_PACKONLY = $40000000; 121 PKCTRL_UNPACKONLY = $20000000; 122 123 PKCTRL_BYTE = $80000000; 124 PKCTRL_WORD = $88000000; 125 PKCTRL_LONG = $90000000; 126 127 PKCTRL_UBYTE = $00000000; 128 PKCTRL_UWORD = $08000000; 129 PKCTRL_ULONG = $10000000; 130 131 PKCTRL_BIT = $18000000; 132 PKCTRL_FLIPBIT = $98000000; 133 134{$WARNING FIX ME!!! Some macros to convert} 135{ 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)) 142 143 144 PACK_STARTTABLE(tagbase) (tagbase) 145 PACK_NEWOFFSET(tagbase) (-1L),(tagbase) 146 PACK_ENDTABLE 0 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)) 151} 152 153 154