ReactOS  0.4.15-dev-2155-g06f57e1
skiplist.h
Go to the documentation of this file.
1 /*
2  * PROJECT: Skiplist implementation for the ReactOS Project
3  * LICENSE: GPL-2.0+ (https://spdx.org/licenses/GPL-2.0+)
4  * PURPOSE: Interfaces for the Skiplist
5  * COPYRIGHT: Copyright 2015 Colin Finck (colin@reactos.org)
6  */
7 
8 #ifndef _REACTOS_SKIPLIST_H
9 #define _REACTOS_SKIPLIST_H
10 
11 // Define SKIPLIST_LEVELS to a value between 1 and 31 before including this header.
12 // This specifies the maximum number of levels you want your Skiplist to have.
13 // A value of X is recommended for handling up to 2^X elements.
14 #ifndef SKIPLIST_LEVELS
15 #error Please define SKIPLIST_LEVELS to a value between 1 and 31.
16 #endif
17 
20 
21 // Function pointer definitions
25 
26 // Structure definitions
27 typedef struct _SKIPLIST_NODE
28 {
32 }
34 
35 typedef struct _SKIPLIST
36 {
43 }
45 
46 // Function prototypes
48 BOOL InsertElementSkiplist(PSKIPLIST Skiplist, PVOID Element);
50 PVOID DeleteElementSkiplist(PSKIPLIST Skiplist, PVOID Element);
51 PVOID LookupElementSkiplist(PSKIPLIST Skiplist, PVOID Element, PDWORD ElementIndex);
53 
54 #endif
#define SKIPLIST_LEVELS
Definition: precomp.h:30
DWORD NodeCount
Definition: skiplist.h:39
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
void InitializeSkiplist(PSKIPLIST Skiplist, PSKIPLIST_ALLOCATE_ROUTINE AllocateRoutine, PSKIPLIST_COMPARE_ROUTINE CompareRoutine, PSKIPLIST_FREE_ROUTINE FreeRoutine)
Definition: skiplist.c:220
PVOID DeleteElementSkiplist(PSKIPLIST Skiplist, PVOID Element)
Definition: skiplist.c:146
PSKIPLIST_ALLOCATE_ROUTINE AllocateRoutine
Definition: skiplist.h:40
PVOID LookupElementSkiplist(PSKIPLIST Skiplist, PVOID Element, PDWORD ElementIndex)
Definition: skiplist.c:357
SKIPLIST_NODE Head
Definition: skiplist.h:37
PVOID(WINAPI * PSKIPLIST_ALLOCATE_ROUTINE)(DWORD)
Definition: skiplist.h:22
char CHAR
Definition: xmlstorage.h:175
CHAR MaximumLevel
Definition: skiplist.h:38
#define DWORD
Definition: nt_native.h:44
unsigned int BOOL
Definition: ntddk_ex.h:94
_In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
Definition: rtlfuncs.h:1089
PSKIPLIST_COMPARE_ROUTINE CompareRoutine
Definition: skiplist.h:41
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE _In_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine
Definition: rtlfuncs.h:1089
void * PVOID
Definition: retypes.h:9
PSKIPLIST_NODE LookupNodeByIndexSkiplist(PSKIPLIST Skiplist, DWORD ElementIndex)
Definition: skiplist.c:412
BOOL InsertTailElementSkiplist(PSKIPLIST Skiplist, PVOID Element)
Definition: skiplist.c:308
#define WINAPI
Definition: msvc.h:6
struct _SKIPLIST_NODE * Next[SKIPLIST_LEVELS]
Definition: skiplist.h:30
unsigned long DWORD
Definition: ntddk_ex.h:95
struct _SKIPLIST SKIPLIST
BOOL InsertElementSkiplist(PSKIPLIST Skiplist, PVOID Element)
Definition: skiplist.c:250
DWORD Distance[SKIPLIST_LEVELS]
Definition: skiplist.h:29
void(WINAPI * PSKIPLIST_FREE_ROUTINE)(PVOID)
Definition: skiplist.h:24
struct _SKIPLIST * PSKIPLIST
C_ASSERT(SKIPLIST_LEVELS >=1)
PVOID Element
Definition: skiplist.h:31
DWORD * PDWORD
Definition: pedump.c:68
struct _SKIPLIST_NODE SKIPLIST_NODE
int(WINAPI * PSKIPLIST_COMPARE_ROUTINE)(PVOID, PVOID)
Definition: skiplist.h:23
struct _SKIPLIST_NODE * PSKIPLIST_NODE
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
Definition: rtlfuncs.h:1089
PSKIPLIST_FREE_ROUTINE FreeRoutine
Definition: skiplist.h:42
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31