utild1.inc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154
  1. {
  2. This file is part of the Free Pascal run time library.
  3. utility definitions (V50) for MorphOS/PowerPC
  4. Copyright (c) 2002 The MorphOS Development Team, All Rights Reserved.
  5. Free Pascal conversion, first part
  6. Copyright (c) 2004 Karoly Balogh for Genesi S.a.r.l. <www.genesi.lu>
  7. See the file COPYING.FPC, included in this distribution,
  8. for details about the copyright.
  9. This program is distributed in the hope that it will be useful,
  10. but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  12. **********************************************************************}
  13. { * utility.library date defines
  14. *********************************************************************
  15. * }
  16. {$PACKRECORDS 2}
  17. type
  18. PClockData = ^TClockData;
  19. TClockData = record
  20. sec : Word;
  21. min : Word;
  22. hour : Word;
  23. mday : Word;
  24. month: Word;
  25. year : Word;
  26. wday : Word;
  27. end;
  28. { * utility.library tagitem defines
  29. *********************************************************************
  30. * }
  31. type
  32. Tag = Cardinal;
  33. type
  34. PPTagItem = ^PTagItem;
  35. PTagItem = ^TTagItem;
  36. TTagItem = record
  37. ti_Tag : Tag;
  38. ti_Data: Cardinal;
  39. end;
  40. const
  41. TAG_DONE = 0;
  42. TAG_END = 0;
  43. TAG_IGNORE = 1;
  44. TAG_MORE = 2;
  45. TAG_SKIP = 3;
  46. const
  47. TAG_USER = 1 Shl 31;
  48. const
  49. TAGFILTER_AND = 0;
  50. TAGFILTER_NOT = 1;
  51. const
  52. MAP_REMOVE_NOT_FOUND = 0;
  53. MAP_KEEP_NOT_FOUND = 1;
  54. { * utility.library namespace defines
  55. *********************************************************************
  56. * }
  57. type
  58. PNamedObject = ^TNamedObject;
  59. TNamedObject = record
  60. no_Object: Pointer;
  61. end;
  62. const
  63. ANO_NameSpace = 4000;
  64. ANO_UserSpace = 4001;
  65. ANO_Priority = 4002;
  66. ANO_Flags = 4003;
  67. NSB_NODUPS = 0;
  68. NSB_CASE = 1;
  69. NSF_NODUPS = 1 Shl NSB_NODUPS;
  70. NSF_CASE = 1 Shl NSB_CASE;
  71. { * utility.library pack attributes and macros
  72. *********************************************************************
  73. * }
  74. const
  75. PSTB_SIGNED = 31;
  76. PSTB_UNPACK = 30;
  77. PSTB_PACK = 29;
  78. PSTB_EXISTS = 26;
  79. PSTF_SIGNED = (1 Shl PSTB_SIGNED);
  80. PSTF_UNPACK = (1 Shl PSTB_UNPACK);
  81. PSTF_PACK = (1 Shl PSTB_PACK);
  82. PSTF_EXISTS = (1 Shl PSTB_EXISTS);
  83. const
  84. PKCTRL_PACKUNPACK = $00000000;
  85. PKCTRL_PACKONLY = $40000000;
  86. PKCTRL_UNPACKONLY = $20000000;
  87. PKCTRL_BYTE = $80000000;
  88. PKCTRL_WORD = $88000000;
  89. PKCTRL_LONG = $90000000;
  90. PKCTRL_UBYTE = $00000000;
  91. PKCTRL_UWORD = $08000000;
  92. PKCTRL_ULONG = $10000000;
  93. PKCTRL_BIT = $18000000;
  94. PKCTRL_FLIPBIT = $98000000;
  95. {$WARNING FIX ME!!! Some macros to convert}
  96. {
  97. 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)
  98. PK_BITNUM2(flg) ((flg < 0x100 ? PK_BITNUM1(flg) : 8 + PK_BITNUM1(flg >> 8)))
  99. PK_BITNUM(flg) ((flg < 0x10000 ? PK_BITNUM2(flg) : 16 + PK_BITNUM2(flg >> 16)))
  100. PK_WORDOFFSET(flg) ((flg) < 0x100 ? 1 : 0)
  101. PK_LONGOFFSET(flg) ((flg) < 0x100 ? 3 : (flg) < 0x10000 ? 2 : (flg) < 0x1000000 ? 1 : 0)
  102. PK_CALCOFFSET(type,field) ((ULONG)(&((struct type *)0)->field))
  103. PACK_STARTTABLE(tagbase) (tagbase)
  104. PACK_NEWOFFSET(tagbase) (-1L),(tagbase)
  105. PACK_ENDTABLE 0
  106. PACK_ENTRY(tagbase,tag,type,field,control) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field))
  107. PACK_BYTEBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field) | (PK_BITNUM(flags) << 13L))
  108. PACK_WORDBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_WORDOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
  109. PACK_LONGBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_LONGOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
  110. }