* config/global.mk
* set HARBOUR=F:100 during build process in OS2 builds - it increases
maximum number of open handles per process from 20 to 100 so it should
be possible to use -j<n> switch during Harbour compilation - please
test, i.e.:
os2-make -j3
* contrib/xhb/hbcompat.ch
! fixed pp rules for Str(,,, <lStrip> ) translation
* include/hbapifs.h
* src/rtl/filesys.c
+ added new C function:
HB_FHANDLE hb_fsOpenEx( const char * pszFileName, HB_FATTR nAttr,
HB_USHORT uiFlags );
* minor cleanup
* include/hbmemory.ch
* src/vm/fm.c
+ added two new actions for Memory() function:
HB_MEM_STATISTICS - return non 0 value if FM statistic is enabled
HB_MEM_ISLIMIT - return non 0 value if used memory limit is
supported
+ added new PRG function:
__fm_allocLimit( [ <nNewLimit> ] ) -> <nPrevLimit>
It allows to set limit for maximum used memory in some memory
managers, -1 means no limit.
Now it works with DLMALLOC and in ST mode it's limit for memory
allocated from system for whole application. In MT mode when
HB_FM_DLMT_ALLOC (default for DLMALLOC) is enabled it's limit for
single MSPACE (Harbour allocates 16 MSPACES and balance them
between threads to improve scalability) so it's rather per thread
limit. If memory statistic module is enabled during Harbour build
process then this limit works with any memory manager and defines
limit for total memory allocated by Harbour application regardles
of MT or ST mode.
* src/vm/hvm.c
* use HB_MEM_STATISTICS instead of HB_MEM_USEDMAX to check if memory
statistic module is enabled
* include/hbsocket.h
* src/rtl/hbsockhb.c
+ added new C function:
HB_BOOL hb_sockexItemReplace( PHB_ITEM pItem, PHB_SOCKEX pSock );
* contrib/hbssl/ssl_sock.c
+ replace passed socket structure to hb_socketNewSSL_connect() and
hb_socketNewSSL_accept() with new one using SSL filter if it was
passed by reference, current syntax is:
hb_socketNewSSL_connect( [@]<pSocket>, <pSSL> [, <nTimeout> ] )
-> <pSocketSSL>
hb_socketNewSSL_accept( [@]<pSocket>, <pSSL> [, <nTimeout> ] )
-> <pSocketSSL>
* contrib/hbssl/hbssl.hbm
* contrib/hbssl/hbssl.hbx
+ contrib/hbssl/ssl_hbcon.prg
+ added new PRG functions which can be used for fast initialization of
SSL connection:
hb_SSL_new() -> <pSSL>
hb_SSL_connect_inet( <pSocket>, [ <nTimeOut> ], [ @<cInfo> ] )
-> <lConnected>
hb_SSL_connect_socket( <pSocket>, [ <nTimeOut> ], [ @<cInfo> ] )
-> <lConnected>
They do not need any addiitonal initialization code and can be called
as first and the only SSL functions in user code.
* contrib/hbtip/mail.prg
! fixed bug reported by Lorenzo - thanks
* use hb_MemoWrit() in :detachFile() to honor Harbour File IO API
* cleanup
* src/common/hbffind.c
* src/rtl/gtos2/gtos2.c
* src/rtl/hbproces.c
* cleaned DosAllocMem() flags
* src/common/hbfsapi.c
* src/rtl/hbproces.c
* pacified OS2 GCC warnings
* config/global.mk
* show information about HB_MT build parameter if set by user
* src/vm/hvm.c
+ allow to compare symbol items with == operator, i.e.:
? @QOut() == &( "@QOut()" )
* include/hbapiitm.h
* src/vm/itemapi.c
+ added new C function:
hb_itemCompare( PHB_ITEM pItem1, PHB_ITEM pItem2,
HB_BOOL bForceExact, int * piResult );
For compatible types it compares pItem1 with pItem2 setting piResult
to -1, 0 or 1 if pItem1 is <, == or > then pItem2 and returns true
otherwise it returns false and does not touch piResult.
+ allow to compare symbol items in hb_itemEqual()
* include/hbrdddel.h
* src/rdd/delim1.c
+ added to DELIM RDD support for defined by user default filename
extenssion. It can be changed by:
hb_rddInfo( RDDI_TABLEEXT, ".csv", "DELIM" )
+ added to DELIM RDD support for exporting initial record with field
names. It can be enabled by:
hb_rddInfo( RDDI_SETHEADER, 1, "DELIM" )
and disabled by:
hb_rddInfo( RDDI_SETHEADER, 0, "DELIM" )
Importing from CSV files with such header is not supported yet but
I plan to add it so in the future RDDI_SETHEADER=1 will also effect
import (APPEND FROM).
* include/hbapigt.h
* src/rtl/gttrm/gttrm.c
* modified GTTRM to generate HB_K_CLOSE if input stream is closed and
then HB_K_TERMINATE on next inkey calls.
* src/rtl/hbznet.c
* src/rtl/hbzsock.c
! cleanup
* include/hbrdddel.h
* include/hbrddsdf.h
* src/rdd/delim1.c
* src/rdd/sdf1.c
+ added support for any standard EOL combination to DELIM and SDF RDDs,
Now LF, CRLF, CR and LFCR EOLs are supported and automatically
recognized during import if one of such EOLs is also set in HVM by
_SET_EOL.
% use 8192 bytes read ahead buffer to speed up import from DELIM and
SDF RDDs
+ modified file IO operations to work with stream only (no support for
file seek) Harbour File IO drivers
% optimized some File IO operations
* strip all EOF (^Z) characters from imported data. It's not strictly
Cl*pper compatible because Cl*pper interrupts import on first ^Z
character anyhow it was always the source of problems when .txt
files are concatenated by tools like 'cat' in *nixes so I decided
to change it.
+ added support RECORD clause command in commands like:
APPEND FROM "data.txt" RECORD (nRec) DELIMITED
APPEND FROM "data.txt" RECORD (nRec) SDF
It's Harbour extension - Cl*pper does not support it.
+ generate RTE when some unsupported in transfer RDDs methods are
called
* include/harbour.hbx
* src/vm/hvm.c
+ added new PRG function:
__RecoverErrorBlock() -> <bError> | NIL
It extracts previous error block pushed on HVM stack
by BEGIN SEQUENCE WITH ...
* src/rdd/dbf1.c
! fixed detecting VFP tables broken in my previous
modification - thanks to Mario H. Sabado for information
about the problem.
* include/dbinfo.ch
* include/hbrdddbf.h
* src/rdd/dbf1.c
+ added new RDD switch RDDI_SETHEADER
It allows to define how DBF header is updated in tables which
will be opened later, i.e.:
// maximize performance reducing number of DBF header updating
// header is updated only when table is closed if before new
// record was added
hb_rddInfo( RDDI_SETHEADER, DB_SETHEADER_MINIMAL )
or:
// update header in the same moment as Clipper and xBase++
// and store only last two digit from the year for compatibility
// with old dBase and FoxPro versions
hb_rddInfo( RDDI_SETHEADER, ;
hb_bitOr( DB_SETHEADER_CLIPPER, DB_SETHEADER_YYEAR ) )
// DB_SETHEADER_CLIPPER
By default Harbour uses DB_SETHEADER_APPENDSYNC.
For more information look at comments for DB_SETHEADER_* switches
in dbinfo.ch
+ added new table switch DBI_SETHEADER
It has the same meaning as RDDI_SETHEADER but changes the header
updated mode of already open table by dbInfo() function.
* src/rtl/filebuf.c
! added missing redirection for Configure() method.
* src/rtl/hbproces.c
! fixed sysconf() emulation for OpenWatcom 1.9 and earlier to work with
_SC_PAGESIZE
* include/hbexpra.c
! accept strings passed in 2-nd parameter of _GET_() function
with the highest priority for macro and macroalias expressions
! fixed late evaluation of macroalias expressions in GET variables.
Thanks to Volodimyr for information about the problem and self
contain code example.
* include/hbexprb.c
! fixed typo in SetGet expression LValue validation
* include/hbstack.h
* src/vm/estack.c
+ added new C function:
HB_ISIZ hb_stackBaseSymbolOffset( PHB_SYMB pSymbol );
it returns offset of pSymbol function frame on HVM stack or -1
if function/procedure pointed by pSymbol is not called.
* contrib/hbnetio/readme.txt
* contrib/hbnetio/netiosrv.c
* contrib/hbnetio/hbnetio.hbx
+ added new server side function:
netio_ServedConnection() -> <pConnectionSocket>
It returns connection served by netio_Server() in current thread and
can be used inside executed RPC functions to access <pConnectionSocket>
* include/hbjson.h
* src/rtl/hbjson.c
+ added new C function:
char * hb_jsonEncodeCP( PHB_ITEM pValue, HB_SIZE * pnLen,
HB_BOOL fHuman, PHB_CODEPAGE cdp );
It allows to pass explicitly codepage in which strings inside pValue
are encoded. If cdp parameter is not NULL then it's used to extract
unicode character values from passed strings and this values is used
to encode to encode non ASCII characters as "\uXXXX" where XXXX is
unicode character value. Data serialized in such way is 7bit clean.
If this parameter is NULL then strings are encoded in raw form just
like in hb_jsonEncode().
+ added new C function:
HB_SIZE hb_jsonDecodeCP( const char * szSource, PHB_ITEM pValue,
PHB_CODEPAGE cdp );
It allows to pass explicitly codepage used for strings decoded from
JSON data. If this parameter is NULL then strings are decoded in raw
form and unicode character with code over 255 are converted to '?'
char.
+ added optional 3-rd parameter with codepage ID to PRG functions
hb_jsonEncode() and hb_jsonDecode(). If this parameter is not given
then above functions works like before this modification:
hb_jsonEncode() uses raw string encoding and hb_jsonDecode() uses
current HVM CP to decode characters encoded as \uXXXX.
+ modified PRG function hb_jsonDecode() to return decoded data
instead of length of decoded data when second parameter is not
passed by reference.
* include/harbour.hbx
* src/rtl/dateshb.c
+ added two new PRG functions:
hb_SecToT( <nSeconds> ) -> <tTime>
hb_MSecToT( <nMilliseconds> ) -> <tTime>
* include/hbset.h
* src/vm/set.c
+ added new C function:
int hb_setUpdateEpoch( int iYear );
if necessary it converts year respecting _SET_EPOCH settings
* src/rtl/dates.c
* use hb_setUpdateEpoch() instead of local code
* src/rdd/dbf1.c
! respect _SET_EPOCH decoding DBF update time from DBF HEADER
(LUpdate() function).
It's not Cl*pper compatible anyhow looks that most of tools
stores only last two digits from the year (just like in the
DBF documentation) and -1900 trick is not used so it helps
to decode correct update date.
* store 'year % 100' instead of 'year - 1900' in DBF header
when DBF table with VFP signature is used (DB_DBF_VFP).
* include/hbapirdd.h
* src/rdd/wacore.c
* changed 4-th parameter of hb_rddRequestArea() from HB_BOOL fWait to
HB_ULONG ulMilliSec
[INCOMPATIBLE]
* src/rdd/dbdetach.c
+ accept optionally as 4-th parameter of hb_dbRequest() numeric value
with timeout in seconds. The previous version using xBase++ compatible
parameters (logical value <lWait> in 4-th parameter) is still working.
; above modifications are based on request and patch sent to harbour-devel
list by Rolf (many thanks), ref:
https://groups.google.com/forum/?hl=pl#!topic/harbour-devel/Pu2b1M5VXjU
* include/hbgtinfo.ch
* removed unused HB_GTI_KBD_* macros
* redefined few other HB_GTI_KBD_* macros to be more HB_KF_* friendly.
[INCOMPATIBLE]
; Warning this modification is not binary compatible so if someone uses
HB_GTI_KBD_SCROLOCK, HB_GTI_KBD_NUMLOCK, HB_GTI_KBD_CAPSLOCK,
HB_GTI_KBD_LSHIFT, HB_GTI_KBD_RSHIFT,
HB_GTI_KBD_LCTRL, HB_GTI_KBD_RCTRL,
HB_GTI_KBD_LALT, HB_GTI_KBD_RALT,
HB_GTI_KBD_LWIN, HB_GTI_KBD_RWIN or
HB_GTI_KBD_MENU
then he should recompile his code with new hbgtinfo.ch header files.
* include/hbgtcore.h
* src/rtl/gtkeycod.c
* src/rtl/gtdos/gtdos.c
* src/rtl/gtos2/gtos2.c
* src/rtl/gtpca/gtpca.c
* src/rtl/gtstd/gtstd.c
+ added support for Harbour extended keycodes
* src/rtl/gtos2/gtos2.c
+ added support for HB_GTI_KBDSHIFTS
* src/rtl/gtdos/gtdos.c
! fixed CTRL+C and CTRL+BREAK handling in OpenWatcom builds
* src/rtl/inkeyapi.c
! fixed translation for CTRL + @
* tests/gtkeys.prg
+ added raw keyboard test - it disables any additional interactions
* modified Harbour output to show more information about extended
keycodes
* include/hbapigt.h
* src/rtl/inkeyapi.c
+ added new C function:
int hb_inkeyKeyExt( int iKey );
It extracts function/edit key code value HB_KX_* from Harbour extended
key code. If passed keycode is not valid extended keycode which points
to function/edit key then 0 is returned.
* include/harbour.hbx
* src/rtl/inkey.c
+ added new PRG function hb_keyExt() - it's wrapper to hb_inkeyKeyExt()
* include/harbour.hbx
* src/rtl/mlcfunc.c
! restored original Cl*pper behavior in memo line functions,
test shows that inside MemoEdit() Cl*pper internally uses a little
bit different rules to format text then in memo line functions,
It's Cl*pper bug but hard to fix because any differences to Cl*pper
in this area cause that someone reports them as bug. So I decided
to leave original Cl*pper behavior for compatibility and add new
function which can be used in MemoEdit() and related code.
+ added new memo line function:
hb_MLEval( <cString>, <bCode>, [ <nLineLength>=79 ],
[ <nTabSize>=4 ], [ <lWrap>=.T. ],
[ <nPos> ], [ @<nRow> ], [ @<nCol> ] ) -> <nLines>
it formats texts using rules like in Cl*pper MemoEdit() not Cl*pper
memo lines functions. For each processed line <bCode> is executed
with 2 parameters: <cLine> and <lSoftCR>. It recognizes and accepts
any EOLs just like hb_ATokens( <cText>, .T. ) and strips or converts
soft CRs depending on word wrap mode.
* src/rtl/teditor.prg
* Use hb_MLEval() to format text
% minor optimization
* src/rtl/memoedit.prg
* enabled Harbour extended key codes
* small optimization
! fixed ME_BOTTOMRIGHT processing
! fixed initial line size calculation
* src/vm/thread.c
* removed dymmy code
* src/rtl/hbcom.c
* src/rtl/gtcrs/gtcrs.c
* src/rtl/gtpca/gtpca.c
* src/rtl/gtstd/gtstd.c
* src/rtl/gttrm/gttrm.c
* added workaround for bug in some Linux kernels (i.e.
3.13.0-64-generic Ubuntu) in which select() unconditionally
accepts terminal device for reading if c_cc[ VMIN ] = 0
It's very serious problem, i.e. in GTTRM no input is possible
in such kernels without this workaround.
* src/rtl/dirscan.prg
* modified hb_DirScan() and hb_DirRemoveAll() to work with Harbour
File IO API (hb_vf*() functions)
+ added new PRG function:
hb_FileDelete( <cFileMask> [, <cAttr> ] ) -> <lResult>
this function removes files which match given <cFileMask>
(it may contain path) and returns .T. if at least one file
was deleted. Optional <cAttr> parameter can be used to include
system ("S") and hidden ("H") files. If <cAttr> contains "R"
letter then before deleting READONLY attribute is removed from
files (it's necessary to remove files with READONLY attribute
in systems like DOS, MS-Windows or OS2). This function uses
Harbour File IO API (hb_vf*() functions)
* remove READONLY attribute from files in hb_DirRemoveAll()
* include/harbour.hbx
+ added hb_DirRemoveAll() and hb_FileDelete()
* contrib/hbct/files.c
! do not allow to remove empty directories by FileDelete() function
even if user explicitly sets directory attribute - CT3 compatible fix.
! remove READONLY attribute before deleting READONLY files if 2-nd
parameter of FileDelete() contains READONLY bit
* src/rtl/filesys.c
* formatting
* ChangeLog.txt
! typo
* include/hbapicls.h
* src/vm/classes.c
* minor modification in variable name
* src/rtl/filebuf.c
* src/rtl/fscopy.c
* src/rtl/fslink.c
* src/rtl/vfile.c
* cleaned FError() setting. It should not be changed by C file IO
functions because they can be activated from RDD code so accessing
work area field could change the FError() result, i.e. this code
does not work when FError() is changed by C level IO operations:
AnyFunc( FSeek( hFile, 0, FS_END ), field->MEMOVAL, FError() )
Even simple field access may cause file IO operations in RDD code
when relations are set because records in child area are repositioned
only when necessary (when user tries to make some operations on this
area). In the past RDD code was full of constructions like:
uiSaveError = hb_fsFError();
// make some IO operations
hb_fsSetFerror( uiSaveError );
to eliminate such overhead I separated PRG level FError() from
C level IOError(). Please keep it.
* ChangeLog.txt
! few typos
* include/hbvmpub.h
* src/vm/hvm.c
+ added support for hb_vmAtInit(), hb_vmAtExit() and hb_vmAtQuit()
functions for dynamically loaded libraries
This modification should also fix issue #33
* contrib/hbhpdf/3rd/libhpdf/hpdfimac.c
! removed obsolete memory.h
* contrib/hbhpdf/3rd/libhpdf/libhpdf.dif
* rediffed
* include/hbdate.h
* enabled reentrant safe version of localtime() and gmtime() in all
OpenWatcom builds
* src/nortl/nortl.c
+ added hb_fsSetError()
* include/hbapifs.h
* src/common/hbfsapi.c
+ added new C function for OS2 builds: hb_fsOS2QueryPathInfo()
Unlike DosQueryPathInfo() it uses dir entries so it does not need to
open the file what can create file sharing violation problem.
+ added new C function for OS2 builds: hb_isWSeB()
It returns true if OS2 version supports long file API
(IBM OS/2 Warp Server for e-Business)
+ added new C functions for OS2 builds:
hb_fsOS2DosOpenL(), hb_fsOS2DosSetFileLocksL(),
hb_fsOS2DosSetFilePtrL(), hb_fsOS2DosSetFileSizeL()
These are dynamically initialized wrappers to OS2 long file API
functions if such functions exists in given OS2 version.
* src/common/hbfsapi.c
* use hb_fsQueryPathInfo() in OS2 builds of hb_fsNameExists(),
hb_fsFileExists() and hb_fsDirExists()
* src/common/hbffind.c
+ added support for long files (longer then 4GB) in OS2 builds.
It also detects OS2 version to check if long file API is supported.
! fixed file error setting in OS2 builds
* src/rtl/filesys.c
* use hb_fsQueryPathInfo() in OS2 builds of hb_fsGetFileTime() and
hb_fsGetAttr()
* use hb_fsOS2*() functions for long files
* src/rtl/fssize.c
* use hb_fsQueryPathInfo() in OS2 builds of hb_fsFSize()
; please make real life tests in OS2
* include/hbdefs.h
* changed reference 32-bit reference counters in Win64 builds to 64-bit
ones. It resolves problems with data alignment in memory allocated
by hb_xgrab().
* src/vm/asort.c
* removed hack for MinGW64 build from new array sort code,
after switching to 64bit reference counters it should not
be longer necessary because allocated that has 64bit alignment
* include/hbapifs.h
* src/rtl/filebuf.c
* added new C function hb_fileLoadData() - it can be used to load data
from already opened regular files and streams
* include/harbour.hbx
* src/rtl/vfile.c
+ added new PRG function:
hb_vfLoad( <cFileName>, [ <nMaxSize> ] ) -> <cFileBody> | NIL
* src/vm/runner.c
* use hb_fileLoadData()
* contrib/hbwin/win_bmp.c
* use hb_fileLoad()
* include/hbapifs.h
* src/rtl/filebufd.c
* moved HB_FILE_ERR_UNSUPPORTED macro to header file
* include/hbapifs.h
* src/rtl/filebuf.c
* added new C function hb_fileLoad() - it can be used to load data
from regular files and streams
* src/rtl/memofile.c
* modified [hb_]Memo{Read|Writ}() to work with streams, i.e. now
this code works:
REQUEST HB_PIPEIO
cDir := hb_memoRead( "|ls -la" )
? upper( cDir )
or:
cData := hb_memoRead( "|xz -c data.gz" )
? hb_memoWrit( "data2.txt", cData )
? hb_memoWrit( "|sh -c 'xz -9 -e > data2.xz'", cData )
* src/rtl/fscopy.c
* removed not used in current code unix header files
* ChangeLog.txt
! fixed typo in ChangeLog entry. I used hb_socketNew() instead of
hb_socketSetFilter()
* include/hbapifs.h
* src/rtl/filebuf.c
+ added helper C function:
HB_SIZE hb_fileResult( HB_SIZE nSize );
It converts ( HB_SIZE ) FS_ERROR to 0 so it can be used to wrap
hb_fileRead()/hb_fileWrite() to force previous results.
* src/rdd/dbffpt/dbffpt1.c
* reduced variable scope
* src/rtl/copyfile.c
! fixed typo in last commit - thanks to Viktor.
* include/fileio.ch
+ added few HB_VF_* macros for hb_vfConfig() settings
* contrib/hbcomio/comio.c
* contrib/hbtcpio/tcpio.c
+ implemented HB_VF_TIMEOUT, HB_VF_PORT, HB_VF_SHUTDOWN, HB_VF_RDHANDLE
and HB_VF_WRHANDLE hb_vfConfig() settings, i.e. now
hb_vfConfig( pFile, HB_VF_TIMEOUT, <nTimeOut> ) -> <nTimeOut>
can be used to change default timeout in TCP and COM Harbour File IO
handles.
* include/hbsocket.h
* src/rtl/hbsockhb.c
+ added socket filters to standard socket API.
At C level hb_sockex*() function with PHB_SOCKEX handler can be
used to operate on socket filters. At PRG level standard hb_socket*()
functions can be used.
The following things has been changed in PRG hb_socket*() functions:
hb_socketErorrString() can accept <pSocket> as 1-st or 2-nd parameter
and redirect call to socket filter errorStr() method.
hb_socketClose() executes automatically shutdown() for connected
sockets - it is important in windows only where without explicit
call to shutdown() before close transmitted data can be lost.
hb_socketSend() and hb_socketRecv() can be redirected to filter
streams if filter set such redirection. If filter does not redirect
them then they operate on raw sockets. If hb_socketSend() is
redirected then sent data is flushed automatically.
The following new PRG functions has been added:
Add/replace socket filter:
hb_socketSetFilter( <pSocket>, [<cFilterName>], [<hParams>] )
-> <pSocket> | NIL
<cFilterName> is filter name, It's possible to set many filters
in single hb_socketSetFilter() call separating filter names
with "|" character, i.e.:
pSock := hb_socketSetFilter( pSock, "ZSOCK|BFSOCK", hParams )
<hParams> is hash array with initialization parameters used by
given socket filter. The core implementation recognize the
following settings:
"readahead" - numeric value with size of read ahead buffer
"flush" - numeric value with auto flush parameter (for more
information look at hb_socketAutoFlush() below)
"redir" - logical value which can be use to enable/disable
hb_socketSend() and hb_socketRecv() redirection
to filter stream.
Return filter name used by socket:
hb_socketGetFilter( <pSocket> ) -> <cFilterName>
Read from socket stream:
hb_socketRead( <pSocket>, @<cData>, [<nLen> = Len( cData )],
[<nTimeout> = FOREVER] ) -> <nRead>
this function is similar to hb_socketRecv() but is always
redirected to socket stream filters.
Write to socket stream:
hb_socketWrite( <pSocket>, <cData>, [<nLen> = Len( cData )],
[<nTimeout> = FOREVER] ) -> <nWritten>
this function is similar to hb_socketSend() but it is always
redirected to socket stream filters. Written data is not flushed
by default and it should be flushed explicitly by hb_socketFlush().
Automatic flushing can be enabled by hb_socketAutoFlush() function.
Flush data written to socket:
hb_socketFlush( <pSocket>, [<nTimeout> = FOREVER], [<lSync>] )
-> <nNotFlushed>
<lSync> parameter is logical value which can be used to force
special synchronization method in some filters. Usually users
do not have to use it in normal code.
Enable/disable automatic flushing of written data.
hb_socketAutoFlush( <pSocket>, [ <nTimeout> ] ) -> <nTimeout>
<nTimeout> is timeout for automatic flush operation on written
data in milliseconds. <nTimeout> = -1 means wait forever and
<nTimeout> = 0 disables auto flush.
automatic flushing can help in adopting existing code anyhow it
may strongly reduce the performance in some filters, i.e.
compression filters like ZSOCK have to add special data to the
stream after each flush operation so it's suggested to call
flush explicitly when we want to force delivering written data
to the peer.
* include/hbznet.h
* src/rtl/hbznet.c
+ added ZNET socket filter - compressed and encrypted streams are
compatible with hb_znet*() streams. The old hb_znet*() interface
is obsolete for pure socket communication and if not used as
hb_inet*() filter then should be replaced by hb_sockex*() in
user programs.
ZNET socket filter can be created by new PRG functions:
hb_socketNewZNet( <pSocket>, [<cPass>], [<nCompressionLevel>], ;
[<nStrategy>] ) -> <pSocket> | NIL
or by standard socket API with "ZNET" as filter name.
ZNET filter recognize the following settings in initialization
hash array:
"key" or "pass" - string with encryption password
"zlib" - numeric compression level (HB_ZLIB_COMPRESSION_*)
"zs" - numeric ZLIB compression strategy (HB_ZLIB_STRATEGY_*)
ZNET filter always disables any other filters and operates on raw
socket.
Please remember that it's optional module. If programmer does not
use hb_socketNewZNet() explicitly and prefers using hb_socketNew()
then he should force linking this module by REQUEST hb_socketNewZNet
+ added fSync parameter to hb_znetFlush()
[INCOMPATIBLE]
* src/rtl/hbinet.c
* call flush filter function before socket is closed
* src/rtl/Makefile
+ src/rtl/hbzsock.c
+ added ZSOCK socket filter - ZLIB and GZIP compression for socket
streams.
ZSOCK socket filter can be created by new PRG functions:
hb_socketNewZSock( <pSocket>, [<hParams>] ) -> <pSocket> | NIL
or by standard socket API with "ZSOCK" as filter name.
Programmers using hb_socketNew() can force linking this module by
REQUEST hb_socketNewZSock
ZSOCK filter can be used with other filters.
ZSOCK filter recognize the following settings in initialization
hash array:
"zlib" - numeric compression level (HB_ZLIB_COMPRESSION_*)
"zs" - numeric ZLIB compression strategy (HB_ZLIB_STRATEGY_*)
"zin" - logical value which allow to enable/disable ZLIB
decompression on input stream (default)
"gzin" - logical value which allow to enable/disable GZIP
decompression on input stream - it's possible to
enable both ZLIB and GZIP decompression together
so both streams can be decompress
"zout" - logical value which allow to enable/disable ZLIB
compression on output stream (default)
"gzout" - logical value which allow to enable/disable GZIP
compression on output stream - if both "zout" and
"gzout" are enabled GZIP compression is used.
* src/rtl/Makefile
+ src/rtl/hbbfsock.c
+ added BFSOCK socket filter - BlowFish input and output stream
encryption in CTR mode.
BFSOCK socket filter can be created by new PRG functions:
hb_socketNewBFSock( <pSocket>, [<hParams>] ) -> <pSocket> | NIL
or by standard socket API with "BFSOCK" as filter name.
Programmers using hb_socketNew() can force linking this module by
REQUEST hb_socketNewBFSock
BFSOCK filter can be used with other filters, i.e. with ZSOCK.
Please only remember that good encryption algorithms have to
generate data which cannot be compressed so using "BFSOCK|ZSOCK"
only wastes resources and correct filter order is "ZSOCK|BFSOCK".
BFSOCK filter recognize the following settings in initialization
hash array:
"key" or "pass" - string with encryption password
"iv" - string with initialization vector for CTR mode
* contrib/hbssl/hbssl.ch
* contrib/hbssl/hbssl.h
* contrib/hbssl/hbssl.hbm
* contrib/hbssl/hbssl.hbx
* contrib/hbssl/ssl.c
* contrib/hbssl/ssl_inet.c
+ contrib/hbssl/ssl_sock.c
+ added SSL socket filter
SSL socket filter can be created by new PRG functions:
hb_socketNewSSL_connect( <pSocket>, <pSSL> [, <nTimeout> ] )
-> <pSocketSSL> | NIL
hb_socketNewSSL_accept( <pSocket>, <pSSL> [, <nTimeout> ] )
-> <pSocketSSL> | NIL
or by standard socket API with "SSL" as filter name.
Programmers using hb_socketNew() can force linking this module by
REQUEST hb_socketNewSSL_connect
or
REQUEST hb_socketNewSSL_accept
SSL filter always disables any other filters and operates on raw
socket.
SSL filter recognize the following settings in initialization hash
array:
"ctx" or "key" - pointer SSL item <pSSL>
"timeout" - timeout (numeric)
"client" - logical value indicating client mode (SSL_connect())
"server" - logical value indicating server mode (SSL_accept())
* contrib/hbssl/tests/inetssl.prg
! cleaned typo in local function name
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
* use new Harbour extended socket API (hb_sockex*()) instead of
raw sockets and hb_znet*()
* contrib/hbtcpio/tcpio.c
* use new Harbour extended socket API (hb_sockex*()) instead of
raw sockets
+ implemented hb_fileFlush()
* contrib/hbtcpio/tcpio.c
* contrib/hbtcpio/hbtcpio.hbx
+ added new PRG function
hb_vfFromSocket( <pSocket> ) -> <pFile>
It converts socket created by socket open into TCPIP virtual file
which works just like files created by hb_vfOpen( "tcp:...", ... )
* include/hbapifs.h
* src/rtl/filesys.c
+ added new C function
HB_SIZE hb_fsPipeWrite( HB_FHANDLE hPipe, const void * buffer,
HB_SIZE nSize, HB_MAXINT nTimeOut );
+ implemented hb_fsPipeUnblock() in OS2 builds
+ set IO error in hb_fsPipeCreate(), hb_fsIsPipeOrSock() and
hb_fsPipeUnblock()
* return ( HB_SIZE ) -1 from hb_fsPipeRead() if end of stream is
reached or read error appears on non empty buffer. This modification
also change the behavior of PRG hb_PRead() function so now result -1
can be used to detect end of stream.
* src/rtl/philes.c
* include/harbour.hbx
+ added new PRG function:
hb_PWrite( <nPipeHandle>, <cBuffer>, [<nBytes>], [<nTimeOut>] )
-> <nBytesWritten>
% removed unnecessary assignment
* include/hbapiitm.h
+ added HVM internal macro hb_itemRawSwap()
* src/vm/asort.c
% use hb_itemRawSwap()
* in old code use comparison which prefers < and > operators
instead of <= and >=
2015-07-31 14:04 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
* include/hbapifs.h
* src/rtl/filebuf.c
* src/rtl/vfile.c
+ add C-level hb_fileSizeGet() function
* update HB_VFSIZE() to use hb_fileSizeGet() when passed a filename
It means now HB_VFSIZE() works for non-virtual filenames
just like HB_FSIZE() did.
* src/rtl/chruni.c
* added new functions hb_BStuff() and hb_UStuff()
* src/rtl/Makefile
- src/rtl/padc.c
- src/rtl/padl.c
- src/rtl/padr.c
+ src/rtl/padx.c
* added new functions hb_BPadL(), hb_BPadR(), hb_BPadC(),
hb_UPadL(), hb_UPadR() and hb_UPadC()
* include/harbour.hbx
* updated
* src/rtl/memoedit.prg
* src/rtl/teditor.prg
* use hb_U*() functions for string manipulation - now it works
correctly with mulitbyte encodings even if HVM CP does enabled
character indexing, i.e. "UTF8"
* src/rtl/vfile.c
* pacified BCC warnin
* src/rtl/filesys.c
* src/rtl/fssize.c
* use GetFileAttributesEx() if available in given windows version
to get file size and time
* include/hbapifs.h
* src/rtl/filebuf.c
* src/rtl/filebufd.c
* src/rtl/filesys.c
* src/rtl/vfile.c
* src/rtl/iousr.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
* contrib/hbcomio/comio.c
* contrib/hbmemio/memio.c
* contrib/hbtcpio/tcpio.c
* contrib/hbnetio/netio.h
* contrib/hbnetio/netiocli.c
* contrib/hbnetio/netiosrv.c
* changed HB_USHORT uiAttr parameter to HB_FATTR nAttr
in hb_fsExtOpen() and hb_fileExtOpen()
* include/fileio.ch
* src/rtl/vfile.c
+ added support for FO_DEFAULTS in hb_vfOpen().
When this flag is used in <nModeAttr> parameters then new
_SET_DEFAULT is respected when new file is created and
_SET_DEFAULT + _SET_PATH when file is opened.
+ added support for checking file size by it's in hb_vfSize()
so it can work like hb_FSize() but for virtual FS not only
for local files. Now this function has the following syntax:
hb_vfSize( <pHandle> | <cFileName> [, <lUseDirEntry> ] ) -> <nSize>
The 2-nd parameter <lUseDirEntry> is significant only when
the 1-st one <cFileName> is character value.
* src/rtl/gttrm/gttrm.c
* replaced C++ comments with ANSI ones
* src/rtl/vfile.c
* updated casing of function names in comments
* return F_ERROR instead of NIL hb_vfHandle() when wrong parameter
is given (borrowed from Viktor's branch)
* added C function hb_fileParamGet() borrowed from Viktor's branch
* src/rtl/filesys.c
* variable localization (synced with Viktor's branch)
* src/rtl/disksphb.c
! fixed bug with potentially uninitialized buffer
(fix borrowed from Viktor's branch)
* include/harbour.hbx
* src/rtl/cdpapihb.c
+ added new PRG function:
hb_cdpIsCharIdx( [ <cCdpID> ] [, <lNewMode>] ) -> <lPrevMode>
It returns .T. when given codepage uses custom character indexes
instead of byte indexes.
If <cCdpID> is not specified then current HVM codepage is used.
Optional logical parameter <lNewMode> allows to enable/disable
custom character indexes in codepages which have such functionality,
i.e. UTF8, BIG5, CP950.
* src/rtl/rtlshort.c
* removed __QUITCANCEL() - this function does not exist in Cl*pper.
* src/common/hbprintf.c
* removed modfl() protection with old HB_OS_IPHONE macro.
If someone will need it for some old iOS versions then please read
it protected by HB_OS_IOS and __IPHONE_OS_VERSION_MIN_REQUIRED
macros or inform me about the exact iOS version which do not support
modfl() and I'll add it.
* include/hbatomic.h
* disable GCC atomic macros for GCC <= 4.5 in OS2 builds.
They can be manually enabled by users using:
set HB_USER_CFLAGS=-DHB_USE_GCCATOMIC
* include/hbsetup.h
* set HB_OS_IOS when __IPHONE_OS_VERSION_MIN_REQUIRED is defined
* include/hbsetup.h
* src/common/hbver.c
* detect 64bit ARM CPUs
* contrib/hbct/envparam.c
* contrib/hbnf/getenvrn.c
! disabled ENVPARAM() and FT_GETE() in iOS builds
+ added support for FT_GETE() in OS2 builds
* include/harbour.hbx
* src/vm/cmdarg.c
+ added new PRG function
hb_ACmdLine() -> <array>
borrowed from Viktor's branch (2015-03-12 03:02 UTC+0100 Viktor Szakats)
It returns array with all command line parameters. Unlike
hb_AParams( __dbgProcLevel() - 1 )
hb_ACmdLine() returns all parameters also hidden ones just like
hb_CmdLine() function and hb_argv()/hb_argc()
Please also remember that hb_AParams() returns current value of
parameters which could be changed bu user code so they can be different
then original parameters passed to given function.
* src/rtl/gtchrmap.c
* casting
* include/std.ch
* synced casing with Viktor's branch
* include/std.ch
+ added VIA and CODEPAGE parameters to SORT TO and TOTAL TO commands
* formatting
* include/hbsix.ch
* synced SIX3 compatible SORT TO command with core SORT TO parameters
* include/hbapirdd.h
* include/hbusrrdd.ch
+ added DBTF_RECALL flag which disables transferring record DELETED flag
* src/rdd/dbcmd.c
* src/rdd/workarea.c
! disable transferring DELETED flag to destination area in SORT TO /
__dbArrange() operations
* src/rdd/delim1.c
* src/rdd/sdf1.c
+ added dummy RECALL() methods - now RECALL() can be executed by workarea
TRANSREC() method when DBTF_RECALL flag is set
* include/Makefile
- include/hbdbsort.h
* src/rdd/Makefile
- src/rdd/hbdbsort.c
* src/rdd/dbf1.c
- completely removed old code used in DBF* RDDs as low level backend
for SORT TO ... command and __dbArrange() function.
It was buggy and extremely inefficient in some cases, i.e. after
20 hours I killed process which was sorting table with 2'000'000
records in reverted order so I cannot even say how much time it
needed.
* src/rdd/dbf1.c
+ added new code for table sorting in DBF* RDDs
(SORT TO ... / __dbArrange() backend)
New code fixes many different problems which existed in previous one
like missing support for national collation, wrong descending orders,
wrong sorting of numeric fields with negative values, missing support
for sorting many field types, missing support for transferring MEMO
fields, missing support for transferring records to table with different
field structure or serving by different RDD, etc.
New code is also many times faster then the old one. In practice it
means is now usable for tables with more then few thousands records,
i.e. the test table with 2'000'000 records I used with old code was
copied in sorted order in 13 secs. when pure COPY TO needed 10 secs.
Now it's possible to export sorted tables to different RDDs, i.e.
using DELIM or SDF RDDs in desitnation area.
New code is written in general form without any local to DBF* RDDs
extensions so it can be adopted as base in any other RDD. Probably
I'll move it to default workarea methods so it will be inherited by
all Harbour RDDs and only if necessary authors of some RDDs may
overload it, i.e. to move the operation to the server side in remote
RDDs when source and destination tables are processed by the same
server.
This modification closes the last known for years bug or rather bag
of bugs ;-) in Harbour.
; NOTE: For large tables new sorting algorithm may access source records
more then once. It means that results may be wrongly sorted when
sorted fields in exported records are modified concurrently by
other station during exporting. This can be easy eliminated by
copping source records to temporary file anyhow it will introduce
additional overhead in all cases and user can easy eliminate the
problem by simple FLOCK before sort or making export to temporary
file and then sorting this file or he can simply ignore this
problem as unimportant in the specific situation so I decided to
not implement double copping.
I haven't tested what Cl*pper exactly does in such case so
I cannot say if current behavior is or isn't Cl*pper compatible.
* include/hbapi.h
* src/vm/garbage.c
+ added hb_gcDummyClear() function
* include/hbapirdd.h
* include/hbusrrdd.ch
+ added DBTF_CPYCTR constant value - when set in dbTransInfo.uiFlags
then after record transfer field counters should to be copied from
source to destination area
* include/hbapirdd.h
* src/rdd/wafunc.c
+ added new C functions hb_dbTransInfoPut() and hb_dbTransInfoGet()
which allow to store and retrieve pointer to DBTRANSINFO structure
into/from HB_ITEM with strict type verification.
* src/rdd/wafunc.c
* pass pointer to DBTRANSINFO structure as argument of DBI_TRANSREC
action. It allows RDD serving destination area to decide which
fields and how should be transferred updating uiFlags, uiItemCount
and lpTransItems members of DBTRANSINFO.
If RDD removes all fields from DBTRANSINFO structure (uiItemCount==0)
or does not return HB_SUCCESS for DBI_TRANSREC action (default WA
implementation returns HB_SUCCESS so it's not necessary to overload
it if RDD does not make any additional operations) then record
transfer is interrupted.
* copy field counters only when destination area asked about it setting
DBTF_CPYCTR in dbTransInfo.uiFlags in DBI_TRANSREC action.
* src/rdd/dbf1.c
* do not copy automatically updated fields when destination area
is not empty
* set DBTF_CPYCTR to indicate that counters should be copied from
source to destination area when original value of automatically
updated fields are transferred
; Now DBF* RDDs in Harbour respects the following rules for record
transfer operations (COPY TO / APPEND FROM) with automatically
updated fields:
- COPY TO transfers original values to destination table and
finally copy counters from the source table to destination one
so autoincrement fields in both tables after next append will be
initialized with the same values regardless of number of copied
records - even if only single record is copied then counters in
destination table will inherit next values for new record from
the source table. Also values of RowVer and ModTime fields are
copied from source to destination table and not updated during
transfer operation.
- APPEND FROM works like COPY TO (original field values and then
counters are copied to destination table) if the source table
supports counters and destination table is empty and FLocked()
or opened in exclusive mode.
If source table does not support counters for given fields, i.e.
it is processed by transfer RDD like DELIM or SDF (RDT_TRANSFER)
or destination table is not empty or opened in shared mode and
FLock is not set when APPEND FROM is executed then automatically
updated fields (counters, RowVer, ModTime) are not copied and
initialized with new values like for each new record added to
destination table.
* ChangeLog.txt
! typo in last ChangeLog entry
* include/hbapi.h
! fixed HB_ISMEMO() macro, original version was accepting the same
items as HB_ISCHAR() so it was not compatible with ISMEMO() macro
in Cl*pper.
* src/rtl/valtype.c
* use HB_ISMEMO() macro