Commit Graph

654 Commits

Author SHA1 Message Date
Viktor Szakats
f99693f142 2009-02-21 08:44 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/vm/hvm.c
    + Added hb_vmSetLinkedMain() function to replace direct
      access to exported variable hb_vm_pszLinkedMain.
      (it's not a public call and caller should always pass
      a string literal).
    * hb_vm_pszLinkedMain -> s_vm_pszLinkedMain and made static.

  * utils/hbmk2/hbmk2.prg
    ! Not adding 'dllimport' for externs in C stub when
      MSVC is used, to avoid compiler warning mentioned in 
      previous entry.

  * utils/hbmk2/hbmk2.prg
  * bin/hb-func.sh
    * Updated for above change.

  ; TODO: Convert GT defaulting to function call too.
2009-02-21 07:45:05 +00:00
Przemyslaw Czerpak
fbe97f53ab 2009-02-18 12:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/hvm.c
    % replaced index to evaluated PCODE by direct PCODE pointer
      modification
2009-02-18 11:12:27 +00:00
Przemyslaw Czerpak
4fd0cafdd2 2009-02-18 10:25 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/cmdarg.c
  * harbour/source/vm/hvm.c
    * added hb_cmdargUpdate() function which makes final argc/argv updating
      (code moved from hb_cmdargInit())
    ! use hb_cmdargUpdate() - it fixes GPF in MT mode when some fs* functions
      were called before allocating HVM stack
    ; TOFIX: change some hb_setGet*() functions to work without HVM stack.

  * harbour/source/rtl/hbtoken.c
    * formatting
2009-02-18 09:20:39 +00:00
Francesco Saverio Giudice
c26dea6c63 2009-02-16 23:55 UTC+0100 Francesco Saverio Giudice (info/at/fsgiudice.com)
+ harbour/contrib/hbblat
  + harbour/contrib/hbblat/blatcls.prg
  + harbour/contrib/hbblat/blatwrp.c
  + harbour/contrib/hbblat/common.mak
  + harbour/contrib/hbblat/hbblat.ch
  + harbour/contrib/hbblat/make_b32.bat
  + harbour/contrib/hbblat/make_vc.bat
  + harbour/contrib/hbblat/Makefile
  + harbour/contrib/hbblat/syntax.txt
  + harbour/contrib/hbblat/tests
  + harbour/contrib/hbblat/tests/blatcmd.prg
  + harbour/contrib/hbblat/tests/blattest.prg
  + harbour/contrib/hbblat/tests/f_listtext.txt
  + harbour/contrib/hbblat/tests/f_ps.txt
  + harbour/contrib/hbblat/tests/f_sample.txt
  + harbour/contrib/hbblat/tests/f_sample1.txt
  + harbour/contrib/hbblat/tests/f_subjectline.txt
  + harbour/contrib/hbblat/tests/hbmk.bat
    + Added BLAT wrapper class

  * harbour/contrib/make_b32_all.bat
  * harbour/contrib/make_vc_all.bat
    * added above contrib

  * harbour/source/vm/hvm.c
    * added missing ;
2009-02-16 23:01:32 +00:00
Viktor Szakats
eefe474f98 2009-02-08 18:06 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/rtl/gtwvt/gtwvt.c
    * BYTE -> CHAR (Windows)

  * contrib/hbct/ctwin.c
  * contrib/hbct/ctwin.h
    + Added hb_ctwGetPosWindows() to find out which window
      is visible on a given physical screen coordinate.

  * make_b32.mak
  * make_gcc.mak
  * make_vc.mak
    * Formatting.

  * include/hbdefs.h
    + Added type HB_COLOR to replace current BYTE.
    * Minor formatting.

  * contrib/rddsql/sddfb/make_b32.bat
  * contrib/rddsql/sddfb/make_vc.bat
  * contrib/rddsql/sddmy/make_b32.bat
  * contrib/rddsql/sddmy/make_vc.bat
  * contrib/rddsql/sddpg/make_b32.bat
  * contrib/rddsql/sddpg/make_vc.bat
    * Minor cleanup.

  * source/vm/hvm.c
  * source/vm/memvars.c
    * Added varnames to prototypes.
2009-02-08 17:07:38 +00:00
Viktor Szakats
1d13959a7b 2009-02-04 01:09 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* include/extend.api
  * include/hbgtcore.h
  * include/hbwince.h
  * include/hbthread.h
  * include/hbdefs.h
  * include/hbsetup.h
  * include/hbapi.h
  * include/clipdefs.h
  * include/hbatomic.h
  * contrib/hbmysql/mysql.c
  * contrib/hbct/ctnet.c
  * contrib/hbct/files.c
  * contrib/hbct/dattime3.c
  * contrib/hbct/disk.c
  * contrib/hbodbc/odbc.c
  * contrib/xhb/hboutdbg.c
  * contrib/xhb/hbsyslog.c
  * contrib/xhb/filestat.c
  * contrib/hbmsql/msql.c
  * contrib/hbole/ole2.c
  * contrib/hbmzip/hbmzip.c
  * contrib/hbapollo/apollo.c
  * contrib/hbfbird/firebird.c
  * contrib/hbnf/descendn.c
  * contrib/hbnf/getenvrn.c
  * contrib/rddsql/sqlmix.c
  * contrib/gtwvg/gtwvg.c
  * contrib/gtwvg/wvggui.c
  * contrib/gtwvg/wvgwin.c
  * contrib/gtwvg/wvgutils.c
  * contrib/gtwvg/wvgcore.c
  * contrib/rddads/adsx.c
  * contrib/rddads/rddads.h
  * contrib/rddads/adsmgmnt.c
  * contrib/rddads/adsfunc.c
  * contrib/rddads/ads1.c
  * contrib/hbfimage/fi_winfu.c
  * contrib/hbfimage/fi_wrp.c
  * contrib/hbgd/gd.ch
  * contrib/hbgd/gdwrp.c
  * contrib/hbgf/hbgfwin/winapi.c
  * contrib/hbtip/utils.c
  * contrib/hbtip/ChangeLog
  * contrib/hbwin/win_prn2.c
  * contrib/hbwin/win_osc.c
  * contrib/hbwin/win_misc.c
  * contrib/hbwin/win_prt.c
  * contrib/hbwin/win_dll.c
  * contrib/hbwin/win_ole.c
  * contrib/hbwin/win_prn1.c
  * contrib/hbwin/win_regc.c
  * contrib/hbssl/sslsess.c
  * contrib/hbssl/sslrand.c
  * contrib/hbwhat/whtdate.c
  * contrib/hbwhat/whtini.c
  * contrib/hbwhat/whtcret.c
  * contrib/hbwhat/whthead.c
  * contrib/hbwhat/whtilst.c
  * contrib/hbwhat/whtreg.c
  * contrib/hbwhat/whtclpb.c
  * contrib/hbwhat/whtmous.c
  * contrib/hbwhat/whtrgn.c
  * contrib/hbwhat/whtmeta.c
  * contrib/hbwhat/whttbar.c
  * contrib/hbwhat/whtrect.c
  * contrib/hbwhat/whtbrsh.c
  * contrib/hbwhat/whtgdi.c
  * contrib/hbwhat/whtdlg.c
  * contrib/hbwhat/whtview.c
  * contrib/hbwhat/whtsys.c
  * contrib/hbwhat/whtmain.c
  * contrib/hbwhat/whtwnd.c
  * contrib/hbwhat/whtmmcap.c
  * contrib/hbwhat/whtfont.c
  * contrib/hbwhat/whtdir.c
  * contrib/hbwhat/whtbmp.c
  * contrib/hbwhat/whtkbrd.c
  * contrib/hbwhat/whtpen.c
  * contrib/hbwhat/whttext.c
  * contrib/hbwhat/whtdc.c
  * contrib/hbwhat/whtdraw.c
  * contrib/examples/uhttpd/socket.c
  * contrib/examples/uhttpd/uhttpdc.c
  * source/vm/mainwin.c
  * source/vm/maindll.c
  * source/vm/maindllh.c
  * source/vm/hvm.c
  * source/vm/cmdarg.c
  * source/vm/maindllp.c
  * source/vm/fm.c
  * source/vm/extrap.c
  * source/vm/thread.c
  * source/vm/dynlibhb.c
  * source/vm/set.c
  * source/common/hbgete.c
  * source/common/hbver.c
  * source/common/hbfsapi.c
  * source/common/hbwince.c
  * source/common/hbdate.c
  * source/rtl/diskspac.c
  * source/rtl/console.c
  * source/rtl/gtwin/gtwin.c
  * source/rtl/fserror.c
  * source/rtl/hbgtcore.c
  * source/rtl/gtclip.c
  * source/rtl/fstemp.c
  * source/rtl/idle.c
  * source/rtl/oemansi.c
  * source/rtl/disksphb.c
  * source/rtl/net.c
  * source/rtl/gtgui/gtgui.c
  * source/rtl/seconds.c
  * source/rtl/gttone.c
  * source/rtl/hbproces.c
  * source/rtl/gtkeycod.c
  * source/rtl/version.c
  * source/rtl/gtwvt/gtwvt.c
  * source/rtl/hbrandom.c
  * source/rtl/hbinet.c
  * source/rtl/hbffind.c
  * source/rtl/gtsys.c
  * source/rtl/filesys.c
  * source/rtl/gtkbstat.c
  * source/rtl/isprint.c
  * source/compiler/cmdcheck.c
  * utils/hbmake/hbmlang.c
    * #defines renamed to be bitwidth-independent.
      - HB_OS_WIN_32_USED -> HB_OS_WIN_USED
      - HB_OS_WIN_32      -> HB_OS_WIN
    ; Please modify your code accordingly.

  * include/hbdefs.h
  * include/hbsetup.h
    + Added compatibility to still understand HB_OS_WIN_32_USED,
      and to #define HB_OS_WIN_32 in addition to HB_OS_WIN.
      This means that old code will still work, but these
      compatibility features will be removed in the future,
      so it's recommended to change the code as above.
2009-02-04 00:18:56 +00:00
Viktor Szakats
dc70d7602c 2009-02-03 18:24 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* doc/en/hb_api.txt
  * doc/en/hb_apird.txt
  * include/hbrdddbf.h
  * include/hbrddcdx.h
  * include/hbapi.h
  * include/hbrddfpt.h
  * include/hbrddntx.h
  * contrib/hbct/dbftools.c
  * contrib/rddado/adordd.prg
  * contrib/hbpgsql/pgrdd.prg
  * contrib/rddads/adsx.c
  * contrib/rddads/adsfunc.c
  * contrib/examples/rdddbt/hbrdddbt.h
  * contrib/examples/rdddbt/dbfdbt1.c
  * source/vm/hvm.c
  * source/vm/memvars.c
  * source/debug/dbgentry.c
    * SUCCESS -> HB_SUCCESS
    * FAILURE -> HB_FAILURE
    * ERRCODE -> HB_ERRCODE
    ; Migration finished.
2009-02-03 17:25:32 +00:00
Przemyslaw Czerpak
77df7fd78f 2009-02-02 11:02 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/fm.c
    ! fixed typo in default FM module setting/

  * harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
  * harbour/source/debug/dbgentry.c
    * renamed hb_dbgObjSendMessage() to hb_dbg_objSendMessage() to keep
      naming convention used for other C debugger functions

  * harbour/source/vm/debug.c
    * added information about existing debugger functions and where they
      are used.

  * harbour/include/hbvm.h
  * harbour/include/hbapidbg.h
  * harbour/include/hbvmpub.h
  * harbour/include/hbstack.h
  * harbour/include/hbapi.h
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
  * harbour/source/debug/dbgentry.c
    * changed the method of static variable handling. Now we do not
      have centralized array of all statics used by application (s_aStatics)
      but each module uses it's own array to keep statics. The old
      s_aStatics has been removed. It means that loading new PCODE module
      from .hrb file or shared/dynamic library does not cause any static
      table reallocation so it does not creates potential GPF trap for MT
      code which may operate on static vars.
      This modification changed a little bit the debugger interface.
      I also updated some unused by us debug functions like __DBGVMVARSLIST()
      or __DBGVMVARSLEN() anyhow any 3-rd party debuggers should be
      updated for new API and modified hb_dbgEntry() syntax.
2009-02-02 09:58:22 +00:00
Przemyslaw Czerpak
603ad8a1fd 2009-01-19 22:17 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    * clone arrays and hash tables instead of coping when thread static
      variable is initialized

  + harbour/tests/mt/mttest12.prg
    + added demonstration/test code which illustrates thread static
      variables initialization
2009-01-19 21:13:58 +00:00
Przemyslaw Czerpak
14a0be1f2d 2009-01-15 20:52 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    * register default RT symbols after setting exception handler

  * harbour/source/vm/fm.c
    % keep process heap address in static variable when HeapAlloc()
      is used.

  * harbour/source/vm/extrap.c
    * casting to pacify warnings
2009-01-15 19:49:20 +00:00
Przemyslaw Czerpak
65644f22a1 2008-12-27 15:31 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/include/hbapi.h
  * harbour/include/hbapiitm.h
  * harbour/source/vm/hashes.c
    * small modifications in order of some structure members for better
      alignment

  * harbour/source/vm/hvm.c
    * pacified BCC warnings

  * harbour/contrib/rddsql/Makefile
  * harbour/contrib/rddsql/sddpg/Makefile
  + harbour/contrib/rddsql/sddfb/Makefile
    * updated GNU make files for new SQL RDDs - many thanks to
      Mindaugas
2008-12-27 14:29:30 +00:00
Przemyslaw Czerpak
9e2ee8d66e 2008-12-24 00:04 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/common/expropt1.c
  * harbour/source/common/expropt2.c
    ! fixed wrongly modified expression during optimization for
      ( <numConst> / 0.0 )
    * cleaned bDec/bWidth updating in compile time optimizations

  * harbour/tests/speedtst.prg
    ! fixed possible race condition in initialization
    + added set workarea private for xHarbour builds - thanks to Phil

  * harbour/doc/cmpopt.txt
    * small cleanup

  * harbour/include/hbvmpub.h
  * harbour/source/vm/hvm.c
    % some optimizations mostly for MT mode or compilers which do
      not support function autoinline optimization
2008-12-23 23:02:06 +00:00
Przemyslaw Czerpak
b16bf45375 2008-12-22 16:30 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
    ! cleaned some typos in my recent ChangeLog entries

  * harbour/include/hbvm.h
  * harbour/include/hbvmpub.h
  * harbour/include/hbsetup.h
  * harbour/include/hbapi.h
  * harbour/include/hbapierr.h
    * added some function attributes which can improve code optimization
      or introduce some additional warnings.
      Now it works only in GCC builds.

  * harbour/source/vm/hvm.c
    ! fixed missing double decimal places initialization in some number
      negating
    ! fixed setting number of decimal places in plus and minus operations
      if integer overflow forces conversion to double item
    * some minor optimizations

  * harbour/source/rtl/rat.c
    * formatting
2008-12-22 15:28:29 +00:00
Przemyslaw Czerpak
fa31aa6f70 2008-12-11 19:48 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbthread.h
  * harbour/source/vm/thread.c
    + added hb_atomic_set(), hb_atomic_get(), hb_atomic_inc() and
      hb_atomic_dec() functions which operates on HB_COUNTER or smaller
      type if it's necessary for some platforms which can be access/assign
      increment/decrement in MT safe atom operations.
      hb_atomic_dec() returns true if counter is 0 after decrementation

  * harbour/include/hbatomic.h
    ! fixed compilation in Linux and OpenWatcom

  * harbour/include/hbapiitm.h
  * harbour/source/rtl/itemseri.c
    + make hb_itemSerialize() and hb_itemDeserialize() public functions
    ! fixed serialization items with internal item references

  * harbour/source/vm/hvm.c
    * release memvars after closing RDDs

  * harbour/source/debug/dbgentry.c
    ! fixed buffer overflow reported by Rodrigo

  * harbour/source/vm/macro.c
  * harbour/source/compiler/hbmain.c
    * formatting

  * harbour/include/hbexprb.c
    ! fixed wrongly recognized functions with HB_I18N_ prefix as
      HB_I18N_GETTEXT()

  * harbour/include/hbapi.h
  * harbour/include/hbstack.h
  * harbour/include/hbthread.h
  * harbour/source/vm/estack.c
  * harbour/source/vm/thread.c
  * harbour/source/vm/hvm.c
    + added support for I18N in HVM.
      Each thread can have it's own i18n set.
      When new thread is created then it inherits i18n set from parent
      thread and both uses the same set (please remember about it if you
      will want to make some direct modifications on active i18n set
      internals).
      When thread change active i18n set then it effects only this thread
      and new threads which will be create later. It does not change i18n
      in other existing threads.
    + added functions to set/get pointer to active i18n set in HVM
         void * hb_vmI18N( void )
         void   hb_vmSetI18N( void * )

  * harbour/include/hbapi.h
  * harbour/source/rtl/hbi18n.c
    + added i18n module. Now only for internal Harbour usage without support
      for optional switching to alternative implementations.
      I'll add such functionality later when I will work on native gettext
      support.

      The following public .prg functions has been added:
         HB_I18N_GETTEXT[_STRICT]( <cMsgID> [, <cContext> ] )
               -> <cTranslatedMsgID> | <cMsgID>
         HB_I18N_NGETTEXT[_STRICT]( <nValue>, <cMsgID> | <acMsgID> ;
                                    [, <cContext> ] )
               -> <cTranslatedMsgID> | <cMsgID> | <acMsgID>[ <nIndex> ]
      This is minimal support necessary for .prg code which has to exists
      in each i18n module working with Harbour.

      The following functions had been added as public C API:
         PHB_ITEM hb_i18n_gettext( PHB_ITEM pMsgID, PHB_ITEM pContext )
         PHB_ITEM hb_i18n_ngettext( PHB_ITEM pNum,
                                    PHB_ITEM pMsgID, PHB_ITEM pContext )

      The following functions had been added as private HVM C API:
         void   hb_i18n_init( void )
         void   hb_i18n_exit( void )
         void   hb_i18n_release( void * cargo )
         void * hb_i18n_alloc( void * cargo )
      They have to be supported by alternative i18n modules

      The following functions has been added to manage Harbour i18n
      translations sets:

         HB_I18N_CREATE()
                  -> <pI18N>
            Creates new empty I18N translation set

         HB_I18N_CODEPAGE( [<pI18N>,] [<cNewCP>], [<lBase>], [<lTranslate>] )
                  -> <cOldCP>
            Gets or sets Harbour codepage used by translation set
            <pI18N> - I18N translation set,
                      if it's not given then currently active I18N set is used
            <cNewCP> - new CP ID. Must be linked with application
            <lBase> - when it's .T. then get/set base massages CP instead of
                      translated massages CP
            <lTranslate> - if it's .T. then translate base (<lBase>==.T.) or
                           final messages in I18N set from previous CP to
                           given one. Base messages translation in synced
                           with context ID translation.

         HB_I18N_PLURALFORM( [<pI18N>,] [<cNewForm>|<bNewForm>], [<lBase>] )
                  -> <cOldForm>|<bOldForm>
            Gets or sets plural form used for final or base messages
            <pI18N> - I18N translation set,
                      if it's not given then currently active I18N set is used
            <cNewForm> - language ID of plural form, f.e.: "EN", "PL", "LT".
                         Now only three above are supported. Please add rules
                         for other languages to source/rtl/hbi18n.c.
            <bNewForm> - codeblock used to calculate plural form indexes.
                         can be used instead of character representation but
                         it's not storred in serialized I18N set
            <lBase> - when it's .T. then get/set base massages plural form
                      instead of translated massages one.

         HB_I18N_DESCRIPTION( [<pI18N>,] [<cNewDescription>] )
                  -> <cOldDescription>
            Gets or sets translation set description. After serialization
            up to 32 bytes is stored in header which can be easy used to
            determinate type of translation file.
            <pI18N> - I18N translation set,
                      if it's not given then currently active I18N set is used
            <cNewDescription> - new description

         HB_I18N_ADDTEXT( <pI18N>, <cMsgID>, <cTrans> | <acTrans> [, <cContext> ] )
                  -> NIL
            Adds new message with translation to i18n translation set
            <pI18N> - I18N translation set
            <cMsgID> - original message
            <cTrans> - translated message
            <acTrans> - array with translated messages used for plural forms
            <cContext> - message context

         HB_I18N_SET( [ <pI18N> | NIL ] )
                  -> <lActive>
            Sets given I18N translation set as default one used by
            HB_I18N_[N]GETTEXT[_STRICT]() functions or remove translation
            set for calling thread when passed parameter is NIL
            <pI18N> - I18N translation set
            Returns logical value which is .T. when i18n set is active

         HB_I18N_SAVETABLE( [<pI18N>] )
                  -> <cTable>
            Returns I18N translation as string item which can be stored
            in file or database
            <pI18N> - I18N translation set, if it's not given then currently
                      active I18N set is used

         HB_I18N_RESTORETABLE( <cTable> )
                  -> <pI18N> | NIL
            Restores I18N translation set from strin item.
            <cTable> - I18N translation set in string representation
            On success it returns new <pI18N> set otherwise NIL if <cTable>
            is not valid item created by HB_I18N_SAVETABLE() or it's corrupted.

         HB_I18N_HEADERSIZE()
                  -> <nHeaderSize>
            Returns size of header used by i18n serialized version

         HB_I18N_CHEK( <cTable> | <cHeader> [, @<cDescription> ] )
                  -> <lValid>
            <cTable> - i18n translation set serialized by HB_I18N_SAVETABLE
            <cHeader> - header of i18n translation set
                        ( LEFT( <cTable>, HB_I18N_HEADERSIZE() )
            <cDescription> - optional parameter passed by reference where
                             will be sored i18n translation set description
                             extracted from valid header
            Returns logical value indicating if given table or header is
            valid serialized by HB_I18N_SAVETABLE() data. It does not
            decode the table though it validates size and control sums.

      These functions are optional and some future alternative implementations
      may not support all of them and/or may provide some other functions.

    + added unofficial .prg function __I18N_HASHTABLE() which allows to
      access hash table used by i18n translation set or create new translation
      set with given hash table. It's helper functions for developers which
      will work on Harbour i18n tools and should not be used by Harbour users.

      Unlike original gettext Harbour allows to use language with many
      plural forms as base one. In such case programmer should activate
      at application startup default i18n translation set with base plural
      form valid for base application language, f.e. by:
         pI18N := hb_i18n_create()
         hb_i18n_pluralForm( pI18N, <cLangID> | <bForm>, .t. )
         hb_i18n_set( pI18N )
      .prg code example:

         #xtranslate _( <x,...> ) => hb_i18n_gettext_strict( <x> )
         #xtranslate _N( <x,...> ) => hb_i18n_ngettext_strict( <x> )

         proc main()
            local pI18N, i

            pI18N := hb_i18n_create()
            hb_i18n_pluralForm( pI18N, "PL", .t. )
            hb_i18n_set( pI18N )

            for i := 0 to 30
               ? i, _N( i, {"grosz", "grosze", "groszy"} )
               if i > 0 .and. i % 10 == 0
                  wait
               endif
            next
         return

      In .pot files created during compilation by Harbour with -j option
      for above code we have the following entries for message with plural
      forms:
            msgid "grosz"
            msgid_plural "grosze"
            msgid_plural2 "groszy"
            msgstr[0] ""
      The msgid_plural2 (and others if language has more plural forms)
      is Harbour extension which is not gettext compatible.


      The above implementation is base version but should be fully functional.
      Now we will need functions to safe/read i18n files and tools to mange
      .pot files: merge them, edit translations, create final binary i18n
      translation sets. Because we are using gettext compatible .pot files
      then for some of such jobs we can use original gettext tools but we
      need at least function which will create translation set from one or
      more .pot files.
      We should also agree some default localization(s) for files containing
      translated data, their name convention and environment variable(s)
      to set default language. It's not strictly necessary and each user
      can have his own implementation but it would help in adding new
      translations by final users to any Harbour application which will
      respect them. We can use LANG envvar to extract preferred language
      and use the same path as executed application looking for files
      <appname>-<lang>.hil files though it may create some problems for
      OSes which support only 8.3 file names so we can also define that
      HB_I18N envvar has higher priority and points to expected translation
      file.

  * harbour/include/hbextern.ch
    - removed old __i18n_*() functions
    + added current i18n functions
2008-12-11 18:47:46 +00:00
Przemyslaw Czerpak
ae5075fa5b 2008-11-10 00:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/config/rules.cf
    ! fixed recursive HB_FLAGS declaration

  * harbour/include/hbdefs.h
  * harbour/include/hbsetup.h
  * harbour/include/hbtrace.h
    * declared hb_tr_trace() parameters as printf() compatible in GCC
      builds. It enabled format string with parameters validation

  * harbour/source/rtl/errorapi.c
    ! fixed GPF caused by HB_ERR_FUNCNAME which is not longer valid
      string

  * harbour/source/vm/itemapi.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/arrays.c
  * harbour/source/vm/memvars.c
  * harbour/source/vm/eval.c
  * harbour/source/vm/extend.c
  * harbour/source/vm/set.c
  * harbour/source/debug/dbgentry.c
  * harbour/source/rtl/gtwin/gtwin.c
  * harbour/source/rtl/gtxwc/gtxwc.c
  * harbour/source/rtl/hbgtcore.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/source/rtl/filesys.c
  * harbour/source/rdd/dbf1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/contrib/gtalleg/gtalleg.c
  * harbour/contrib/xhb/freadlin.c
  * harbour/contrib/gtwvg/gtwvg.c
  * harbour/contrib/rddads/adsfunc.c
  * harbour/contrib/rddads/ads1.c
  * harbour/contrib/hbwin/win_ole.c
  * harbour/utils/hbdoc/hbdfrdln.c
  * harbour/utils/hbmake/hbmfrdln.c
    ! fixed bugs in HB_TRACE massages reported in GCC builds
2008-11-09 23:20:16 +00:00
Viktor Szakats
8be149614c 2008-11-09 17:15 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* source/vm/arrays.c
  * source/vm/classes.c
  * source/vm/cmdarg.c
  * source/vm/codebloc.c
  * source/vm/debug.c
  * source/vm/dynsym.c
  * source/vm/extend.c
  * source/vm/fm.c
  * source/vm/hashes.c
  * source/vm/hvm.c
  * source/vm/itemapi.c
  * source/vm/maindll.c
  * source/vm/maindllh.c
  * source/vm/maindllp.c
  * source/vm/mainstd.c
  * source/vm/mainwin.c
  * source/vm/set.c
  * source/vm/vm.c
    % Removed HB_EXPORT from remaining function definitions.
2008-11-09 16:16:54 +00:00
Viktor Szakats
618407cbec 2008-11-09 17:03 UTC+0100 Viktor Szakats (harbour.01 syenar hu)
* contrib/gtwvg/wvgcore.c
  * contrib/gtwvg/wvgutils.c
  * contrib/hbwin/win_dll.c
  * contrib/hbwin/win_ole.c
  * contrib/xhb/cstructc.c
  * contrib/xhb/dbgfxc.c
  * source/common/hbarch.c
  * source/common/hbdate.c
  * source/common/hbfsapi.c
  * source/common/hbstr.c
  * source/common/hbver.c
  * source/common/hbverdsp.c
  * source/debug/dbgentry.c
  * source/main/harbour.c
  * source/rdd/dbf1.c
  * source/rdd/nulsys/nulsys.c
  * source/rdd/wacore.c
  * source/rdd/wafunc.c
  * source/rdd/workarea.c
  * source/rtl/cdpapi.c
  * source/rtl/console.c
  * source/rtl/dates.c
  * source/rtl/errorint.c
  * source/rtl/file.c
  * source/rtl/filesys.c
  * source/rtl/fscopy.c
  * source/rtl/fserror.c
  * source/rtl/fstemp.c
  * source/rtl/gtapi.c
  * source/rtl/gtapiu.c
  * source/rtl/hbadler.c
  * source/rtl/hbcrc.c
  * source/rtl/hbffind.c
  * source/rtl/hbgtcore.c
  * source/rtl/hbmd5.c
  * source/rtl/inkeyapi.c
  * source/rtl/isprint.c
  * source/rtl/math.c
  * source/rtl/mouseapi.c
  * source/rtl/seconds.c
  * source/rtl/setcolor.c
  * source/rtl/setcurs.c
  * source/rtl/strmatch.c
  * source/vm/hvm.c
    % Removed HB_EXPORT from function definitions.
      Placing it in declaration is enough.

  * source/debug/dbgentry.c
    * Formatting.
2008-11-09 16:06:36 +00:00
Przemyslaw Czerpak
da3a714803 2008-11-04 17:28 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
  * harbour/source/vm/mainstd.c
    * force linking main() function in OpenWatcom OS2 builds

  * harbour/contrib/xhb/hbcrypt.c
    ! casting
2008-11-04 16:27:40 +00:00
Przemyslaw Czerpak
6822b74b3d 2008-10-30 15:03 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvmpub.h
    + added HB_VM_ISFUNC(), HB_VM_FUNCUNREF() and HB_VM_EXECUTE()
      macros to operate on HB_SYMB structure

  * harbour/source/vm/hvm.c
  * harbour/source/vm/classes.c
     * use HB_VM_ISFUNC()/HB_VM_FUNCUNREF()/HB_VM_EXECUTE() macros
       for executing function inside HB_SYMB structure to avoid possible
       synchronization problems during modifications
2008-10-30 14:03:16 +00:00
Przemyslaw Czerpak
9af43b48eb 2008-10-28 10:43 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    ! added missing HB_STACK_PRELOAD
2008-10-28 09:43:32 +00:00
Przemyslaw Czerpak
ecddf89923 2008-10-28 10:24 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbxvm.h
  * harbour/source/vm/hvm.c
  * harbour/source/compiler/gencc.c
    + added finished by mistake support for hidden strings in -gc3 mode
2008-10-28 09:24:37 +00:00
Viktor Szakats
c4636942ec 2008-10-27 21:43 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/Makefile
  * contrib/make_vc_all.bat
  * contrib/make_b32_all.bat
  * contrib/make_gcc_all.sh
    + Added rddsql to default builds.
      Please test.

  * contrib/hbdbgfx/dbgfxc.c
    * Added TODO. (multiplatform support in one the functions)

  * include/hbsetup.h
  * include/hbexprb.c
  * contrib/hbct/ctnet.c
  * contrib/hbct/color.c
  * contrib/hbct/dattime2.c
  * contrib/xhb/hboutdbg.c
  * contrib/hbtpathy/tpwin32.c
  * contrib/hbmzip/hbmzip.c
  * contrib/hbsqlit3/hbsqlit3.c
  * contrib/hbfbird/firebird.c
  * contrib/hbziparc/hbzipcpp.old
  * contrib/hbnf/getver.c
  * contrib/hbpgsql/postgres.c
  * contrib/hbclipsm/gauge.c
  * contrib/rddads/adsfunc.c
  * contrib/rddads/ads1.c
  * contrib/hbgd/gdwrp.c
  * contrib/hbmisc/spd.c
  * contrib/hbtip/utils.c
  * contrib/hbwin/win_prt.c
  * contrib/examples/pp/hbppcore.c
  * contrib/examples/pp/hbppcomp.c
  * source/pp/pplib.c
  * source/pp/ppcore.c
  * source/pp/hbpp.c
  * source/vm/estack.c
  * source/vm/debug.c
  * source/vm/itemapi.c
  * source/vm/hvm.c
  * source/vm/cmdarg.c
  * source/vm/fm.c
  * source/vm/extrap.c
  * source/vm/classes.c
  * source/main/harbour.c
  * source/common/hbver.c
  * source/common/hbverdsp.c
  * source/common/hbstr.c
  * source/common/hbdate.c
  * source/rtl/gtxwc/gtxwc.c
  * source/rtl/hbgtcore.c
  * source/rtl/gtcrs/gtcrs.c
  * source/rtl/errorint.c
  * source/rtl/gtsln/gtsln.c
  * source/rtl/gttrm/gttrm.c
  * source/rtl/gtpca/gtpca.c
  * source/rtl/fkmax.c
  * source/rtl/langapi.c
  * source/rtl/hbffind.c
  * source/rdd/workarea.c
  * source/rdd/sdf1.c
  * source/rdd/delim1.c
  * source/rdd/dbf1.c
  * source/rdd/wafunc.c
  * source/compiler/hbmain.c
  * source/compiler/cmdcheck.c
  * source/compiler/hbpcode.c
  * source/compiler/genhrb.c
  * source/compiler/gencobj.c
  * source/compiler/genobj32.c
  * source/compiler/genc.c
  * source/compiler/hbusage.c
  * source/compiler/hbfunchk.c
  * source/compiler/hbgenerr.c
  * utils/hbmake/hbmgauge.c
    * Changed snprintf() calls to hb_snprintf().
    ; TODO: Finish the mappings in headers.

  * tests/wvtext.prg
  * include/inkey.ch
  * source/rtl/gtwvt/gtwvt.c
    * Changed K_HB_RESIZE to HB_K_RESIZE. The reason is 
      that we already got a HB_K_MULTICODE code (few lines 
      below, I didn't know about it before), and it's better 
      to keep consistency with that.
2008-10-27 20:55:24 +00:00
Przemyslaw Czerpak
520a0a0206 2008-10-22 05:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/include/hbgtcore.h
  * harbour/include/hbthread.h
  * harbour/include/hbapigt.h
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/thread.c
  * harbour/source/rtl/hbgtcore.c
    + added support for optional allocating independent console window by
      each thread. By default new thread inherits console Window from
      parent thread. But each thread can allocate its own console window
      by calling hb_gtReload( <cGtName> ) function, f.e. by:
         hb_gtReload( hb_gtVersion() )
      If GT driver supports such functionality then new it will allocate
      new console windows.
      Each console window has reference counter which is increased when
      new thread starts and decreased when hb_gtReload() is executed or
      thread terminates. When counter reach zero give console window is
      destroyed.

  * harbour/source/rtl/gtwvt/gtwvt.c
    ! use SendNotifyMessage() instead of SendMessage() to not block
      threads which inherited GT from parent thread. Why non of MS-Win
      users reported this problem?
    + added reference counter to window class for multi GT support

  + harbour/tests/mt/mttest10.prg
    + added demonstration/test code for using independent console window
      in different threads. It needs GT driver which supports such
      functionality, f.e GTXWC in *nixes or GTWVT in MS-Windows

  * harbour/tests/mt/mttest09.prg
    ! fixed typo in comment
2008-10-22 03:03:58 +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
caadc6fa2e 2008-10-15 01:39 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    ! clear HVM stack return value before use in initialization code
2008-10-14 23:39:35 +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
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
996822f732 2008-10-13 12:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/compiler/gencc.c
    ! fixed thread static variable offsets generated in .c code when
      -gc3 is used

  * harbour/source/vm/hvm.c
    % removed unnecessary call to HB_STACK_TLS_PRELOAD
2008-10-13 10:42:34 +00:00
Przemyslaw Czerpak
abfc488c1a 2008-10-12 20:31 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    ! execute hb_vmThreadQuit() after hb_vmStackRelease()

  * harbour/source/vm/thread.c
    * do not destroy critical sections on exit
2008-10-12 18:31:41 +00:00
Przemyslaw Czerpak
5964eac44c 2008-10-10 22:46 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    * reduced the mutex lock time in thread exit state

  * harbour/source/vm/thread.c
    ; added note about possible behavior of hb_threadSelf() function
      in one very specific situation. It's documented and expected
      behavior

  * harbour/source/rtl/hbgtcore.c
    + added support for retrieving current HB_GTI_NOTIFIERBLOCK code block
    + added support for removing HB_GTI_NOTIFIERBLOCK code block without
      setting the new one
2008-10-10 20:46:50 +00:00
Przemyslaw Czerpak
f51b6c2f24 2008-10-10 21:22 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/garbage.c
    * unblock HVM before executing destructors and releasing blocks

  * harbour/source/vm/fm.c
    ! do not call internal error with active lock when FM statistic
      is enabled

  * harbour/source/vm/thread.c
    ! stop other threads in hb_threadOnce() if the 1-st one
      executes bAction block to be sure that it will be completed
      before thread leave hb_threadOnce() function

  * harbour/source/vm/set.c
    ! do not call hb_inkeyReset() in set release. It's not necessary
      and it could change keyboard buffer size for other threads using
      the same GT driver.

  * harbour/source/vm/hvm.c
    % allocate new thread stack without lock

  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/gtapi.c
    * moved clipboard resetting from hbgtcore.c to gtapi.c

  * harbour/source/rtl/filesys.c
    ! do not use read/write operations with given file offset in Win9X
      which seems to not support such functionality
2008-10-10 19:23:11 +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
cb836d8481 2008-10-09 14:11 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    * changed the place where exception handles are set/remove.
      Now it's set at the beginning of hb_vmInit() and removed
      at the end of hb_vmQuit()

  * harbour/source/rdd/dbcmd.c
  * harbour/source/rdd/dbf1.c
    ! added workaround for problem with EVAL block used in PACK
      command

  * harbour/source/compiler/hbmain.c
    * minor simplification
2008-10-09 12:11:49 +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
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
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
423391977e 2008-10-06 02:18 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/tests/speedtst.prg
    * marked T054 as memory tests

  * harbour/source/vm/hvm.c
  * harbour/source/vm/thread.c
    * added hb_threadOnce( @<onceControl> [, <bAction> ] ) -> <lFirstCall>
      This function allow to execute some code only once. It's usefull in
      MT environment for initialization.
      <onceControl> is variable which holds the execution status and have
      to be initialized to NIL. In most of cases it will be simple static
      variable in user code.
      <bAction> is optional codeblock which is executed only once (on 1-st
      call with given <onceControl>)

  * harbour/source/rtl/filesys.c
    ! do not make any file name conversions in hb_fsNameConv() if HVM stack
      is not allocated

  * harbour/source/rtl/gtcrs/gtcrs.c
    * casting
2008-10-06 00:19:10 +00:00
Przemyslaw Czerpak
01fb05675c 2008-10-05 17:53 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/tests/speedtst.prg
    + added support for --scale switch - it enables special mode
      which compare scalability, f.e.:
         ./speedtst --thread=4 --scale
      executes each test loop 4 times by single thread then
      by 4 simultaneous threads, counts total real times in both
      cases and presents them with the scale factor.
      Please note that exactly the same loop tests are executed
      simultaneously so this test should well show all places which
      are not well scalable.
      This test allows me to locate yet another memory variable written by
      each thread on each function call just like uiPolls in main HVM loop.
      It's s_bDebugging which is not used in MT mode because we do not have
      any MT debugger yet but is was effectively killing the scalability
      in my hardware.
      If possible I would like to see some Windows results from multi CPU
      machine with --scale parameter, f.e.:
         speedtst --thread=8 --scale > speedtst.log
      Please make some tests.

  * harbour/source/vm/hvm.c
    % do not assign s_bDebugging in hb_vmDo()/hb_vmSend() when debugger
      is not linked

  * harbour/source/vm/garbage.c
    % enabled spinlocks in all x86 GCC builds
2008-10-05 15:53:51 +00:00
Przemyslaw Czerpak
0ef0ce6b1c 2008-09-29 22:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    ! restored some item type settings I wrongly removed few days ago
2008-09-29 20:56:23 +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
Przemyslaw Czerpak
c8d341cefb 2008-09-23 15:38 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/codebloc.c
    * updated old and not longer valid comment

  * harbour/source/vm/memvars.c
    * minor code formatting

  * harbour/source/common/expropt2.c
    ! fixed bug in power math expression optimization caused
      by two lines left in the code by mistake. Many thanks to
      Maurilio for locating the problem.

  * harbour/include/hbstack.h
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
    % added support for buffering hb_stack TLS access be preloading
      the stack pointer into C stack function local variables.
      Please make speed tests for MT mode with different C compilers
      and different platforms.
2008-09-23 13:39:35 +00:00
Przemyslaw Czerpak
f05cbbaaaf 2008-09-22 19:32 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
   ! corrected previous ChangeLog entry: instead of hb_waDetach()/
     hb_waRequest() should be db_dbDetach()/hb_dbRequest()

  * harbour/source/vm/hvm.c
   * disabled PRG tracing in default builds. If someone wants to
     use this feature then he should recompile Harbour with HB_PRG_TRACE
     macro. In such case tracing can be enabled/disabled by __TRACEPRGCALLS()
     function. HB_NO_TRACE macro is not longer usable - it's default in
     current code.

  * harbour/source/vm/classes.c
    + added PRG function __clsPreallocate() which extends the size of
      classes buffer to given value to avoid later RT reallocations.
      It may be useful in some very seldom cases for MT programs which
      will allocate dynamically at runtime more then 16386 classes.
      In practice rather impossible though who knows ;-)

  * harbour/source/rdd/workarea.c
    * set default preallocation size for RDD nodes to 128
    + added PRG function __rddPreallocate() which extends the size of
      RDD nodes buffer to given value to avoid later RT reallocations.
      It may be useful in some very seldom cases for MT programs which
      will register dynamically at runtime more then 128 RDDs when other
      threads are active and may use RDD nodes.

  * harbour/include/hbrddcdx.h
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
    + added ORDLSTDELETE() method.
      Now ordbagClear() should work for DBFCDX.
2008-09-22 17:32:36 +00:00
Przemyslaw Czerpak
b34b792443 2008-09-22 03:49 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbstack.h
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
    + added support for nested hb_vmUnlock()/hb_vmLock() calls

  * harbour/source/rtl/hbinet.c
    * encapsulated all potentially slow inet functions inside
      hb_vmUnlock()/hb_vmLock() calls
2008-09-22 01:50:21 +00:00
Przemyslaw Czerpak
a8aac5cae5 2008-09-22 02:34 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvm.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/thread.c
    + added .prg function hb_threadSelf() -> <pThID> | NIL
      It returns thread ID pointer variable or NIL when thread was
      registered without it (main thread and some 3-rd party threads
      created by C API)

  * harbour/source/vm/hvm.c
    * protect s_InitFunctions and s_ExitFunctions by mutex

  * harbour/source/common/hbverdsp.c
    * use hb_verBuildDate() instead of __DATE__ and __TIME__ in
      hb_verBuildInfo() function to report the same time in both
      cases.
2008-09-22 00:34:52 +00:00
Przemyslaw Czerpak
c1c574142e 2008-09-21 23:03 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/arrays.c
    + added hb_arrayGetPtrGC(), hb_arrayGetSymbol(), hb_arraySetSymbol()

  * harbour/include/hbapi.h
  * harbour/source/vm/dynsym.c
    + added hb_dynsymProtectEval(). Works like hb_dynsymEval() but
      keeps dynamic symbol table locked during whole execution.
      It's faster then hb_dynsymEval() but user function may not
      access dynamic symbol tbale to not cause recursive locks
    + added protection against possible dynamic symbol table resizing
      during hb_dynsymEval() by other threads.

  * harbour/include/hbapi.h
  * harbour/source/vm/memvars.c
    + added hb_memvarSaveInArray( int iScope, BOOL fCopy ) and
      hb_memvarRestoreFromArray( PHB_ITEM pArray )
    % use hb_dynsymProtectEval() in places where it's safe

  * harbour/include/Makefile
  + harbour/include/hbthread.ch
    + added header file with thread constant definitions:
         HB_THREAD_INHERIT_PUBLIC
         HB_THREAD_INHERIT_PRIVATE
         HB_THREAD_INHERIT_MEMVARS
         HB_THREAD_MEMVARS_COPY

  * harbour/include/hbthread.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/thread.c
    + added support for inheriting visible memvars from current
      thread when new thread is created. Memvars in child thread
      can be shared with parrent or they can be copied. See HB_THREAD_*
      attributes defined in hbthread.ch, f.e.:
         hb_threadStart( HB_THREAD_INHERIT_PUBLIC, @thFunc() )
      or:
         hb_threadStart( HB_BITOR( HB_THREAD_INHERIT_MEMVARS + ;
                                   HB_THREAD_MEMVARS_COPY ), ;
                          @thFunc() )
      Please note that when child thread creates new PUBLIC variable
      which didn't existed when thread was started then it's visible
      only for this thread and optionally for its child threads but
      not for parent thread.
      Please also remember that write access to shared memvars have
      to be protected by users.

  + harbour/tests/mt/mttest08.prg
    + added test code for thread memvars inheritance
2008-09-21 21:04:47 +00:00
Przemyslaw Czerpak
d94370e84e 2008-09-20 03:38 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/hvm.c
    * minor modification: #ifdef ... => #if defined( ... )

  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gttrm/gttrm.c
    ! fixed reentrance counter resetting
2008-09-20 01:39:17 +00:00
Przemyslaw Czerpak
7cc11cf5e2 2008-09-19 22:27 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/set.c
    ! fixed casting

  * harbour/contrib/xhb/xhbcopyf.c
    * replaced TABs with SPACEs

  * harbour/include/hbapirdd.h
  * harbour/source/rdd/workarea.c
  * harbour/source/rdd/wacore.c
  * harbour/source/rdd/wafunc.c
    + added support for detaching and attaching workareas

  * harbour/source/vm/hvm.c
    % minor cleanup in thread return code

  * harbour/include/hbthread.h
  * harbour/source/vm/thread.c
    * unlock HVM stack during thread join operation
    * added workaround for DosWaitThread() which seems to fail if thread
      terminated before
    ; added TOFIX note for OS2 and join code
2008-09-19 20:28:26 +00:00
Przemyslaw Czerpak
26623b9f34 2008-09-15 04:33 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/pack_src.sh
    * added file list to archive so it's possible to recreate it later without SVN data

  * harbour/common.mak
  * harbour/make_b32.mak
  * harbour/make_gcc.mak
    + added HBVMMT library for default builds
      BCC version not tested - please test.

  * harbour/source/vm/hvm.c
    * moved language and code page setting before class and error initialization

  * harbour/source/rtl/fserror.c
  * harbour/source/rtl/fstemp.c
  * harbour/source/rtl/fssize.c
  * harbour/source/rtl/hbffind.c
  * harbour/source/rtl/filesys.c
    ! fixed overloading FS error codes by other operations, f.e. accessing
      TLS data by OS API function call
2008-09-15 02:34:44 +00:00