home *** CD-ROM | disk | FTP | other *** search
-
- (c) Copyright Sequiter Software Inc. 1988-1990. All rights reserved.
-
-
- Block Routines
-
-
- The block routines are low level routines called by the index file routines.
- Index file information is organized into a hierarchy of blocks. Block routines
- read, write, and manipulate those blocks.
-
-
-
- b4add()
-
- Usage int b4add( int index_ref, (KEY *) key_ptr)
-
- Description Adds a key to the current block. 'b4add'
- works with 'i4add' to add a key to an index file.
-
- Returns Value Meaning
-
- 0 Success
- 1 Error
-
-
-
-
-
- b4down()
-
- Usage long b4down( int index_ref, int direction )
-
- Description Reads one level deeper down the hierarchy of blocks.
-
- Parameters Name Use
-
- index_ref The index file reference number.
-
- direction Specifies which direction to traverse
- down the tree.
- If 'direction' is less than zero, the tree is
- traversed left, and if 'direction' is greater than
- zero, the tree is traversed right.
-
- Returns Value Meaning
-
- >= 0 Block reference number of the new block.
- -1 At the bottom level. Cannot read further down.
- -2 Read Error
- -3 Out of Memory
-
-
-
-
-
-
- b4remove()
-
- Usage int b4remove( int index_ref )
-
- Description The current key is removed from the current block.
- No writing is done to disk.
-
- Returns Value Meaning
-
- >= 0 Number of Keys left in Block
- 0 Success
- -1 Error
-
-
-
-
-
-
-
- b4search()
-
- Usage int b4search( int index_ref, char * srch_ptr )
-
- Description The current block of the specified index file is
- searched for the value pointed to by 'srch_ptr'.
-
- Returns Value Meaning
-
- 0 Complete Match
- 1 Inexact Match
- 2 After the specified key
- 3 After the block
-
-
-
-
-
-
- b4skip()
-
- Usage int b4skip( int index_ref, long num_skip )
-
- Description A specified number of keys are skipped. Skipping is relative
- to the current key of the current block.
-
- Parameters Name Use
-
- index_ref The index file reference number.
-
- num_skip The number of keys to skip. This can be
- a negative number.
-
- Returns The number of keys actually skipped. When an error occurs,
- 'num_skip' with an opposite sign is returned.
-
-
-
-
-
- b4up()
-
- Usage int b4up( int index_ref )
-
- Description Frees the current block and moves one block up the hierarchy of
- blocks. This is the opposite to routine 'b4down'.
-
- Returns Value Meaning
-
- >= 0 The block reference number of the new block.
- -1 The current block is the root block. Nothing was
- done.
- -2 No block is present.
-
-
-
-
-
-
- b4write()
-
- Usage int b4write( int index_ref )
-
- Description The current block of the specified index file is written to
- disk.
-
- Returns Value Meaning
-
- 0 Success
- -1 Error