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

  1. /*    Copyright (c) 1989 Citadel    */
  2. /*       All Rights Reserved        */
  3.  
  4. /* #ident    "lsgetlck.c    1.1 - 89/07/03" */
  5.  
  6. #include "lseq_.h"
  7.  
  8. /*man---------------------------------------------------------------------------
  9. NAME
  10.      lsgetlck - get lseq lock status
  11.  
  12. SYNOPSIS
  13.      #include <lseq.h>
  14.  
  15.      int lsgetlck(lsp)
  16.      lseq_t *lsp;
  17.  
  18. DESCRIPTION
  19.      The lsgetlck function reports the lock status of lseq lsp.  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.           LS_RDLCK     lseq locked for reading
  26.           LS_WRLCK     lseq locked for reading and writing
  27.           LS_UNLCK     lseq not locked
  28.  
  29. SEE ALSO
  30.      lslock.
  31.  
  32. ------------------------------------------------------------------------------*/
  33. int lsgetlck(lsp)
  34. lseq_t *lsp;
  35. {
  36.     if (!(lsp->flags & LSLOCKS)) {
  37.         return LS_UNLCK;
  38.     } else if (lsp->flags & LSWRLCK) {
  39.         return LS_WRLCK;
  40.     }
  41.  
  42.     return LS_RDLCK;
  43. }
  44.