include the right files
[reactos.git] / reactos / lib / ntdll / rtl / bitmap.c
index 0885c10..3ece1b6 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: bitmap.c,v 1.3 2002/09/07 15:12:40 chorns Exp $
+/* $Id: bitmap.c,v 1.7 2004/02/02 13:34:01 ekohl Exp $
  *
  * COPYRIGHT:       See COPYING in the top level directory
  * PROJECT:         ReactOS kernel
@@ -8,17 +8,20 @@
  *                  20/08/99 Created by Eric Kohl
  */
 
-#define NTOS_USER_MODE
-#include <ntos.h>
+#include <ddk/ntddk.h>
+
 
 #define NDEBUG
-#include <debug.h>
+#include <ntdll/ntdll.h>
 
 #define ALIGN(x,align) (((x)+(align)-1) / (align))
 
 
 /* FUNCTIONS *****************************************************************/
 
+/*
+ * @implemented
+ */
 VOID
 STDCALL
 RtlInitializeBitMap (
@@ -32,6 +35,9 @@ RtlInitializeBitMap (
 }
 
 
+/*
+ * @implemented
+ */
 BOOLEAN
 STDCALL
 RtlAreBitsClear (
@@ -72,6 +78,9 @@ RtlAreBitsClear (
 }
 
 
+/*
+ * @implemented
+ */
 BOOLEAN
 STDCALL
 RtlAreBitsSet (
@@ -116,6 +125,9 @@ RtlAreBitsSet (
 }
 
 
+/*
+ * @implemented
+ */
 VOID
 STDCALL
 RtlClearAllBits (
@@ -128,6 +140,9 @@ RtlClearAllBits (
 }
 
 
+/*
+ * @implemented
+ */
 VOID
 STDCALL
 RtlClearBits (
@@ -166,6 +181,9 @@ RtlClearBits (
 }
 
 
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlFindClearBits (
@@ -222,6 +240,9 @@ RtlFindClearBits (
 }
 
 
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlFindClearBitsAndSet (
@@ -244,6 +265,19 @@ RtlFindClearBitsAndSet (
 }
 
 
+/*
+ * @unimplemented
+ */
+ULONG STDCALL
+RtlFindClearRuns (PRTL_BITMAP BitMapHeader,
+                 PRTL_BITMAP_RUN RunArray,
+                 ULONG SizeOfRunArray,
+                 BOOLEAN LocateLongestRuns)
+{
+  return (ULONG)-1;
+}
+
+
 ULONG
 STDCALL
 RtlFindFirstRunClear (
@@ -362,6 +396,21 @@ RtlFindFirstRunSet (
 }
 
 
+/*
+ * @unimplemented
+ */
+ULONG STDCALL
+RtlFindLastBackwardRunClear (IN PRTL_BITMAP BitMapHeader,
+                            IN ULONG FromIndex,
+                            IN PULONG StartingRunIndex)
+{
+  return (ULONG)-1;
+}
+
+
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlFindLongestRunClear (
@@ -419,6 +468,9 @@ RtlFindLongestRunClear (
 }
 
 
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlFindLongestRunSet (
@@ -476,6 +528,21 @@ RtlFindLongestRunSet (
 }
 
 
+/*
+ * @unimplemented
+ */
+ULONG STDCALL
+RtlFindNextForwardRunClear (IN PRTL_BITMAP BitMapHeader,
+                           IN ULONG FromIndex,
+                           IN PULONG StartingRunIndex)
+{
+  return (ULONG)-1;
+}
+
+
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlFindSetBits (
@@ -532,6 +599,9 @@ RtlFindSetBits (
 }
 
 
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlFindSetBitsAndClear (
@@ -554,6 +624,9 @@ RtlFindSetBitsAndClear (
 }
 
 
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlNumberOfClearBits (
@@ -583,6 +656,9 @@ RtlNumberOfClearBits (
 }
 
 
+/*
+ * @implemented
+ */
 ULONG
 STDCALL
 RtlNumberOfSetBits (
@@ -612,6 +688,9 @@ RtlNumberOfSetBits (
 }
 
 
+/*
+ * @implemented
+ */
 VOID
 STDCALL
 RtlSetAllBits (
@@ -624,6 +703,9 @@ RtlSetAllBits (
 }
 
 
+/*
+ * @implemented
+ */
 VOID
 STDCALL
 RtlSetBits (
@@ -661,4 +743,46 @@ RtlSetBits (
        }
 }
 
+
+/*
+ * @implemented
+ */
+CCHAR STDCALL
+RtlFindLeastSignificantBit (IN ULONGLONG Set)
+{
+  int i;
+
+  if (Set == 0ULL)
+    return -1;
+
+  for (i = 0; i < 64; i++)
+    {
+      if (Set & (1 << i))
+        return (CCHAR)i;
+    }
+
+  return -1;
+}
+
+
+/*
+ * @implemented
+ */
+CCHAR STDCALL
+RtlFindMostSignificantBit (IN ULONGLONG Set)
+{
+  int i;
+
+  if (Set == 0ULL)
+    return -1;
+
+  for (i = 63; i >= 0; i--)
+    {
+      if (Set & (1 << i))
+        return (CCHAR)i;
+    }
+
+  return -1;
+}
+
 /* EOF */