home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 9
/
MEDIASHARE_09.ISO
/
cprog
/
btree.zip
/
BFH.HPP
next >
Wrap
C/C++ Source or Header
|
1992-02-16
|
2KB
|
67 lines
// C++ B+Tree
// (c) 1990,1991 Larry A. Walker
// This source is proprietary information which cannot be distributed
// without written permission of Larry A. Walker
#ifndef BFH_H
#define BFH_H
// Define one of these three:
/*
#define UNIX
#define XENIX
*/
#define MSDOS
/* The block file handler is the basic class for all database and
indexing operations */
#include "runerr.hpp"
#define warning(str) \
proc_error( (int)WARNING, (int)__LINE__, (char *)__FILE__, (char *)str, (int)1 );
#define fatal(str) \
proc_error( (int)FATAL, (int)__LINE__, (char *)__FILE__, (char *)str, (int)1 );
class BFHClass : public RunError {
int file_fd;
char * fd_name;
struct bfh_data bdata;
char * empty_node ;
char * other_data_hdr;
int other_data_hdr_size;
long current_pointer;
int direction;
public:
BFHClass(){
};
OpenBFH( char * , void * , int , int, int );
~BFHClass(){
};
int BFHClose();
int WriteBlock(char *, long); // write the block at the char pointer
// to the indicated position
int ReadBlock(char *, long); // read the block at the position to
// the pointer
long NewBlock(); // initialize a new block and return
// its address
int FreeBlock(long); // add a block to the free list
//
long AddrBlock(long); // return the address of the block at
// position # int
int FullBlock(long); // return yes 1 no 0 if block is presently
// full
void get_info (struct bfh_data * ); // return
int GetBFHSize(); // What was the block size as created.
int OpenState();
};
#endif BFH_H