CFBitVector.pas 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237
  1. { CFBitVector.h
  2. Copyright (c) 1998-2013, Apple Inc. All rights reserved.
  3. }
  4. {
  5. Modified for use with Free Pascal
  6. Version 308
  7. Please report any bugs to <[email protected]>
  8. }
  9. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  10. {$mode macpas}
  11. {$packenum 1}
  12. {$macro on}
  13. {$inline on}
  14. {$calling mwpascal}
  15. unit CFBitVector;
  16. interface
  17. {$setc UNIVERSAL_INTERFACES_VERSION := $0400}
  18. {$setc GAP_INTERFACES_VERSION := $0308}
  19. {$ifc not defined USE_CFSTR_CONSTANT_MACROS}
  20. {$setc USE_CFSTR_CONSTANT_MACROS := TRUE}
  21. {$endc}
  22. {$ifc defined CPUPOWERPC and defined CPUI386}
  23. {$error Conflicting initial definitions for CPUPOWERPC and CPUI386}
  24. {$endc}
  25. {$ifc defined FPC_BIG_ENDIAN and defined FPC_LITTLE_ENDIAN}
  26. {$error Conflicting initial definitions for FPC_BIG_ENDIAN and FPC_LITTLE_ENDIAN}
  27. {$endc}
  28. {$ifc not defined __ppc__ and defined CPUPOWERPC32}
  29. {$setc __ppc__ := 1}
  30. {$elsec}
  31. {$setc __ppc__ := 0}
  32. {$endc}
  33. {$ifc not defined __ppc64__ and defined CPUPOWERPC64}
  34. {$setc __ppc64__ := 1}
  35. {$elsec}
  36. {$setc __ppc64__ := 0}
  37. {$endc}
  38. {$ifc not defined __i386__ and defined CPUI386}
  39. {$setc __i386__ := 1}
  40. {$elsec}
  41. {$setc __i386__ := 0}
  42. {$endc}
  43. {$ifc not defined __x86_64__ and defined CPUX86_64}
  44. {$setc __x86_64__ := 1}
  45. {$elsec}
  46. {$setc __x86_64__ := 0}
  47. {$endc}
  48. {$ifc not defined __arm__ and defined CPUARM}
  49. {$setc __arm__ := 1}
  50. {$elsec}
  51. {$setc __arm__ := 0}
  52. {$endc}
  53. {$ifc not defined __arm64__ and defined CPUAARCH64}
  54. {$setc __arm64__ := 1}
  55. {$elsec}
  56. {$setc __arm64__ := 0}
  57. {$endc}
  58. {$ifc defined cpu64}
  59. {$setc __LP64__ := 1}
  60. {$elsec}
  61. {$setc __LP64__ := 0}
  62. {$endc}
  63. {$ifc defined __ppc__ and __ppc__ and defined __i386__ and __i386__}
  64. {$error Conflicting definitions for __ppc__ and __i386__}
  65. {$endc}
  66. {$ifc defined __ppc__ and __ppc__}
  67. {$setc TARGET_CPU_PPC := TRUE}
  68. {$setc TARGET_CPU_PPC64 := FALSE}
  69. {$setc TARGET_CPU_X86 := FALSE}
  70. {$setc TARGET_CPU_X86_64 := FALSE}
  71. {$setc TARGET_CPU_ARM := FALSE}
  72. {$setc TARGET_CPU_ARM64 := FALSE}
  73. {$setc TARGET_OS_MAC := TRUE}
  74. {$setc TARGET_OS_IPHONE := FALSE}
  75. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  76. {$setc TARGET_OS_EMBEDDED := FALSE}
  77. {$elifc defined __ppc64__ and __ppc64__}
  78. {$setc TARGET_CPU_PPC := FALSE}
  79. {$setc TARGET_CPU_PPC64 := TRUE}
  80. {$setc TARGET_CPU_X86 := FALSE}
  81. {$setc TARGET_CPU_X86_64 := FALSE}
  82. {$setc TARGET_CPU_ARM := FALSE}
  83. {$setc TARGET_CPU_ARM64 := FALSE}
  84. {$setc TARGET_OS_MAC := TRUE}
  85. {$setc TARGET_OS_IPHONE := FALSE}
  86. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  87. {$setc TARGET_OS_EMBEDDED := FALSE}
  88. {$elifc defined __i386__ and __i386__}
  89. {$setc TARGET_CPU_PPC := FALSE}
  90. {$setc TARGET_CPU_PPC64 := FALSE}
  91. {$setc TARGET_CPU_X86 := TRUE}
  92. {$setc TARGET_CPU_X86_64 := FALSE}
  93. {$setc TARGET_CPU_ARM := FALSE}
  94. {$setc TARGET_CPU_ARM64 := FALSE}
  95. {$ifc defined(iphonesim)}
  96. {$setc TARGET_OS_MAC := FALSE}
  97. {$setc TARGET_OS_IPHONE := TRUE}
  98. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  99. {$elsec}
  100. {$setc TARGET_OS_MAC := TRUE}
  101. {$setc TARGET_OS_IPHONE := FALSE}
  102. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  103. {$endc}
  104. {$setc TARGET_OS_EMBEDDED := FALSE}
  105. {$elifc defined __x86_64__ and __x86_64__}
  106. {$setc TARGET_CPU_PPC := FALSE}
  107. {$setc TARGET_CPU_PPC64 := FALSE}
  108. {$setc TARGET_CPU_X86 := FALSE}
  109. {$setc TARGET_CPU_X86_64 := TRUE}
  110. {$setc TARGET_CPU_ARM := FALSE}
  111. {$setc TARGET_CPU_ARM64 := FALSE}
  112. {$ifc defined(iphonesim)}
  113. {$setc TARGET_OS_MAC := FALSE}
  114. {$setc TARGET_OS_IPHONE := TRUE}
  115. {$setc TARGET_IPHONE_SIMULATOR := TRUE}
  116. {$elsec}
  117. {$setc TARGET_OS_MAC := TRUE}
  118. {$setc TARGET_OS_IPHONE := FALSE}
  119. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  120. {$endc}
  121. {$setc TARGET_OS_EMBEDDED := FALSE}
  122. {$elifc defined __arm__ and __arm__}
  123. {$setc TARGET_CPU_PPC := FALSE}
  124. {$setc TARGET_CPU_PPC64 := FALSE}
  125. {$setc TARGET_CPU_X86 := FALSE}
  126. {$setc TARGET_CPU_X86_64 := FALSE}
  127. {$setc TARGET_CPU_ARM := TRUE}
  128. {$setc TARGET_CPU_ARM64 := FALSE}
  129. { will require compiler define when/if other Apple devices with ARM cpus ship }
  130. {$setc TARGET_OS_MAC := FALSE}
  131. {$setc TARGET_OS_IPHONE := TRUE}
  132. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  133. {$setc TARGET_OS_EMBEDDED := TRUE}
  134. {$elifc defined __arm64__ and __arm64__}
  135. {$setc TARGET_CPU_PPC := FALSE}
  136. {$setc TARGET_CPU_PPC64 := FALSE}
  137. {$setc TARGET_CPU_X86 := FALSE}
  138. {$setc TARGET_CPU_X86_64 := FALSE}
  139. {$setc TARGET_CPU_ARM := FALSE}
  140. {$setc TARGET_CPU_ARM64 := TRUE}
  141. { will require compiler define when/if other Apple devices with ARM cpus ship }
  142. {$setc TARGET_OS_MAC := FALSE}
  143. {$setc TARGET_OS_IPHONE := TRUE}
  144. {$setc TARGET_IPHONE_SIMULATOR := FALSE}
  145. {$setc TARGET_OS_EMBEDDED := TRUE}
  146. {$elsec}
  147. {$error __ppc__ nor __ppc64__ nor __i386__ nor __x86_64__ nor __arm__ nor __arm64__ is defined.}
  148. {$endc}
  149. {$ifc defined __LP64__ and __LP64__ }
  150. {$setc TARGET_CPU_64 := TRUE}
  151. {$elsec}
  152. {$setc TARGET_CPU_64 := FALSE}
  153. {$endc}
  154. {$ifc defined FPC_BIG_ENDIAN}
  155. {$setc TARGET_RT_BIG_ENDIAN := TRUE}
  156. {$setc TARGET_RT_LITTLE_ENDIAN := FALSE}
  157. {$elifc defined FPC_LITTLE_ENDIAN}
  158. {$setc TARGET_RT_BIG_ENDIAN := FALSE}
  159. {$setc TARGET_RT_LITTLE_ENDIAN := TRUE}
  160. {$elsec}
  161. {$error Neither FPC_BIG_ENDIAN nor FPC_LITTLE_ENDIAN are defined.}
  162. {$endc}
  163. {$setc ACCESSOR_CALLS_ARE_FUNCTIONS := TRUE}
  164. {$setc CALL_NOT_IN_CARBON := FALSE}
  165. {$setc OLDROUTINENAMES := FALSE}
  166. {$setc OPAQUE_TOOLBOX_STRUCTS := TRUE}
  167. {$setc OPAQUE_UPP_TYPES := TRUE}
  168. {$setc OTCARBONAPPLICATION := TRUE}
  169. {$setc OTKERNEL := FALSE}
  170. {$setc PM_USE_SESSION_APIS := TRUE}
  171. {$setc TARGET_API_MAC_CARBON := TRUE}
  172. {$setc TARGET_API_MAC_OS8 := FALSE}
  173. {$setc TARGET_API_MAC_OSX := TRUE}
  174. {$setc TARGET_CARBON := TRUE}
  175. {$setc TARGET_CPU_68K := FALSE}
  176. {$setc TARGET_CPU_MIPS := FALSE}
  177. {$setc TARGET_CPU_SPARC := FALSE}
  178. {$setc TARGET_OS_UNIX := FALSE}
  179. {$setc TARGET_OS_WIN32 := FALSE}
  180. {$setc TARGET_RT_MAC_68881 := FALSE}
  181. {$setc TARGET_RT_MAC_CFM := FALSE}
  182. {$setc TARGET_RT_MAC_MACHO := TRUE}
  183. {$setc TYPED_FUNCTION_POINTERS := TRUE}
  184. {$setc TYPE_BOOL := FALSE}
  185. {$setc TYPE_EXTENDED := FALSE}
  186. {$setc TYPE_LONGLONG := TRUE}
  187. uses MacTypes,CFBase;
  188. {$endc} {not MACOSALLINCLUDE}
  189. {$ALIGN POWER}
  190. type
  191. CFBit = UInt32;
  192. type
  193. CFBitVectorRef = ^__CFBitVector; { an opaque type }
  194. __CFBitVector = record end;
  195. CFMutableBitVectorRef = ^__CFBitVector; { an opaque type }
  196. function CFBitVectorGetTypeID: CFTypeID; external name '_CFBitVectorGetTypeID';
  197. function CFBitVectorCreate( allocator: CFAllocatorRef; bytes: UnivPtr; numBits: CFIndex ): CFBitVectorRef; external name '_CFBitVectorCreate';
  198. function CFBitVectorCreateCopy( allocator: CFAllocatorRef; bv: CFBitVectorRef ): CFBitVectorRef; external name '_CFBitVectorCreateCopy';
  199. function CFBitVectorCreateMutable( allocator: CFAllocatorRef; capacity: CFIndex ): CFMutableBitVectorRef; external name '_CFBitVectorCreateMutable';
  200. function CFBitVectorCreateMutableCopy( allocator: CFAllocatorRef; capacity: CFIndex; bv: CFBitVectorRef ): CFMutableBitVectorRef; external name '_CFBitVectorCreateMutableCopy';
  201. function CFBitVectorGetCount( bv: CFBitVectorRef ): CFIndex; external name '_CFBitVectorGetCount';
  202. function CFBitVectorGetCountOfBit( bv: CFBitVectorRef; range: CFRange; value: CFBit ): CFIndex; external name '_CFBitVectorGetCountOfBit';
  203. function CFBitVectorContainsBit( bv: CFBitVectorRef; range: CFRange; value: CFBit ): Boolean; external name '_CFBitVectorContainsBit';
  204. function CFBitVectorGetBitAtIndex( bv: CFBitVectorRef; idx: CFIndex ): CFBit; external name '_CFBitVectorGetBitAtIndex';
  205. procedure CFBitVectorGetBits( bv: CFBitVectorRef; range: CFRange; bytes: UnivPtr ); external name '_CFBitVectorGetBits';
  206. function CFBitVectorGetFirstIndexOfBit( bv: CFBitVectorRef; range: CFRange; value: CFBit ): CFIndex; external name '_CFBitVectorGetFirstIndexOfBit';
  207. function CFBitVectorGetLastIndexOfBit( bv: CFBitVectorRef; range: CFRange; value: CFBit ): CFIndex; external name '_CFBitVectorGetLastIndexOfBit';
  208. procedure CFBitVectorSetCount( bv: CFMutableBitVectorRef; count: CFIndex ); external name '_CFBitVectorSetCount';
  209. procedure CFBitVectorFlipBitAtIndex( bv: CFMutableBitVectorRef; idx: CFIndex ); external name '_CFBitVectorFlipBitAtIndex';
  210. procedure CFBitVectorFlipBits( bv: CFMutableBitVectorRef; range: CFRange ); external name '_CFBitVectorFlipBits';
  211. procedure CFBitVectorSetBitAtIndex( bv: CFMutableBitVectorRef; idx: CFIndex; value: CFBit ); external name '_CFBitVectorSetBitAtIndex';
  212. procedure CFBitVectorSetBits( bv: CFMutableBitVectorRef; range: CFRange; value: CFBit ); external name '_CFBitVectorSetBits';
  213. procedure CFBitVectorSetAllBits( bv: CFMutableBitVectorRef; value: CFBit ); external name '_CFBitVectorSetAllBits';
  214. {$ifc not defined MACOSALLINCLUDE or not MACOSALLINCLUDE}
  215. end.
  216. {$endc} {not MACOSALLINCLUDE}