home *** CD-ROM | disk | FTP | other *** search
/ Frostbyte's 1980s DOS Shareware Collection / floppyshareware.zip / floppyshareware / DOOG / CBASE09.ZIP / CBASE.ZIP / CBGETLCK.C < prev    next >
Text File  |  1989-08-31  |  1KB  |  44 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "cbgetlck.c    1.1 - 89/08/31" */
  5.  
  6. #include "cbase_.h"
  7.  
  8. /*man---------------------------------------------------------------------------
  9. NAME
  10.      cbgetlck - get cbase lock status
  11.  
  12. SYNOPSIS
  13.      #include <cbase.h>
  14.  
  15.      int cbgetlck(cbp)
  16.      cbase_t *cbp;
  17.  
  18. DESCRIPTION
  19.      The cbgetlck function reports the lock status of cbase cbp.  The
  20.      function returns the status of the lock currently held by the calling
  21.      process.  Locks held by other processes are not reported.
  22.  
  23.      The possible return values are:
  24.  
  25.           CB_RDLCK - cbase locked for reading
  26.           CB_WRLCK - cbase locked for reading and writing
  27.           CB_UNLCK - cbase not locked
  28.  
  29. SEE ACBO
  30.      cblock.
  31.  
  32. ------------------------------------------------------------------------------*/
  33. int cbgetlck(cbp)
  34. cbase_t *cbp;
  35. {
  36.     if (!(cbp->flags & CBLOCKS)) {
  37.         return CB_UNLCK;
  38.     } else if (cbp->flags & CBWRLCK) {
  39.         return CB_WRLCK;
  40.     }
  41.  
  42.     return CB_RDLCK;
  43. }
  44.