utild1.inc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  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. type
  17. PClockData = ^TClockData;
  18. TClockData = packed record
  19. sec : Word;
  20. min : Word;
  21. hour : Word;
  22. mday : Word;
  23. month: Word;
  24. year : Word;
  25. wday : Word;
  26. end;
  27. { * utility.library tagitem defines
  28. *********************************************************************
  29. * }
  30. {type
  31. Tag = Cardinal;
  32. type
  33. PPTagItem = ^PTagItem;
  34. PTagItem = ^TTagItem;
  35. TTagItem = packed record
  36. ti_Tag : Tag;
  37. ti_Data: Cardinal;
  38. end;}
  39. const
  40. TAG_DONE = 0;
  41. TAG_END = 0;
  42. TAG_IGNORE = 1;
  43. TAG_MORE = 2;
  44. TAG_SKIP = 3;
  45. {const
  46. TAG_USER = 1 Shl 31;}
  47. const
  48. TAGFILTER_AND = 0;
  49. TAGFILTER_NOT = 1;
  50. const
  51. MAP_REMOVE_NOT_FOUND = 0;
  52. MAP_KEEP_NOT_FOUND = 1;
  53. { * utility.library namespace defines
  54. *********************************************************************
  55. * }
  56. type
  57. PNamedObject = ^TNamedObject;
  58. TNamedObject = packed record
  59. no_Object: Pointer;
  60. end;
  61. const
  62. ANO_NameSpace = 4000;
  63. ANO_UserSpace = 4001;
  64. ANO_Priority = 4002;
  65. ANO_Flags = 4003;
  66. NSB_NODUPS = 0;
  67. NSB_CASE = 1;
  68. NSF_NODUPS = 1 Shl NSB_NODUPS;
  69. NSF_CASE = 1 Shl NSB_CASE;
  70. { * utility.library pack attributes and macros
  71. *********************************************************************
  72. * }
  73. const
  74. PSTB_SIGNED = 31;
  75. PSTB_UNPACK = 30;
  76. PSTB_PACK = 29;
  77. PSTB_EXISTS = 26;
  78. PSTF_SIGNED = (1 Shl PSTB_SIGNED);
  79. PSTF_UNPACK = (1 Shl PSTB_UNPACK);
  80. PSTF_PACK = (1 Shl PSTB_PACK);
  81. PSTF_EXISTS = (1 Shl PSTB_EXISTS);
  82. const
  83. PKCTRL_PACKUNPACK = $00000000;
  84. PKCTRL_PACKONLY = $40000000;
  85. PKCTRL_UNPACKONLY = $20000000;
  86. PKCTRL_BYTE = $80000000;
  87. PKCTRL_WORD = $88000000;
  88. PKCTRL_LONG = $90000000;
  89. PKCTRL_UBYTE = $00000000;
  90. PKCTRL_UWORD = $08000000;
  91. PKCTRL_ULONG = $10000000;
  92. PKCTRL_BIT = $18000000;
  93. PKCTRL_FLIPBIT = $98000000;
  94. {$WARNING FIX ME!!! Some macros to convert}
  95. {
  96. 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)
  97. PK_BITNUM2(flg) ((flg < 0x100 ? PK_BITNUM1(flg) : 8 + PK_BITNUM1(flg >> 8)))
  98. PK_BITNUM(flg) ((flg < 0x10000 ? PK_BITNUM2(flg) : 16 + PK_BITNUM2(flg >> 16)))
  99. PK_WORDOFFSET(flg) ((flg) < 0x100 ? 1 : 0)
  100. PK_LONGOFFSET(flg) ((flg) < 0x100 ? 3 : (flg) < 0x10000 ? 2 : (flg) < 0x1000000 ? 1 : 0)
  101. PK_CALCOFFSET(type,field) ((ULONG)(&((struct type *)0)->field))
  102. PACK_STARTTABLE(tagbase) (tagbase)
  103. PACK_NEWOFFSET(tagbase) (-1L),(tagbase)
  104. PACK_ENDTABLE 0
  105. PACK_ENTRY(tagbase,tag,type,field,control) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field))
  106. PACK_BYTEBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | PK_CALCOFFSET(type,field) | (PK_BITNUM(flags) << 13L))
  107. PACK_WORDBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_WORDOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
  108. PACK_LONGBIT(tagbase,tag,type,field,control,flags) (control | ((tag-tagbase) << 16L) | (PK_CALCOFFSET(type,field) + PK_LONGOFFSET(flags)) | ((PK_BITNUM(flags) & 7) << 13L))
  109. }