ftp.nice.ch/pub/next/developer/languages/c/gcc.2.7.2.2.I.b.tar.gz#/lib/gcc-lib/m68k-next-nextstep3/2.7.2.2.f.2/include/btree/IXBTree.h

This is IXBTree.h in view mode; [Download] [Up]

/*
IXBTree.h
Copyright 1991, NeXT, Inc.
*/

#import <mach/cthreads.h>
#import	<objc/Object.h>

#import	"protocols.h"

#import	<store/IXStoreFile.h>

#ifdef	NX_COMPILER_RELEASE_3_0
@interface IXBTree: Object <IXNameAndFileAccess, IXComparatorSetting, IXComparisonSetting>
#else
@interface IXBTree: Object
#endif
{
@public
    struct mutex	mutexLock; /* public for explicit locking*/
#ifdef	NX_COMPILER_RELEASE_3_0
@protected
#endif
    vm_offset_t		_rootOffset;
    unsigned		_recordCount;
    unsigned		_syncVersion;
    unsigned		_codeVersion;
    unsigned		_blockShift;
    unsigned		_btreeDepth;
    boolean_t		_freeStore;
    char		*_handleName;
    unsigned		_handle;
    IXStore		*_store;
    IXComparator	*_comparator;
    void		*_context;
    char		*_comparison;
    struct BTreeStore	*_btreeStore;
    struct		{
	unsigned	isSpanning:1;
	unsigned	rightRotation:1;
	unsigned	leftRotation:1;
    }			_cursorStatus;
}

/* Returns the store, e.g., [[client store] startTransaction].*/
- (IXStore *)store;

- (unsigned)count; /* returns the number of key/record pairs*/
- empty; /* removes all key/record pairs*/

- compact; /* this method is not implemented, but remains for compatibility*/
- (unsigned)keyLimit; /* returns the maximum key length*/

- optimizeForTime; /* faster insertion, more empty space per page*/
- optimizeForSpace; /* slower insertion, less empty space per page*/

/* This method causes records to span node boundaries for optimal space */
/* utilization.  It renders the resulting B* tree unchangeable, however, and */
/* attempting to modify a spanned B* tree will produce an exception.  The */
/* records must be added to the B* tree in key order when spanning is enabled.*/

- setSpanning:(BOOL)flag;

/* These macros accquire and release the public mutex lock instance variable.  */
/* The lock is advisory only.  Callers must cooperate to obtain thread safety.*/

#define	IXLockBTreeMutex(btree)	mutex_lock(&(btree)->mutexLock)
#define IXUnlockBTreeMutex(btree) mutex_unlock(&(btree)->mutexLock)

@end

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.