ReactOS 0.4.15-dev-8102-g108db8f
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
27typedef struct _SKIPLIST_NODE
28{
32}
34
35typedef struct _SKIPLIST
36{
43}
45
46// Function prototypes
48BOOL InsertElementSkiplist(PSKIPLIST Skiplist, PVOID Element);
51PVOID LookupElementSkiplist(PSKIPLIST Skiplist, PVOID Element, PDWORD ElementIndex);
53
54#endif
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
unsigned int BOOL
Definition: ntddk_ex.h:94
unsigned long DWORD
Definition: ntddk_ex.h:95
#define C_ASSERT(e)
Definition: intsafe.h:73
#define DWORD
Definition: nt_native.h:44
DWORD * PDWORD
Definition: pedump.c:68
struct _SKIPLIST_NODE * PSKIPLIST_NODE
struct _SKIPLIST SKIPLIST
struct _SKIPLIST_NODE SKIPLIST_NODE
BOOL InsertTailElementSkiplist(PSKIPLIST Skiplist, PVOID Element)
Definition: skiplist.c:308
PVOID(WINAPI * PSKIPLIST_ALLOCATE_ROUTINE)(DWORD)
Definition: skiplist.h:22
int(WINAPI * PSKIPLIST_COMPARE_ROUTINE)(PVOID, PVOID)
Definition: skiplist.h:23
PVOID LookupElementSkiplist(PSKIPLIST Skiplist, PVOID Element, PDWORD ElementIndex)
Definition: skiplist.c:357
PSKIPLIST_NODE LookupNodeByIndexSkiplist(PSKIPLIST Skiplist, DWORD ElementIndex)
Definition: skiplist.c:412
void(WINAPI * PSKIPLIST_FREE_ROUTINE)(PVOID)
Definition: skiplist.h:24
struct _SKIPLIST * PSKIPLIST
BOOL InsertElementSkiplist(PSKIPLIST Skiplist, PVOID Element)
Definition: skiplist.c:250
PVOID DeleteElementSkiplist(PSKIPLIST Skiplist, PVOID Element)
Definition: skiplist.c:146
void InitializeSkiplist(PSKIPLIST Skiplist, PSKIPLIST_ALLOCATE_ROUTINE AllocateRoutine, PSKIPLIST_COMPARE_ROUTINE CompareRoutine, PSKIPLIST_FREE_ROUTINE FreeRoutine)
Definition: skiplist.c:220
DWORD Distance[SKIPLIST_LEVELS]
Definition: skiplist.h:29
struct _SKIPLIST_NODE * Next[SKIPLIST_LEVELS]
Definition: skiplist.h:30
PVOID Element
Definition: skiplist.h:31
CHAR MaximumLevel
Definition: skiplist.h:38
PSKIPLIST_COMPARE_ROUTINE CompareRoutine
Definition: skiplist.h:41
SKIPLIST_NODE Head
Definition: skiplist.h:37
PSKIPLIST_FREE_ROUTINE FreeRoutine
Definition: skiplist.h:42
DWORD NodeCount
Definition: skiplist.h:39
PSKIPLIST_ALLOCATE_ROUTINE AllocateRoutine
Definition: skiplist.h:40
void * PVOID
Definition: typedefs.h:50
#define SKIPLIST_LEVELS
Definition: precomp.h:30
#define WINAPI
Definition: msvc.h:6
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE _In_ PRTL_GENERIC_FREE_ROUTINE FreeRoutine
Definition: rtlfuncs.h:1090
_In_ PRTL_GENERIC_COMPARE_ROUTINE _In_ PRTL_GENERIC_ALLOCATE_ROUTINE AllocateRoutine
Definition: rtlfuncs.h:1089
_In_ PRTL_GENERIC_COMPARE_ROUTINE CompareRoutine
Definition: rtlfuncs.h:1088
char CHAR
Definition: xmlstorage.h:175