home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / TPSHAR10.ZIP / ABSHARE.INT < prev    next >
Encoding:
Text File  |  1992-10-02  |  1.3 KB  |  53 lines

  1. Unit ABShare;
  2. {
  3.   Share & Record Locking Routines for TP 6.0
  4.  
  5.   Copyright (c) 1991,1992 A.B.S. - ALL RIGHTS RESERVED
  6.  
  7.   1.00
  8. }
  9.  
  10. {$A-,B-,D-,F+,I-,N-,O+,R-,S-,V-}
  11.  
  12. Interface
  13.  
  14. Const
  15.   ABShareVer = '1.00';
  16.  
  17. Function  LockRec(FileHandle : Word; FilePosition, FileLength : LongInt;
  18.                   UnLock : Boolean) : Word;
  19. {
  20.  Lock or UnLock a Region of a File for exclusive access.  Share must
  21.  be loaded.  A call to Lock must be followed by a call to UnLock
  22.  with the same FilePosition and FileLength.
  23.  
  24.  FileHandle   - FileRec(f).Handle, f is a variable of type file
  25.  FilePosition - Offset of Region to Lock/UnLock
  26.  FileLength   - Length of Region to Lock/UnLock
  27.  UnLock       - True to UnLock, False to Lock
  28.  
  29.  Returns:
  30.    00h - successful
  31.    01h - function number invalid
  32.    06h - invalid handle
  33.    21h - lock violation
  34.    24h - sharing buffer overflow
  35. }
  36.  
  37. Function  UpdateFile(FileHandle : Word) : Word;
  38. {
  39.  Updates a file to disk by opening and closing a duplicate handle
  40.  
  41.  FileHandle - FileRec(f).Handle, f is a variable of type file
  42.  
  43.  Returns:
  44.    00h - successful
  45.    04h - too many open files (no handles available)
  46.    06h - invalid handle
  47. }
  48.  
  49. Function  ShareInstalled : Boolean;
  50. {
  51.  Returns True if Share is Installed, otherwise False
  52. }
  53.