mirror of
https://github.com/reactos/reactos.git
synced 2024-10-02 07:26:47 +00:00
Added some splay-tree functions.
svn path=/trunk/; revision=5959
This commit is contained in:
parent
f6ee216aae
commit
e3b6ff8479
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.def,v 1.107 2003/08/22 13:46:55 ea Exp $
|
||||
; $Id: ntdll.def,v 1.108 2003/09/02 11:21:59 ekohl Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -556,8 +556,8 @@ RtlSizeHeap@12
|
|||
;RtlStartRXact
|
||||
RtlSubAuthorityCountSid@4
|
||||
RtlSubAuthoritySid@8
|
||||
;RtlSubtreePredecessor
|
||||
;RtlSubtreeSuccessor
|
||||
RtlSubtreePredecessor@4
|
||||
RtlSubtreeSuccessor@4
|
||||
RtlSystemTimeToLocalTime@8
|
||||
RtlTimeFieldsToTime@8
|
||||
RtlTimeToElapsedTimeFields@8
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
; $Id: ntdll.edf,v 1.96 2003/08/22 13:46:55 ea Exp $
|
||||
; $Id: ntdll.edf,v 1.97 2003/09/02 11:21:59 ekohl Exp $
|
||||
;
|
||||
; ReactOS Operating System
|
||||
;
|
||||
|
@ -555,8 +555,8 @@ RtlSizeHeap=RtlSizeHeap@12
|
|||
;RtlStartRXact
|
||||
RtlSubAuthorityCountSid=RtlSubAuthorityCountSid@4
|
||||
RtlSubAuthoritySid=RtlSubAuthoritySid@8
|
||||
;RtlSubtreePredecessor
|
||||
;RtlSubtreeSuccessor
|
||||
RtlSubtreePredecessor=RtlSubtreePredecessor@4
|
||||
RtlSubtreeSuccessor=RtlSubtreeSuccessor@4
|
||||
RtlSystemTimeToLocalTime=RtlSystemTimeToLocalTime@8
|
||||
RtlTimeFieldsToTime=RtlTimeFieldsToTime@8
|
||||
RtlTimeToElapsedTimeFields=RtlTimeToElapsedTimeFields@8
|
||||
|
|
70
reactos/lib/ntdll/rtl/splaytree.c
Normal file
70
reactos/lib/ntdll/rtl/splaytree.c
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* ReactOS kernel
|
||||
* Copyright (C) 2003 ReactOS Team
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
/* $Id: splaytree.c,v 1.1 2003/09/02 11:19:29 ekohl Exp $
|
||||
*
|
||||
* COPYRIGHT: See COPYING in the top level directory
|
||||
* PROJECT: ReactOS system libraries
|
||||
* PURPOSE: Splay-Tree implementation
|
||||
* FILE: lib/ntdll/rtl/splaytree.c
|
||||
*/
|
||||
|
||||
#include <ddk/ntddk.h>
|
||||
|
||||
/* FUNCTIONS *****************************************************************/
|
||||
|
||||
PRTL_SPLAY_LINKS STDCALL
|
||||
RtlSubtreePredecessor (IN PRTL_SPLAY_LINKS Links)
|
||||
{
|
||||
PRTL_SPLAY_LINKS Child;
|
||||
|
||||
Child = Links->RightChild;
|
||||
if (Child == NULL)
|
||||
return NULL;
|
||||
|
||||
if (Child->LeftChild == NULL)
|
||||
return Child;
|
||||
|
||||
/* Get left-most child */
|
||||
while (Child->LeftChild != NULL)
|
||||
Child = Child->LeftChild;
|
||||
|
||||
return Child;
|
||||
}
|
||||
|
||||
|
||||
PRTL_SPLAY_LINKS STDCALL
|
||||
RtlSubtreeSuccessor (IN PRTL_SPLAY_LINKS Links)
|
||||
{
|
||||
PRTL_SPLAY_LINKS Child;
|
||||
|
||||
Child = Links->LeftChild;
|
||||
if (Child == NULL)
|
||||
return NULL;
|
||||
|
||||
if (Child->RightChild == NULL)
|
||||
return Child;
|
||||
|
||||
/* Get right-most child */
|
||||
while (Child->RightChild != NULL)
|
||||
Child = Child->RightChild;
|
||||
|
||||
return Child;
|
||||
}
|
||||
|
||||
/* EOF */
|
Loading…
Reference in a new issue