home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / progm / cbase.zip / CBASE10B.ZIP / CBASE.ZIP / CBGETLCK.C < prev    next >
Text File  |  1989-11-08  |  1KB  |  44 lines

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "cbgetlck.c    1.2 - 89/11/08" */
  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
  21.      calling process.  Locks held by other processes are not reported.
  22.  
  23.      The possible return values are:
  24.  
  25.      CB_UNLCK       cbase not locked
  26.      CB_RDLCK       cbase locked for reading
  27.      CB_WRLCK       cbase locked for reading and writing
  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.