Commit Graph

1859 Commits

Author SHA1 Message Date
Viktor Szakats
a2385b1c55 2008-10-19 09:00 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
  * include/assert.ch
  * common.mak
  * source/rtl/Makefile
  - source/rtl/strtrim.c
  + source/rtl/hbntos.c
  * contrib/xhb/hbcompat.ch
  * source/debug/dbgthsh.prg
  * source/debug/tbrwtext.prg
  * source/debug/dbgwa.prg
  * source/debug/debugger.prg
  * source/debug/dbgtarr.prg
  * source/rtl/errorsys.prg
  * source/rtl/valtoexp.prg
  * source/rtl/getsys.prg
  * source/rtl/tgetlist.prg
  * source/rtl/browse.prg
  * source/rtl/alert.prg
  * source/rtl/tclass.prg
  * source/rtl/tsymbol.prg
  * source/rtl/tscalar.prg
  * source/rtl/tpersist.prg
  * utils/hbmake/hbmake.prg
  * utils/hbrun/hbrun.prg
    * Renamed hb_N2S() to hb_NToS() which feels more 
      natural in Clipper.
2008-10-19 07:02:22 +00:00
Viktor Szakats
e6b20f05a4 2008-10-19 00:17 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/assert.ch
  * contrib/xhb/hbcompat.ch
  * source/debug/tbrwtext.prg
  * source/debug/dbgthsh.prg
  * source/debug/debugger.prg
  * source/debug/dbgwa.prg
  * source/debug/dbgtarr.prg
  * source/rtl/errorsys.prg
  * source/rtl/valtoexp.prg
  * source/rtl/getsys.prg
  * source/rtl/tgetlist.prg
  * source/rtl/browse.prg
  * source/rtl/alert.prg
  * source/rtl/tscalar.prg
  * source/rtl/tpersist.prg
  * utils/hbmake/hbmake.prg
  * utils/hbrun/hbrun.prg
    % Using hb_N2S() instead of LTrim( Str() ) expressions.
    ; NOTE: contribs and hbdoc not touched yet.
2008-10-18 22:23:45 +00:00
Viktor Szakats
2ab83da8a1 2008-10-19 00:05 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* common.mak
  * include/hbextern.ch
  * source/rtl/Makefile
  + source/rtl/strtrim.c
    + Added function HB_N2S( <number> ) -> <string>.
      This is equivalent to LTrim( Str( <number> ) ), 
      just faster.

  * source/rtl/dircmd.prg
  * source/rtl/tget.prg
    * Minor cleanup.
2008-10-18 22:07:57 +00:00
Viktor Szakats
ee26c1b8d6 2008-10-18 10:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapi.h
  * source/common/hbgete.c
    + Added hb_getenv_buffer(). Similar to hb_getenv() but 
      this one needs a buffer+size to be passed, so no memory 
      allocation is done by the function. It also return 
      a BOOL to signal success. It doesn't signal if passed 
      buffer was too small to store the value.
2008-10-18 08:28:50 +00:00
Viktor Szakats
992016b359 2008-10-16 08:42 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/common.ch
  * contrib/hbziparc/hbziparc.prg
  * source/rtl/tclass.prg
  * source/rtl/hbini.prg
    * Minor formatting. (hb_Is*() -> hb_is*())

  * contrib/hbct/ctrand.prg
  * contrib/hbct/numconv.prg
  * contrib/hbct/cttime.prg
  * contrib/hbct/showtime.prg
  * contrib/hbwhat/hbwhat.ch
  * utils/hbrun/hbrun.prg
  * source/debug/dbgtobj.prg
  * source/debug/dbgbrwsr.prg
  * source/debug/dbgthsh.prg
  * source/debug/dbgtarr.prg
  * source/rtl/alert.prg
  * source/rtl/tbrowse.prg
    % ValType() -> IS*() / hb_is*()

  * contrib/hbwhat/hbwhat.ch
    % Using common.ch instead of replicating logic.
    * Some formatting.

  * utils/hbtest/hbtest.prg
    * Minor formatting.
2008-10-16 06:44:26 +00:00
Przemyslaw Czerpak
3ed8136c80 2008-10-15 17:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
  * harbour/source/debug/dbgentry.c
  * harbour/source/debug/debugger.prg
    * moved debugRequest flag and debugger internal structure
      pointer to HVM stack
    * allocate debugger internal structure dynamically in thread
      thread local area when PCODE with debug information is executed
    * changed STATIC s_oDebugger to THREAD STATIC
    * send HB_DBG_VMQUIT after each thread termination when
      debugger is activated
      Now debugger can be used in MT programs and each thread can be
      debugged separately (each has its own debuger). Please only
      remember that thread sharing console window can overwrite other
      threads debugger screen. There is also one limitation which I'll
      try to remove later: only main thread debugger keeps information
      about file wide STATIC names and line numbers with possible break
      point places. This data should be shared between debuggers.
2008-10-15 15:51:02 +00:00
Przemyslaw Czerpak
11fe9fff36 2008-10-15 13:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/estack.c
    * disabled all debugger related bindings and variables when
      HB_NO_DEBUG macro is set
    % moved s_fDebuging to HVM function stack frame to eliminate
      saving/restoring this variable in each function/message call
      Note: if you think it's good to block linking .prg code compiled
            with -b (debugger support) with HVM compiled with HB_NO_DEBUG
            then it's enough to disable whole hb_dbg_SetEntry() function
            in hvm.c when HB_NO_DEBUG macro is set.
2008-10-15 11:32:43 +00:00
Przemyslaw Czerpak
b0a88e24ff 2008-10-15 00:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbxvm.h
  * harbour/source/vm/hvm.c
    - removed to unused functions

  * harbour/source/vm/thread.c
    - removed unnecessary casting
2008-10-14 22:32:03 +00:00
Viktor Szakats
c9dc573359 2008-10-14 19:23 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
    + Added hb_macroBlock()

  * source/rtl/langapi.c
    * One error text changed to be more precise.

  * doc/gmake.txt
  * bin/bld.bat
  * contrib/hbbtree/tests/bld_vc.bat
  * contrib/examples/pp/bld_vc.bat
  * contrib/examples/guestbk/bld_vc.bat
  * contrib/examples/pe/bld_vc.bat
  * contrib/examples/dbu/bld_vc.bat
  * contrib/examples/hscript/bld_vc.bat
  * utils/hbdoc/bld_vc.bat
  * utils/hbmake/bld_vc.bat
  * utils/hbmake/hbmake.prg
    - Removed MSVC -TP switches.
2008-10-14 17:26:24 +00:00
Przemyslaw Czerpak
d8af011440 2008-10-14 11:51 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/macro.c
    * added missing const attribute to hb_macroCompile() parameter
    + added new .prg function:
         hb_macroBlock( <cExpr> ) -> <bCode>
      which converts macro expression to codeblock. New codeblocks
      do not inherit hb_macroBlock() caller scope/attributes.
2008-10-14 09:51:37 +00:00
Viktor Szakats
005bc1d9f7 2008-10-13 22:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* tests/transtst.prg
  * doc/en/string.txt
  * doc/en/compiler.txt
  * doc/en/macro.txt
  * doc/en/browse.txt
  * doc/en/binnum.txt
  * doc/es/macro.txt
  * doc/es/browse.txt
  * doc/es/binnum.txt
  * doc/transfrm.txt
  * doc/whatsnew.txt
  * include/hbclass.ch
  * include/hbmacro.ch
  * include/hbexprb.c
  * ChangeLog
  * contrib/hbvpdf/hbvpdft.prg
  * contrib/hbwhat/import.ch
  * source/vm/macro.c
  * source/rtl/tobject.prg
  * source/rtl/tthreadx.prg
  * source/rtl/transfrm.c
  * source/rtl/tget.prg
  * source/rtl/isprint.c
  * source/rtl/tbrowse.prg
  * source/rdd/wacore.c
  * source/rdd/dbdetach.c
  * utils/hbtest/rt_trans.prg
    * Xbase++ name references cleaned.

  * common.mak
  * source/rdd/Makefile
  * source/rdd/dbdetach.c
  + source/rdd/dbdetacx.c
    * Moved XBase++ compatibility functions to separate file.
2008-10-13 20:33:26 +00:00
Przemyslaw Czerpak
f97d4e1cda 2008-10-13 21:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbwince.h
  * harbour/source/common/hbwince.c
    ! fixed LastError overwriting inside WinCE wrapper functions
2008-10-13 19:30:38 +00:00
Przemyslaw Czerpak
b9e2e7b6f0 2008-10-13 20:21 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rdd/wacore.c
    ; updated comments about xbase++ behavior in dbRelease()

  * harbour/include/hbvm.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/dynlibhb.c
  * harbour/source/vm/runner.c
    ! added MT protection for HB_LIBLOAD()/HB_LIBFREE() and
      HB_HRBLOAD()/HB_HRBUNLOAD(). Please remember that you should
      not use any external LoadLibrary() functions because they are
      not protected for clean PCODE modules loading/unloading even
      in ST mode. Using them can cause HVM internal structure corruption.
      If we have such functions in contrib then they should be redirected
      to our HVM ones.
      There is still one problem in MT mode which has to be resolved yet.
      When dynamic library containing PCODE using static variables
      is loaded 1-st time then it will force resizing of internal array
      with static variables. If in exactly the same moment some other
      thread operates on static variable then it may cause corruption.
      To resolve this problem we will have to divide continuous memory
      block common for all modules where we store all static variables
      into separated blocks bound with each PCODE module (symbol table).

  * harbour/source/vm/dynlibhb.c
    + added support for DLL loading/unloading in OS2 builds.
      Based on xHarbour code by Maurilio Longo - please test.
2008-10-13 18:21:42 +00:00
Przemyslaw Czerpak
7d8c51e71a 2008-10-13 18:01 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/thread.c
    + added small description for hb_threadOnce() .prg function

  * harbour/include/hbthread.h
    ! do not set TLS in POCC and XCC builds when _MSC_VER macro is set
      This compilers also have this macro but dllspec( thread) does
      not work for them (at least in version 4.50.15)

  * harbour/utils/hbtest/rt_hvm.prg
    + added few tests which exploit by DMC bug. Be careful with
      this compiler. In some cases it gives buggy final code, f.e.
      try this:

            #include <stdio.h>
            typedef struct
            {
               double         dd;
               long long int  ll;
            } UN;
            const char * cmp( UN * pU )
            {
               return pU->dd >= pU->ll ? "OK" : "ERRROR";
            }
            int main( void )
            {
               UN u = { 10.50, 10 };
               printf( "%s\n", cmp( &u ) );
               return 0;
            }

      The same bug can be exploited also by final Harbour binaries
      compiled by DMC in code like:

         ? iif( 10.50 >= 10, "OK", "ERROR" )

      I used DMC 8.42n. As long as such things will not be fixed by
      DMC developers this compiler is not supported by Harbour and
      reported problems with DMC Harbour builds will have to be
      ignored by us.
2008-10-13 16:01:44 +00:00
Przemyslaw Czerpak
b3ee472fee 2008-10-13 16:34 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
  * harbour/source/vm/classes.c
  * harbour/source/rtl/tobject.prg
  * harbour/source/rtl/tclass.prg
    ! fixed race condition when class function is called 1-st time
      and new class is created. It was possible that more then one
      thread execute this function simultaneously and two classes
      identical classes but with different handles were created
      and registered in HVM

  * harbour/contrib/xhb/xhbcomp.prg
    * updated hack with optional inheritance for new class code
2008-10-13 14:35:07 +00:00
Viktor Szakats
31c5f289d9 2008-10-11 20:54 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapierr.h
    ! Fixed previous casting fix.

  * source/rtl/console.c
  * source/rtl/philes.c
    % Optimized by using static buffers and hb_retc_const():
      HB_OSNEWLINE()
      HB_OSPATHSEPARATOR()
      HB_OSPATHLISTSEPARATOR()
      HB_OSPATHDELIMITERS()
      HB_OSDRIVESEPARATOR()
      HB_OSFILEMASK()

  * source/rtl/filesys.c
    ! hb_fsDisableWaitLocks() made static.
2008-10-12 18:55:12 +00:00
Viktor Szakats
51de53494c 2008-10-11 16:59 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* make_b32.mak
  * make_vc.mak
  * make_gcc.mak
    ! Minor formatting.

  * include/hbapierr.h
    ! Fixed casting in macro HB_ERR_FUNCNAME, as it was 
      generating a new warning with MSVC in 64-bit mode.
      '( ( char * ) 1 )' -> '( ( const char * ) NULL + 1 )'
      ('const' keyword was not enough to silence it)

  * include/hbapierr.h
  * source/rtl/errorapi.c
    - Disabled (marked with HB_LEGACY_LEVEL) hb_errFuncName 
      symbol. No longer supported, pls use HB_ERR_FUNCNAME 
      instead.
2008-10-12 15:00:30 +00:00
Przemyslaw Czerpak
5d69653985 2008-10-12 13:19 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbthread.h
    * casting cleanup

  * harbour/include/hbapigt.h
  * harbour/source/rtl/gtapi.c
  * harbour/source/rtl/scroll.c
  * harbour/source/rtl/console.c
  * harbour/source/rtl/box.c
    * changed hb_gtDrawBox() and hb_gtPutText() to operate on color
      number (index in some GTs) instead of color string
    * use int as color number (index) in hb_gtScrollEx() hb_gtBoxEx()

  * harbour/source/rtl/box.c
    % changed DISPBOX() with color and frame string to work as one
      GT atomic operation

  * harbour/source/vm/classes.c
    ! fixed profiler usage
2008-10-12 11:19:42 +00:00
Viktor Szakats
cdb27e08d2 2008-10-11 11:06 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
    + New functions added.

  * source/rtl/alert.prg
    % Minor optimization.
    ; NOTE: Found yet another hidden extension in Alert() code :(

  * source/rtl/radiobtn.prg
    ! Fix and optimization in recent modification.
2008-10-11 09:07:17 +00:00
Przemyslaw Czerpak
618df79c9b 2008-10-11 04:56 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapigt.h
  * harbour/source/rtl/gtapi.c
    + added C functions hb_gtLock() and hb_gtUnlock()
      They block current GT for other threads

  * harbour/source/rtl/gtfunc.c
    + added PRG functions hb_gtLock() and hb_gtUnlock()
      They block current GT for other threads - be careful using them
      and always unlock locked GT

  * harbour/source/rtl/scroll.c
    + added HB_SCROLL() function - it works like SCROLL() but supports
      2 additional parameters: color and erase char. It's stateless and
      atomic in GT access

  * harbour/source/rtl/tbrowse.prg
    * use HB_SCROLL() instead of SCROLL(). Now whole TBROWSE class
      does not depend on other thread screen output and does not
      set any GT variables except of cursor positioning to active
      cell when it's enabled

  * harbour/source/rtl/memoedit.prg
  * harbour/source/rtl/tgetlist.prg
  * harbour/source/rtl/tlabel.prg
  * harbour/source/rtl/listbox.prg
  * harbour/source/rtl/tmenusys.prg
  * harbour/source/rtl/achoice.prg
  * harbour/source/rtl/profiler.prg
  * harbour/source/rtl/teditor.prg
    * use atomic stateless functions when possible - this code should
      be checked and updated by some who know it.
2008-10-11 02:56:22 +00:00
Przemyslaw Czerpak
aeb6b8686e 2008-10-11 03:06 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapigt.h
  * harbour/source/rtl/gtapi.c
    + added hb_gtDrawBox() works like hb_gtBox() but does not change cursor
      posiion and support colors
    + added support for color parameter to hb_gtPutText()

  * harbour/source/rtl/console.c
    * use new hb_gtPutText() format in HB_DISPOUTAT()
      Now all screen operations inside this function is one atomic
      operation for other threads

  * harbour/source/rtl/box.c
    + added HB_DISPBOX() function - works like DISPBOX() bit does not
      change cursor position and is atomic for other threads


  * harbour/include/hbapigt.h
  * harbour/include/hbgtcore.h
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtclip.c
  * harbour/source/rtl/gtdos/gtdos.c
  * harbour/source/rtl/gtwin/gtwin.c
  * harbour/source/rtl/gtxwc/gtxwc.c
  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gtstd/gtstd.c
  * harbour/source/rtl/gtsln/gtsln.c
  * harbour/source/rtl/gttrm/gttrm.c
  * harbour/source/rtl/gtpca/gtpca.c
  * harbour/source/rtl/gtcgi/gtcgi.c
  * harbour/source/rtl/gtwvt/gtwvt.c
  * harbour/contrib/gtalleg/gtalleg.c
  * harbour/contrib/gtalleg/ssf.h
  * harbour/contrib/gtalleg/ssf.c
  * harbour/contrib/gtwvg/gtwvg.c
    * cleanup char * casting

  * harbour/source/rtl/filesys.c
    ! do not use pread()/pwrite() in OpenWatcom Linux builds
2008-10-11 01:06:39 +00:00
Viktor Szakats
4c7936d636 2008-10-10 10:50 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
    ! Fixed XPP class names.
2008-10-10 08:50:29 +00:00
Viktor Szakats
d0a14cc81c 2008-10-10 09:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* make_b32.mak
  * bin/bld.bat
    + -tWM BCC32 switch made the all-time default.

  * include/hbextern.ch
    + Added new functions.
2008-10-10 07:28:24 +00:00
Przemyslaw Czerpak
d4b61aece8 2008-10-10 06:26 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvm.h
  * harbour/source/vm/hvm.c
    + added hb_vmProcessDynLibSymbols() which works like
      hb_vmProcessSymbolsEx() but always mark registered modules as
      dynamic

  * harbour/source/vm/maindllp.c
    * redirect hb_vmProcessSymbolsEx() to hb_vmProcessDynLibSymbols()

  * harbour/source/vm/thread.c
    * disabled some low level locking code in non MT HVM mode
2008-10-10 04:26:42 +00:00
Przemyslaw Czerpak
6829fa76a5 2008-10-10 01:43 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbgtcore.h
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtapi.c
    + added new GT methods: LOCK() and UNLOCK()
    * serialize GT access in MT mode - please remember that it's only
      low level serialization to protect access to low GT resources.
      It has nothing to application level screen output from different
      threads which has to be serialized by programmer if necessary.

  * harbour/source/rtl/tthreadx.prg
    * use HB_THREAD_INHERIT_PUBLIC as thread attribute for thread
      started by oThread:start() to emulate xbase++ PUBLIC variables
      behavior
2008-10-09 23:43:41 +00:00
Przemyslaw Czerpak
15054c311b 2008-10-10 00:14 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapigt.h
  * harbour/source/rtl/gtapi.c
    + added hb_gtPutText() C function

  * harbour/source/rtl/console.c
    + added HB_DISPOUTAT() which works like DISPOUTAT but does not change
      cursor position. xBase++ users can use
         #xtranslate DispOutAt( <x,...> ) => hb_dispOutAt( <x> )
      for xBase++ compatible code
2008-10-09 22:15:01 +00:00
Viktor Szakats
c3c9bc4e89 2008-10-09 09:57 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
    + Added missing HB_DISABLEWAITLOCKS().
    ; NOTE: This looks like a hack to add FLX_WAIT flag 
            for locks app-wide, and on Windows systems only.
            IMO we should not have such hacks in core, or if 
            this is really important it should support all 
            possible platforms.
            It also has a low-level function equivalent, 
            which is missing from hbapifs.h. There is no 
            reference to these function in any Harbour or 
            xhb changelogs.
            If there are no objections, I'd like remove 
            this functionality.

  * source/rtl/hbrandom.c
  * source/rtl/filesys.c
    * Minor formatting.
2008-10-09 08:06:47 +00:00
Przemyslaw Czerpak
953208bbe1 2008-10-09 03:26 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbcompdf.h
  * harbour/source/compiler/hbmain.c
    % do not add dummy entries to symbol table for functions declared
      as dynamic - it allows to include hbdynamic.ch with list of all
      supported functions by application and/or harbour.dll to any .prg
      file which will be used to create shared library (.dll, .so, ...)
      without any memory overhead.

  * harbour/source/compiler/genc.c
    % do not generate unnecessary HB_FUNC_EXTERN() declarations for
      function declared as DYNAMIC
2008-10-09 01:27:03 +00:00
Viktor Szakats
f5c04a91e9 2008-10-09 01:33 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
    + Added HB_THREADWAIT()
2008-10-08 23:14:05 +00:00
Przemyslaw Czerpak
a9ed741e26 2008-10-09 00:17 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbtypes.h
  * harbour/source/vm/maindllp.c
    ! updated casting for current SVN code
      [TOMERGE 1.0]

  * harbour/include/hbthread.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/thread.c
    + added .prg function
         hb_threadWait( <pThID> | <apThID>, [ <nTimeOut> ] [, <lAll> ] )
               => <nThInd> | <nThCount> | 0
      This function wait for <nTimeOut> seconds (default infinite wait)
      until one or all (controlled by <lAll> parameter) of given HVM threads
      will have finished execution in HVM area. It does not join the threads.
      It returns index to 1-st thread which has finished execution (default)
      or number of threads which has finished in given time period when lAll
      is .T.
2008-10-08 22:18:09 +00:00
Przemyslaw Czerpak
f6eb3cfb17 2008-10-07 18:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
    % moved static USHORT uiPolls to HVM stack to not reduce the HVM
      performance in MT mode. In multi CPU environment if many threads
      try to change the same memory variable in the same time the overall
      performance is strongly reduced on most of tested hardware - probably
      some random CPU delay used to resolve the conflict.
2008-10-07 16:33:02 +00:00
Viktor Szakats
a7870bbdf2 2008-10-07 14:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapierr.h
   * source/vm/extrap.c
   * source/rtl/errorint.c
     ! Fixed recent modification on Windows platform, where 
       GPF would generate an internal error.
       It didn't launch the OS error handler.
     ! Fixed hb_errInternal() being marked as HB_EXPORT 
       in the headers only.
2008-10-07 12:25:23 +00:00
Viktor Szakats
f75bc7b051 2008-10-07 09:33 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
  * source/rtl/inkey.c
    + Added HB_KEYCLEAR() a documented function equivalent 
      to "CLEAR TYPEAHEAD" command, or undocumented __KEYBOARD() function.

  * contrib/rddads/rddads.h
  * contrib/rddads/ads1.c
    + Added support for ADS_USE_OEM_TRANSLATION for old ads versions.
      Borrowed from xhb/Pavel Tsarenko.
2008-10-07 07:35:38 +00:00
Przemyslaw Czerpak
e1ea6f3cec 2008-10-07 02:57 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/Makefile
  + harbour/include/hbatomic.h
  * harbour/include/hbthread.h
  * harbour/source/vm/garbage.c
  * harbour/source/vm/fm.c
    * moved atomic and spinlock functions into hbatomic.h

  * harbour/include/hbatomic.h
    + added atomic inc/dec for GCC and x86@64 and PPC@32
    + use OSAtomic*() and OSSpin*() functions for atomic inc/dec and
      spinlocks in Darwin builds 
    + added spinlocks to MS-Win builds
2008-10-07 00:57:54 +00:00
Viktor Szakats
3f2735f5e6 2008-10-06 22:24 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbthread.h
     ! Committed MT fix to make it compile under Darwin.
       Thanks Przemek.
2008-10-06 20:25:04 +00:00
Przemyslaw Czerpak
1ec50a7d81 2008-10-06 21:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    ! fixed last commit typo in thread number allocating - all threads
      where using 0 number

  * harbour/source/vm/thread.c
    ! fixed return value in recursive call to hb_mutexLock() - was FALSE
    ! fixed typo in timeout parameter number
      should be 2 instead of 1

  * harbour/source/rtl/tobject.prg
    ! fixed init() return value - it should be ignored and current
      object should be returned

  * harbour/source/rtl/tthreadx.prg
    ! probably fixed timeout parameter use in signal:wait() method
      I guess that like other xbase++ functions it's in 1/100th of
      a second

  * harbour/include/hboo.ch
  * harbour/include/hbclass.ch
  * harbour/source/vm/classes.c
  * harbour/source/rtl/tclass.prg
    + added support for SYNC object and CLASS messages working like
      in xBase++. Please remember that all locked by thread SYNC messages
      objects and classes are unblocked automatically for the time which
      thread spends in hb_subscribe[Now]() or signal:wait()
2008-10-06 19:50:53 +00:00
Viktor Szakats
9e70689436 2008-10-06 21:27 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbapifs.h
   * include/hbextern.ch
   * source/common/hbfsapi.c
   * source/rtl/hbfile.c
     + Added hb_fsNameExists() C level function.
     + Added hb_FNameExists() Harbour level function.
     ; Both will return true if any kind of directory entry 
       exists with the given name (IOW it doesn't matter 
       if it's a file or directory, or else).
2008-10-06 19:30:27 +00:00
Przemyslaw Czerpak
67cc2f7ebe 2008-10-06 15:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbthread.h
  * harbour/source/vm/thread.c
  * harbour/source/vm/hvm.c
    + add numeric HVM thread identifiers to thread structure. Now
      HB_THREADID() returns numbers in all OSes

  * harbour/include/hbexprop.h
  * harbour/include/hbexprb.c
  * harbour/source/common/expropt2.c
    + added compile time optimization for MIN() and MAX() functions

  * harbour/source/rtl/minmax.c
    * removed trailing spaces from source code
2008-10-06 13:30:47 +00:00
Przemyslaw Czerpak
12ac680ed3 2008-10-06 12:38 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
  * harbour/include/hboo.ch
    + added SYNC attribute to accepted syntax in class declaration
      it allows to compile code which uses this attribute but low
      level implementation is not ready yet - work in progress

  * harbour/source/vm/garbage.c
    ! added #define INCL_DOSPROCESS for OS2 builds. For some reasons
      #define INCL_DOSDATETIME I've found in DosSleep() documentation
      is note enough
2008-10-06 10:38:22 +00:00
Viktor Szakats
f5939dca16 2008-10-06 03:09 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbextern.ch
    + Added HB_THREADONCE.

  * ChangeLog
    - Removed a duplicate entry of mine.
2008-10-06 01:10:07 +00:00
Viktor Szakats
0316d44e12 2008-10-06 00:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbthread.h
    ! Blind fix for WinCE compilation after MT changes.
2008-10-05 22:29:02 +00:00
Viktor Szakats
ed672c29c9 2008-10-05 15:56 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbpers.ch
  * source/rtl/perfuncs.prg
  * source/rtl/objfunc.prg
  * source/rtl/tlabel.prg
  * source/rtl/setta.prg
  * source/rtl/dirscan.prg
  * source/rtl/tthreadx.prg
  * source/rtl/setfunc.prg
  * source/rtl/readvar.prg
  * source/rtl/tclass.prg
  * source/rtl/ttextlin.prg
  * source/rtl/profiler.prg
  * source/rtl/treport.prg
  * source/rtl/tgetint.prg
  * source/rtl/persist.prg
  * source/rtl/altd.prg
  * source/rtl/devoutp.prg
  * source/rdd/usrrdd/example/exmemo.prg
  * source/rdd/usrrdd/example/exhsx.prg
  * source/rdd/usrrdd/example/exfcm.prg
  * source/rdd/usrrdd/example/exrlx.prg
  * source/rdd/usrrdd/rdds/dbtcdx.prg
  * source/rdd/usrrdd/rdds/fptcdx.prg
  * source/rdd/usrrdd/rdds/arrayrdd.prg
  * source/rdd/usrrdd/rdds/hscdx.prg
  * source/rdd/usrrdd/rdds/rlcdx.prg
  * source/rdd/usrrdd/rdds/fcomma.prg
  * source/rdd/usrrdd/rdds/smtcdx.prg
    * Formatting. Basically finished.

  * include/hbextern.ch
    ! Added two missing functions.
2008-10-05 13:57:35 +00:00
Viktor Szakats
011d73157d 2008-10-02 23:16 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbsetup.ch
    ! Removed some company names from comments.

  * source/vm/extrap.c
    + Added //BATCH internal switch to indicate exception handler 
      to suppress the Windows exception dialog when an exception 
      occurs. Useful for programs running without user interaction.
      NOTE: This may not be the ultimate method. If we can gather 
            more such situations where such "batch" mode might 
            be useful, we may as well implement it as a Set().
    - Removed Harbour specific exception MessageBox(). Besides 
      having gotten rid of a MessageBox() call in core VM, Harbour now 
      got back the standard Windows error handling dialog, which is 
      more standard and easy to get by than the previous default 
      method, where several clicks were needed to pass through 
      the (sometimes hidden) popups. The details of all GPFs are 
      still logged into hb_out.log.
    + Removed size limit for the logged exception call stack.
2008-10-02 21:49:11 +00:00
Przemyslaw Czerpak
c16b13e573 2008-10-02 21:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rdd/sdf1.c
    ! fixed stupid typo (missing !) in last modification which broke
      SDF RDD read mode. Thanks to Marco for information and example.

  * harbour/include/hbstack.h
  * harbour/source/vm/estack.c
    * small cleanup in used macros
2008-10-02 19:12:30 +00:00
Przemyslaw Czerpak
ffd9b480a4 2008-10-02 14:33 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
    % enable assembler inline function to access HVM thread stack pointer
      without native compiler TLS support even if HB_STACK_PRELOAD is not
      defined in MinGW builds. It gives some additional small speed
      improvement in MT mode

  * harbour/source/rtl/idle.c
    * unlock HVM inside hb_releaseCPU() function

  * harbour/contrib/hbwin/win_ole.c
    ! fixed casting and C++ compilation in some compilers

  * harbour/include/Makefile
  + harbour/contrib/examples/rdddbt/hbrdddbt.h
  - harbour/include/hbrdddbt.h
    ! moved hbrdddbt.h to correct location

  * harbour/include/Makefile
    ! added missinf hbthread.h

  * harbour/tests/rddtest/rddmktst.prg
  * harbour/tests/rddtest/adscl52.prg
  * harbour/tests/rddtest/adscl53.prg
  * harbour/tests/rddtest/ntxcl52.prg
  * harbour/tests/rddtest/ntxcl53.prg
  * harbour/tests/rddtest/cdxcl52.prg
  * harbour/tests/rddtest/rddtst.prg
  * harbour/tests/rddtest/cdxcl53.prg
    ! fixed description in header I wrongly copied without updating
      from other files

  + harbour/tests/hsxtest.prg
    + added test code for HiPer-SEEK indexes

  * harbour/source/rtl/filesys.c
    + added new functions: hb_fsExtName(), hb_fsReadAt(), hb_fsWriteAt(),
      hb_fsTruncAt() to use with shared file handles.
      Please test it in other *nixes. I used pread[64]()/pwrite[64]()
      POSIX functions but I do not know if they are available by default
      in other supported platforms like MacOSX, BSD, HPUX, SunOS.
      If not they I will have to implement some workaround.

  * harbour/common.mak
  * harbour/source/rtl/Makefile
  * harbour/include/hbapifs.h
  + harbour/source/rtl/filebuf.c
    + added set of new file functions (hb_file*()) which are designed to
      use with shared file handles and locks (buffers in the future):
      hb_fileExtOpen(), hb_fileCreateTemp(), hb_fileClose(), hb_fileLock(),
      hb_fileReadAt(), hb_fileWriteAt(), hb_fileTruncAt(), hb_fileSize(),
      hb_fileCommit(), hb_fileHandle()
      These functions operate on PHB_FILE structure instead of HB_FHANDLE.
      Now in POSIX systems they share file handle between aliased or
      simultaneously open by other thread work areas. It resolves the
      problem with releasing all process FCNTL locks by any close()
      operation even on duplicated or open() separately handle.
      Now DOS deny flags emulation works in single process even if
      BSD locks are disabled (non Linux *nixes).
      They also keep internal file lock list what allows to synchronize
      threads and aliases with file locks in POSIX systems. In the future
      it will be used also for internal locking to synchronize threads
      without OS level locks - pseudo exclusive mode in cloned WA.
      Finally these structures will be used also for file buffers
      which will be shared between aliased WA and threads.

  * harbour/include/hbrdddbf.h
  * harbour/include/hbrddcdx.h
  * harbour/include/hbrddntx.h
  * harbour/include/hbrdddel.h
  * harbour/include/hbrddsdf.h
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/delim1.c
  * harbour/source/rdd/sdf1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/dbfntx/dbfntx1.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/hsx/hsx.c
  * harbour/contrib/hbbmcdx/bmdbfcdx.c
  * harbour/contrib/hbbmcdx/hbbmcdx.h
    * use PHB_FILE and hb_file*() functions instead of HB_FHANDLE (hb_fs*())
      to access files.

  + harbour/tests/aliaslck.prg
    + added test code for file lock synchronization between aliased
      work areas
2008-10-02 12:34:36 +00:00
Przemyslaw Czerpak
cf55a99c10 2008-09-30 11:37 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/Makefile
  + harbour/include/hbvmint.h
    + added new header file which works like hbvmopt.h but does not enable
      stack macros

  * harbour/contrib/xhb/xhbenum.c
  * harbour/contrib/xhb/xhbqself.c
  * harbour/contrib/xhb/xhbwith.c
  * harbour/contrib/xhb/cstructc.c
  * harbour/contrib/hbwin/win_ole.c
    ! use hbvmint.h instead of hbvmopt.h to eliminate direct bindings to
      HVM stack structure
2008-09-30 09:37:58 +00:00
Przemyslaw Czerpak
f06af57f7e 2008-09-29 17:41 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbset.h
  * harbour/source/vm/set.c
    + divided __SETCENTURY() PRG function into two functions:
      __SETCENTURY() and public C function hb_setSetCentury()
      to manipulate century setting from C code.
      Modyfication by Francesco Saverio Giudice
2008-09-29 15:42:21 +00:00
Przemyslaw Czerpak
cce3e73961 2008-09-29 11:18 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvm.h
  * harbour/include/hbthread.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/thread.c
    + added hb_vmThreadRegister() funtion which allows to register new
      thread in HVM without HVM stack allocation
    + added hb_vmThreadRelease() which removes registered thread which
      does not have allocated HVM stack yet
    + added hb_threadStateNew() which returns new thread control state
      which can be used as parameter to hb_vmThreadInit(),
      hb_vmThreadRegister(), hb_vmThreadRelease()
    * register thread control state also for main thread
      Now hb_threadSelf() returns thread pointer also for main thread
    ! fixed possible race condition in hb_threadWaitForAll() and
      hb_threadTerminateAll() by using hb_vmThreadRegister() before
      starting thread.

  * harbour/source/rtl/idle.c
    * interrupt hb_idleSleep() on QUIT or BREAK requests

  * harbour/tests/mt/mttest09.prg
    * small cleanup
2008-09-29 09:19:46 +00:00
Viktor Szakats
26c2a6fd7e 2008-09-27 09:15 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* include/hbthread.h
    % Disabled HB_USE_TLS for __BORLAND__ and __MINGW32__ for 
      best performance.

  * contrib/hbwhat/whtmmcap.c
    ! Fixed some warnings under certain MinGW 4.3.2 
      installations. 
      TODO: hbwhat users pls finish this fix.

  * utils/hbmake/hbmake.prg
    ! Fixed hbw32 to hbwin.
    * Win32 references changed to Windows.

  * make_gcc.sh
    * Not accepting CFLAGS anymore as custom C flags envvar.
      Pls use C_USR instead.

  * make_gcc.mak
    + Added wsock32 lib to Cygwin system liblist.
    ! Removed setting HB_OS_* macros explicitly.

  * make_b32.mak
  * make_vc.mak
    * Minor formatting.
2008-09-27 07:16:10 +00:00
Przemyslaw Czerpak
893c372e0b 2008-09-26 19:34 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/source/vm/estack.c
    + added assembler inline macros for TLS access in BCC and MinGW32
      They are enabled when Harbour is compiled with -DHB_NO_TLS.
      Please check the speed difference. If it will be noticeable
      then we keep them probably as default. Otherwise they will be
      removed.
2008-09-26 17:35:37 +00:00