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