home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / DOC / B4.DOC next >
Encoding:
Text File  |  1990-03-04  |  3.9 KB  |  147 lines

  1.  
  2. (c) Copyright Sequiter Software Inc. 1988-1990.  All rights reserved.
  3.  
  4.  
  5. Block Routines
  6.  
  7.  
  8. The block routines are low level routines called by the index file routines.  
  9. Index file information is organized into a hierarchy of blocks.  Block routines 
  10. read, write, and manipulate those blocks.
  11.        
  12.                                                                  
  13.  
  14. b4add()
  15.       
  16. Usage           int  b4add( int index_ref, (KEY *) key_ptr)  
  17.    
  18. Description     Adds a key to the current block.  'b4add' 
  19.                 works with 'i4add' to add a key to an index file.  
  20.   
  21. Returns         Value        Meaning  
  22.   
  23.                   0          Success 
  24.                   1          Error
  25.  
  26.  
  27.                              
  28.  
  29.  
  30. b4down()
  31.  
  32. Usage           long  b4down( int index_ref, int direction ) 
  33.  
  34. Description     Reads one level deeper down the hierarchy of blocks. 
  35.  
  36. Parameters      Name         Use 
  37.  
  38.                 index_ref    The index file reference number. 
  39.  
  40.                 direction    Specifies which direction to traverse 
  41.                              down the tree. 
  42.                              If 'direction' is less than zero, the tree is
  43.                              traversed left, and if 'direction' is greater than
  44.                              zero, the tree is traversed right. 
  45.  
  46. Returns         Value        Meaning 
  47.  
  48.                 >=  0        Block reference number of the new block. 
  49.                  -1          At the bottom level.  Cannot read further down. 
  50.                  -2          Read Error 
  51.                  -3          Out of Memory
  52.  
  53.  
  54.  
  55.                
  56.  
  57.  
  58. b4remove()
  59.                                                                              
  60. Usage           int  b4remove( int index_ref ) 
  61.  
  62. Description     The current key is removed from the current block.  
  63.                 No writing is done to disk. 
  64.  
  65. Returns         Value           Meaning 
  66.  
  67.                  >= 0           Number of Keys left in Block 
  68.                   0             Success 
  69.                  -1             Error
  70.  
  71.  
  72.  
  73.  
  74.  
  75.  
  76.  
  77. b4search()
  78.  
  79. Usage           int b4search( int index_ref, char * srch_ptr ) 
  80.  
  81. Description     The current block of the specified index file is 
  82.                 searched for the value pointed to by 'srch_ptr'. 
  83.  
  84. Returns         Value        Meaning 
  85.  
  86.                   0          Complete Match 
  87.                   1          Inexact  Match 
  88.                   2          After the specified key 
  89.                   3          After the block
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96. b4skip()
  97.  
  98. Usage           int  b4skip( int index_ref, long num_skip ) 
  99.  
  100. Description     A specified number of keys are skipped.  Skipping is relative
  101.                 to the current key of the current block. 
  102.  
  103. Parameters      Name            Use 
  104.  
  105.                 index_ref       The index file reference number. 
  106.  
  107.                 num_skip        The number of keys to skip.  This can be 
  108.                                 a negative number. 
  109.  
  110. Returns         The number of keys actually skipped.  When an error occurs,
  111.                 'num_skip' with an opposite sign is returned.
  112.  
  113.  
  114.  
  115.  
  116.  
  117. b4up()
  118.  
  119. Usage           int  b4up( int index_ref ) 
  120.  
  121. Description     Frees the current block and moves one block up the hierarchy of
  122.                 blocks.  This is the opposite to routine 'b4down'. 
  123.  
  124. Returns         Value       Meaning 
  125.  
  126.                  >= 0       The block reference number of the new block. 
  127.                   -1        The current block is the root block.  Nothing was 
  128.                             done. 
  129.                   -2        No block is present.
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136. b4write()
  137.  
  138. Usage            int  b4write( int index_ref ) 
  139.  
  140. Description      The current block of the specified index file is written to 
  141.                  disk. 
  142.  
  143. Returns          Value       Meaning 
  144.  
  145.                    0         Success 
  146.                   -1         Error
  147.