Commit Graph

171 Commits

Author SHA1 Message Date
Przemyslaw Czerpak
046d1ea4d7 2007-04-11 22:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
    ! fixed some possible false warning messages

  * harbour/include/hboo.ch
  * harbour/source/vm/classes.c
    + added support for HB_OO_MSG_PROPERTY and HB_OO_MSG_CLASSPROPERTY
      to make some xHarbour users happy ;-)

  * harbour/common.mak
  * harbour/harbour.spec
  * harbour/include/hbcompdf.h
  * harbour/source/compiler/Makefile
  + harbour/source/compiler/hbcmplib.c
    + added HB_COMPILE() function - it accepts exactly the same parameters
      as harbour compiler and makes the same job :-)

  * harbour/utils/hbrun/Makefile
  * harbour/utils/hbrun/hbrun.prg
    + added support for compilation and direct execution of .prg files
      Now hbrun can accept as first parameter .hrb or .prg file and if
      it's .prg file it's compiled and then executed just like .hrb one.
      In *nixes if you copy compiled hbrun to /usr/bin directory then
      you can add to your .prg files as first line:
         #!/usr/bin/hbrun
      and then after setting executable attribute you can directly
      execute them, f.e.:
         ./test.prg
      If you are using Linux then you can also chose default gt driver
      by dding to above line: //gt<name>
      F.e.
         #!/usr/bin/hbrun //gtstd
2007-04-11 20:01:18 +00:00
Przemyslaw Czerpak
3fe91afe15 2007-04-10 14:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/Makefile
    + added hbregex.h

  * harbour/include/hbclass.ch
    + added support for ENDCLASS LOCK[ED]
    + := <clasname> { <constructorParams,...> }

  * harbour/source/debug/tbrwtext.prg
  * harbour/source/rtl/memoedit.prg
  * harbour/utils/hbdoc/ffile1.prg
  * harbour/utils/hbmake/ffile1.prg
    * changed code with:
         super:<msg>
      to
         ::super:<msg>
      I will want to remove lines with:
         [ ; #translate Super( <SuperClassN> ): => ::<SuperClassN>: ] ;
         [ ; #translate Super( <SuperClass1> ): => ::<SuperClass1>: ] ;
         [ ; #translate Super(): => ::<SuperClass1>: ] ;
         [ ; #translate Super: => ::<SuperClass1>: ] ;
         [ ; #translate ::Super : => ::<SuperClass1>: ]
      from our hbclass.ch (at least the last three ones) because they beaks
      code which uses SUPER identifier

  * harbour/source/rtl/philes.c
    * changed FSEEK() to use hb_fsSeekLarge() for OSes which supports
      large (64bit) files

  * harbour/source/vm/classes.c
    ! updated some comments about function syntax
2007-04-10 12:35:47 +00:00
Przemyslaw Czerpak
88cda3200d 2007-03-22 12:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/common.mak
    * updated for new files - please check

  * harbour/harbour.spec
    * added compiler library

  * harbour/bin/pack_src.sh
  * harbour/bin/hb-func.sh
    * updated for new files and libraries

  * harbour/config/w32/mingw32.cf
  * harbour/config/w32/watcom.cf
  * harbour/config/w32/xcc.cf
    * added winsock libraries

  * harbour/include/hbapicdp.h
  * harbour/source/rtl/cdpapi.c
    + added hb_cdpicmp() - not case sensitive version of hb_cdpcmp()

  * harbour/include/hbapiitm.h
  * harbour/source/vm/itemapi.c
    + hb_itemStrICmp(), hb_itemCopyFromRef(), hb_itemMoveFromRef()

  * harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbcompdf.h
  * harbour/include/hbexpra.c
  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/include/hbmacro.h
  * harbour/include/hbpcode.h
  * harbour/include/hbvmpub.h
  * harbour/include/hbxvm.h
  * harbour/source/common/expropt1.c
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/gencli.c
  * harbour/source/compiler/genhrb.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbmain.c
  * harbour/source/compiler/hbopt.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/macro/macro.y
  * harbour/source/macro/macro.yyc
  * harbour/source/macro/macro.yyh
  * harbour/source/macro/macrolex.c
  * harbour/source/vm/Makefile
  * harbour/source/vm/arrays.c
  * harbour/source/vm/asort.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/eval.c
  * harbour/source/vm/garbage.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/macro.c
  + harbour/source/vm/hashes.c
  + harbour/source/vm/hashfunc.c
    + added hash items, f.e.:
         local h1 := {=>}, h2 := { "a"=>1.234, "b"=>2.345 }
         ? h2[ "a" ], h2[ "b ]
    + added support for DYNAMIC function declaration - it allow to define
      functions which are lately bound at runtime, f.e.:
         /*** t01.prg ***/
         dynamic func1
         proc main()
         local h:=__hrbload("t02.hrb")
         ? func1()
         return

         /*** t02.prg ***/
         func func1
         return "Hello!!!"

    % use new FUNCALL structure to hold EXTERNAL and DYNAMIC functions,
      it reduce memory usage, FUNCALL is much smaller then FUNCTION
    % use symbol scope bits when possible instead of making some linear scan
    + added new enumarator message: __ENUMKEY - it allow to access
      key value when hash item is base enumerator value, f.e.:
         proc main()
         local v, h:={"a"=>1.000,"b"=>2.000,"c"=>3.000}
         heval( h, { |k,v,i| qout( k, v, i ) } ); ?
         for each v in h
            ? v, "=>", v:__enumKey(), v:__enumValue(), v:__enumIndex(), ;
                       valtype(v:__enumBase())
            v += 0.123
         next
         ? ;heval( h, { |k,v,i| qout( k, v, i ) } )
         return
    + added C level hb_hash*() functions
    + added support for full HASH item cloning and updated array cloning
      to also clone nested hashes - please note that xHarbour does not do
      that, in xHarbour ACLONE() clones _ONLY_ nested arrays and HCLONE()
      _DOES_NOT_ clone _ANY_ nested items.

  * harbour/include/hbextern.ch
    + added hash functions HB_H*()
    * changed INET*() functions to HB_INET*()
    + added hash functions H*() and socket functions INET*() when
      HB_COMPAT_XHB is set

  * harbour/include/hbtypes.h
    + added missing HB_EXTERN_BEGIN / HB_EXTERN_END

  * harbour/include/hbpp.h
  * harbour/source/pp/ppcore.c
    ! added protection against automatic word concatenation in some cases
    ! fixed preprocessing expressions when match marker matches ';' token

  * harbour/source/rtl/Makefile
  + harbour/source/rtl/itemseri.c
    + added functions for item serialization: HB_SERIALIZE() and
      HB_DESERIALIZE() - these function are not binary compatible
      with xHarbour functions with the same names but make very
      similar job with the exception to serialization of codeblock
      and object variables - Harbour does not allow to serialize
      codeblocks and serialize objects as arrays.
      In most cases these functions can replace the xHarbour ones
    + added HB_DESERIALBEGIN() and HB_DESERIALIZE() functions covered
      by HB_COMPAT_XHB macro - this functions are only for compatibility
      with existing xHarbour code, In Harbour HB_DESERIALBEGIN() is
      dummy function which returns first parameter and HB_DESERIALNEXT()
      is a simple wrapper to HB_DESERIALIZE() so it's not necessary to
      use them.

  * harbour/source/rtl/hbinet.c
    * changed INET*() functions to HB_INET*() and enable them for default
      build
    + added INET*() functions wrappers covered by HB_COMPAT_XHB macro

  * harbour/source/rtl/hbrandom.c
    + added HB_RANDOMINT() - xHarbour compatible

  * harbour/source/rtl/len.c
    + added support for HASHes

  * harbour/source/rtl/valtype.c
    + added support for HASHes
    + added set of HB_IS*() functions - they are a little bit faster then
      calling VALTYPE( v ) == <cVal>
    - removed HB_ISBYREF() - this function cannot longer work, it was using
      a Clipper incompatible anomalies in passing variables by reference I
      fixed so it has to stop to work. If it will be realy necessary to
      implement HB_ISBYREF() function then please inform me - it will have
      to be done at compiler level or with some much deeper HVM stack
      checking.

  * harbour/source/vm/extend.c
    ! fixed hb_extIsArray() and hb_extIsObject() to work well with
      parameters passed by reference.
      Please note that now hb_extIsArray() return TRUE only for pure arrays
      not object values.

  * harbour/contrib/Makefile
  + harbour/contrib/tip/Changelog
  + harbour/contrib/tip/Makefile
  + harbour/contrib/tip/atokens.c
  + harbour/contrib/tip/base64x.c
  + harbour/contrib/tip/cgi.prg
  + harbour/contrib/tip/client.prg
  + harbour/contrib/tip/credent.prg
  + harbour/contrib/tip/cstr.prg
  + harbour/contrib/tip/encb64.prg
  + harbour/contrib/tip/encmthd.c
  + harbour/contrib/tip/encoder.prg
  + harbour/contrib/tip/encqp.prg
  + harbour/contrib/tip/encurl.prg
  + harbour/contrib/tip/ftpcln.prg
  + harbour/contrib/tip/hbhex2n.c
  + harbour/contrib/tip/httpcln.prg
  + harbour/contrib/tip/mail.prg
  + harbour/contrib/tip/popcln.prg
  + harbour/contrib/tip/smtpcln.prg
  + harbour/contrib/tip/tip.ch
  + harbour/contrib/tip/url.prg
  + harbour/contrib/tip/utils.c
    + added TIP library - code borrowed from xHarbour



   Please test - a lot of above code is not well tested, also some peaces
   were written over year ago for different things (f.e. serialization for
   NETRDD) and now I collected them and committed.
   The TIP library was not tested at all. It can be compiled but I cannot
   say if it works - I hope that people familiar with it can make necessary
   test and fixes.
   It's also not the final version of low level HASH item code. I'm working
   on more efficient structure which uses binary tries but I cannot say when
   I'll finish it (maybe in this weekend or maybe in next year) so I committed
   working version now even if I'm not happy with overall performance (BTW
   not worser then in xHarbour)
2007-03-22 12:28:14 +00:00
Przemyslaw Czerpak
48f8dba263 2007-02-08 23:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbgtinfo.ch
  * harbour/contrib/libct/ctwin.c
  * harbour/source/rtl/gtalleg/gtalleg.c
  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gtdos/gtdos.c
  * harbour/source/rtl/gtos2/gtos2.c
  * harbour/source/rtl/gtpca/gtpca.c
  * harbour/source/rtl/gtsln/gtsln.c
  * harbour/source/rtl/gtstd/gtstd.c
  * harbour/source/rtl/gtwin/gtwin.c
  * harbour/source/rtl/gtwvt/gtwvt.c
  * harbour/source/rtl/gtxwc/gtxwc.c
    + added support for GTI_FULLSCREEN, GTI_KBDSUPPORT, GTI_ISCTWIN

  * harbour/source/rtl/hbgtcore.c
    ! fixed line and box drawing when the coordinates are out of screen size

  * harbour/include/hbapi.h
  * harbour/include/hbcomp.h
  * harbour/include/hbpcode.h
  * harbour/include/hbstack.h
  * harbour/include/hbvm.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/complex.c
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/harbour.yyh
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
    ! added protection against cyclic references in arrays
    * eliminated action parameter from hb_vmRequestReenter() /
      hb_vmRequestRestore()
    * moved s_lRecoverBase and s_uiActionRequest to HB_STACK structure
      for future MT HVM version
    + added internal item structure hb_struRecover - it's not real item
      but this structure is used to keep information about BEGIN SEQUENCE
      data - it reduce HB_STACK usage
    + added support for ALWAYS clause in BEGIN SEQUENCE
      The syntax is:
         BEGIN SEQUENCE
            <code>
         [ RECOVER [ USING oErr ] ]
            <recoverCode>
         [ ALWAYS ]
            <alwaysCode>
         END [ SEQUENCE ]
      It's guaranteed that <alwaysCode> is _ALWAYS_ executed even if
      inside <code> or <recoverCode> some new exceptions like RETURN,
      BREAK or QUIT will appear.
      Please note that when the following code is executed:
         BEGIN SEQUENCE
            <code>
         ALWAYS
            <alwaysCode>
         END
      (without RECOVER clause) then BREAK exception inside <code> is not
      recovered, <alwaysCode> is executed and then BREAK exception is
      passed to outer BEGIN SEQUENCE. This is the same semantic as
      used in TRY / [ CATCH ] / FINALLY / END
      Those of you who prefer to use TRY / CATCH / FINALLY / END instead
      of BEGIN SEQUENCE / RECOVER / ALWAYS / END can simply add to your
      source code:
         #command TRY               => BEGIN SEQUENCE
         #command CATCH [ oErr ]    => RECOVER [ USING <oErr> ]
      and:
         errorBlock( {|oErr| break( oErr ) } )
      Though instead of 'break( oErr )' I suggest to use some small function
      which will support some basic recovery/substitute operations like in
      default errorsys() and LockErrHandler() to not break existing code
      which may depends on the default behavior.
      If you want I can add direct support for TRY / CATCH / FINALLY / END
      but I'm not sure it's really necessary.
      Please note also that in Harbour ALWAYS code is execute even for QUIT
      excpetion.
      When <alwaysCode> is executed current exception is stored and restored
      when is finished. If new exception appears inside <alwaysCode> then
      restored exception depends on the priority in the following order:
         QUIT     // highest priority
         BREAK
         RETURN
      If both exceptions have the same priority and contain additional value
      (error object in BREAK or return value in RETURN) then the recently set
      one is restored. It's similar behavior to destructor code.

  * harbour/source/common/hbstr.c
    * moved one character length string table (hb_szAscii) from hvm.c
      to use it also in compiler and preprocessor

  * harbour/source/compiler/ppcomp.c
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/pplib.c
    * tuned error messages to be more Clipper compatible
    % use static strings from hb_szAscii

  * harbour/source/rtl/alert.prg
    * use hb_gtInfo( GTI_FULLSCREEN ) to detect type of GT driver
    ! some minor fixes
      TOFIX: we have to also use GTI_ISCTWIN or add window allocation
             to standard GT drivers to be Clipper compatible when CTWIN
	     is used - In Clipper Tools ALERT() works in differ way then
	     the standard one. It creates separate window box to display
	     data, supports SETKEY(), etc. I'll think about adding some
	     extended support for ALERT() and similar operations (f.e.
	     separate debugger windows) to GT API so it will be also
	     possible to overload standard alert() command by GUI message
	     box in GTGUI and similar GT drivers.

  * harbour/source/rtl/binnumx.c
    ! fixed U2BIN() - wrong casting
2007-02-08 22:56:31 +00:00
Przemyslaw Czerpak
071fef7612 2007-01-13 14:05 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/adsfunc.c
  * harbour/source/rdd/workarea.c
    * formatting

  * harbour/include/hbapi.h
  * harbour/source/vm/extend.c
    + added missing hb_storptrGC()

  * harbour/include/hbapicdp.h
  * harbour/source/rtl/cdpapi.c
    + added parameter to unicode translation function to protect control
      code translation
    * formatting

  * harbour/source/rtl/gtsln/kbsln.c
  * harbour/source/rtl/gtxwc/gtxwc.c
    * use new unicode translation function format. It also fixes problem
      with space translation in GTLSN used in UTF8 mode

  * harbour/include/hbapiitm.h
  * harbour/source/vm/itemapi.c
    + added hb_itemCopyToRef(), hb_itemMoveToRef(), hb_itemMoveRef(),
      hb_itemUnRefWrite()

  * harbour/include/hbexprb.c
    ! use HB_P_DUPLUNREF instead of HB_P_DUPLICATE when assign is used in
      push context - Clipper compatible behavior, see:
         x:=10
         f(y:=iif(.t.,@x,))
         ? x, y
         func f(x)
         x+=100
         return nil

  * harbour/include/hbver.h
  * harbour/source/common/hbver.c
    * changed status to "devel"

  * harbour/source/common/expropt2.c
    * disabled setting NIL when iif(.t.,,sth()) is optimized to avoid
      warning when iif() is used as statement - to fix number of parameters
      passed to function in code like f(iif(.t.,,sth())) we will need a
      little bit deeper modification

  * harbour/source/compiler/complex.c
    * added hack for potential problems caused by WITH OBJECT syntax, f.e.
      in code like:
         proc p(obj,x)
         case:=myCaseClass():new()
         retu:=myCaseClass():new()
         WITH OBJECT obj
            do case
               case x==nil
               case:value()
               case:action()
                  retu:sth()
            end
         END
         case:action()
         retu:sth()
         return
      case:action(), case:value(), retu:sth() can means two different things
      and compiler cannot guess which one should use. It cannot be fixed
      because it's caused by bad WITH OBJECT syntax. In xHarbour constractions
      like case:value() or retu:sth() are always used as in  WITH OBJECT
      context what is not Clipper compatible. I do not want to introduce
      such limitations. We have two choices: change WITH OBJECT syntax or
      add some hack to "hide" the problem a little bit. Now I intorduce
      ugly hack which check number of spaces between ':' so
         case :action()
      is compiled as case condition using WITH OBJECT message and
      case:action() as sending message to object in case variable

  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
    + added support for passing base value to FOR EACH by reference.

  * harbour/source/vm/arrays.c
    * use hb_itemMoveRef() in AINS()/ADEL() to avoid creation of cyclic
      reference chains

  * harbour/source/vm/debug.c
  * harbour/source/vm/memvars.c
    * use hb_itemCopyToRef() to avoid creation of cyclic reference chains

  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
    * use hb_itemMoveToRef() to avoid creation of cyclic reference chains
    + added support for for writable string enumerators, f.e.:
         proc main()
         local s, c
         s:="abcdefghijklmnopqrst"
         for each c in @s
            if c$"aeio"
               c:="*"
            endif
         next
         ? s // "*bcd*fgh*jklmn*pqrst"
         return
2007-01-13 13:18:35 +00:00
Przemyslaw Czerpak
b86b5a8fe7 2006-12-08 05:55 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
  * harbour/bin/hb-mkslib.sh
  * harbour/bin/postinst.sh
  * harbour/config/bsd/gcc.cf
  * harbour/config/darwin/gcc.cf
  * harbour/config/dos/owatcom.cf
  * harbour/config/hpux/gcc.cf
  * harbour/config/linux/gcc.cf
  * harbour/config/linux/owatcom.cf
  * harbour/config/os2/gcc.cf
  * harbour/config/sunos/gcc.cf
  * harbour/config/w32/watcom.cf
  * harbour/contrib/rdd_ads/ads1.c
  * harbour/contrib/rdd_ads/adsfunc.c
  * harbour/include/hbapifs.h
  * harbour/include/hbexprc.c
  * harbour/include/hbsetup.h
  * harbour/source/common/expropt2.c
  * harbour/source/common/hbdate.c
  * harbour/source/common/hbgete.c
  * harbour/source/common/hbstr.c
  * harbour/source/common/hbver.c
  * harbour/source/common/hbverdsp.c
  * harbour/source/compiler/cmdcheck.c
  * harbour/source/compiler/fixflex.c
  * harbour/source/compiler/gencobj.c
  * harbour/source/compiler/genobj32.c
  * harbour/source/compiler/harbour.c
  * harbour/source/compiler/harbour.l
  * harbour/source/compiler/harbour.y
  * harbour/source/compiler/harbour.yyc
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hbfunchk.c
  * harbour/source/pp/ppcore.c
  * harbour/source/pp/ppgen.c
  * harbour/source/pp/pplib.c
  * harbour/source/rdd/dbcmd.c
  * harbour/source/rdd/workarea.c
  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbffpt/dbffpt1.c
  * harbour/source/rdd/hsx/hsx.c
  * harbour/source/rtl/accept.c
  * harbour/source/rtl/ampm.c
  * harbour/source/rtl/console.c
  * harbour/source/rtl/defpath.c
  * harbour/source/rtl/errorint.c
  * harbour/source/rtl/filesys.c
  * harbour/source/rtl/fkmax.c
  * harbour/source/rtl/fstemp.c
  * harbour/source/rtl/hbffind.c
  * harbour/source/rtl/hbgtcore.c
  * harbour/source/rtl/langapi.c
  * harbour/source/rtl/seconds.c
  * harbour/source/rtl/set.c
  * harbour/source/rtl/tobject.prg
  * harbour/source/rtl/transfrm.c
  * harbour/source/rtl/gtcrs/chrmap.c
  * harbour/source/rtl/gtcrs/gtcrs.c
  * harbour/source/rtl/gtcrs/gtcrs.h
  * harbour/source/rtl/gtpca/gtpca.c
  * harbour/source/rtl/gtwvt/gtwvt.c
  * harbour/source/rtl/gtxwc/gtxwc.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/cmdarg.c
  * harbour/source/vm/debug.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/fm.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/macro.c
  * harbour/source/vm/proc.c
  * harbour/source/vm/runner.c
  * harbour/utils/hbmake/hbmlang.c
  * harbour/utils/hbpp/hbpp.c
  * harbour/utils/hbpp/hbppcomp.c
  * harbour/utils/hbpp/hbppcore.c
  * harbour/utils/hbpp/hbpplib.c
  * harbour/utils/hbpp/pragma.c
  * harbour/utils/hbver/hbverfix.c
    * general code cleanup: all strcpy() and strcat() replaced hb strn*()
      and hb_strn*(), sprintf() by snprintf(), etc.
      It fixed some possible buffer overflow but it's also possible that
      it will exploit some some hidden so far problems but I strongly
      prefer to know about them ASAP to fix them before final 1.0 release.
    ! fixed bug I introduce in codeblock falgs which disabled early macro
      evaluation in codeblocks.
    ! added missing protection against execution by bison destructor for
      used CBSTART token on syntax error.
    % use PP stringify logik added for FLEX support to remove all redundant
      spaces in stringified for early macro evaluation codeblocks and add
      spaces between operators if after preprocessing they were removed.
      Now we are supporting also some code which cannot be compiled by
      Clipper.
    % cleaned and improved the speed of printer redirecting in console code.
      Chen please check if CG still reports problems and if not ubdate
      TODO/TOFIX or inform me about them.
    * some cleanups in building process for different *nixes: MacOSX, SunOS,
      *BSD, etc.
    * removed not longer necessary (I hope) compiler flag to force default
      'char' type as signed. Now Harbour should work with signed and unsigned
      char without any problems. To other developers: please remember that
      when you are using 'char' as 8 bytes signed integer then it's a bug.
      Always explicitly use: 'signed char' in such case. On some platforms
      it's not possible to set default type for 'char' so if you hardcode
      that 'char' is signed or unsigned somewhere then code will not be
      portable. Chen if you will find a while to also rebuild Harbour with
      BCC and -K switch to make some tests with CG then I'll be thankful.
2006-12-08 05:03:58 +00:00
Przemyslaw Czerpak
ef48cb6d96 2006-11-08 17:20 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed type checking for "string" type. It should be translate
      to character not symbol item type.
2006-11-08 16:19:59 +00:00
Przemyslaw Czerpak
0fae2fdd2c 2006-10-07 04:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
    + added validation for class data names. As additional preprocessor
      rule to not use <!marker!>

  * harbour/include/hboo.ch
  * harbour/source/rtl/tclass.prg
  * harbour/source/vm/classes.c
    + added delegate messages

  * harbour/include/hbstack.h
  * harbour/source/vm/arrays.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/proc.c
    + added startup symbol to hb_stack. It gives very good stop
      condition for all procedures which trace stack calls and
      resolves the problem with hb_stack.pBase which was never
      pointing to valid function/procedure symbol when no symbol
      was put on HVM stack. Now after hb_stackInit() the first
      item is allocated for "hb_stackInit()" symbol so hb_stack.pBase
      is always a pointer to valid function/procedure symbol.
    * changed the guard condition for buggy code in hb_stackPop()
      and similar code from:
         hb_stack.pPos < hb_stack.pItems
      to:
         hb_stack.pPos <= hb_stack.pBase
      The old condition was generating usable error message only in the
      startup function. In deeply called functions it was only waste of
      CPU time on one of the most often call functions. Before it was
      activated internal stack structures were corrupted.
      If we were leaving for many years without really working stack
      underflow protection then maybe we should think about disabling
      it at when HB_STACK_MACROS are used and keep it only in real
      stack functions for HVM developers. Single protection in
      hb_stackOldFrame() I've just added is enough for basic C code
      validation.
      I created the second version of stack macros without it in
      hbstack.h but I would like to hear other developers opinion.
2006-10-07 02:35:52 +00:00
Przemyslaw Czerpak
e47d291938 2006-10-04 02:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
    * most of the rules rewritten
    ! fixed some wrong rules and general cleanup
    + added additional code validation
    ! fixed compilation of more then one class in single file.
      Now it's even possible to declare all classes at beginning of
      single file and then implementing their methods in any order
    ! fixed using static classes and classes
    ! fixed compilation without <ClassName>_ prefix in method names
    + added support for HB_CLS_NO_DECORATION macro which disable
      adding <ClassName>_ prefix to method names - this macro is
      set by default when HB_SHORTNAMES is set.
    + added support for declared parameters validation - it can be
      disabled with HB_CLS_NO_PARAMS_ERR and I had to disable it
      by default due to problems with our preprocessor.
      Ryszard seems that our PP has serious problems with decoding
      directives when there is no space between symbol and some other
      non symbol character. I had to add some workarounds and even
      introduce buggy rules to make it working. Please look at it.
      You can remove #define HB_CLS_NO_PARAMS_ERR from hbclass.ch
      and try to rebuild Harbour core code to see the problem.

  * harbour/include/hboo.ch
  * harbour/source/vm/classes.c
    + added support for new primitive message: HB_OO_MSG_PERFORM

  * harbour/source/rtl/tclass.prg
    - removed <lPersistent> parameter from HBClass messages and
      internals data. Persistent is supported as scope bit and
      separate variable was redundant.
    - removed stripping of () from message names. Here is not a place
      to fix wrong preprocessor rules.

  * harbour/utils/hbtest/rt_class.prg
    * use: METHOD PROCEDURE ... CALSS ...
      instead of: PROCEDURE ... CALSS ...
      The first version is preferable syntax.

  * harbour/source/debug/dbgtmenu.prg
  * harbour/source/rtl/checkbox.prg
    ! fixed some parameters in method declaration - global cleanup
      will have to wait for preprocessor fixes

   Hi all,
   Please make test with current hbclass.ch code.
   I hope that I haven't broken too much things ;-) but I rewrite
   from scratch most rules and it's possible that I missed sth or
   made some stupid typos. Current version is much shorter and should
   be easier to updated. For sure I've intentionally changed one thing.
   CLASSDATA was ignoring SHARED attribute and always created shared
   class variables. Seems that it was long existing typo but the fix
   may interact with already existing code which needs SHARED class
   variables but does not use SHARED clause in CLASSDATA declaration.
   In such case please update it and add missing SHARED.
   Also in the end of CLASS declaration we have:
      [ ; #translate Super( <SuperClassN> ): => ::<SuperClassN>: ] ;
      [ ; #translate Super( <SuperClass1> ): => ::<SuperClass1>: ] ;
      [ ; #translate Super(): => ::<SuperClass1>: ] ;
      [ ; #translate Super: => ::<SuperClass1>: ] ;
      [ ; #translate ::Super : => ::<SuperClass1>: ]
   These rules introduce very serious bug - they are breaking supercasting
   in code which makes sth like:
      ::super:super:super:msg
   or in any other code which sends SUPER message to some other class
   objects. I will have to remove them. At least the last three ones.
   There were some other things I wanted to write about but it's too late
   and I'm to tired - sorry. If you will have any question please ask. if
   you will notice some problems with current rules please inform me.
2006-10-04 00:33:00 +00:00
Przemyslaw Czerpak
bb8804e7ac 2006-09-29 22:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    * allow to access object variables using assign messages without
      parameter. I do not want to add symmetric behavior for access messages
      though it's technically possible but such things should be controlled
      by programmer because access messages can have less restricted scoping
      then assign ones (READONLY) so I'll add new rule for it in hbclass.ch

  * harbour/source/vm/hvm.c
    * fixed warning message when object variable reference is
      generated using macro compiler without '_' as prefix.
2006-09-29 20:51:46 +00:00
Przemyslaw Czerpak
8deba76fc3 2006-09-28 14:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/common.ch
    + added ISSYMBOL()

  * harbour/include/hbextern.ch
    - removed __CLS_PARAM()

  * harbour/include/hbclass.ch
  * harbour/source/rtl/tclass.prg
  * harbour/source/vm/classes.c
    * replaced __CLS_PAR00() and __CLS_PARAM() functions by preprocessor
      rules. These functions are not longer necessary though I left them
      in classes.c for backward binary compatibility. Probably they will
      be removed in the future.
    ! use function pointers (@<funcname>()) instead of function names
      with REQUEST for super classes ID. It fixes using STATIC class
      functions.
2006-09-28 12:29:24 +00:00
Przemyslaw Czerpak
9aaaadbc6f 2006-09-28 00:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/make_rpm.sh
    * check for rpmbuild also when BUGGY_RPM is set

  * harbour/make_tgz.sh
    * removed rebuild hbpptest with shared libraries

  * harbour/include/hbapicls.h
    + added definitions for hb_clsCreate(), hb_clsAdd(), hb_clsAssociate()

  * harbour/include/hbapierr.h
  * harbour/source/rtl/errorapi.c
    + added hb_errFuncName - pseudo function name which can be used as
      operation description in new error object. It should help to simplify
      some code and fix function names when RT error is generated from C
      function which can be executed from different .prg functions.

  * harbour/include/hbclass.ch
    + added some missing Classy(y) compatible object variable type
      descriptions: Int, Integer, Block

  * harbour/source/rdd/dbfcdx/dbfcdx1.c
    ! disabled early retrieving from the cache key position and key count

  * harbour/include/hbvm.h
  * harbour/source/vm/hvm.c
    + added: void hb_vmPushEvalSym( void ) for the code which do not
      want to access any [P]HB_SYMB structures
    * changed symbol name in hb_symEval from __EVAL to EVAL and modified
      hb_symEval registration method to not register hb_vmDoBlock as global
      function. Having PHB_DYNS address for "EVAL" in hb_symEval.pDynSym
      allows to eliminate some strcmp() when we are looking for EVAL public
      symbol.
    ! fixed symbol table updating in PCODE functions for future multi module
      .hrb files

  * harbour/source/vm/proc.c
    * use hb_symEval.pDynSym instead of strcmp()

  * harbour/source/vm/arrays.c
  * harbour/source/vm/debug.c
    * minor code cleanup

  * harbour/source/rtl/tclass.prg
  * harbour/source/vm/classes.c
    % separate message hash table from methods table - it will cause farther
      reduction of allocated memory - many thanks to all people who send
      me statistics about number of used classes and symbols from their code.
    % use hb_symEval.pDynSym
    + added support for object variable type scope checking like in Class(y).
    ! fixed typo in pushing object class variables by reference
    % s_pClasses is now indexed directly by class handle
    % some other optimiztions
    ! make hidden and non virtual invisible in child classes if it overloaded
      some other non hidden method. In such case the overloaded method is used
      and can be accessed.
    ! make friend functions real method class oriented not (super)object for
      hidden messages
2006-09-27 22:39:06 +00:00
Przemyslaw Czerpak
8ef38acb75 2006-09-23 14:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/itemapi.c
    * minor modification in function order to group together the ones
      which can operate on reference counters
    + added additional stop condition in hb_itemUnRef() - we will have
      to make some modifications for the code which execute hb_itemUnRef()
      to resolve some possible conflicts with operators overloading and
      compiler optimizations

  * harbour/source/vm/classes.c
    * do not inherit friends - seems that our classes code was too
      friendly ;-)
      It also effectively resolves logical problem with accessing
      overloaded non virtual methods from friends.
    + added __clsLock( <hClass> ) - it locks any farther class
      modifications and can be used if programmer wants to be sure
      that no one will try to hack his class definition. It's very
      important when programmers work in a team on bigger project.
      Please do not add to CVS any __clsUnLock() functions - if someone
      needs it then he can create his own custom HVM build.
    * code cleanup

  * harbour/source/vm/eval.c
    + added hb_execFromArray() - idea and syntax borrowed from xHarbour's
      HB_ExecFromArray() by Giancarlo Niccolai though it's independent
      implementation. Now when we have support for functions with variable
      number of parameters then we need sth like this function to fully
      benefit from new feature. The following syntax is supported:
         hb_execFromArray( <cFuncName> [, <aParams> ] )
         hb_execFromArray( @<funcName>() [, <aParams> ] )
         hb_execFromArray( <bCodeBlock> [, <aParams> ] )
         hb_execFromArray( <oObject> , <cMethodName> [, <aParams> ] )
         hb_execFromArray( <oObject> , @<msgName>() [, <aParams> ] )
      or:
         hb_execFromArray( <aExecArray> )
      where <aExecArray> is in one of the following format:
         { <cFuncName> [, <params,...>] }
         { @<funcName>() [, <params,...>] }
         { <bCodeBlock> [, <params,...>] }
         { <oObject> , <cMethodName> [, <params,...>] }
         { <oObject> , @<msgName>() [, <params,...>] }

  * harbour/source/rtl/symbol.prg
    * removed C code inside #pragma BEGINDUMP/ENDDUMP
      now it's only .prg code which uses variable parameters function
      and hb_execFromArray()
2006-09-23 12:39:22 +00:00
Przemyslaw Czerpak
1202be4471 2006-09-22 23:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbclass.ch
  * harbour/include/hbvm.h
  * harbour/source/rtl/tclass.prg
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
    ! fixed bug in real codeblock scoping which was exploited by
      dictionary resizing
    * changed ACCESS messages to ASSIGN ones when object item
      reference is created for proper READONLY scope checking.
      The reference to object variable can be created only when
      caller has sufficient ASSIGN privileges.
    + added FRIEND CLASS and FRIEND FUNCTION support.
      It's enough to add class definition:
         FRIEND CLASS <classFunc1> [, <classFuncN> ]
      and/or:
         FRIEND FUNCTION <FuncName1> [, <FuncNameN> ]
      and all methods of given class or given function will be able
      to access private variables.
      Warning!!! Friends cannot access overloaded non virtual methods.
                 This feature is available _ONLY_ for real class members.
    + added MODULE FRIENDLY to class definition. It causes that all other
      functions and classes defined in the same .prg module will have
      friend privileges. In such way works xHarbour and there is now way
      to disable this "feature" what is IMHO bug. In Harbour programmer
      has to explicitly enable it (until he will not change / add new
      preprocessor rule and set it as default ;-)). Syntax:
         CREATE CLASS .... MODULE FRIENDLY
            ...
         END CLASS

  * harbour/source/vm/proc.c
  * harbour/source/vm/runner.c
    * updated function symbols processing

  * harbour/source/compiler/harbour.c
    * added note in hb_compOptimizeFrames() about exceeding maximum number
      of local variables (255). We should add new pcode(s) HB_P_LARGE[V]FRAME
      or generate compile time error.

  * harbour/source/vm/macro.c
    % minor optimizations
2006-09-22 21:02:17 +00:00
Przemyslaw Czerpak
b6bed767c0 2006-09-20 18:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
    * synced with recent xHarbour fixes

  * harbour/include/hbdefs.h
    * indenting

  * harbour/include/hbexprb.c
  * harbour/include/hbexprop.h
  * harbour/source/common/expropt2.c
    + added compile time optimization for STOD(cConstDateString)
      covered by -kh compiler extension (default)
      It allows to keep the same source code for Clipper and
      Harbour and benefits from data constants without using
      0dYYYYMMDD values

  * harbour/source/vm/classes.c
    * restored the original 3-rd parameter in  hb_clsAdd to void(void) -
      PHB_FUNC - and added translation for PHB_SYMB to not force using
      [P]HB_SYMB in 3-rd party code

  * harbour/source/vm/estack.c
    * added protection against possible GPF after executing
      hb_stackBaseProcOffset() when first item on the stack
      was not HB_IT_SYMBOL - it can happen in some seldom
      cases. Probably some more general solution like leaving
      first dummy item on HVM stack for breaking stack scan
      loops will be better. I'll think about it.

  * harbour/source/vm/itemapi.c
    ! fixed clearing enumerators
2006-09-20 16:42:12 +00:00
Przemyslaw Czerpak
18f74581d1 2006-09-19 11:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbapicls.h
  * harbour/include/hbpcode.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/genc.c
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/hbdead.c
  * harbour/source/compiler/hbfix.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/compiler/hbpcode.c
  * harbour/source/compiler/hbstripl.c
  * harbour/source/vm/arrays.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
   + added three new PCODEs:
      HB_P_MACROSEND    - to use for: s:=1,2,3"; o:=send(&s)
      HB_P_PUSHOVARREF  - to create references to object variables: @o:var
      HB_P_ARRAYPUSHREF - to create references to array items, it can be used
                          in some optimization, f.e.: a[ <exp1> ] += <exp2>
                          or directly by: func( @a[ <exp> ] )
                          if we add passing array elements by reference
     Implemented in HVM and PCODE generation, the compiler has to be
     modified yet to use them.
   * changed last parameter in hb_codeblockGetRef() - I'd like to have
     all variables in hb_struRefer structure in one place: hb_itemUnRefOnce()
     for easier modifications in the future.
   * replaced in hb_struRefer 'itemsbase' with 'array'.
   + added hb_arrayGetItemRef() to create references to array elements.
     Such reference updates array reference counters.
   * changed STATICs passed by reference to use new array item references.
   ! block destructor execution after classy releasing on HVM exit
2006-09-19 09:59:42 +00:00
Przemyslaw Czerpak
dc9ebdf37c 2006-09-17 02:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    + added hb_clsRealMethodName() function which I'm using in some
      test code

  * harbour/tests/clsscast.prg
    * updated to use __CLS_CNTSHRDATA() instead of __CLS_CNTCLSDATA()

  * harbour/utils/hbtest/rt_class.prg
    + added tests for class and shared class variables/allocating
2006-09-18 00:01:53 +00:00
Przemyslaw Czerpak
24159987a2 2006-09-17 18:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* xharbour/include/hbvm.h
  * xharbour/source/vm/hvm.c
    + added hb_vmPushDynSym( PHB_DYNS )
      It should allow most applications to not use [P]HB_SYMB at all.
      Removing PHB_SYMB from 3-rd party .c code may allow us to add
      freeing unused symbol tables from HVM in the future.

  * harbour/source/vm/classes.c
    * temporary restored hb_objGetpMethod()
    + added __ClsCntClasses()
    ! allocated real methods for OnError and Destructor to keep
      the same behavior in these methods as in any others, f.e.
      scoping checking or debugging.

  * harbour/common.mak
  * harbour/utils/hbtest/Makefile
  * harbour/utils/hbtest/hbtest.prg
  + harbour/utils/hbtest/rt_class.prg
    + added tests for our classy code. Now destructors and instance
      area allocating/casting. Some other in the future.
2006-09-17 16:54:04 +00:00
Przemyslaw Czerpak
ff658ccfec 2006-09-16 23:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
    * synced with recent Brian fixes in xHarbour

  * harbour/include/hbapi.h
    + added 'method' member to hb_struBlock structure

  * harbour/source/vm/hvm.c
    * initialize 'method' member in hb_struBlock structure

  * harbour/source/vm/proc.c
    * changed the name of last parameter of hb_procname() from
      bSkipBlock to fMethodName and modified to use information
      about the class of executed codeblock from new hb_struBlock
      members

  * harbour/source/vm/classes.c
    * removed hb_objGetpMethod() - I hope it's not longer used
    * added real codeblock scoping.
      In Clipper there is no information where the codeblock where
      created and what priviladges/scopes it should has.
      Class(y) to resovle this problem when codeblock is executed scans
      the HVM stack for the nearest method call and takes scopes defined
      for this method. It's a workaround which allow to break standard
      access rights though seems reasonable when it's not possible to
      store information where the block is created. I've added to block
      item structure information about class and method where code block
      was created so we can use the exact method priviladges.
      Now Harbour classy code can work exactly like Class(y) when compiled
      with -DHB_CLASSY_BLOCK_SCOPE and with real code block scoping when
      compiled with -DHB_REAL_BLOCK_SCOPE. I set the second (real code
      block scopes) as default. If you think we should be strict Class(y)
      compatible here then please inform me and I'll change default setting.

  + tests/clsscope.prg
    + added demonstration/test code for class method scoping
2006-09-16 21:24:06 +00:00
Przemyslaw Czerpak
fe3786511e 2006-09-15 21:15 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/arrays.c
  * harbour/source/vm/classes.c
    ! fixed multiple use of supercasted object I broke in last commit
    * removed some unused code and moved some scoping checking to
      class creation code
2006-09-15 19:14:32 +00:00
Przemyslaw Czerpak
f22f040335 2006-09-15 13:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbvm.h
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
    + added hb_vmRequestReenter() and hb_vmRequestRestore()
    + added executing destructors when some exception is active
      I forgot about it in previous commit.

  + harbour/tests/destruct.prg
    + added example/test code for object destructors
2006-09-15 11:28:48 +00:00
Przemyslaw Czerpak
a35053003b 2006-09-15 04:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/doc/destruct.txt
    + added description for object destructors in Harbour

  * harbour/include/error.ch
    + added new error code EG_DESTRUCTOR

  * harbour/source/lang/msgpl852.c
  * harbour/source/lang/msgpliso.c
  * harbour/source/lang/msgplmaz.c
  * harbour/source/lang/msgplwin.c
  * harbour/source/rtl/langapi.c
    + added desription for new error code - other language modules
      have to be updated

  * harbour/include/hbapi.h
    + added hb_gcRefCheck() and cover some hb_gc* functions by
      _HB_API_INTERNAL_ macro

  * harbour/source/vm/itemapi.c
    ! fixed possible RT error generation when some exception is active

  * harbour/include/hbapicls.h
  * harbour/include/hbclass.ch
  * harbour/include/hboo.ch
  * harbour/source/rtl/tclass.prg
  * harbour/source/vm/arrays.c
  * harbour/source/vm/classes.c
    + added support for object destructors

  * harbour/source/vm/garbage.c
    + added support for object destructors
    + added logic to detect buggu .prg code which uses destructors
      see doc/destruct.txt for more info.
      It's also possible that this code will exploit some bugs
      in other code which uses GC allocated memory blocks.
2006-09-15 03:10:38 +00:00
Przemyslaw Czerpak
77d31074e8 2006-09-13 03:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    * keep class shared data in separate array
    + added __CLS_CNTSHRDATA( hClass ) -> nSharedDatas
    % some minor optimizations

  * harbour/tests/clsscast.prg
    + added test code for shared class data allocating and casting

  * harbour/include/hbapicls.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
    + added support for FOR EACH overloading - it's work in progress
      do not create any code which may use current solution - it may
      change in the nearest future
2006-09-13 01:12:18 +00:00
Przemyslaw Czerpak
6b15fe3ba1 2006-09-12 12:37 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed typo in adding SHARED CLASS VAR ASSIGN messages
    * some minor cleanup
2006-09-12 10:38:17 +00:00
Przemyslaw Czerpak
7463296f9e 2006-09-11 20:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.ch
    * added HB_EXPORT to public functions and some internal covered by
      _HB_API_INTERNAL_ macro

  * harbour/include/hboo.ch
    + added HB_OO_CLSTP_NONVIRTUAL and HB_OO_CLSTP_OVERLOADED

  * harbour/source/rtl/tclass.prg
    ! do not add supercast class messages - now it's done automatically
      by __clsNew() function with proper instance area offset updating
    ! enumerate instance class datas in __clsAddMsg() from 1 - inherited
      instance variables are managed internally by classy code with
      proper instance area offset updating
    ! use __CLS_CNTCLSDATA() as start offset for class data. Do not
      try to calculate it yourself - some of super classes can be ignored
      when they are appear in the inheritance tree more then once so it's
      not possible to calculate class data or instance data start offset
      using simple sum of class or instance variables in super classes.

  * harbour/source/vm/classes.c
    ! fixed instance area casting
    ! fixed class variables casting
    ! fixed multi-inheritance when the same class can apear more then
      once in super classes tree.
    ! Do not add unnecessary instance variables for the same class when
      it's inherited more then once.
    ! Do not add unnecessary class variables for the same class when
      it's inherited more then once.
    ! Do not add unnecessary initialization class and instance variables
    + added support for non virtual messages
    + added support for static and casted scoping
    + super cast messages added automatically. They are used to dynamic
      recalculation of instance are offsets and to avoid multiple inheritance
      of the same class so please do not overload them or you will have as
      result something what we have before recent modifications in the
      instance and class data area. Just simply run tests/clsccast.prg
      and tests/clsicast.prg compiled with current CVS code and last
      release code or with xHarbour and compare the results.
      Also Class(y) does not pass these tests and I do not know if any
      other dynamic OOP model in xbase languages can properly address it.
      BTW maybe I should add RT error when .prg code will try to delete
      or overwrite class cast message. For me it seems to be reasonable
      and what's your opinion?
    * make hidden class members non virtual by default. It can be disabled
      by compiling classes.c with -DHB_VIRTUAL_HIDDEN but IMHO keeping
      HIDDEN members as virtual causes that they are not really HIDDEN
      because subclasses can simply overwrite them. It also means that
      it's not possible to create class with some private data and
      methods which will never interact with any subclass code created
      by other programmers where name conflict can appear. So one of
      the most important OOP features is missing in such case.
      See tests/clsnv.prg as an example for non virtual hidden members.

  + tests/clsicast.prg
    + added test code for proper instance area allocating and casting

  + tests/clsccast.prg
    + added test code for proper class data allocating and casting

  + tests/clsnv.prg
    + added test code for non virtual hidden class members

   Now we should be able to create and class model even replicate the
   static one like in C++ using current class engine which still fully
   supports dynamic bindings. It consumes less memory and due to much
   more efficient hashing it should be faster then it was though some
   other minor optimization can be add and I'll plan to make them in
   some spare time.
   The item type verification in assignment is still missing. I'll add
   it when I'll collect some statistic informantion I'd like to ask
   [x]Harbour users. I need these information to tune some internal
   structures where I can balance between speed and memory allocation
   to statistically optimal form.

   Marek asked me to add passing object datas by reference and I'll do
   that but I'd like to ask Ryszard to add support for:
      @<oVar>:<message>
   to compiler. I'll implement all other HVM modifications. If you can
   please also add support for:
      <oVar>:&<cMsgName>[(...)]
   For this we do not need any HVM modifications or new PCODEs.
   We are supporting xBase++ macro list compilation in:
      cList:="1,2,3"
      x := aVar[ &cList ]
      aVar:={ &cList }
      func( &cList )
   But we do not support:
      <oVar>:<message>( &cList )
   IMHO it looks ugly. If we have this syntax for function call then we
   should also support it in message sending.
   Ryszard can you make necessary compiler modifications?
   I'm also thinking about adding support for variable parameters
      func myfunc(...)
      [...]
      return xVar
   In few cases it will help to encode some function much more efficient
   then now.

   I'll add Class(y) compatible functions used in class(y) header files
   so it will be possible to use original class(y) .ch files in Harbour
   though it will not be the most efficient because we have @func() operator
   which gives better performance then using codeblocks. Anyhow classy
   create separate meta class for each class with CLASS members and
   <clasName>() function always return such meta class object so for full
   Class(y) compatibility we need to generate differ .prg code.
   But all such modifications now can be done on preprocessor and
   .prg level and they will not need .c code modification.
   We should make them to give user interface for our new OOP features.

   Now I'm waiting for reports about any problems with current classy
   code.
2006-09-11 18:14:41 +00:00
Przemyslaw Czerpak
45033c962e 2006-09-10 14:28 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    * cleaned BCC warning
2006-09-10 12:29:25 +00:00
Przemyslaw Czerpak
43d20b8eb6 2006-09-10 13:05 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/hvm.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/arrays.c
    * moved static base offset from hb_struBlock structure
      to HB_CODEBLOCK structure
    + added hclass member to hb_struBlock - it will be used in
      the future for checking codeblock scope in classy so we will
      real scope checking also for messages sent from codeblocks.
    - removed supercast and superoffset members from hb_struArray
      structure.

  * harbour/include/hbclass.ch
    * added class(y) like
         @:<MessageName>([<MsgParams,...>])
      send operator. It's not exactly the same as in class(y) where
      this operator is hardcoded to executing function directly,
      needs method name instead of message name and is linked statically.
      In Harbour this operator uses message name so can be used also for
      instance variables and make dynamic casting to the class from which
      current method is inherited. In short words sending messages to @:
      instead of :: causes that they work like non-virtual messages in
      C++ mode.
      If you do not use the same method body in different classes
      then you can also use explicitly self casting:
         ::<myclass>:<msgname>[(...)]
      and it will be a little bit faster

  * harbour/include/hboo.ch
    + added: HB_OO_MSG_ASSIGN, HB_OO_MSG_ACCESS,
             HB_OO_MSG_CLSASSIGN, HB_OO_MSG_CLSACCESS
      They should be used insted of HB_OO_MSG_DATA and HB_OO_MSG_CLSDATA
      This resolves problems with name conflicts when we were detecting
      type of message (ACCESS/ASSIGN) by checking the first character
      in message name. F.e. now it's possible to create exported instance
      variable called __WithObject and it will be used in all WITH OBJECT
      statement instead of the base object value. It's simple and effective
      WITH OBJECT overloading.
      I kept backward compatibility for HB_OO_MSG_DATA and HB_OO_MSG_CLSDATA
      but I strongly suggest to update code to use new constants.
    + added HB_OO_MSG_REALCLASS

  * harbour/source/rtl/objfunc.prg
  * harbour/source/rtl/tobject.prg
  * harbour/source/rtl/tclass.prg
    * use HB_OO_MSG_[CLS]{ASSIGN,ACCESS} instead of HB_OO_MSG_[CLS]DATA

  * harbour/source/rtl/tclass.prg
    + added REALCLASS message to creted classes - it's used for @: operator

  * harbour/source/vm/classes.c
    * updated for above modifications
    * calculate instance area offset in supercasting dynamically - it
      will allow to eliminate multiple instance area allocating when
      in the inheritance tree the same class exists more then once and
      also quite easy add support for non-virtual messages.
    ! fixed GPF in __CLSINSTSUPER() class function generate HVM exception
    % do not inherit unaccessible inline blocks
    * some other minor optimization, fixes and code cleanups

  * harbour/source/rdd/usrrdd/usrrdd.c
    ! fixed HB_TRACE message

  * harbour/source/rtl/errorapi.c
    ! generate internal error if ErrorNew() function does not return an object
2006-09-10 11:16:43 +00:00
Przemyslaw Czerpak
22b6c06fce 2006-09-04 19:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/TODO
    + added simpler example for memory leak in macro compiler:
         ? type("user input")

  * harbour/source/macro/macro.y
    * replaced TABs with SPACEs

  * harbour/source/vm/classes.c
    * added some TRACE() messages
    + added support for executing functions with <symItem>:EXEC()
      registered dynamically after creating <symItem>

  * harbour/source/vm/hvm.c
    * minor modification
2006-09-04 17:45:53 +00:00
Przemyslaw Czerpak
a55606d726 2006-09-04 11:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbexprc.c
    ! fixed bug in wrong integer negating, f.e.:
         proc main(); local i:=0; i-=-32768; ? i; return
    ! fixed PCODE generated for +=, -=, /=, *= expressions when right side
      of expression is undefined variable - it's possible that it will be
      field and we will have RT error. It fixes tt4.prg example form TODO
      file.

  * harbour/TODO
    - removed tt4.prg example from TOFIX

  * harbour/source/vm/classes.c
    ! fixed supercast message validation

  * harbour/source/vm/hvm.c
    ! fixed very bad typo in hb_vmMinus() which can cause wrong
      results when on 64-bit integer overflow
2006-09-04 09:40:43 +00:00
Przemyslaw Czerpak
7e6acbd5ff 2006-09-04 09:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/ChangeLog
  + harbour/ChangeLog.016
    ! added ChangeLog.016 and updated number - mistake in my previous commit

  * harbour/source/vm/classes.c
    * stronger parameters validation and fixed some possible problems
      in hb_objGetMethod()
    + added support for assigning enumerator value by:
         <enum>:__enumValue(<newVal>)
      and enumerator index by:
         <enum>:__enumIndex(<newIndex>)
      It's a work in progress - please do not create any code which may
      need such functionality yet

  * harbour/source/vm/debug.c
  * harbour/source/vm/hvm.c
    * minor code cleanup
2006-09-04 07:44:04 +00:00
Przemyslaw Czerpak
30d4efb954 2006-09-03 18:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
  * harbour/source/vm/hvm.c
  * harbour/tests/overload.prg
    + added support for overloading [] in assignment operation
2006-09-03 17:01:55 +00:00
Przemyslaw Czerpak
69503c8a2b 2006-09-03 16:20 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hboo.ch
    + added HB_OO_CLSTP_PERSIST and HB_OO_MSG_INITIALIZED

  * harbour/include/hbapi.h
  * harbour/include/hbvmpub.h
  * harbour/source/vm/dynsym.c
    % changed HB_HANDLE hArea to USHORT uiArea to reduce HB_DYNS size.
      RDD code internally uses USHORT as area number so it's not
      necessary to keep it as HB_HANDLE value.

  * harbour/source/vm/arrays.c
    * modified internal static function name

  * harbour/source/vm/itemapi.c
    + added missing HB_TRACE in hb_itemClone()

  * harbour/source/vm/classes.c
    ! moved initialization values to separate structure not bound with
      methods. We can inherit the same method names from more then one
      object so we will store only the first one but we are inheriting
      whole instance area which is accessible with super casting (last
      fixes) so we have to properly initialize it even if methods does
      not exist. This modification also fixes some possible memory leaks.
    % replaced bIsPersistent by HB_OO_CLSTP_PERSIST in uiScope in method
      definition
    ! added basic parameter validation to __CLSADDMSG() to avoid some
      possible strange behavior at runtime when broken messages are
      defined.
    * updated __OBJHASMSG() and __OBJSENDMSG() to accept SYMBOL items
      too (@funcName()). Using symbol items it faster then strings.
      Also added support to use non array parametes. F.e. now
         __OBJHASMSG( {||NIL}, "EVAL" )
      returns TRUE
    * some other fixes, reduced memory consumption and speed optimizations
2006-09-03 14:30:26 +00:00
Przemyslaw Czerpak
8363f1e978 2006-09-01 23:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
+ harbour/source/codepage/uckam.c
    + added missing in my previous commit file

  * harbour/include/hbvmpub.h
  * harbour/source/vm/dynsym.c
    + added USHORT uiSymNum to HB_DYNS structure - I will need it for MT
      as index for thread local HB_DYNSYM values for MT version in the
      future but now I use it as perfectly efficient continuous hash
      value for all symbols. Of course PHB_DYNS address is also perfectly
      good hash value and in classes code can be used but it does not
      guaranties that all messages will cover well whole 16bit area used
      as message pool without dynamic bucket size modification.

  * harbour/source/vm/classes.c
    * changed hashing method. Now it uses really unique base hash key
      values which can cover whole 16 bit area so mathematically it's
      not be possible to break it by any combination of method names
      as long as our dynamic symbol table will be limited to 2^16 symbols.
      It still consumes more memory then necessary and I'll change it in
      the future but it's much less then before.
      The BUCKET size is smaller (4) and all calculations are done only
      with bit shifts so it should be also faster.
    * use ULONG instead of USHORT to calculate maximum number of methods
      to avoid possible overflow problems if it reach 2^16 (rather
      impossible in normal application - it will have to create more then
      2^15 symbols)
    ! some other fixes and code cleanup

  * harbour/source/vm/hvm.c
    * minor modifications
2006-09-01 21:28:02 +00:00
Przemyslaw Czerpak
f07d1b6ce5 2006-09-01 10:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/lang/msgcs852.c
  * harbour/source/lang/msgcsiso.c
  * harbour/source/lang/msgcskam.c
  * harbour/source/lang/msgcswin.c
    * typo fixed (Vojtech Obrdlik <vobrdlik centrum.cz>)
  * harbour/include/hbapicdp.h
  * harbour/source/codepage/Makefile
  + harbour/source/codepage/cpcs852.c
  + harbour/source/codepage/cpcsiso.c
  + harbour/source/codepage/cpcskam.c
  + harbour/source/codepage/cpcswin.c
  + harbour/source/codepage/uckam.c
  * harbour/doc/en/lang.txt
  * harbour/common.mak
    + added czech codepage support (Vojtech Obrdlik <vobrdlik centrum.cz>)
      Vojtech many thanks.
      We will have to fix our CDP code to work well with characters
      with the same wight - now sorting with such codepages does not
      work correctly, f.e. in CSISO:
        CHR(65)+CHR(204) > CHR(65)+CHR(201)
      but:
        CHR(65)+CHR(201) >= CHR(65)+CHR(204)
      as you can see comparison depends on string order:
        s1 > s2 but not s2 < s1
      It means that such codepages cannot be used in any sorting
      systems like indexes until we will not fix internal CPD logic.
      Alexander can you look at it?
      If not then please inform me and I'll work on it in some spare
      time.


  * harbour/source/rtl/do.c
    * minor RTE message simplification

  * harbour/source/rtl/gtos2/gtos2.c
    * casting

  * harbour/source/vm/dynsym.c
    + added __DYNSN2SYM( <cName> ) -> symbolItem

  * harbour/include/hbapi.h
  * harbour/source/vm/arrays.c
    + added supercast and superoffset members to hb_struArray structure

  * harbour/source/vm/classes.c
  * harbour/source/rtl/tclass.prg
    ! fixed calculation of instance area offsets
    ! fixed accessing instance variables with super casting
    + added selfclass casting
    + added support for sending 'exec' and 'name' messages to
      symbol items, f.e.:
         funcSym := (@funcName())
         ? "Exacuting:", funcSym:name
         funcSym:exec( param1, param2, ... )
    * changed __CLASSNAME() to be Clipper compatible
    * changed __CLSINST()/__CLASSINSTANCE() now accepts as third paramter
      function name - Clipper compatible
    ! fixed GPF trap in __OBJGETCLSNAME() when executed with wrong parameter
    * some other fixes and small speed improvement
2006-09-01 08:27:40 +00:00
Przemyslaw Czerpak
1d39228e0b 2006-08-29 10:25 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    + added Class(y) compatible scoping - please test and report any
      possible problems
2006-08-29 08:27:38 +00:00
Przemyslaw Czerpak
5f696874dc 2006-08-28 12:40 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed __SENDER() function to work with non-inline methods
    ! respect super casting in ClassName(), ClassH(), ClassSel() methods
    % some optimizations
2006-08-28 10:42:28 +00:00
Przemyslaw Czerpak
61b4f5ac8e 2006-08-27 20:54 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed bug in super casting introduced in my last commit
2006-08-27 18:55:41 +00:00
Przemyslaw Czerpak
d4af3b201b 2006-08-23 23:12 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbrdddbf.h
  * harbour/source/rdd/dbf1.c
  * harbour/contrib/rdd_ads/ads1.c
    * synced with xHarbour

  * harbour/include/hbapi.h
    + added uiClass and uiMethod to HB_STACK_STATE structure
    - removed puiClsTree from HB_BASEARRAY structure

  * harbour/include/hbvmpub.h
    ! fixed typo in HB_ARRAY_OBJ() declaration

  * harbour/source/vm/arrays.c
    - removed puiClsTree from HB_BASEARRAY structure

  * harbour/source/vm/classes.c
    - removed static variable s_pMethod to make classes code MT safe
    * store information about current method index and supercasting on
      HVM stack in HB_STACK_STATE structure
    ! changed hb_objGetRealClsName() to not use puiClsTree - this functions
      was never working as it should when object was supercasted.
      Now it simply returns name of class where method was defined and
      inherited.
    - removed hb_objPopSuperCast() and changed last parameter in
      hb_objGetMethod() from BOOL * to PHB_STACK_STATE
      hb_objPopSuperCast() is not longer necessary
    - removed hb_mthRequested() and first parameter from hb_mthAddTime()
    + added char * hb_clsName( USHORT uiClass );
    + added TOFIX notes in hb___msgGetData() and hb___msgSetData()

  * harbour/source/vm/estack.c
    + added uiClass and uiMethod to HB_STACK_STATE structure

  * harbour/source/vm/hvm.c
    * updated for above modifications

  * harbour/source/vm/proc.c
    ! do not use hb_objGetRealClsName() anymore but retrieve information
       about _REAL_ class form HVM stack
2006-08-23 21:13:42 +00:00
Przemyslaw Czerpak
8bef490815 2006-08-19 01:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
    * moved HB_STACK_STATE declaration from hbstack.h to hbapi.h
      it's covered by _HB_API_INTERNAL_ macro so it should not
      effect 3-rd party code
    * modified hb_struSymbol structure:
         LONG stackbase
      replaced by:
         PHB_STACK_STATE stackstate
      this modification allows to keepadditional information bound with
      function call stack accessible from different HVM modules.
      Now it's used by memvars code to keep/update PRIVATE variables
      stack pointers. I plan to store in HB_STACK_STATE structure
      information additional information for classes code like super
      casting or instance variables offsets in new OOP model I'm working on.
      It can be also used by debugger code to retrieve some informations
      about executed functions without active updating by main HVM loop.
    + added hb_memvarsClear() - cleanly clears all PRIVATE and PUBLIC
      variables
    + added hb_memvarUpdatePrivatesBase() - updates PRIVATE stack base
      offset so PRIVATE variables created in current function/procedure
      will not be removed when it returns
    - removed hb_memvarsRelease() and hb_memvarValueNew()

  * harbour/include/hbstack.h
    + added hb_stackClearMevarsBase() - helper function for hb_memvarsClear()
      clears PRIVATE stack offsets in executed functions
    * changed to static offset from int to long - in different places we
      were using int or long in HVM so I cleaned the HVM code to always
      operate on the same type

  * harbour/source/vm/estack.c
    * set/restore PRIVATE stack base offset in hb_stackNewFrame()/
      hb_stackOldFrame()
    * updated for new HB_IT_SYMBOL structure

  * harbour/source/vm/hvm.c
    ! removed setting/restoring PRIVATE stack base offset in hb_vmExecute()
      It make code like:
         eval(&("{||VAR:=1}"))
      Clipper compatible
    * updated for new HB_IT_SYMBOL structure
    * changed order of execution exit procedures for clean memvars removing
      and future destructors execution. I'll describe it better when I'll
      add destructors.

  * harbour/source/vm/memvars.c
    ! fixed CLEAR MEMORY - now this function should be safe in Harbour
      It's not exactly compatible with Clipper because I intentionally
      didn't replicated some Clipper bugs like possible memory corruption.
    + added hb_memvarsClear() - cleanly clears all PRIVATE and PUBLIC
      variables
    + added hb_memvarUpdatePrivatesBase() - updates PRIVATE stack base
      offset so PRIVATE variables created in current function/procedure
      will not be removed when it returns
    ! fixed releasing PUBLIC and PRIVATE variables which were passed by
      reference and are still active on HVM stack or in codeblocks as
      detached locals (see: hb_memvarDetachDynSym())
    * modified hb_memvarFindSymbol() to be more Clipper compatible
    % optimized hb_memvarRelease() to operate or PHB_DYNS instead of
      string comparison and not make linear dynamic symbol scan for
      PUBLIC or not existing symbols
    - removed hb_memvarReleasePublic()

  * harbour/include/hbvmpub.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/gencc.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/debug.c
  * harbour/source/vm/itemapi.c
  * harbour/source/vm/pcount.c
  * harbour/source/vm/proc.c
  * harbour/source/vm/pvalue.c
    * updated for the above modifications

  * harbour/source/rtl/memvarbl.prg
  * harbour/source/rtl/menuto.prg
    * use __mvEXIST( cMemvar ) instead of __mvSCOPE( cMemvar ) > HB_MV_ERROR
      __mvEXIST() is much faster function

  * harbour/source/rtl/type.c
    * execute hb_memvarUpdatePrivatesBase() after macro type checking.
      This should not be necessary but we are not Clipper compatible here
      and this is work around for difference in our TYPE() implementation.
      Clipper for:
         ? TYPE("VAR:=1")
      create PUBLIC variable VAR when [x]Harbour PRIVATE one.
      Should we try to make it Clipper compatible?

   The above should fix problems reported with memvars. We are not 100%
   Clipper compatible but unlike in Clipper we cannot break VM internals
   using some operation on references to memvars and detached locals
   and/or RELEASE.../ CLEAR MEMORY. This modifications should be intensively
   tested. If you will find any problems with current code please inform me.
   I'd like to hear your opinions about memvars created by TYPE() (see above).
   Should we change it? It may not be very easy operation - we will have to
   change macro compiler and add new PCODE for that.
2006-08-18 23:12:38 +00:00
Przemyslaw Czerpak
110957e91b 2006-08-05 13:42 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/common/hbver.c
    * extended C compiler information

  * harbour/source/compiler/genc.c
    * use hb_verHarbour() and hb_verCompiler() to for information
      about Harbour build in generated .c files' headers

  * harbour/source/rdd/dbfcdx/dbfcdx1.c
  * harbour/source/rdd/dbfntx/dbfntx1.c
    ! fixed typo in my last commit - additional dummy evaluations of
      EVAL block
2006-08-05 11:58:08 +00:00
Przemyslaw Czerpak
f1fa94f3c4 2006-07-25 10:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/contrib/rdd_ads/ads1.c
    ! make GOTOP() when new index is open and is set as control one

  * harbour/include/hbcomp.h
  * harbour/include/hbstack.h
  * harbour/include/hbxvm.h
  * harbour/source/compiler/gencc.c
  * harbour/source/compiler/hblbl.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/estack.c
  * harbour/source/vm/hvm.c
  * harbour/source/vm/itemapi.c
    * added automatic destructors for FOR EACH and WITH OBJECT statement
    * s_lWithObjectBase changed to lWithObjectBase hb_stack membera
    * added hb_stackWithObject*() functions/macros to manipulate
      WITH OBJECT offset/item
    * removed setting/restoring lForEach and lWithObject in functions
      preamble/postamble
    ! fixed restoring s_lRecoverBase on HB_QUIT_REQUESTED
    ! fixed possible GPF on enumerators copping
    * moved FOR EACH / WITH OBJECT massages suport from HVM to classy.c
    ! fixed access to first stack item in hb_vmIsLocalRef()

  * harbour/TODO
    - removed note about hb_objGetMethod() - it's already addressed
2006-07-25 09:03:06 +00:00
Przemyslaw Czerpak
61dffc7bb7 2006-07-07 18:45 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/include/hbvmpub.h
  * harbour/source/vm/classes.c
    + added HB_ARRAY_OBJ() and changed HB_IS_OBJECT() to use it
      instead of HB_OBJ_CLASS() - it allows to use HB_IS_OBJECT()
      without including hbapicls.h
2006-07-07 16:45:32 +00:00
Przemyslaw Czerpak
5cbcaa09f0 2006-06-27 10:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/proc.c
    + added BOOL hb_procinfo( int iLevel, char * szName,
                              USHORT * puiLine, char * szFile )

  * harbour/include/hbstack.h
  * harbour/source/vm/estack.c
    + added hb_stackTotalItems(), hb_stackDateBuffer(),
      hb_stackGetStaticsBase(), hb_stackSetStaticsBase(),
      hb_stackBaseProcInfo()

  * harbour/source/vm/garbage.c
    * indenting

  * harbour/source/vm/classes.c
  * harbour/source/vm/codebloc.c
  * harbour/source/vm/extend.c
  * harbour/source/vm/fm.c
  * harbour/source/vm/hvm.c
    * replaced direct stack access by stack functions/macros

  * harbour/source/vm/debug.c
    * removed hb_stackLenGlobal() and replace it by hb_stackTopOffset()
      Warning!!! hb_stackTopOffset() returnes results smaller by 1.
      The TOP stack item is undefined and should not be accessed by
      debuger.
    * changed HB_DBG_VMSTKGLIST() to operate on functions/macros.
      It's possible that the above will badly interact with core debugger
      code so I stop farther modifications leaving them for someone who
      knows debugger core code.
2006-06-27 08:53:26 +00:00
Przemyslaw Czerpak
1f3d20c259 2006-06-22 11:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
    + hb_objSendMessage( PHB_ITEM pObj, PHB_DYNS pMessage, ULONG ulArg, ... )
    * code clean-up

  * harbour/source/rtl/do.c
    * removed old not longer necessary code - thanks to Chen.

  * harbour/source/vm/runner.c
    * added one TODO note

  * harbour/source/rtl/gtstd/gtstd.c
    * try to enable raw mode for console stdin in W32

  * harbour/source/rdd/dbfntx/dbfntx1.c
    * code clean-up
2006-06-22 09:32:15 +00:00
Przemyslaw Czerpak
60d2420387 2006-06-20 17:22 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/vm/classes.c
    ! fixed memory leak when CLASSSEL() message was sent to non object
      item
2006-06-20 15:41:53 +00:00
Przemyslaw Czerpak
ee780cf997 2006-06-20 14:50 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
    ! fixed typo in function name should be hb_objHasMessage()
2006-06-20 12:51:16 +00:00
Przemyslaw Czerpak
96229354ab 2006-06-20 13:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapicls.h
  * harbour/source/vm/classes.c
    + added hb_objHasMesage( PHB_ITEM pObject, PHB_DYNS pMessage )
    + added hb_objGetpMethod() for backward binary compatibility with FWH
    * hidden for 3-rd party users hb_objGetMethod() and hb_objPopSuperCast()
      If for some reason 3-rd party code will need these methods please
      tell me in which case and I'll add necessary functions. Please
      try to not use any non-public function. I strongly prefer to
      add new public functions for which we will know that they are used
      by 3-rd party code then create problems with binary compatibility
      after updating local HVM functions.
2006-06-20 11:36:43 +00:00
Przemyslaw Czerpak
5f67da8896 2006-06-19 23:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/Makefile
    + added hbapicls.h

  * harbour/include/hbapi.h
  * harbour/source/vm/garbage.c
    * added some testing macros

  * harbour/include/hbmath.h
    * HB_MATH_ERRNO enabled for MINGW build. Seems that MinGW doesn't
      activate math error handler and only sets errno

  * harbour/include/hbtypes.h
  * harbour/source/vm/maindllp.c
    ! fixed VM_PROCESS_SYMBOLS_EX definition
    * cleaned a little bit code to not return uninitialized values
      when original function cannot be detected

  * harbour/source/compiler/genc.c
    * minor modifications

  * harbour/source/rtl/math.c
    ! fixed possible memory leak
    * indenting

  * harbour/source/vm/classes.c
    ! fixed possible GPF in __GETMSGPRF
    * use only one function for method name hashing

  * harbour/source/vm/hvm.c
    * minor fix
2006-06-19 21:11:59 +00:00
Przemyslaw Czerpak
81e26ae43b 2006-06-16 01:30 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/hbapi.h
  * harbour/source/vm/arrays.c
    * added hb_arraySelfParams()

  * harbour/include/hbapierr.h
  * harbour/source/rtl/errorapi.c
    + added HB_ERR_ARGS_SELFPARAMS for automatic setting as argument list
      array with self item and passed parameters

  * harbour/source/rtl/copyfile.c
  * harbour/source/rtl/str.c
  * harbour/source/rtl/strtran.c
  * harbour/source/rtl/strzero.c
  * harbour/source/rtl/substr.c
  * harbour/source/vm/arrayshb.c
  * harbour/source/vm/classes.c
  * harbour/source/vm/evalhb.c
  * harbour/source/vm/memvars.c
  * harbour/source/vm/runner.c
    * use HB_ERR_ARGS_BASEPARAMS in generated RT messages

  * harbour/source/rtl/fstemp.c
    * formatting

  * harbour/source/vm/hvm.c
    ! added some missing operator overloading
    ! fixed some error messages to be Clipper compatible
    ! fixed FOR loop for nonnumerical value and STEP, f.e.:
         FOR d := date() TO date() + 10 step 2
            ? d
         NEXT
    * added disabled code to support reverted FOR condition
      like in Clipper. See below.

  * harbour/source/compiler/harbour.y
    * added disabled code to generate reverted FOR condition
      like in Clipper. I cannot uncomment it because it will break
      backward binary compatibility so I'll do that when some modification
      will force PCODE version updating.
      Enabling this code clean the following errors reported by hbtest:
         ! 2907 MAIN_MISC(200)  TFORNEXT( NIL, NIL, NIL )
                Result: "E BASE 1074 Argument error <= A:2:U:NIL;U:NIL F:S"
              Expected: "E BASE 1075 Argument error > A:2:U:NIL;U:NIL F:S"
         ! 2919 MAIN_MISC(212)  TFORNEXT( NIL, NIL, NIL )
                Result: "E BASE 1074 Argument error <= A:2:U:NIL;U:NIL F:S"
              Expected: "E BASE 1075 Argument error > A:2:U:NIL;U:NIL F:S"
2006-06-15 23:48:56 +00:00
Przemyslaw Czerpak
3f605c0795 2006-06-15 18:10 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/source/rdd/usrrdd/usrrdd.c
    + added functions to set WorkArea flags USRRDD_SETBOF, USRRDD_SETEOF,
      USRRDD_SETFOUND, USRRDD_SETTOP, USRRDD_SETBOTTOM

  * harbour/include/hbapierr.h
    + added HB_ERR_ARGS_BASEPARAMS

  * harbour/source/rtl/errorapi.c
    ! check if ARGS passed to __ERRRT_BASE() and __ERRRT_SBASE() are
      valid to avoid possible GPF
    * replaced old hack with passing ARGS in array for some chosen errors
      by HB_ERR_ARGS_BASEPARAMS in hb_errRT_BASE and hb_errRT_BASE_SubstR
      - it was impossible to generate Clipper compatible error message

  * harbour/source/rtl/do.c
    * use HB_ERR_ARGS_BASEPARAMS

  * harbour/source/rtl/tobject.prg
    * assign SELF to ARGS of error object when EG_NO[VAR]METHOD RT error
      is generated - Clipper compatible.

  * harbour/source/vm/classes.c
    * added __msgNoMethod which is returned to hb_vmSend when object does
      not support requested message. This handler can display previous
      Harbour error message though now it's disabled and Clipper compatible
      error message is generated. I leave the decision to Harbour users
      which version of error message should be used.
    * changed __msgClsSel to return variable size array with only valid items
      If some code needs fixed size array then it will have to be updated

  * harbour/source/vm/hvm.c
    * generate Clipper compatible error messages for EG_NO[VAR]METHOD
      and EG_NOFUNC. Please do not change it. If you want previous Harbour
      error messages for EG_NO[VAR]METHOD then please change __msgNoMethod
      in classy.c

  * harbour/source/vm/arrays.c
    * minor modification
2006-06-15 16:11:27 +00:00