* include/hbjson.h
* src/rtl/hbjson.c
* changed 3-rd parameter 'HB_BOOL fHuman' in hb_jsonEncode() and
hb_jsonEncodeCP() C functions to 'int iIndent'
char * hb_jsonEncode( PHB_ITEM pValue, HB_SIZE * pnLen,
int iIndent );
char * hb_jsonEncodeCP( PHB_ITEM pValue, HB_SIZE * pnLen,
int iIndent, PHB_CODEPAGE cdp );
Positive iIndent value defines number of spaces used for indenting,
0 disables indenting and -1 means TAB ( ASCII:9 ) indenting.
This modification is binary compatible though in C code using HB_TRUE
as 3-rd parameter it changes indenting from 2 spaces to 1 so please
update the code if it's significant.
+ added optional support for numeric value in 2-nd parameter of
hb_jsonEncode() PRG function. Current syntax is:
hb_jsonEncode( <xValue>, [ <lHuman> | <nIndent> ], [ <cDestCP> ] )
-> <cJSONString>
* contrib/rddads/ads1.c
* minor simplification
* include/hbapigt.h
* formatting
* src/rdd/dbf1.c
! fixed typo in index used inside DBS_ISNULL
! fixed blanking new record for variable length unicode fields (Q:U)
; above fix problems reported by KevinC - many thanks for information
about the problems and self contain examples - such support really
helps
* added protection against possible GPF when corrupted Q:U fields are
read from DBF file
* contrib/hbwin/hbwin.ch
* contrib/hbwin/hbwin.hbx
* contrib/hbwin/wapi_winuser_2.c
+ added PRG wrapper
wapi_MessageBoxTimeout( <phWnd>, <cText>, <cCaption>, ;
<nType>, <nLangId>, <nTimeout> )
-> <messageBox_results> | WIN_MB_TIMEDOUT
to undocumented MS-Windows function MessageBoxTimeout().
This function exists in all MS-Windows versions and is used internally
by MessageBox() and MessageBoxEx() with 0xFFFFFFFF timeout.
* contrib/hbwin/win_svc_2.c
* src/common/hbfopen.c
! fixed POCC and XCC builds
* src/pp/ppcore.c
! fixed line numbering in unclosed extended block
* interrupt extended block processing if it contains internal
FUNCTION or PROCEDURE declaration
* include/hbcompdf.h
* src/compiler/complex.c
* src/compiler/harbour.y
* src/compiler/hbmain.c
! fixed possible GPF when FUNCTION/PROCEDURE starts in unclosed
control structure - thanks to Abe Buchinger for information
about the problem
* report all unclosed control structures when FUNCTION/PROCEDURE starts
* src/compiler/harbour.yyc
* src/compiler/harbour.yyh
* regenerated
* contrib/hbmemio/memio.c
! fixed FO_TRUNC attribute in MEM: file IO - thanks to Miroslav Georgiev
for information about the problem
* include/hbgtinfo.ch
* src/rtl/gtwvt/gtwvt.h
* src/rtl/gtwvt/gtwvt.c
+ added new hb_gtInfo() action HB_GTI_SYSMENUADD
It allows to add new items to window system menu which
selected add defined by user key code into keyboard queue, i.e.
hb_gtInfo( HB_GTI_SYSMENUADD, HB_K_MENU, "Settings" )
* In WinCE builds use DeleteMenu() + AppendMenu() instead of
missing ModifyMenu()
! pacified warning in non UNICODE builds
* src/compiler/hbcomp.c
! revert an accidental sync with 3.4 resulting in .prg source
filenames being included in the compiled source only in debug mode.
It's now restored to have these at all times.
The comment typo in the same line remains synced.
Ref: https://groups.google.com/d/msg/harbour-devel/7c-EyPWxjfg/ei84cbsvAQAJ
+ src/rdd/usrrdd/rdds/arrayrdd.prg -> contrib/rddmisc/arrayrdd.prg
+ src/rdd/usrrdd/rdds/dbtcdx.prg -> contrib/rddmisc/dbtcdx.prg
+ src/rdd/usrrdd/rdds/fptcdx.prg -> contrib/rddmisc/fptcdx.prg
+ src/rdd/usrrdd/rdds/hscdx.prg -> contrib/rddmisc/hscdx.prg
+ src/rdd/usrrdd/rdds/logrdd.prg -> contrib/rddmisc/logrdd.prg
+ src/rdd/usrrdd/rdds/rlcdx.prg -> contrib/rddmisc/rlcdx.prg
+ src/rdd/usrrdd/rdds/smtcdx.prg -> contrib/rddmisc/smtcdx.prg
+ src/rdd/usrrdd/rdds/vfpcdx.prg -> contrib/rddmisc/vfpcdx.prg
* src/rdd/usrrdd/rdds/arrayrdd.prg
* src/rdd/usrrdd/rdds/dbtcdx.prg
* src/rdd/usrrdd/rdds/fptcdx.prg
* src/rdd/usrrdd/rdds/hscdx.prg
* src/rdd/usrrdd/rdds/logrdd.prg
* src/rdd/usrrdd/rdds/rlcdx.prg
* src/rdd/usrrdd/rdds/smtcdx.prg
* src/rdd/usrrdd/rdds/vfpcdx.prg
* move usrrdd sources to contrib/rddmisc to have the source tree
in sync with 3.4 fork, where these were converted to a contrib.
In 3.2 they will still be compiled into core with an #include
trick.
* *
* partial sync with the 3.4 fork codebase. These are the things
synces for the most part:
- copyright headers
- grammar/typos in comments and some readmes
- comment/whitespace/decorations
- variable scoping in C files
- DO CASE/SWITCH and some other alternate syntax usage
- minimal amount of human readable text in strings
- minor code updates
- HB_TRACE() void * casts for pointers and few other changes to
avoid C compiler warnings
- various other, minor code cleanups
- only Harbour/C code/headers were touched in src, utils, contrib,
include. No 3rd party code, no make files, and with just a few
exceptions, no 'tests' code was touched.
- certain components were not touched were 3.4 diverged too much
already, like f.e. hbmk2, hbssl, hbcurl, hbexpat
- the goal was that no actual program logic should be altered by
these changes. Except some possible minor exceptions, any such
change is probably a bug in this patch.
It's a massive patch, if you find anything broken after it, please
open an Issue with the details. Build test was done on macOS.
The goal is make it easier to see what actual code/logic was changed
in 3.4 compared to 3.2 and to make patches easier to apply in both
ways.
* src/rtl/dirscan.prg
! fixed type in hb_DirRemoveAll() result - it always returned .F.
* src/rtl/itemseri.c
! fixed internal error when HB_SERIALIZE_COMPRESS is passed to
hb_Serialize() and ZLIB was not linked with application
* src/rtl/tpersist.prg
! fixed deserialization of multidimensional arrays - thanks to Peter
* contrib/rddads/ads1.c
* pacified 'fall through' warnings
* contrib/hbexpat/3rd/expat/_hbconf.h
* contrib/hbexpat/3rd/expat/xmlparse.c
! fixed WINCE builds
! fixed OpenWatcom DOS builds
! fixed OpenWatcom OS2 builds
* contrib/hbexpat/3rd/expat/expat.dif
* rediffed
* include/harbour.hbx
* include/hbvm.h
* src/harbour.def
* src/vm/hvm.c
* src/vm/thread.c
+ added new C function
HB_BOOL hb_vmThreadIsMain( void * );
it checks if given or current thread is main HVM thread
+ added new PRG function
hb_threadIsMain( [ <pThID> ] ) -> <lMainHvmThread>
it returns true if given or current thread is main HVM thread
+ added new PRG function
hb_mutexExists( <pMtx> ) -> <lExists>
it returns true if passed <pMtx> parameter is pointer item to
fully functional mutex
* src/rtl/tpersist.prg
! fixed problem with array item deserialization - many thanks
to Peter Rees for exact information about the problem.
* src/rtl/val.c
* minor simplification
* contrib/rddads/ads1.c
* src/rdd/workarea.c
* simplified the code and eliminated wrong /* fallthrough */ comments
inside case block reported by Viktor
* src/harbour.def
! add hb_rand*() functions, fixing hbtip regression (#154) after
1938dd0a70
; import of 2014-12-10 14:38 UTC+0100 functions from Viktor's 3.4 fork
* src/rtl/hbrand.c
! hb_randStr(): fixed possible GPF and other errors when passing
negative size
* include/harbour.hbx
* include/hbapi.h
* src/rtl/hbrandom.c
+ added C level hb_random_num_secure() which works like hb_random_num()
but uses arc4 internally
+ added hb_randInt() which works the same as hb_RandomInt() but uses
arc4 internally
+ added hb_randNum() which works the same as hb_Random() but uses
arc4 internally
* include/hbexprb.c
! added missing code to restore original expression type after
direct type change in code like:
<var> := <var> + <exp>
It created problems when <var> was reused later, i.e. in FOR loop:
FOR v := v + x TO 3
* simplified code to restore original expression type and updated
comments
* src/compiler/harbour.y
* minor cleanup
* include/hbcomp.h
* src/compiler/hbmain.c
* removed not longer necessary calls to hb_compExprLstDealloc()
* src/compiler/hbcomp.c
! do not generate internal error when nested expression deallocation
is activated
* contrib/rddads/ads1.c
! fixed bad typo which effectively completely broke
AdsTestRecLocks( .t. ) mode
* include/hbcompdf.h
* include/hbexprb.c
* src/common/expropt1.c
* redefined all HB_ET_MACRO_* macros as bitfields
* src/compiler/complex.c
* small modification for future extensions in macro usage
* src/compiler/hbcomp.c
! replaced old temporrary hack with internal error.
* src/compiler/hbmain.c
* code reformating
* src/compiler/harbour.y
* separated DECLARE tokens
* src/compiler/harbour.yyc
* src/compiler/harbour.yyh
* regenerated
* src/rdd/dbffpt/dbffpt1.c
! fixed possible bad interaction (modified default memo type) due to
uninitialized item returned by hb_stackAllocItem(). Such items may
contain any simple value.
* src/vm/memvars.c
* minor variable name cleanup
* utils/hbtest/rt_math.prg
* repeat tests for macro messages and macro <op>=, pre/post ++/--
operations with and without pass by reference (-ks) optimization
* src/common/hbdate.c
* implemented monotonic timers in POSIX and MS-Windows builds
* config/wce/global.mk
* config/wce/mingwarm.mk
* config/win/global.mk
* utils/hbmk2/hbmk2.prg
* added winmm/mmtimer to list of system libraries - required
for timeGetTime()
* ChangeLog.txt
! typos
* include/hbapifs.h
* src/rtl/filesys.c
+ added new C functions for UNIX and DJGPP builds:
int hb_fsPollFD( PHB_POLLFD pPollSet, int iCount,
HB_MAXINT nTimeOut );
int hb_fsCanRead( HB_FHANDLE hFileHandle, HB_MAXINT nTimeOut );
int hb_fsCanWrite( HB_FHANDLE hFileHandle, HB_MAXINT nTimeOut );
These functions should be used instead of select() in C code to hide
low level access to select()/poll() functionality in *nix builds
(they are supported by DJGPP only to simplify existing code common
for DJGPP and *nix builds). Maximum file handle value which can be
used in select() is limited by FD_SETSIZE. Please note that it's
file handle value not number of file handles in the set. It creates
serious problem for applications which operate on great number of
handles (i.e. servers which have to keep open many sockets, pipes,
files, etc. for their clients) so the new file/socket/pipe/...
handle value can easy exceed FD_SETSIZE limit and in such case
cannot be used with select(). The modification on
2016-04-05 21:24 UTC+0200 Przemyslaw Czerpak
resolved the problem only for sockets and pipes in code which uses
corresponding hb_socket*() and hb_fsPipe*() API but not for all
other cases. This one is for POSIX compilant code which needs pure
POSIX select()/poll() functionality.
Please note that HB_POLLFD structure should is compatible with
struct pollfd defined by POSIX.1-2001 anyhow not all platforms
confirm this standard so portable Harbour code should always use
HB_POLLFD and HB_POLL* constant values instead of POLL* ones.
* include/hbdate.h
* src/common/hbdate.c
+ added new C functions to calculate timeouts:
HB_MAXUINT hb_timerGet( void );
HB_MAXUINT hb_timerInit( HB_MAXINT nTimeOut );
HB_MAXINT hb_timerTest( HB_MAXINT nTimeOut, HB_MAXUINT * pnTimer );
They are designed to be used instead of direct access to
hb_dateMilliSeconds(). Now they internally use hb_dateMilliSeconds()
but it can be easy replaced by any other system monotonic clock by
one local modification inside hb_timerGet() function.
* src/rtl/filesys.c
* use hb_timer*() functions instead of hb_dateMilliSeconds()
* use hb_fsCanRead()/hb_fsCanWrite() instead of select()/poll()
It also fixed timeout processing inside hb_fsPipeIsData() and
hb_fsPipeWrite() in builds using poll()
* src/rtl/filesys.c
* src/rtl/gtcrs/gtcrs.h
* src/rtl/gtcrs/gtcrs.c
* src/rtl/gtpca/gtpca.c
* src/rtl/gtsln/gtsln.c
* src/rtl/gtsln/mousesln.c
* src/rtl/gtstd/gtstd.c
* src/rtl/gttrm/gttrm.c
* src/rtl/gtxwc/gtxwc.c
* use hb_timer*() functions instead of hb_dateMilliSeconds()
* use hb_fsCanRead()/hb_fsCanWrite() instead of select()/poll()
* src/vm/thread.c:
* src/rtl/gtwin/gtwin.c
* src/rtl/hbcom.c
* src/rtl/hbgtcore.c
* src/rtl/hblpp.c
* src/rtl/idle.c
* contrib/hbnetio/netiosrv.c:
* contrib/hbssl/ssl_sock.c:
* use hb_timer*() functions instead of hb_dateMilliSeconds()
* contrib/xhb/hboutdbg.c
* use hb_fsCanWrite() instead of select()
* src/rtl/hbsocket.c
! repeat select() interrupted by signal inside hb_socketSelect()
when poll() function is not available
* src/3rd/hbdossrl/serial.c
! fixed -Wshift-negative-value GCC warnings
* src/compiler/hbgenerr.c
* changed "with object" in last error message to upper cases
* src/rdd/dbf1.c
+ added assigned value to error object ARGS array when data type or
data width error is generated inside PUTVALUE() method
* utils/hbtest/hbtest.prg
* utils/hbtest/rt_array.prg
* utils/hbtest/rt_hvma.prg
* utils/hbtest/rt_main.ch
* utils/hbtest/rt_math.prg
* utils/hbtest/rt_misc.prg
+ added support for alternative results to HBTEST code.
It's enabled by default and can be turned off by -noalt hbtest
parameter.
+ added alternative results for tests which return different then
Cl*pper results but they are expected and not Harbour bugs.
* include/hbcomp.h
* include/hbcompdf.h
* include/hberrors.h
* include/hbexprb.c
* src/common/expropt1.c
* src/compiler/hbgenerr.c
* src/compiler/hbmain.c
+ added new macros HB_ET_MACRO_NOLIST and HB_ET_MACRO_NOPARE
% use new HB_ET_MACRO_* macros
+ added new compile time error:
"Code block contains both macro and with object messages ':%s'"
NOTE: -kd compiler switch allows to compile codeblocks with macros
and declared symbols / with object messages
* replaced hb_compErrorCodeblock() with hb_compErrorCodeblockDecl() and
hb_compErrorCodeblockWith()
+ added new C function hb_compPushMacroVar()
* code simplification
; added few comments
* utils/hbtest/rt_math.prg
* extended test code for macro messages and macro <op>=, pre/post ++/--
operations
* src/vm/hvm.c
! protection against executing hb_threadStateNew() during GC pass
inside hb_vmRequestReenterExt()
* src/vm/garbage.c
! add volatile attribute to s_bCollecting variable
* small modification in hb_gcAll() parameter
* src/rtl/errsys.prg
; minor comment cleanup
* doc/xhb-diff.txt
* extended a little bit section STRONG TYPED VARIABLES
* src/compiler/harbour.y
* create real function in internal memory instead of dummy flow control
error for unclosed structures when new function/procedure declaration
is found just to reset context for farther error reporting. It leaves
unclosed structure on Bison stack but it's unimportant for us because
result of such compilation is ignored due to detected errors and this
modification resolves the problem with ignored pending declarations.
* src/compiler/harbour.yyc
* regenerated
* src/compiler/hbdead.c
* src/compiler/hbfix.c
* src/compiler/hblbl.c
* src/compiler/hbopt.c
* src/compiler/hbpcode.c
* src/compiler/hbstripl.c
* small comment cleanup in PCODE tables
* include/hberrors.h
* src/compiler/hbgenerr.c
+ added new compile time error messages for incorrect
ENDWITH, ENDSWITCH and END SEQUENCE
* changed error message:
"CASE or OTHERWISE does not match DO CASE"
to
"CASE or OTHERWISE does not match DO CASE or SWITCH"
* src/compiler/harbour.y
* if control structure is closed by wrong statement generate
error and close it. Cl*pper works in similar way so now compile
time errors are much more close to Clipper in such cases and
this modification fixes also problem with long list of errors
reported to the end of function when in fact only one control
structure was wrongly closed.
* generate error messages for parts of control structures used
in wrong context
* src/compiler/harbour.yyc
* src/compiler/harbour.yyh
* regenerated
* src/compiler/complex.c
- removed wrongly working old error messages - initially they were
implemented in old Flex lexer but they couldn't work correctly
inside any lexer. When I wrote new lexer I simply copied them to
new code with old broken logic just for backward compatibility.
Now such messages are generated by grammar parser for all cases
not only chose ones so I can clean lexer code.
* set more precisely lexer state for error messages generated by
grammar parser
* simplified the code after above modifications
* tests/speedtst.prg
! fixed memory statistic detection
* contrib/hbgs/core.c
! fixed to build with new GS versions - fix borrowed from Viktor's
branch
* src/rtl/setkey.c
+ in hb_SetKey() and hb_SetKeyCheck() if extended keycode is passed
and does not have associated action check also for actions bound
with corresponding standard keycode
! honor user parameters passed by reference to hb_SetKeyCheck()
! fixed hardcoded 4 parameter limit in hb_SetKeyCheck()
* src/compiler/hbopt.c
! fixed 'assigned but not used' warning detection - it should not
mark initial HB_P_PUSHLOCALREF PCODE as used when next <op>=
operation leaves result on HVM stack.
* optimize 'var <op>= 0', 'var <op>= 1' and 'var <op>= <timestamp>'
operations
* small cleanup
* include/hbdefs.h
+ added macros HB_CAST_*( double ) for conversions of double values
to integer types - they are designed to hide some differences
between C compilers and platforms in such conversions
* src/common/expropt2.c
* src/vm/extend.c
* src/vm/itemapi.c
* use new HB_CAST_*() macros
* package/harbour.spec
* contrib/hbbz2/hbbz2.hbp
* package/mpkg_rpm.sh
+ added support for '--with localbz2' RPM build parameter
* include/hbpp.h
* src/pp/ppcore.c
* src/compiler/hbmain.c
* modified hb_pp_inBuffer() parameters. Now it supports optional
szFileName parameter.
Warning: it's incompatible with previous version but I do not think
that anyone used this function outside core code so I decided to not
add new function but simply change the existing one.
[INCOMPATIBLE]
* src/rtl/filebuf.c
! do not resepct SET DEFAULT/PATH in hb_fileExists() when 2nd parameter
is NULL in default file IO drivers. It also changes the behvior of
PRG function hb_vfOpen() which now honors SET DEFAULT/PATH only if
its 2nd parameter is passed by reference - this modification is
compatible with 2016-01-25 18:16 UTC+0100 Viktor Szakats in his fork.
* src/rdd/dbf1.c
* src/rdd/dbfcdx/dbfcdx1.c
* src/rdd/dbfnsx/dbfnsx1.c
* src/rdd/dbfntx/dbfntx1.c
* updated to work correctly with modified hb_fileExists() behavior
; CL5.2 DBFCDX and Six3 CDX/NSX RDDs looking for production indexes
respect SET PATH but Harbour in core DBF* index RDDs is CL5.3/COMIX
compatible and looks for production indexes only in the directory
where DBF file is located and only SIXCDX Harbour RDD is CL5.2/Six3
compatible.
Please also note that it's significant only for situations when
DBF file is located in current directory. If it's open from
SET DEFAULT/PATH directory then corresponding path is added
to DBF file name what effectively disables SET DEFAULT/PATH
processing when production index is open.
* src/rtl/filebuf.c
* src/rtl/filebufd.c
* src/rtl/iousr.c
* contrib/hbmemio/memio.c
; cleaned name of hb_fileCopy() paramter
* include/hbapifs.h
* src/rtl/filebuf.c
* src/harbour.def
+ added new C function:
HB_BOOL hb_fileMove( const char * pszSrcFile,
const char * pszDstFile );
* src/rtl/vfile.c
* include/harbour.hbx
* src/harbour.def
+ added new PRG function:
hb_vfMoveFile( <cFileSrc>, <cFileDst> ) -> <nResult>
; unlike hb_fileRename()/hb_vfRename() new hb_fileMove()/hb_vfMoveFile()
functions allow to move files between different file systems/drives
and also different Harbour file IO drivers. Please note that it means
that file name IO driver prefix is significant in both source and
destination file names unless it's local FS operation. New functions
when both file names point to the same Harbour file IO driver try to
use simple rename operation. If it fails then they try to copy the
file and remove the source one.
* ChangeLog.txt
! typo
* include/hbfloat.h
* contrib/xhb/xhbctbit.c
* src/compiler/hbcmplib.c
* src/compiler/hbcomp.c
* src/compiler/hbusage.c
! pacified new GCC warnings and partially synced with Viktor's fork
* src/compiler/hbusage.c
* added Klas Engwall to credits list
* added Rolf to credits list
* updated April White email address
; please verify it and update if necessary
* contrib/gtqtc/gtqtc1.cpp
! fixed clipboard selection with shift + left mouse button to not report
mouse events during selection
* include/hbdate.h
* src/common/hbdate.c
+ added support for ISO 8601 week dates (YYYY-Www-D) in timestamp
literals
+ added support for ISO 8601 ordinal dates (YYYY-DDD) in timestamp
literals
+ added new C functions:
HB_BOOL hb_dateDecWeek( long lJulian, int * piYear,
int * piWeek, int * piDay );
long hb_dateEncWeek( int iYear, int iWeek, int iDay );
to decode/encode ISO 8601 week dates
* src/rtl/dateshb.c
+ added new PRG function get week number and other parts ISO 8601
week date:
hb_Week( <dDate>, [@<nYear>], [@<nDayOfWeek>] ) -> <nWeek>
* include/harbour.hbx
* src/harbour.def
* updated for new functions
* include/harbour.hbx
* src/harbour.def
* src/rtl/dateshb.c
+ added new PRG functions which convert time difference to hours,
minutes, seconds and milliseconds. Except milliseconds the results
are floating point numbers with fractional part representing the
rest of conversion:
hb_NToHour( <nTimeDiff> ) => <nHours>
hb_NToMin ( <nTimeDiff> ) => <nMinutes>
hb_NToSec ( <nTimeDiff> ) => <nSeconds>
hb_NToMSec( <nTimeDiff> ) => <nMilliseconds>
+ added new PRG functions which convert timestamp value to hours,
minutes, seconds and milliseconds. Except milliseconds the results
are floating point numbers with fractional part representing the
rest of conversion:
hb_TToHour( <tTimeStamp> ) => <nHours>
hb_TToMin ( <tTimeStamp> ) => <nMinutes>
hb_TToSec ( <tTimeStamp> ) => <nSeconds>
hb_TToMSec( <tTimeStamp> ) => <nMilliseconds>
* src/rtl/gtsln/gtsln.c
! fixed cleanup string sent to terminal to remove test UTF-8 character
* src/rtl/gtsln/kbsln.c
+ added workaround for some broken Linux kernel which wrongly sets
tty device as ready for reading
* src/rtl/hbsocket.c
* added comment
* src/rdd/dbfnsx/dbfnsx1.c
* src/rdd/dbfntx/dbfntx1.c
! added missing tag root page restoring cleared after discarding buffers
due to concurrent access to multitag indexes.
Many thanks for Karsten Stucker for self contain example.
* src/rdd/dbfntx/dbfntx1.c
* discard buffers when next free page is changed even without touching
version number - minor protection for potentially broken 3-rd party
NTX code or very old [x]Harbour NTX RDDs which do not increment
version number on update.