Przemyslaw Czerpak 4bebbd6ac3 2011-06-09 15:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapifs.h
  * harbour/src/rtl/filesys.c
    % removed unnecessary PID setting in POSIX file lock function.
    + added new C function:
         int hb_fsLockTest( HB_FHANDLE hFileHandle, HB_FOFFSET nStart,
                            HB_FOFFSET nLength, HB_USHORT uiMode );
      It allows to test file range lock status.
      It returns -1 on error, 0 when lock can be set and value greater
      then 0 if part of given range is locked by other process. In POSIX
      systems this value is PID of current lock owner. In other systems
      it's always 1.
      In uiMode only FLX_SHARED bit is significant.

  * harbour/include/hbapifs.h
  * harbour/src/rtl/filebuf.c
    + added new C function:
         int hb_fileLockTest( PHB_FILE pFile, HB_FOFFSET nStart,
                              HB_FOFFSET nLen, int iType );
      It's redirected to hb_fsLockTest()

  * harbour/contrib/hbnetio/netio.h
  * harbour/contrib/hbnetio/netiocli.c
  * harbour/contrib/hbnetio/netiosrv.c
  * harbour/contrib/hbmemio/memio.c
    + implemented hb_fileLockTest() low level code

  * harbour/include/dbinfo.ch
    + added DBI_LOCKTEST

  * harbour/src/rdd/dbf1.c
    % small code simplification
    + implemented DBI_LOCKTEST
         dbInfo( DBI_LOCKTEST [, <nRecNo> ] ) -> <nStatus>
      returns corresponding results to C level hb_fsLockTest() function.
      If current workarea is already locked then 0 is returned.
      If low level FS is located on POSIX system (accessed directly or by
      HBNETIO) then value greater then 0 is PID of current lock owner.
      If the lock is hold by aliased area or other thread of calling
      process then <nStatus> is current PID. In Other systems 1 is returned
      when lock cannot be set in current workarea.
      If <nRecNo> is given then the test is for RLOCK() otherwise FLOCK()
      operation.
2011-06-09 13:32:19 +00:00
Description
Harbour Core — Reference source for Five development
172 MiB
Languages
C 80.3%
xBase 17.8%
Makefile 0.6%
C++ 0.4%
Harbour 0.4%
Other 0.3%