y_bit.inc 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. #if defined _INC_y_bit
  2. #endinput
  3. #endif
  4. #define _INC_y_bit
  5. /**
  6. * <library name="y_bit">
  7. * <section>
  8. * Description
  9. * </section>
  10. * Provides functions for bit manipulation and bit arrays greater than 32bits.
  11. * The arrays are usually bigger than required due to cell boundaries but this
  12. * shouldn't cause a major problem (bit tests on the 101st bit of a 100 bit
  13. * array won't return 0 for out of bounds, but the 129th will).
  14. *
  15. * Note that y_commands has a few optimisations which bypass the code in here
  16. * so any modifications to bit array layouts will need to be reflected there.
  17. * <section>
  18. * Version
  19. * </section>
  20. * 0.2
  21. * <section>
  22. * Functions
  23. * </section>
  24. * <subsection>
  25. * Stock
  26. * </subsection><ul>
  27. * <symbol name="Bit_Set">Sets a slot to the given value.</symbol>
  28. * <symbol name="Bit_Get">Gets a slot state.</symbol>
  29. * <symbol name="Bit_SetAll">Sets all the slots in an array to the same thing.</symbol>
  30. * <symbol name="Bit_GetCount">Gets the number of 1s in a bit array.</symbol>
  31. * </ul><subsection>
  32. * Inline
  33. * </subsection><ul>
  34. * <symbol name="Bit_Bits">Gets the number of cells required for a bit array.</symbol>
  35. * <symbol name="Bit_Let">Sets a slot to 1.</symbol>
  36. * <symbol name="Bit_Vet">Sets a slot to 0.</symbol>
  37. * <symbol name="Bit_GetBits">Gets the bit at a slot unsafely.</symbol>
  38. * </ul><section>
  39. * Definitions
  40. * </section><ul>
  41. * <symbol name="CELLSHIFT">Number of bits that can hold "cellbits"</symbol>
  42. * </ul><section>
  43. * Tags
  44. * </section><ul>
  45. * <symbol name="Bit">Bit array type.</symbol>
  46. * </ul>
  47. * </library>
  48. *//** *//*
  49. Legal:
  50. Version: MPL 1.1
  51. The contents of this file are subject to the Mozilla Public License Version
  52. 1.1 the "License"; you may not use this file except in compliance with
  53. the License. You may obtain a copy of the License at
  54. http://www.mozilla.org/MPL/
  55. Software distributed under the License is distributed on an "AS IS" basis,
  56. WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
  57. for the specific language governing rights and limitations under the
  58. License.
  59. The Original Code is the YSI framework.
  60. The Initial Developer of the Original Code is Alex "Y_Less" Cole.
  61. Portions created by the Initial Developer are Copyright C 2011
  62. the Initial Developer. All Rights Reserved.
  63. Contributors:
  64. Y_Less
  65. koolk
  66. JoeBullet/Google63
  67. g_aSlice/Slice
  68. Misiur
  69. samphunter
  70. tianmeta
  71. maddinat0r
  72. spacemud
  73. Crayder
  74. Dayvison
  75. Ahmad45123
  76. Zeex
  77. irinel1996
  78. Yiin-
  79. Chaprnks
  80. Konstantinos
  81. Masterchen09
  82. Southclaws
  83. PatchwerkQWER
  84. m0k1
  85. paulommu
  86. udan111
  87. Thanks:
  88. JoeBullet/Google63 - Handy arbitrary ASM jump code using SCTRL.
  89. ZeeX - Very productive conversations.
  90. koolk - IsPlayerinAreaEx code.
  91. TheAlpha - Danish translation.
  92. breadfish - German translation.
  93. Fireburn - Dutch translation.
  94. yom - French translation.
  95. 50p - Polish translation.
  96. Zamaroht - Spanish translation.
  97. Los - Portuguese translation.
  98. Dracoblue, sintax, mabako, Xtreme, other coders - Producing other modes for
  99. me to strive to better.
  100. Pixels^ - Running XScripters where the idea was born.
  101. Matite - Pestering me to release it and using it.
  102. Very special thanks to:
  103. Thiadmer - PAWN, whose limits continue to amaze me!
  104. Kye/Kalcor - SA:MP.
  105. SA:MP Team past, present and future - SA:MP.
  106. Optional plugins:
  107. Gamer_Z - GPS.
  108. Incognito - Streamer.
  109. Me - sscanf2, fixes2, Whirlpool.
  110. */
  111. #include "..\YSI_Internal\y_compilerdata"
  112. #include "..\YSI_Internal\y_version"
  113. #include "..\YSI_Core\y_debug"
  114. #include "..\YSI_Core\y_utils"
  115. #include "..\YSI_Core\y_cell"
  116. #include "y_bit/impl"
  117. #if defined YSI_TESTS
  118. #include "..\YSI_Data\y_iterate"
  119. #include "..\YSI_Core\y_testing"
  120. #include "y_bit/tests"
  121. #endif