home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c160 / 1.ddi / SOURCE / D4LOCK_A.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-06-22  |  639 b   |  31 lines

  1.  
  2. /* d4lock_all()   (c)Copyright Sequiter Software Inc., 1987-1990.  All rights reserved.
  3. */
  4.  
  5. #include "d4all.h"
  6.  
  7. extern INDEX *v4index ;
  8.  
  9. int d4lock_all( int do_wait, int free_buffers )
  10. {
  11.    int     rc, index_on ;
  12.  
  13.    if ( ! d4locked(-1L))
  14.       if ( d4unlock(-1L) < 0)  return -1 ;
  15.  
  16.    if ( (rc = d4lock( -1L, do_wait)) < 0)  return rc ;
  17.  
  18.    for ( index_on =  d4ptr()->index_ref;
  19.          index_on >= 0; index_on = v4index[index_on].prev )
  20.    {
  21.       if ( (rc = i4lock( index_on, do_wait)) < 0) return rc ;
  22.       if ( free_buffers )
  23.          if ( i4free( index_on) < 0)  return -1 ;
  24.    }
  25.  
  26.    return 0 ;
  27. }
  28.  
  29.  
  30.  
  31.