* 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 >=
* src/vm/asort.c
* restored original loop and added different workaround which for
the problem in 64 bit MinGW we exploited. It's dummy function call
inside a loop so probably link time optimization (LTO is enabled
by -O4 in the newest GCC versions) ignore it and the problem will
reappear. Anyhow it only temporary solution which should give time
to create self contain example and report the problem to MinGW
authors - it's highly possible that also other code exploited this
problem so be careful with MinGW64.
% fixed index range checking to eliminate unnecessary index verification
* src/vm/asort.c
! fixed missing nStart checking during array items reordering
* utils/hbtest/rt_array.prg
* updated Harbour specific results - I thought that someone
invested time to exactly replicate CA-Cl*pper ASort() sorting
but in fact Harbour specific resutls where hardcoded inside
HBTEST so previous code was not Cl*pper compatible in the
same way as current one.
* src/rtl/gtxwc/gtxwc.c
* src/rtl/mlcfunc.c
* pacified new GCC C++ warnings
* src/rtl/hbsocket.c
* do not execute select() if HVM exception was generated when
socket handlers are extracted but return an error immediately
* src/vm/asort.c
% added new code for ASort()
Warning: new sorting algorithm is stable (does not change the
order of equal items). It means is not strictly Cl*pper
compatible and it can be seen some dummy ASort() tests
in HBTEST results.
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/teditor.prg
! fixed hb_ULen() wrongly used instead of Len() for arrays
% use byte oriented functions (hb_B*()) instead of character
ones (hb_U*()) to update color strings
* 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)
* src/rtl/gttrm/gttrm.c
* gives the highest priority to terminal type specified by <params>
in //gttrm:<params> switch
+ added support for extended XTERM colors.
It can be enabled by EXCLR GTTRM parameter.
So far GTTRM used only standard 8 ANSI colors combined with BOLD
and BLINK attributes to highlight text and/or background.
Such functionality is supported by nearly all color terminals
so is well portable but in some cases BOLD and BLINK attributes
where interpreted differently.
Now for XTERM compatible terminals GTTRM can use also other
methods of color settings. They can be enabled by //gttrm:exclr<n>
application command line switch, i.e.:
//GTTRM:EXCLR=0 - use 8 ANSI colors with BLINK and BOLD
attributes (current default behavior)
//GTTRM:EXCLR=1 - use XTERM 16 extended colors
//GTTRM:EXCLR=2 - use XTERM 256 extended colors
//GTTRM:EXCLR=3 - use XTERM RGB colors
(//GTTRM:EXCLR without number is the same as //GTTRM:EXCLR=1)
If terminal supports XTERM extended color escape sequences then
it's possible to enable 16 colors even if BLINK and BOLD does
not do that and if terminal support XTERM RGB color escape
sequences then also colors set by HB_GTI_PALETTE will be shown
(so far HB_GTI_PALETTE in GTTRM was working only for Linux and
PuTTY which support: ESC ] P <n> <rr> <gg> <bb> escape sequence).
Warning: I added above modes to test different terminals.
It's possible that I'll change it after tests.
* 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/pp/ppcore.c
! restored previous algorithm for scanning #included files when included
file is given without path
Now the following(Cl*pper compatible) file search algorithm is used
for files which are not marked as system headers (system headers are
enclosed in <>):
1) if file name contains absolute path then open the file from
the given location. If path starts with drive letter then
is always used as absolute path regardless of used path separator
after drive delimiter: ":"
2) if file name contains relative path then open then:
a) try to access included file starting from current directory
b) try to access included file starting from the path taken from
the first compiled file in list of included files
c) check INCLUDE paths (paths specified by -I compile switch and
taken from INCLUDE envvar)
3) if file name does not contain any path then open then:
a) try to access included file starting from the path taken from
the first compiled file in list of included files (if it does
not have any path then starting from current directory)
b) check INCLUDE paths (paths specified by -I compile switch and
taken from INCLUDE envvar)
For files marked as system headers in #include directive (enclosed in <>)
the file name is always used as relative path and Harbour scans only
INCLUDE paths (-I and INCLUDE envvar). It's Harbour extension, Cl*pper
does not support system headers.
; Maybe we should think about adding yet another step between (b) and (c)
in case 2 above and between (a) and (b) in case 3:
- try to access included file starting from the path taken from
the file with #include directive
It should help to create nested projects using relative paths. Maybe
it should even have the highest priority. It could be important only
in case of file name conflicts.
* contrib/hbmzip/mzip.c
* src/rtl/filesys.c
! initialize tm_isdst member of tm structure with -1 to force correct
local time to UTC conversion in mktime()
* src/pp/ppcore.c
! fixed directory include precedence in #included files which
are not marked as system headers (system headers are enclosed in <>)
Now the following order is used:
1) try to access included file as is starting from current directory
2) if included file has relative path then check if the first
compiled file has path and if yes try to access file using this
path as start point
3) check INCLUDE paths (envvar and -I parameter)
Previous version used: 2 for nested files or 1 for first file or when
first file was given without path then 3.
Now we are Cl*pper compatible but such version strongly depends on
current directory which has the highest priority. Personally I do no
like such behavior because it may give different results when current
directory is changed.
* utils/hbmk2/hbmk2.prg
! fix header search algorithm to handle headers specified
with _absolute paths_.
This fixed the problem reported by Sergy, here:
https://groups.google.com/d/msg/harbour-users/EYT9VQ9M7jk/SPtHIxpUB1oJ
Using absolute path to refer to a headers inside source
should be avoided and not necessary given properly setup
header paths.
; merged Viktor's patch: 2015-06-23 17:50 UTC+0200 Viktor Szakats
* src/vm/classes.c
! fixed __objGetIVars() to correctly serialize objects without any own
and inherited instance variables
* contrib/hbhpdf/3rd/libhpdf/hpdfimac.c
! include string.h
* contrib/hbhpdf/3rd/libhpdf/libhpdf.dif
* rediffed
* src/rtl/filesys.c
! fixed FXO_TRUNCATE flag used without FXO_SHARELOCK in POSIX systems
* src/rtl/net.c
! typo in variable name
* src/vm/task.c
! variable scope
* src/compiler/compi18n.c
* minor variable type update
* ChangeLog.txt
! formatting
* src/rtl/Makefile
* src/rtl/net.c
+ src/rtl/netusr.c
* moved hb_UserName() to separate file. It uses internally getpwuid()
in *nix builds and access to this function adds additional library
dependency which may block static builds in some cases.
TODO: eliminate hb_UserName() from things like initial random seed
to not create unnecessary dependency.
* contrib/gtqtc/gtqtc1.cpp
+ enable software input panel (virtual keyboard) in iOS builds
* 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
* contrib/hbct/ctwin.c
! added protection against GPF in hb_ctwGetPosWindow() called before
any window is open. It's correct version of this fix.
* contrib/hbmemio/memio.c
* contrib/xhb/xhbfunc.c
! fixed size of filename buffer - it should be exactly HB_PATH_MAX
* src/rtl/itemseri.c
! fixed stupid typo which could cause buffer overrun during
serialization of hash items with default value.
Tanks to Abe for reporting the problem.
* src/rdd/workarea.c
! fixed typo in RDDI_AUTOORDER type - it should be numeric
just like in _SET_AUTORDER. Many thanks to Rolf for locating
the problem
* contrib/hbnetio/netiosrv.c
* contrib/hbtcpio/tcpio.c
* call hb_socketShutdown() before hb_socketClose() to force output
buffer flush in systems like MS-Windows.
* src/debug/dbgentry.c
! fixed typo in my previous commit for AltD() function detection
Thanks to Franček Prijatelj for reporting the problem and Abe
for self contain example
* src/rdd/dbfcdx/dbfcdx1.c
* reverted byte order in Harbour CDX signature - by mistake I used
little endian. When existsing index is open then reverted signatures
are accepted for backward compatiblity though they will be removed
in the future.
* src/rdd/workarea.c
* move results of EVALBLOCK() RDD method from Harbour stack return item
to workarea valResult item instead of copping it.
; Warning: This modification may exploit problems in code which
wrongly looks for result of EVALBLOCK() RDD method in
HVM stack return item instead of workarea valResult item.
* 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
* src/rdd/dbf1.c
! restored the line with initialization of allocated memory buffer
I deleted by mistake removing my private comments before commit.
Without this line sort could randomly crash on small tables (less
then 65537 sorted records)
* 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.