* include/hbclass.ch
* disabled DECLARE to not generate ignored by compiler noise in .ppo
files
* src/rdd/dbcmd.c
! allow to use dbSetFilter() with string only parameter without
codeblock - Cl*pper compatibility fix.
Cl*pper allows to set text filter without codeblock. In local
RDDs it effectively does nothing and only dbFilter() returns it
but RDDs with automatic filter optimization like CL53/DBFCDX /
COMIX/ClipMore or RDDs working with remote data base servers
may use only text version of filter and ignore or use with
lower priority the codeblock so Harbour has to work like
Cl*pper here.
* src/rdd/workarea.c
* typo in comment
* contrib/rddads/ads1.c
* do not validate empty text filters
* src/lang/Makefile
+ src/lang/l_de_at.c
* include/hblang.hbx
+ added new DE_AT German-Austria lang module by byte1one@gmail.com
* src/lang/l_is.c
! fixes in Icelandic lang module by Isleifur Gislason
<isleifurgisla@gmail.com>
* include/hbapifs.h
* src/rtl/filesys.c
+ added new C function:
HB_FOFFSET hb_fsGetSize( HB_FHANDLE hFileHandle );
! fixed SetFilePointer() error detecting - it was broken
and we returned wrong results for offset 0xFFFFFFFF
* src/rtl/filebuf.c
* use hb_fsGetSize()
* include/hbapifs.h
* src/common/hbfsapi.c
+ added automatic file handle table resizing to hb_fsOS2DosOpenL()
+ added new C function: hb_fsOS2DosOpen() which is wrapper to DosOpen()
with automatic file handle table resizing.
Please remember that unlike hb_fsOS2DosOpenL() this function is
pure wrapper to DosOpen() so it does not make file name conversions
and does not set hb_fsError().
* src/rtl/filesys.c
* src/rtl/hbcom.c
* src/rtl/hbproces.c
* use hb_fsOS2DosOpen() instead of DosOpen()
* src/vm/cmdarg.c
* set the initial size of file handle table to 256 in OS2 OpenWatcom
builds if user does not set it explicitly by //F:<n> switch
* config/global.mk
- removed set HARBOUR=F:100 - it's not necessary with automatic FHT
resizing
; Please test it in real OS2 environment
* *
% remove brandings and homepage from copyright header. Pass 2 - semi-auto.
* project homepage and name is described in README, amongst others
; this should make the diff between 3.4 and 3.2 easier to manage
* *
% remove brandings and homepage [1] from copyright header. Pass 1 - using script.
[1] nobody has access to it anymore AFAIK - and it's also just
a redirect since long
! update url in copyright header
; this should make the diff between 3.4 and 3.2 easier to manage
* 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