7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/* $Id$ */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/** @file
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * IPRT - AVL tree, RTGCPHYS, unique keys.
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/*
c58f1213e628a545081c70e26c6b67a841cff880vboxsync * Copyright (C) 2006-2010 knut st. osmundsen (bird-src-spam@anduin.net)
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync *
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * available from http://www.virtualbox.org. This file is free software;
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * you can redistribute it and/or modify it under the terms of the GNU
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * General Public License (GPL) as published by the Free Software
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync *
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * The contents of this file may alternatively be used under the terms
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * of the Common Development and Distribution License Version 1.0
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * VirtualBox OSE distribution, in which case the provisions of the
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * CDDL are applicable instead of those of the GPL.
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync *
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * You may elect to license modified versions of this file under the
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * terms and conditions of either the GPL or the CDDL or both.
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#ifndef NOFILEID
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsyncstatic const char szFileId[] = "Id: kAVLULInt.c,v 1.4 2003/02/13 02:02:38 bird Exp $";
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#endif
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/*******************************************************************************
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync* Defined Constants And Macros *
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync*******************************************************************************/
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/*
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * AVL configuration.
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVL_FN(a) RTAvlGCPhys##a
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVL_MAX_STACK 27 /* Up to 2^24 nodes. */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVL_CHECK_FOR_EQUAL_INSERT 1 /* No duplicate keys! */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVLNODECORE AVLGCPHYSNODECORE
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define PKAVLNODECORE PAVLGCPHYSNODECORE
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define PPKAVLNODECORE PPAVLGCPHYSNODECORE
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVLKEY RTGCPHYS
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define PKAVLKEY PRTGCPHYS
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVLENUMDATA AVLGCPHYSENUMDATA
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define PKAVLENUMDATA PAVLGCPHYSENUMDATA
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define PKAVLCALLBACK PAVLGCPHYSCALLBACK
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/*
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * AVL Compare macros
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVL_G( key1, key2) ( (key1) > (key2) )
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVL_E( key1, key2) ( (key1) == (key2) )
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KAVL_NE(key1, key2) ( (key1) != (key2) )
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/*******************************************************************************
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync* Header Files *
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync*******************************************************************************/
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include <iprt/avl.h>
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include <iprt/assert.h>
f72db2874332da64a5887d0a8d9c1b5f7745be18vboxsync#include <iprt/err.h>
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync/*
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync * Include the code.
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync */
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define SSToDS(ptr) ptr
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define KMAX RT_MAX
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#define kASSERT Assert
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include "avl_Base.cpp.h"
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include "avl_Get.cpp.h"
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include "avl_DoWithAll.cpp.h"
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include "avl_GetBestFit.cpp.h"
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include "avl_RemoveBestFit.cpp.h"
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync#include "avl_Destroy.cpp.h"
7a9e8a29e7990b6a2267a4d6d7a1d66242ddc8ffvboxsync