* contrib/hbexpat/3rd/expat/expat.diff
* contrib/hbexpat/3rd/expat/loadlibr.c
! use HB_WINAPI_GETPROCADDRESS() instead of GetProcAddress()
in WinCE builds
* contrib/hbhpdf/3rd/libhpdf/hpdfstre.c
* contrib/hbhpdf/3rd/libhpdf/libhpdf.diff
! include <windows.h> in WinCE builds, it's necessary for GetLastError()
* src/3rd/jpeg/Makefile
! do not use getenv() in all WinCE builds
* src/common/hbver.c
* cast revision number to HB_ULONG to pacify warning
* src/vm/extrap.c
! do not compile unused in WinCE builds hb_winExceptionHandler()
* include/hbapi.h
* added HB_EXPORT attribute to hb_macroTextValue() function
* include/hbvm.h
* src/vm/hvm.c
+ added C function:
PHB_ITEM hb_vmCompileMacro( const char * szExpr, PHB_ITEM pDest );
It returns Harbour item or NULL at error (wrong macro text).
The result should be used with hb_vmEvalBlockOrMacro() and then freed
by hb_vmDestroyBlockOrMacro(). It hides low level macro representation
so we can change it in the future. Now it's still simple pointer item
without autodestructor.
* src/rdd/hsx/hsx.c
* src/rdd/workarea.c
* use hb_vmCompileMacro() instead of hb_macroCompile()
* src/vm/runner.c
* changed 6101 error message for "Unknown or unregistered symbol"
to "Unknown or unregistered function symbol".
* report above error when HRB module is loaded and its external function
is not registered or not marked as DYNAMIC by earlier registered modules
in HVM symbol table.
Warning. This modification may exploit problems in code loading HRB files
with cross references which has worked so far. In such case user should
pass to hb_hrbLoad()/hb_hrbRun() as first parameters flags containing
HB_HRB_BIND_LAZY or declare the problematic function in his main code
as dynamic, i.e.:
DYNAMIC <funcName>
* src/rdd/dbf1.c
* declare internal function hb_dbfTransCheckCounters() as static one
* src/harbour.def
! added missing exported Harbour functions
* include/hbvm.h
* include/harbour.hbx
* src/harbour.def
* src/vm/hvm.c
+ added new C function:
extern HB_EXPORT HB_BOOL hb_vmSetKeyPool( HB_BOOL fEnable );
It allows to disable keyboard pooling by GT driver in main HVM loop.
It's important in programs which mix GT terminal with GUI library
which use common event loop. Many GUI objects are not reentrant
safe and activating event loop during big changes may cause crash.
Such things can happen in applications which try to mix HBQT
and GTQTC. To avoid such problems before PRG code is called it's
enough to disable keyboard pooling in main HVM loop, eg.
if( hb_vmRequestReenter() )
{
HB_BOOL fKeyPool = hb_vmSetKeyPool( HB_FALSE );
hb_vmPushEvalSym();
hb_vmPush( pBlockItm );
hb_vmSend( 0 );
hb_vmSetKeyPool( fKeyPool );
hb_vmRequestRestore();
}
+ added new PRG function:
__vmKeyPool( [<fEnable>] ) -> <fPrevState>
It's PRG interface to above C function. If application uses GT driver
and GUI library using the same event loop and such GUI library does not
disable keyboard pooling in main HVM loop before PRG code is activated
then it's enough to call this function at the beginning of application,
eg.
PROCEDURE INIT Clip()
__vmKeyPool( .f. )
RETURN
With above peace of code you can mix HBQT or other QT wrapper with GTQTC.
* *
* 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.
* 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
* *
% 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
* include/hbvm.h
* src/vm/hvm.c
+ added new HVM function: hb_vmTryEval()
This function tries to execute given block or function
inside BEGIN SEQUENCE / RECOVER oErr / END SEQUENCE statement.
It return HB_TRUE if it was executed without any problem and
HB_FALSE otherwise. Result or RTE object is stored in 1-st
parameter and should be freed by the caller using hb_itemRelese()
* src/debug/dbgentry.c
! use hb_vmTryEval() instead of hb_itemDo() to evaluate trace point
expressions. Now debugger does not crash when user sets tracepoint
expression which cannot be evaluated in executed context.
! allow to use expressions with more then 99 variables
! added missing protections against GPF when wrong parameters are
passed to __dbg*() functions
* keep original trace and watch point expression for farther
processing
* replaced IS_IDENT_*() macros with HB_IS*IDCHAR()
+ added new debuger function:
__dbgGetWatchPoints() -> <aWatchTracePoints>
<aWatchTracePoints> contains subarrays describing trace and watch
points:
{ <cExpression>, <lTracePoint>, <lValid>, <xResult> }
It was the last function necessary to extract all information
about debugged context from core internals. Now it's possible
to create fully functional standalone debugger without storing
and updating locally any information about debugger state.
All such information can be accessed at any time using __dbg*()
functions.
It should greatly simplify creating 3-rd party debuggers like
HWDebug or HBQTDebug.
* src/debug/debugger.prg
! fixed callstack window updating during tracing and stepping.
Tanks to Rolf for reporting the problem.
* src/rtl/filebuf.c
! unlock HVM stack before locking local mutex and calling hb_fs*()
functions which also unlocks HVM. It fixes possible deadlock condition
when hb_gcAll( .T. ) is executed.
* include/hbapi.h
* src/vm/garbage.c
! changed mark function semantic.
Adding support for user defined mark function I created race condition
in MT GC code. It happens because blocks marked as deleted were not
scanned by GC mark code so their subitems where not accessible.
To fix it we have to change mark function semantic. Now mark function
can be executed also for blocks currently deleted. It means that GC
block destructor should clean references to just removed items and
subblocks. The best place to make it is clearing pointers to GC blocks
just after hb_itemRelease() or hb_gcRefFree().
It is save to clean the reference just before hb_itemRelease() or
hb_gcRefFree() but only for the single block passed to these functions.
It is not save to clear reference to more then one block and then
execute above functions.
+ check reference count after destructor execution for all blocks
not only arrays - warning it may exploit some wrong C code.
- removed not longer used hb_gcRefCheck() function.
* include/hbvm.h
* src/vm/hvm.c
+ added new internal function hb_vmLockForce()
! fixed to mark GC blocks with active threads
* src/vm/thread.c
* include/hbthread.h
% modified sync mutexes used by xBase++ signal class emulation
to not use item array internally
* updated mutex destructor to new GC mark semantic
! mark GT items if GT is bound with thread item
! fixed mutex notify/subscribe code to not change GC items
when HVM stack is unlocked
! use hb_vmLockForce() to eliminate potential deadlock
+ added new C function hb_threadEnterCriticalSectionGC().
It should be used instead of hb_threadEnterCriticalSection()
in code which manipulates GC items inside critical section.
It's slower but eliminates possible deadlock condition.
Please remember that remember that both functions cannot
be used for the same mutex. So if it's necessary to use
hb_threadEnterCriticalSectionGC() in one place then it
has to be used in all others when the same mutex is locked.
* src/vm/arrays.c
* src/vm/codebloc.c
* src/vm/hashes.c
* src/rtl/hbgtcore.c
* contrib/hbcurl/core.c
* contrib/hbexpat/core.c
* updated destructors to new GC mark semantic
* contrib/hbxpp/dllx.c
! fixed destructor for pointer item created by DllPrepareCall()
Now it respects reference counter.
; added note about real behavior of library handle destructor,
I haven't changed existing code behavior but maybe it should
be done.
* contrib/xhb/hbserv.c
* src/debug/dbgentry.c
* src/rdd/wacore.c
! fixed possible deadlocks by using hb_threadEnterCriticalSectionGC()
instead of hb_threadEnterCriticalSection().
* contrib/hbmemio/memio.c
! slightly modified hb_memfsDirectory() code to avoid race condition
without using hb_threadEnterCriticalSectionGC()
* src/vm/fm.c
% reduce the lock range in HB_FM_STAT builds
* src/rtl/hbsocket.c
! added missing HVM stack unlocking in hb_socketSelect() function
* src/rtl/gtxwc/gtxwc.c
! added few missing locks for version compiled with HB_XWC_XLIB_NEEDLOCKS
* src/rdd/dbtotal.prg
* allow to use symbols instead of codeblocks
* modified Harbour extension which uses ordKey() as default group
signature to work also without index. In such case all records
are summarized into single one.
; Most of above modifications were critical for stability of MT programs.
They should allow to activate GC in any place.
* include/hbvm.h
* src/vm/hvm.c
* added new 7-th parameter fOverLoad to hb_vmRegisterSymbols() function.
When it's TRUE then new public function symbols overload existing ones.
* src/vm/runner.c
! use new fOverLoad parameter of hb_vmRegisterSymbols() function to
overload existing functions (HB_HRB_BIND_OVERLOAD) instead of making
local modifications in global symbol table. It fixes memory corruption
when the same HRB module is reloaded with HB_HRB_BIND_OVERLOAD parameter.
This was very old bug which has existed from the beginning when I added
support for HB_HRB_BIND_* flags.
* include/hbapi.h
* include/hbapigt.h
* include/hbvm.h
* src/rtl/inkeyapi.c
* src/vm/cmdarg.c
* src/vm/hvm.c
* replaced hb_cmdargProcessVM() with hb_cmdargProcess() and removed
unused for long time custom user cancel key functionality.
- removed dummy hb_inkeySetCancelKeys() C function.
- removed not used for long time HVM C functions and macros:
hb_vmFlagEnabled(), hb_vmFlagSet(), hb_vmFlagClear(),
HB_VMFLAG_HARBOUR, HB_VMFLAG_ARRSTR
* include/hbgtinfo.ch
+ added new HB_GTI_* actions:
HB_GTI_WINHANDLE - Get console window low level handle
HB_GTI_MOUSEPOS_XY - Get mouse position in pixels
HB_GTI_DISPIMAGE - Display image with given name
* include/hbapigt.h
* src/rtl/inkeyapi.c
+ added new C function: int hb_inkeyKeyMod( int iKey )
+ added code for translation from extended key codes to
standard Clipper ones
* include/harbour.hbx
* src/rtl/inkey.c
+ added new PRG function hb_keyMod( <nExtKey> ) -> <nModifiers>
It extract keyboard modifiers (HB_KF_*) from extended key code.
* include/hbgtcore.h
* src/rtl/hbgtcore.c
+ added new macros for generating extended key codes with keyboard
modifiers for ASCII and UNICODE characters
% strip repeated extended key codes for mouse move
! use standard key codes in extended ALERT() GT method
* include/inkey.ch
+ added key modifiers/flags for extended key codes: HB_KF_*
+ added extended key codes: HB_KX_*
- removed unused HB_K_MULTICODE macro
* src/rtl/gttrm/gttrm.c
* replaced old keyboard and mouse code with new one using
extended key codes for keyboard and mouse
+ added support for keyboard modifiers in GPM events
+ added support for keyboard modifiers in terminal mouse events
* src/rtl/gtwvt/gtwvt.h
* src/rtl/gtwvt/gtwvt.c
! invert selection region in WinCE builds
! fixed selection in fullscreen or maximized modes with margins
* do not add EOL to one line selections
+ added support for painting box drawing characters.
This mode can be enabled by:
hb_gtInfo( HB_GTI_FONTATTRIBUTE, HB_GTI_FONTA_DRAWBOX )
and it causes that GTWVT draws all box characters as pixmap
regardles of used font.
So far this functionality existed only in GTXWC.
+ added support for HB_GTI_FONTA_FIXMETRIC and HB_GTI_FONTA_CLRBKG
So far this functionality existed only in GTXWC.
+ added support for HB_GTI_WINHANDLE
! do not add EOL at the end of one line selection
* src/rtl/gtxwc/gtxwc.h
* src/rtl/gtxwc/gtxwc.c
* replaced old keyboard and mouse code with new one using
extended key codes for keyboard and mouse
* renamed HB_GTXWC_* box drawing macros to HB_BOXCH_* ones
* do not add EOL to one line selections
! fixed few keypad keycodes
* use cursor blinking rate HB_GTI_CURSORBLINKRATE for whole
show/hide period not only half of them. If someone use this
GTI action in his code then now he should double passed
value. [incompatible]
! fixed return value for HB_GTI_SETPOS_ROWCOL
* few minor cleanups
* tests/gtkeys.prg
* replaced old keyboard and mouse code with new one using
extended key codes for keyboard and mouse
+ added description for some key codes
+ added some initial HB_GTI_* actions
+ change cursor size by K_INS
+ display terminal size after HB_K_RESIZE
+ display mouse position after mouse key codes
! display all characters created by hb_keyChar()
! fixed formatting
* src/rdd/dbf1.c
* added more general protection against GPF in not fully
initialized workarea
* (all files)
* stripped svn header
* minor cleanups
; use following command to find out the history of files:
git log
git log --follow
git blame
git annotate