* contrib/hbmzip/mzip.c
! disable _LARGEFILE64_SOURCE after including system header files in
non *nix builds just before including zlib headers.
It's workaround for wrong condition in zconf.h
* src/common/hbfsapi.c
* src/rtl/filesys.c
* src/rtl/filebuf.c
* contrib/hbmzip/mzip.c
* contrib/xhb/filestat.c
! if available always use stat64() instead of stat() in *nixes builds.
On 32-bit platforms stat() fails for larger files (>2GB).
It should fix problem reported by Lorenzo.
* src/rtl/filebuf.c
! fixed bad typo inside hb_fileIsLocalName() - result was reverted.
Many thanks to Juan Gálvez for locating the problem.
* src/debug/dbgbrwsr.prg
! fixed typo in previous commit.
It should fix also problem with positioning in debugger source
window reported by Alexey Myronenko.
% minor simplification
* contrib/hbmisc/udpds.prg
! updated to send correct broadcast messages in * nixes and
respect broadcast addresses returned by system for IP interfaces
* src/rdd/hbdbsort.c
* src/rdd/hbsix/sxcompr.c
* pacified warnings
* src/debug/debugger.prg
! calculate ListBox coordinates as integer value
(it fixes RTE reported by Rolf in SWITCH statement)
* src/debug/dbghelp.prg
! fixed number of help pages calculation
* src/rtl/cdpapi.c
* src/rtl/iousr.c
* src/rtl/hbjson.c
* src/rtl/gtcrs/gtcrs.c
* src/rtl/gtsln/gtsln.c
* src/rtl/gttrm/gttrm.c
* src/rtl/gtxwc/gtxwc.c
* src/rdd/workarea.c
* src/rdd/hbsix/sxcompr.c
* contrib/hbct/token2.c
* contrib/hbsqlit3/core.c
* pacified some of -Wshadow warnings
* include/hbapicdp.h
! typo in comment: bytes -> bits
* src/vm/garbage.c
* src/vm/thread.c
* disabled some code with spinlocks when HB_HELGRIND_FRIENDLY macro
is defined. It causes that final MT HVM code is slower using native
platform mutexes but only such ones helgrind can recognize so the
new macro can be useful for people who want to make some tests with
helgrind. In such case they should rebuild Harbour with
HB_USER_CFLAGS=HB_HELGRIND_FRIENDLY
We use spinlocks and atomic integer operations also in few other
places so it's possible that deeper tests can exploit them and
we will have to cover them by HB_HELGRIND_FRIENDLY too just to
easy detect real problems.
* contrib/gtqtc/gtqtc.h
* contrib/gtqtc/gtqtc1.cpp
* overload inputMethodEvent() in console object and insert
commitString() data into GT keyboard input queue.
It's necessary for Android working with SoftwareInputPanel
and it fixes problem with eaten standard characters.
QT documentation says that QInputMethodEvent are generated
only when Qt::WA_InputMethodEnabled attribute is set but
tests shows that it's not true and these events are generated
instead of keyPress/keyRelease ones for simple text input.
CTRL modifier, ESC, INS, HOME, END, PGUP, PGDN and Fn keys
still does not work with GTQTC in Android builds.
* src/rtl/tbrowse.prg
! fixed compilation with HB_BRW_STATICMOUSE
! do not cover dummy ivar with HB_COMPAT_C53 macro
* minor simplification
* src/vm/arrays.c
* removed old commented code not used with current GC
* contrib/hbnetio/netiosrv.c
* fully consume RPC messages even if RPC is disabled. It allows to
continue client connection in such case and process next messages.
* contrib/hbnetio/netiosrv.c
! fixed very bad bug in one of recent modifications which completely
broke all servers using early authentication by netio_VerifyClient()
* src/rtl/filebufd.c
* src/rtl/iousr.c
* slightly modified code to pacify warnings in some older GCC versions
* contrib/gtwvg/gtwvg.hbx
* regenerated with new function
* src/rtl/filebuf.c
! unlock HVM stack before locking local mutex and calling hb_fs*()
functions which also unlocks HVM. It fixes possible deadlock condition
when hb_gcAll( .T. ) is executed.
* include/hbapi.h
* src/vm/garbage.c
! changed mark function semantic.
Adding support for user defined mark function I created race condition
in MT GC code. It happens because blocks marked as deleted were not
scanned by GC mark code so their subitems where not accessible.
To fix it we have to change mark function semantic. Now mark function
can be executed also for blocks currently deleted. It means that GC
block destructor should clean references to just removed items and
subblocks. The best place to make it is clearing pointers to GC blocks
just after hb_itemRelease() or hb_gcRefFree().
It is save to clean the reference just before hb_itemRelease() or
hb_gcRefFree() but only for the single block passed to these functions.
It is not save to clear reference to more then one block and then
execute above functions.
+ check reference count after destructor execution for all blocks
not only arrays - warning it may exploit some wrong C code.
- removed not longer used hb_gcRefCheck() function.
* include/hbvm.h
* src/vm/hvm.c
+ added new internal function hb_vmLockForce()
! fixed to mark GC blocks with active threads
* src/vm/thread.c
* include/hbthread.h
% modified sync mutexes used by xBase++ signal class emulation
to not use item array internally
* updated mutex destructor to new GC mark semantic
! mark GT items if GT is bound with thread item
! fixed mutex notify/subscribe code to not change GC items
when HVM stack is unlocked
! use hb_vmLockForce() to eliminate potential deadlock
+ added new C function hb_threadEnterCriticalSectionGC().
It should be used instead of hb_threadEnterCriticalSection()
in code which manipulates GC items inside critical section.
It's slower but eliminates possible deadlock condition.
Please remember that remember that both functions cannot
be used for the same mutex. So if it's necessary to use
hb_threadEnterCriticalSectionGC() in one place then it
has to be used in all others when the same mutex is locked.
* src/vm/arrays.c
* src/vm/codebloc.c
* src/vm/hashes.c
* src/rtl/hbgtcore.c
* contrib/hbcurl/core.c
* contrib/hbexpat/core.c
* updated destructors to new GC mark semantic
* contrib/hbxpp/dllx.c
! fixed destructor for pointer item created by DllPrepareCall()
Now it respects reference counter.
; added note about real behavior of library handle destructor,
I haven't changed existing code behavior but maybe it should
be done.
* contrib/xhb/hbserv.c
* src/debug/dbgentry.c
* src/rdd/wacore.c
! fixed possible deadlocks by using hb_threadEnterCriticalSectionGC()
instead of hb_threadEnterCriticalSection().
* contrib/hbmemio/memio.c
! slightly modified hb_memfsDirectory() code to avoid race condition
without using hb_threadEnterCriticalSectionGC()
* src/vm/fm.c
% reduce the lock range in HB_FM_STAT builds
* src/rtl/hbsocket.c
! added missing HVM stack unlocking in hb_socketSelect() function
* src/rtl/gtxwc/gtxwc.c
! added few missing locks for version compiled with HB_XWC_XLIB_NEEDLOCKS
* src/rdd/dbtotal.prg
* allow to use symbols instead of codeblocks
* modified Harbour extension which uses ordKey() as default group
signature to work also without index. In such case all records
are summarized into single one.
; Most of above modifications were critical for stability of MT programs.
They should allow to activate GC in any place.
* contrib/hbpgsql/rddcopy.c
! fixed typos in my recent modification and potential memory corruption
and/or wrong output due to ugly hack for last field terminator in old
code. Thanks to Aleksander Czajczynski for reporting the problem.
* src/vm/garbage.c
! added protection for activating GC from thread with unlocked HVM stack
when other thread is already executing GC passes. Such situation does
not happen in core code and the protections is only just in case.
* src/vm/hvm.c
! do not release HVM thread STOP signal when GC mark pass is activated.
It was very serious bug which could cause memory corruption when
thread unlocked HVM stack what allow to start GC mark pass by other
thread and then locked HVM and begin to change complex variables
still scanned by the GC thread. This problem have existed from the
beginning when I committed initial version of Harbour MT support.
I do not remember why I added code to remove the STOP signal - probably
I was experimenting with some new things working on Harbour MT code
and I forgot to deactivate it.
NOTE: 3-rd party developers who use GC collectible pointer items
must not activate any PRG code execution inside their mark
functions.
* include/Makefile
+ include/hbiousr.ch
* src/rtl/Makefile
+ src/rtl/iousr.c
+ added module for writting Harbour FILE IO redirectors at PRG level
+ tests/iotcp.prg
+ example code for FILE IO redirector written in PRG.
It's IOTCP and gives exactly the same functionality as TCP redirector
in contrib which is written in C.
* src/vm/runner.c
% modified internal structure to eliminate some memory allocations
* contrib/hbpgsql/rddcopy.c
% small simplification
* include/hbapifs.h
* src/rtl/filebuf.c
* src/rtl/filebufd.c
* contrib/hbcomio/comio.c
* contrib/hbmemio/memio.c
* contrib/hbnetio/netiocli.c
* contrib/hbtcpio/tcpio.c
* changed internal FILE IO API. Now all functions which do
not operate on PHB_FILE receive pointer to function table
(PHB_FILE_FUNCS) used by given redirector.
* src/rtl/vfile.c
* open wirtual files in READWRITE mode by default
* translate FO_* attributes to FXO_* ones
* src/vm/classes.c
! fixed typo in RTE message
* src/vm/garbage.c
* use different error code (1301/1302) for destructor RTE
* src/rtl/gtxwc/gtxwc.c
* src/rtl/gtxwc/gtxwc.h
+ added support for HB_GTI_FONTWEIGHT with HB_GTI_FONTW_* actions
* contrib/hbpgsql/rddcopy.c
! fixed memory leak
% encapsulate PQ calls in hb_vmUnlock()/hb_vmLock() to not stop
other threads when GC is activated
* include/hbapifs.h
* src/rtl/filebuf.c
* move HB_FILE_TYPE_MAX definition to header file
% include C stat() header only in *nix builds
* src/pp/ppcore.c
! force stringify when illegal characters are included inside
square brackets []
* contrib/rddads/adsx.c
* implemented intermediate index creation in case ADS can process index
FOR or WHILE condition.
Ex., if requested index has WHILE condition supported by server,
but index key expression is not supported (or codeblock is used),
server side index is created using WHILE condition. This intermediate
index later is used to create final index.
This logic increases speed dramatically if WHILE condition was used
to filter a few records from a large database using subindex.
* src/rdd/hbdbsort.c
* casting
* src/rtl/filesys.c
+ added additional method to extract file time in MS-Windows version of
hb_fsGetFileTime()
* include/hbapifs.h
* src/rtl/vfile.c
+ added C functions to manipulate PRG level hb_vf*() file pointer items
* include/hbapifs.h
* src/rtl/filebuf.c
+ added C functions to create/extract file IO handle from raw file handle
+ added C functions to check if file IO handle points to local file
* contrib/hbmzip/mzip.c
* changed hb_fs*() API to hb_file*() API
! fixed file time setting in *nix builds
* contrib/hbtcpio/tcpio.c
* use default timeout defined in initial hostname string in read/write
operations
* include/hbapicom.h
* src/rtl/hbcom.c
+ added new C function:
int hb_comFindPort( const char * pszDevName, HB_BOOL fCreate );
It check if given port name is already defined and if not and second
parameter fCreate is TRUE then it allocates such port in one of last
free slots. On success port number is returned. If port cannot be
found or created 0 is returned.
* include/harbour.hbx
* src/rtl/hbcomhb.c
+ added new PRG function:
hb_comFindPort( <cDeviceName> [, <lCreate> = .F. ] ) -> <nPort>
* contrib/hbplist.txt
+ contrib/hbcomio/comio.c
+ contrib/hbcomio/hbcomio.hbc
+ contrib/hbcomio/hbcomio.hbp
+ added new Harbour FILE IO redirector.
It recognizes and process names with "COM<n>:" prefix, in form like:
COM<n>:[<com_params>]
<n> is port number or port name prefixed with "$" character.
<com_params> may contain serial port parameters like baud rate, stop
and data bits, parity and flow control (XON,XOFF,CTS, RTS,DST,DTR).
As delimiter comma "," is accepted.
This redirector can be used in different subsystems using Harbour
FILE IO and stream read/write operations, i.e.
REQUEST HB_COMIO
SET PRINTER TO COM2:38400,N81,XONXOFF
can be used to connect to serial printers.
Please remember that redirectors like NETIO can be used as wrapper
to other redirectors so code like:
pFile := hb_vfOpen( "NET:192.168.0.1:::COM1:9600,8N1" )
opens 1-st serial port on the server and
pFile := hb_vfOpen( "NET:192.168.0.1:::COM$/dev/ttyUSB0:9600,8N1" )
opens "/dev/ttyUSB0" serial device on the server.
* src/vm/set.c
! fixed freed memory access exploited by interactions between
modifications in last few years.
! do not try to remove trailing ^Z char reading from the stream
if FS_END seek reports 0.
! if possible open printer/alternate/extra output in write only mode
to avoid problem on devices where read access is not available.
* src/rtl/langapi.c
* keep EN lang active after deinitialization
* src/rtl/filesys.c
! fixed condition for file time refresh in *nix builds
! fixed file time setting in *nix builds
* include/hbapifs.h
* src/rtl/Makefile
* src/rtl/filebuf.c
+ src/rtl/filebufd.c
* renamed hb_fileRegister2() to hb_fileRegisterFull()
+ added new function hb_fileRegisterPart() which simplifies writing
small FILE IO redirectors.
* contrib/hbmemio/memio.c
* contrib/hbnetio/netiocli.c
* use hb_fileRegisterFull()
* contrib/hbplist.txt
+ contrib/hbtcpio/hbtcpio.hbc
+ contrib/hbtcpio/hbtcpio.hbp
+ contrib/hbtcpio/hbtcpio.hbx
+ contrib/hbtcpio/tcpio.c
+ added new Harbour FILE IO redirector.
It recognizes and process names with "tcp:" prefix, in form like:
tcp:<host>:<port>[:<timeout>]
It can be used in different subsystems using Harbour FILE IO and
stream read/write operations, i.e.
REQUEST HB_TCPIO
SET PRINTER TO tcp:192.168.0.110:9100
can be used to connect to network printers using TCP direct printing.
* utils/hbmk2/po/hbmk2.pt_BR.po
! fixed typo in translation
* src/debug/dbgentry.c
! added additional protection against recursive debugger activation.
It should fix problem reported by Rafa.
* src/rtl/fssize.c
* use explicit open attributes.
* src/rtl/copyfile.c
! reset error object between different RTE calls in __copyFile()
! copy file attributes only on *nix platforms.
In Cl*pper __copyFile() does not copy attributes so maybe also
in *nixes we should make the same.
* contrib/xhb/xhbcopyf.c
* changed hb_fs*() API to hb_file*() API.
* include/hbchksum.h
* src/rtl/hbmd5.c
* changed C function:
void hb_md5file( HB_FHANDLE hFile, char * digest )
to
HB_BOOL hb_md5file( const char * pszFileName, char * digest )
Warning: [INCOMPATIBLE]
* src/rtl/copyfile.c
* src/rtl/fscopy.c
* src/rtl/hbmd5.c
* src/rtl/isprint.c
* src/rtl/memofile.c
* changed hb_fs*() API to hb_file*() API
* contrib/hbnetio/netiocli.c
! fixed GPF when non attributes are passed to hb_fileDirectory()
redirected to NETIO - thanks to Rolf for the info about the problem.
* contrib/hbnetio/netiosrv.c
! allow to pass empty directory to hb_fileDirectory() redirected to NETIO
* src/vm/set.c
! added missing FXO_APPEND flag.
It should fix#54.
* src/vm/asort.c
! respect milliseconds part when timestamp values are compared in ASORT()
Note: ASORT() does not use exact comparison so when mixed date and
timestamp values are used only date is significant. Just like in:
ASort( aValue, {|x, y| x < y } )
* src/rtl/filebuf.c
! fixed C&P typo.
It should fix problem with SET PRINTER TO reported by Rolf.
* src/rtl/hbgtcore.c
! added missing break after HB_GTI_VERSION
* ChangeLog.txt
* include/harbour.hbx
* src/rtl/Makefile
- src/rtl/xfile.c
+ src/rtl/vfile.c
* renamed PRG functions HB_X*() to HB_VF*()
* renamed PRG functions hb_vf[GS]etAttr() to hb_vfAttr[GS]et()
* renamed PRG functions hb_vf[GS]etDateTime() to hb_vfTime[GS]et()
* include/hbapifs.h
* src/rtl/filebuf.c
* src/rtl/fscopy.c
* contrib/hbmemio/memio.c
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
* renamed C functions hb_file[GS]etAttr() to hb_fileAttr[GS]et()
* renamed C functions hb_file[GS]etFileTime() to hb_fileTime[GS]et()
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
+ added support for redirecting hb_vfConfig() to the server.
NETIO does not use it anyhow NETIO works as full redirector
to server system and it may be used on the server side.
* include/hbapifs.h
* src/rtl/filebuf.c
+ added new C function hb_filePOpen()
* include/hbset.h
* src/vm/set.c
* src/rtl/console.c
* changed hb_fs*() API to hb_file*() API in HVM SETs
* src/vm/memvars.c
* changed hb_fs*() API to hb_file*() API in .mem files
* src/vm/runner.c
* changed hb_fs*() API to hb_file*() API in .hrb files
* include/hbapifs.h
* src/rtl/filesys.c
* renamed hb_fsPOpen() param
* contrib/hbhpdf/3rd/libhpdf/hpdffdfj.c
! removed executable attribute
* src/vm/thread.c
! fixed typo reported by Viktor - thanks.
* include/hbapifs.h
* src/rtl/hbproces.c
* src/rtl/spfiles.c
* src/rtl/filesys.c
* src/rtl/file.c
* synced parameter file and dir names used in declarations and
implementations
* include/hbrddcdx.h
+ added few fields used in ADI files
* src/codepage/cp_utf8.c
* src/rtl/cdpapi.c
! always return -1, 0 and 1 from hb_cdpcmp() function.
Workaround for problem exploited by optimized memcmp() function.
* src/rdd/dbfntx/dbfntx1.c
! fixed possible sort problem when optimized memcmp() is used
* added feew missing const declarations
* src/rdd/dbfntx/dbfntx1.c
* src/rdd/dbfnsx/dbfnsx1.c
* src/rdd/dbfntx/dbfntx1.c
! fixed OrdWildSeek() to work with optimized memcmp()
* include/hbapifs.h
* src/rtl/disksphb.c
+ added new C function:
double hb_fsDiskSpace( const char * pszPath, HB_USHORT uiType );
* include/hbapifs.h
* src/rtl/direct.c
+ added new C function:
PHB_ITEM hb_fsDirectory( const char * pszDirSpec,
const char * pszAttributes );
* src/rtl/filesys.c
! report EOF in hb_fsEof() also when file position is out of file size
* updated comment
* include/hbapifs.h
* src/rtl/filebuf.c
+ extended Harbour FILE IO API and added support for read/write filepos,
directory and link operations.
Read/write filepos support in some systems (i.e. *nixes) needs additional
emulation code. If it's not necessary then this functionality can be
disabled by FXO_NOSEEKPOS attribute. Now this attribute is used by our
RDD code.
* src/rtl/Makefile
+ src/rtl/xfile.c
+ added PRG interface to Harbour FILE IO API
The following PRG functions are available for Harbour programmers:
HB_XEXISTS( <cFileName>, [ @<cDestFileName> ] ) -> <lOK>
HB_XERASE( <cFileName> ) -> <nResult>
HB_XRENAME( <cFileSrc>, <cFileDst> ) -> <nResult>
HB_XCOPYFILE( <cFileSrc>, <cFileDst> ) -> <nResult>
HB_XDIREXISTS( <cDirName> ) -> <lExists>
HB_XDIRMAKE( <cDirName> ) -> <nSuccess>
HB_XDIRREMOVE( <cDirName> ) -> <nSuccess>
HB_XDIRECTORY( [ <cDirSpec> ], [ <cAttr> ] ) -> <aDirectory>
HB_XDIRSPACE( <cDirName>, [ <nInfoType> ] ) -> <nFreeSpace>
HB_XGETATTR( <cFileName>, @<nAttr> ) -> <lOK>
HB_XSETATTR( <cFileName>, <nAttr> ) -> <lOK>
HB_XGETDATETIME( <cFileName>, @<tsDateTime> ) -> <lOK>
HB_XSETDATETIME( <cFileName>, <tsDateTime> ) -> <lOK>
HB_XLINK( <cExistingFileName>, <cNewFileName> ) -> <nSuccess>
HB_XLINKSYM( <cTargetFileName>, <cNewFileName> ) -> <nSuccess>
HB_XLINKREAD( <cFileName> ) -> <cDestFileName> | ""
HB_XOPEN( <cFileName>, [ <nMode> ], [ <nAttr> ] ) -> <pHandle> | NIL
HB_XCLOSE( <pHandle> ) -> <lOK>
HB_XLOCK( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) -> <lOK>
HB_XUNLOCK( <pHandle>, <nStart>, <nLen> ) -> <lOK>
HB_XLOCKTEST( <pHandle>, <nStart>, <nLen>, [ <nType> ] ) ;
-> <nPID> | 0 (nolock) | -1 (err)
HB_XREAD( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nTimeOut> ] ) ;
-> <nRead>
HB_XWRITE( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nTimeOut> ] ) ;
-> <nWritten>
HB_XREADAT( <pHandle>, @<cBuff>, [ <nToRead> ], [ <nAtOffset> ] ) ;
-> <nRead>
HB_XWRITEAT( <pHandle>, <cBuff>, [ <nToWrite> ], [ <nAtOffset> ] ) ;
-> <nWritten>
HB_XSEEK( <pHandle>, <nOffset>, [ <nWhence> ] ) -> <nOffset>
HB_XTRUNC( <pHandle>, [ <nAtOffset> ] ) -> <lOK>
HB_XSIZE( <pHandle> ) -> <nSize>
HB_XEOF( <pHandle> ) -> <lEOF>
HB_XFLUSH( <pHandle>, [ <lDirtyOnly> ] ) -> NIL
HB_XCOMMIT( <pHandle> ) -> NIL
HB_XCONFIG( <pHandle>, <nSet>, [ <nParam> ] ) -> <nResult>
HB_XHANDLE( <pHandle> ) -> <nOsHandle>
HB_XTEMPFILE( @<cFileName>, [ <cDir> ], [ <cPrefix> ], [ <cExt> ], ;
[ <nAttr> ] ) -> <pHandle> | NIL
Please remember that not all redirectors have to support all of them.
I.e. MEMIO allows to use directory names in files but does not allow to
create or remove directories. It also does not support file attributes
and times in current implementation though it can be easy added.
HB_XCONFIG() is general function which can be used by redirector
authors to make some special operations which are specific to given
device.
HB_XTEMPFILE() always creates temporary files on local system without
switching to FILE IO redirector. It's intentional behavior.
* src/rtl/fscopy.c
* used Harbour FILE IO API in hb_fsCopy()/HB_FCOPY()
Please remember that HB_FCOPY() always makes operation using current
system when HB_XCOPY() may optimize it moving the operation to low
level subsystem or even other computer i.e. NETIO can do that when
both files are located on the same server.
* src/rdd/delim1.c
* src/rdd/sdf1.c
* src/rdd/dbf1.c
* src/rdd/dbfcdx/dbfcdx1.c
* src/rdd/dbffpt/dbffpt1.c
* src/rdd/dbfnsx/dbfnsx1.c
* src/rdd/dbfntx/dbfntx1.c
* src/rdd/hsx/hsx.c
* open files with FXO_NOSEEKPOS attribute to inform low level API that
read/write filepos is not used (disables unnecessary filepos emulation).
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
+ added support for extended Harbour FILE IO API.
* contrib/hbnetio/utils/hbnetio/netiomgm.hb
! renamed "quit" command to "shutdown" as suggested by Rolf.
* contrib/hbnetio/utils/hbnetio/hbnetio.prg
* allow to interrupt server process using ESC when run in console window.
* contrib/hbmemio/memio.c
+ added support for extended Harbour FILE IO API.
I left two minor TODO notes - maybe someone will try to implement it.
* src/rtl/saverest.c
! added protection against passing to small screen
buffer to RestScreen() function (issue #43)
* src/rtl/xsavescr.c
! save and reuse original screen size in
__XSaveScreen()/__XRestScreen() functions