Commit Graph

11 Commits

Author SHA1 Message Date
Przemyslaw Czerpak
35fbd4f189 2012-01-02 21:38 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/include/hbapistr.h
  * harbour/src/vm/strapi.c
    + added new C functions:
         const char * hb_parastr( int iParam, HB_SIZE nIndex,
                                  void * cdp,
                                  void ** phString, HB_SIZE * pnLen );
         const char * hb_parastr_utf8( int iParam, HB_SIZE nIndex,
                                       void ** phString, HB_SIZE * pnLen );
         const HB_WCHAR * hb_parastr_u16( int iParam, HB_SIZE nIndex,
                                          int iEndian,
                                          void ** phString, HB_SIZE * pnLen );

  * harbour/include/hbwinuni.h
    + added new C macros for windows builds:
         HB_PARASTR( nItem, nIndex, phStr, pnLen )
         HB_PARASTRDEF( nItem, nIndex, phStr, pnLen )

  * harbour/src/vm/hashes.c
    + added optional code for deleting items from hash arrays with
      strict order. This code can be enabled by Harbour compile time
      macro: HB_FAST_HASH_DEL.
      I added it for testing only.
2012-01-02 20:38:17 +00:00
Przemyslaw Czerpak
2cd688f7a6 2011-12-29 23:51 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* harbour/include/hbapistr.h
  * harbour/src/vm/strapi.c
    + added new C functions:
         hb_wstrncpy(), hb_wstrncat()

  * harbour/src/common/hbstr.c
    ; minor updated in comment

  * harbour/include/hbwinuni.h
    + added new macros:
         HB_STRLEN(), HB_STRNLEN(), HB_STRDUP(), HB_STRNDUP(),
         HB_STRNCPY(), HB_STRNCAT(), HB_STRCMP(), HB_STRNCMP()

  * harbour/src/rtl/disksphb.c
  * harbour/src/rtl/gtwvt/gtwvt.h
  * harbour/src/rtl/gtwvt/gtwvt.c
    * eliminated HB_TCHAR_*() macros
2011-12-29 22:51:29 +00:00
Viktor Szakats
db1fbb5aed 2010-07-06 21:00 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* utils/hbrun/hbrun.prg
    ! Don't search passed program in PATH and hbrun dir, if
      program name has path component.

  * contrib/xhb/xhbenum.c
  * contrib/xhb/xhbqself.c
  * contrib/xhb/xhbwith.c
  * contrib/xhb/xhberrc.c
    ! Fixed msvc64 warnings after HB_SIZE extension in stack API.

  * contrib/make.hbs
    + Added logic to protect against case when 'clean install'
      is used but hbrun or hbmk2 isn't available when launching
      the make process. In this case 'clean' phase won't be executed
      for contribs, which is solved by forcing a -rebuild in
      'install' phase.

  * src/vm/strapi.c
  * src/vm/runner.c
  * src/vm/itemapi.c
  * src/vm/asort.c
  * src/vm/hvm.c
  * src/vm/arrays.c
  * src/vm/memvars.c
  * src/vm/set.c
  * src/vm/classes.c
  * src/rtl/lennum.c
  * src/rtl/strcase.c
  * src/rtl/replic.c
  * src/rtl/padr.c
  * src/rtl/padc.c
  * src/rtl/strtran.c
  * src/rtl/strtoexp.c
  * src/rtl/padl.c
  * src/rtl/saverest.c
  * src/rtl/right.c
  * src/rtl/philes.c
  * src/rtl/mlcfunc.c
  * src/rtl/left.c
  * src/rtl/xsavescr.c
  * src/rtl/setkey.c
  * src/rtl/stuff.c
  * src/rtl/trace.c
  * src/rtl/samples.c
  * src/rtl/inkeyapi.c
  * src/rtl/inkey.c
  * src/rtl/mtran.c
  * src/rtl/colorind.c
  * src/rtl/rat.c
  * include/hbapi.h
  * include/hbapistr.h
    * Renamed HB_SIZE variables to have 'n' prefix.
      (verified to generate the same objects as before)

  * src/rtl/philes.c
    * Changed hb_retnint()/hb_retni() to hb_retns().

  * contrib/hbgd/gdwrp.c
    * Formatting.
2010-07-06 19:02:19 +00:00
Viktor Szakats
2fa7ba29cf 2010-06-03 16:43 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* package/winuni/mpkg_win_uni.nsi
    * 2.0 -> 2.1

  * src/hbextern/hbextern.prg
  * src/pp/pplib.c
  * src/pp/ppcore.c
  * src/pp/pplib2.c
  * src/pp/hbpp.c
  * src/pp/pplib3.c
  * src/main/harbour.c
  * src/debug/dbgtwin.prg
  * src/debug/dbghelp.prg
  * src/debug/dbgtmenu.prg
  * src/debug/dbgtmitm.prg
  * src/debug/dbgtobj.prg
  * src/debug/dbgbrwsr.prg
  * src/debug/dbgmenu.prg
  * src/debug/dbgthsh.prg
  * src/debug/tbrwtext.prg
  * src/debug/dbgwa.prg
  * src/debug/debugger.prg
  * src/debug/dbgtarr.prg
  * src/debug/dbgtinp.prg
  * src/common/hbgete.c
  * src/common/hbffind.c
  * src/common/hbver.c
  * src/common/hbwin.c
  * src/common/hbtrace.c
  * src/common/funcid.c
  * src/common/hbfsapi.c
  * src/common/hbprintf.c
  * src/common/hbverdsp.c
  * src/common/hbwince.c
  * src/common/hbfopen.c
  * src/common/expropt1.c
  * src/common/hbstr.c
  * src/common/expropt2.c
  * src/common/hbdate.c
  * src/common/hbmem.c
  * src/common/strwild.c
  * src/common/hbhash.c
  * src/nortl/nortl.c
  * src/macro/macro.yyc
  * src/macro/macro.y
  * src/macro/macrolex.c
  * src/compiler/compi18n.c
  * src/compiler/hbmain.c
  * src/compiler/ppcomp.c
  * src/compiler/hbfix.c
  * src/compiler/cmdcheck.c
  * src/compiler/hbdbginf.c
  * src/compiler/hbpcode.c
  * src/compiler/genhrb.c
  * src/compiler/complex.c
  * src/compiler/hbdead.c
  * src/compiler/hbcomp.c
  * src/compiler/genobj32.c
  * src/compiler/genc.c
  * src/compiler/hbopt.c
  * src/compiler/hbident.c
  * src/compiler/hbusage.c
  * src/compiler/gencc.c
  * src/compiler/hbcmplib.c
  * src/compiler/hblbl.c
  * src/compiler/harbour.yyc
  * src/compiler/hbstripl.c
  * src/compiler/harbour.y
  * src/compiler/hbfunchk.c
  * src/compiler/hbgenerr.c
  * include/hbpp.h
  * include/set.ch
  * include/achoice.ch
  * include/hbrdddbf.h
  * include/hbstdgen.ch
  * include/hbvmpub.h
  * include/hbgtinfo.ch
  * include/vm.api
  * include/hbpcode.h
  * include/hbset.h
  * include/hbver.h
  * include/hbtrace.h
  * include/extend.api
  * include/hbapicdp.h
  * include/hbrddnsx.h
  * include/button.ch
  * include/hbstack.h
  * include/item.api
  * include/inkey.ch
  * include/hbapilng.h
  * include/hbhrb.ch
  * include/tbrowse.ch
  * include/common.ch
  * include/rdd.api
  * include/gt.api
  * include/hbgtcore.h
  * include/dbinfo.ch
  * include/hbundoc.api
  * include/hbapifs.h
  * include/hbtask.h
  * include/hbsetup.ch
  * include/hbwince.h
  * include/hbvmopt.h
  * include/hb_io.h
  * include/hbthread.h
  * include/hbxvm.h
  * include/setcurs.ch
  * include/hbdefs.h
  * include/hbmsgreg.h
  * include/dbedit.ch
  * include/hblang.ch
  * include/filesys.api
  * include/hbdebug.ch
  * include/hbextcdp.ch
  * include/hbsetup.h
  * include/hbmacro.h
  * include/hbzlib.ch
  * include/hbinit.h
  * include/hbtypes.h
  * include/hbmacro.ch
  * include/hbusrrdd.ch
  * include/hbrddsdf.h
  * include/hbgtreg.h
  * include/hbwinuni.h
  * include/hbapi.h
  * include/simpleio.ch
  * include/hbmemory.ch
  * include/hbpers.ch
  * include/error.ch
  * include/hb.ch
  * include/hbapiitm.h
  * include/hbmath.h
  * include/hbmath.ch
  * include/memoedit.ch
  * include/hbvmint.h
  * include/hbver.ch
  * include/fileio.ch
  * include/rddsys.ch
  * include/hbrddntx.h
  * include/hbapicom.h
  * include/hbatomic.h
  * include/extend.h
  * include/hbznet.h
  * include/hbvm.h
  * include/std.ch
  * include/hbapidbg.h
  * include/hbmemvar.ch
  * include/hbcomp.h
  * include/hbapirdd.h
  * include/hbextlng.ch
  * include/color.ch
  * include/hbcompdf.h
  * include/hbclass.ch
  * include/hbsxdef.ch
  * include/hbmather.h
  * include/dbstruct.ch
  * include/hbsocket.ch
  * include/hbdyn.ch
  * include/hbrdddel.h
  * include/hbtrace.ch
  * include/error.api
  * include/hbapistr.h
  * include/hbwmain.c
  * include/hbexpra.c
  * include/hbexprop.h
  * include/hbiniseg.h
  * include/hbgfx.ch
  * include/hbsocket.h
  * include/hbchksum.h
  * include/hbdbf.h
  * include/hbbfish.h
  * include/hbdbsort.h
  * include/hbcdpreg.h
  * include/hbapigt.h
  * include/hbfloat.h
  * include/hbgfxdef.ch
  * include/hbsix.ch
  * include/hbextern.ch
  * include/hbapicls.h
  * include/hberrors.h
  * include/directry.ch
  * include/clipdefs.h
  * include/hboo.ch
  * include/box.ch
  * include/hbinkey.ch
  * include/hbapierr.h
  * include/hbhash.h
  * include/assert.ch
  * include/hbassert.h
  * include/getexit.ch
  * include/reserved.ch
  * include/hbregex.h
  * include/fm.api
  * include/hbthread.ch
  * include/hbexprb.c
  * include/ord.ch
  * include/hbdate.h
    * Deleted 'www.' from harbour-project.org website name.
      (www.harbour-project.org -> harbour-project.org)
2010-06-03 14:48:23 +00:00
Przemyslaw Czerpak
ee2d00f19a 2010-04-29 10:51 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/strapi.c
  * harbour/include/hbapistr.h
    + added new C function hb_wstrnlen()

  * harbour/include/hbdefs.h
  * harbour/src/common/hbwin.c
    ! fixed possible buffer overflows in hb_mb*() and hb_wc*() functions
    * removed danger hb_mb*() and hb_wc*() functions which were wrongly
      used in core code and corresponding HB_TCHAR_*() macros
    + added hb_mbntowccpy() function and HB_TCHAR_COPYTO() macro
      it always sets trailing 0 after passed buffer just like hb_strncpy()
    + added hb_wcntombcpy() function and HB_TCHAR_COPYFROM() macro
      it always sets trailing 0 after passed buffer just like hb_strncpy()

  * harbour/src/rtl/gtclip.c
    ! fixed wrongly calculated size of string extracted from clipboard
      (when unicode string was in clipboard then number of unicode characters
      were used instead of number of multibyte ones)
    ! added protection against possible memory corruption if some external
      process sets clipboard text without trailing 0
    * changed hb_gt_winapi_[sg]etClipboard() functions parameters to use
      PHB_ITEM as buffer
    Question to windows users: different Win GTs use different encoding
    for the clipboard buffer. Maybe you want to normalize it?

  * harbour/src/vm/cmdarg.c
  * harbour/src/vm/extrap.c
  * harbour/src/common/hbgete.c
  * harbour/src/common/hbffind.c
  * harbour/src/common/hbtrace.c
  * harbour/src/rtl/gtwin/gtwin.c
  * harbour/src/rtl/fstemp.c
  * harbour/src/rtl/filesys.c
  * harbour/src/rtl/gtgui/gtgui.c
  * harbour/src/rtl/gtwvt/gtwvt.c
  * harbour/include/hbgtcore.h
  * harbour/include/hbapistr.h
  * harbour/include/hbwmain.c
  * harbour/contrib/gtwvg/gtwvg.c
  * harbour/contrib/gtwvg/wvggui.c
  * harbour/contrib/gtwvg/wvgcuig.c
  * harbour/contrib/gtwvg/wvgutils.c
  * harbour/contrib/gtwvg/wvgcore.c
  * harbour/contrib/gtwvg/wvgwing.c
  * harbour/examples/gtwvw/gtwvw.c
    ! fixed possible buffer overflows and GPF traps due to wrongly used
      HB_TCHAR_*() macros and/or corresponding hb_mb*()/hb_wc*() functions
      Seems that some problems were potentially exploited even in non UNICODE
      builds.
2010-04-29 08:51:41 +00:00
Viktor Szakats
003fd7c41e 2010-01-14 18:01 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/rtl/strclear.c
    + HB_STRCLEAR() return value will now precisely inform about
      successful clear operation. Thanks to Mindaugas.

  * src/vm/hashfunc.c
  * src/vm/macro.c
  * src/vm/strapi.c
  * src/vm/runner.c
  * src/vm/estack.c
  * src/vm/codebloc.c
  * src/vm/hashes.c
  * src/vm/maindll.c
  * src/vm/dynsym.c
  * src/vm/debug.c
  * src/vm/itemapi.c
  * src/vm/garbage.c
  * src/vm/asort.c
  * src/vm/hvm.c
  * src/vm/cmdarg.c
  * src/vm/mainstd.c
  * src/vm/maindllp.c
  * src/vm/arrays.c
  * src/vm/task.c
  * src/vm/fm.c
  * src/vm/proc.c
  * src/vm/thread.c
  * src/vm/memvars.c
  * src/vm/arrayshb.c
  * src/vm/eval.c
  * src/vm/extend.c
  * src/vm/dynlibhb.c
  * src/vm/set.c
  * src/vm/classes.c
  * src/debug/dbgentry.c
  * src/common/hbgete.c
  * src/common/hbffind.c
  * src/common/hbver.c
  * src/common/hbprintf.c
  * src/common/hbfsapi.c
  * src/common/hbstr.c
  * src/common/expropt1.c
  * src/common/expropt2.c
  * src/common/hbdate.c
  * src/common/strwild.c
  * src/common/hbhash.c
  * src/rtl/gtdos/gtdos.c
  * src/rtl/fscopy.c
  * src/rtl/run.c
  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtxwc/gtxwc.h
  * src/rtl/gtxwc/gtxwc.c
  * src/rtl/math.c
  * src/rtl/empty.c
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/trim.c
  * src/rtl/filehb.c
  * src/rtl/hbtoken.c
  * src/rtl/fstemp.c
  * src/rtl/gtchrmap.c
  * src/rtl/strmatch.c
  * src/rtl/gtstd/gtstd.c
  * src/rtl/gttrm/gttrm.c
  * src/rtl/padr.c
  * src/rtl/hbstrfmt.c
  * src/rtl/transfrm.c
  * src/rtl/fserr.c
  * src/rtl/minmax.c
  * src/rtl/hbfeof.c
  * src/rtl/dates.c
  * src/rtl/padc.c
  * src/rtl/gtcgi/gtcgi.c
  * src/rtl/errapi.c
  * src/rtl/version.c
  * src/rtl/hbregexc.c
  * src/rtl/hbrandom.c
  * src/rtl/strtran.c
  * src/rtl/hbprocfn.c
  * src/rtl/hbsocket.c
  * src/rtl/hbinet.c
  * src/rtl/copyfile.c
  * src/rtl/errintlo.c
  * src/rtl/gtapi.c
  * src/rtl/filesys.c
  * src/rtl/padl.c
  * src/rtl/hbregex.c
  * src/rtl/hbbit.c
  * src/rtl/isprint.c
  * src/rtl/saverest.c
  * src/rtl/diskspac.c
  * src/rtl/console.c
  * src/rtl/spfiles.c
  * src/rtl/gtos2/gtos2.c
  * src/rtl/philes.c
  * src/rtl/hbbffnc.c
  * src/rtl/hbgtcore.c
  * src/rtl/cdpapi.c
  * src/rtl/dirdrive.c
  * src/rtl/hbi18n1.c
  * src/rtl/gtclip.c
  * src/rtl/mlcfunc.c
  * src/rtl/gtapiu.c
  * src/rtl/accept.c
  * src/rtl/idle.c
  * src/rtl/itemseri.c
  * src/rtl/hbrunfun.c
  * src/rtl/setcolor.c
  * src/rtl/setkey.c
  * src/rtl/gtsln/mousesln.c
  * src/rtl/gtsln/gtsln.c
  * src/rtl/gtsln/kbsln.c
  * src/rtl/gtsln/gtsln.h
  * src/rtl/disksphb.c
  * src/rtl/strc.c
  * src/rtl/gtpca/gtpca.c
  * src/rtl/gtgui/gtgui.c
  * src/rtl/hbhex.c
  * src/rtl/trace.c
  * src/rtl/gt_tpl/gt_tpl.c
  * src/rtl/inkeyapi.c
  * src/rtl/filebuf.c
  * src/rtl/gete.c
  * src/rtl/setcurs.c
  * src/rtl/hbproces.c
  * src/rtl/langapi.c
  * src/rtl/gtwvt/gtwvt.h
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/mouse53.c
  * src/rtl/fssize.c
  * src/rtl/hbbyte.c
  * src/rtl/mouseapi.c
  * src/rtl/memofile.c
  * src/rtl/valtostr.c
  * src/rtl/file.c
  * src/rtl/val.c
  * src/rtl/rat.c
  * src/rdd/hbsix/sxcompr.c
  * include/hbvmpub.h
  * include/hbset.h
  * include/hbapicdp.h
  * include/hbstack.h
  * include/hbapilng.h
  * include/hbgtcore.h
  * include/hbapifs.h
  * include/hbthread.h
  * include/hbxvm.h
  * include/hbmacro.h
  * include/hbtypes.h
  * include/hbapi.h
  * include/hbapiitm.h
  * include/hbznet.h
  * include/hbvm.h
  * include/hbapidbg.h
  * include/hbcomp.h
  * include/hbsxfunc.h
  * include/hbcompdf.h
  * include/hbmather.h
  * include/hbapistr.h
  * include/hbwmain.c
  * include/hbexpra.c
  * include/hbexprop.h
  * include/hbsocket.h
  * include/hbapigt.h
  * include/hbapicls.h
  * include/hbhash.h
  * include/hbregex.h
  * include/hbexprb.c
  * include/hbdate.h
  * contrib/gtalleg/gtalleg.c
  * contrib/xhb/hboutdbg.c
  * contrib/xhb/hbserv.h
  * contrib/xhb/bkgtsks.c
  * contrib/xhb/dbf2txt.c
  * contrib/xhb/xhbis.c
  * contrib/xhb/fparse.c
  * contrib/xhb/xhb.h
  * contrib/xhb/xhbsave.c
  * contrib/xhb/xhbmsgs.c
  * contrib/xhb/freadlin.c
  * contrib/xhb/txtline.c
  * contrib/xhb/dbgfxc.c
  * contrib/xhb/xhberrc.c
  * contrib/xhb/filestat.c
  * contrib/xhb/xhbcopyf.c
  * contrib/xhb/hbnxs.h
  * contrib/xhb/hbserv.c
  * contrib/xhb/cstructc.c
  * contrib/xhb/xhbfunc.c
  * contrib/hbmzip/hbmzip.c
  * contrib/gtqtc/gtqtc.cpp
  * contrib/gtwvg/gtwvg.c
  * contrib/gtwvg/gtwvg.h
  * contrib/gtwvg/wvggui.c
  * contrib/gtwvg/wvgcuig.c
  * contrib/gtwvg/wvggui.h
  * contrib/gtwvg/wvgwin.c
  * contrib/gtwvg/wvgutils.c
  * contrib/gtwvg/wvgcore.c
  * contrib/gtwvg/wvgwing.c
  * contrib/hbmisc/hb_f.c
  * contrib/hbmisc/dates2.c
  * contrib/hbwin/hbwapi.h
  * contrib/hbbtree/tests/ctest.c
    * BOOL  -> HB_BOOL
    * TRUE  -> HB_TRUE
    * FALSE -> HB_FALSE
    ; If possible please try to verify me, at least your own are of interest
      or expertise. Look for HB_BOOL/HB_TRUE/HB_FALSE usage in WINAPI calls,
      if you see such thing, it's wrong. Also some, HB_BOOL WINAPI BOOL
      implicit conversions may need to be cleaned.
    ; I didn't touch PP, RDD, SDD and compiler parts yet.
    ; In few places it's possible that some in-line comments are disaligned
      after this operation.
2010-01-14 17:59:30 +00:00
Viktor Szakats
c5847e7452 2010-01-14 12:25 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* src/vm/hashfunc.c
  * src/vm/macro.c
  * src/vm/strapi.c
  * src/vm/codebloc.c
  * src/vm/hashes.c
  * src/vm/debug.c
  * src/vm/itemapi.c
  * src/vm/asort.c
  * src/vm/hvm.c
  * src/vm/cmdarg.c
  * src/vm/maindllp.c
  * src/vm/arrays.c
  * src/vm/memvars.c
  * src/vm/arrayshb.c
  * src/vm/extend.c
  * src/vm/set.c
  * src/rtl/strtran.c
  * include/hbxvm.h
  * include/hbtypes.h
  * include/hbapi.h
  * include/hbapistr.h
    * ULONG -> HB_SIZE
2010-01-14 11:28:27 +00:00
Przemyslaw Czerpak
51a5487cb8 2009-12-12 01:42 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/strapi.c
  * harbour/include/hbapistr.h
    + added new functions:
         hb_itemPutStr(), hb_itemPutStrUTF8(), hb_itemPutStrU16(),
         hb_arrayGetStr(), hb_arrayGetStrUTF8(), hb_arrayGetStrU16(),
         hb_arraySetStrLen(), hb_arraySetStrLenUTF8(), hb_arraySetStrLenU16(),
         hb_arraySetStr(), hb_arraySetStrUTF8(), hb_arraySetStrU16(),

  * harbour/include/hbwinuni.h
    * removed unnecessary and danger casting in UNICODE version of
      HB_RETSTR(), HB_RETSTRLEN(), HB_STORSTR() and HB_STORSTRLEN() macros
    * modify HB_ARRAYSETSTR() and HB_ARRAYSETSTRLEN() macros to use new
      STR API functions

  * harbour/external/Makefile
    * modified the order of compiled libraries for better performance in
      parallel compilation (-j<N>)
2009-12-12 00:43:01 +00:00
Przemyslaw Czerpak
cb65540d4e 2009-12-11 20:42 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/strapi.c
  * harbour/include/hbapistr.h
    + added new functions to operate on Harbour wide character strings:
         ULONG hb_wstrlen( const HB_WCHAR * szText );
         HB_WCHAR * hb_wstrdup( const HB_WCHAR * szText );
         HB_WCHAR * hb_wstrndup( const HB_WCHAR * szText, ULONG ulLen );
         int hb_wstrcmp( const HB_WCHAR * s1, const HB_WCHAR * s2 );
         int hb_wstrncmp( const HB_WCHAR * s1,
                          const HB_WCHAR * s2, ULONG count );
    + added new functions to convert NULL pointers to empty strings:
         const char * hb_strnull( const char * str );
         const HB_WCHAR * hb_wstrnull( const HB_WCHAR * str );
    + added new functions to convert string buffer returned by Harbour
      string functions to writable state:
         char * hb_strunshare( void ** phStr,
                               const char * pStr, ULONG ulLen );
         HB_WCHAR * hb_wstrunshare( void ** phStr,
                                    const HB_WCHAR * pStr, ULONG ulLen );
  * harbour/include/hbwinuni.h
    ! fixed HB_PARSTRDEF() to return empty string instead of NULL
    ! fixed HB_ARRAYSETSTR() to accept NULL as string parameter
2009-12-11 19:42:40 +00:00
Przemyslaw Czerpak
b8b10faf91 2009-11-28 00:26 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/src/vm/strapi.c
  * harbour/include/hbapistr.h
    * modified syntax for hb_itemGetStr*() and hb_parstr*() functions as
      suggested by Mindaugas. Now we have:
         const char * hb_itemGetStr( PHB_ITEM pItem, void * cdp,
                                     void ** phString, ULONG * pulLen );
         const char * hb_itemGetStrUTF8( PHB_ITEM pItem,
                                         void ** phString, ULONG * pulLen );
         const HB_WCHAR * hb_itemGetStrU16( PHB_ITEM pItem, int iEndian,
                                            void ** phString, ULONG * pulLen );
      and:
         const char * hb_parstr( int iParam, void * cdp,
                                 void ** phString, ULONG * pulLen );
         const char * hb_parstr_utf8( int iParam,
                                      void ** phString, ULONG * pulLen );
         const HB_WCHAR * hb_parstr_u16( int iParam, int iEndian,
                                         void ** phString, ULONG * pulLen );
2009-11-27 23:26:56 +00:00
Przemyslaw Czerpak
ee46919af2 2009-11-17 19:37 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/include/Makefile
  + harbour/include/hbapistr.h
  * harbour/src/vm/Makefile
  * harbour/src/vm/hvmall.c
  + harbour/src/vm/strapi.c
    + added new C functions to extract strings in different encoding:
         void * hb_itemGetStr( PHB_ITEM pItem, void * cdp,
                               const char ** pStrPtr, ULONG * pulLen );
         void * hb_itemGetStrUTF8( PHB_ITEM pItem,
                                   const char ** pStrPtr, ULONG * pulLen );
         void * hb_itemGetStrU16( PHB_ITEM pItem, int iEndian,
                                  const HB_WCHAR ** pStrPtr, ULONG * pulLen );
      extract from given item string in requested encoding and store pointer
      to this string and its size in characters in last two parameters.
      These functions return handler which is used to lock memory buffer
      with result or NULL if given item does not contain string. All not NULL
      handles returned by above functions have to be free by hb_strfree()
      function:
         void hb_strfree( void * hString );
      As long as they are not freed memory buffer set in pStrPtr is valid
      even if other code overwrote given item.
      The second parameter in hb_itemGetStr() can specify expected CP
      encoding, i.e.:
         hStr = hb_itemGetStr( pItem, hb_setGetOSCP(), &pszText, &ulLen );
         if( hStr )
         {
            ...
            hb_strfree( hStr );
         }
      extracts string in encoding set by Set( _SET_OSCODEPAGE, <cCPID> )
      The second parameter in hb_itemGetStrU16() define endian encoding
      and can be one of the following values:
         #define HB_CDP_ENDIAN_NATIVE        0
         #define HB_CDP_ENDIAN_LITTLE        1
         #define HB_CDP_ENDIAN_BIG           2
      defined in hbapicdp.h

    + added new C functions to copy part of strings to given buffers in
      different encoding:
         ULONG hb_itemCopyStr( PHB_ITEM pItem, void * cdp,
                               char * pStrBuffer, ULONG ulSize );
         ULONG hb_itemCopyStrUTF8( PHB_ITEM pItem,
                                   char * pStrBuffer, ULONG ulSize );
         ULONG hb_itemCopyStrU16( PHB_ITEM pItem, int iEndian,
                                  HB_WCHAR * pStrBuffer, ULONG ulSize );
      hb_itemCopyStr*() functions works in similar way to hb_itemGetStr*()
      ones but they copy the strings to given buffer and return the number
      of characters (not bytes) copied to the buffer.

    + added new C functions to store given strings in different encoding in
      HVM item:
         PHB_ITEM hb_itemPutStrLen( PHB_ITEM pItem, void * cdp,
                                    const char * pStr, ULONG ulLen );
         PHB_ITEM hb_itemPutStrLenUTF8( PHB_ITEM pItem,
                                        const char * pStr, ULONG ulLen );
         PHB_ITEM hb_itemPutStrLenU16( PHB_ITEM pItem, int iEndian,
                                       const HB_WCHAR * pStr, ULONG ulLen );
      These functions accepts strings in different encoding, made some
      conversions (if necessary and internal string representation in HVM is
      different) and then store them as HVM string items.

    + added few extended API functions to operate on strings in different
      encoding:
         void * hb_parstr( int iParam, void * cdp,
                           const char ** pStrPtr, ULONG * pulLen );
         void * hb_parstr_utf8( int iParam,
                                const char ** pStrPtr, ULONG * pulLen );
         void * hb_parstr_u16( int iParam, int iEndian,
                               const HB_WCHAR ** pStrPtr, ULONG * pulLen );

         void hb_retstr( void * cdp, const char * szText );
         void hb_retstr_utf8( const char * szText );
         void hb_retstr_u16( int iEndian, const HB_WCHAR * szText );

         void hb_retstrlen( void * cdp, const char * szText, ULONG ulLen );
         void hb_retstrlen_utf8( const char * szText, ULONG ulLen );
         void hb_retstrlen_u16( int iEndian,
                                const HB_WCHAR * szText, ULONG ulLen );

         int hb_storstr( void * cdp, const char * szText, int iParam );
         int hb_storstr_utf8( const char * szText, int iParam );
         int hb_storstr_u16( int iEndian,
                             const HB_WCHAR * szText, int iParam );

         int hb_storstrlen( void * cdp,
                            const char * szText, ULONG ulLen, int iParam );
         int hb_storstrlen_utf8( const char * szText, ULONG ulLen, int iParam );
         int hb_storstrlen_u16( int iEndian,
                                const HB_WCHAR * szText, ULONG ulLen, int iParam );

      They can be used instead of hb_parc*()/hb_retc*()/hb_storc*() ones and
      allow to easy create code which operates on strings in different
      encoding, i.e.:

            HB_FUNC( MY_STRTOUTF8 )
            {
               const char * str;
               ULONG len;
               void * h;
               h = hb_parstr_utf8( 1, &str, &len );
               if( h )
               {
                  hb_retclen( str, len );
                  hb_strfree( h );
               }
            }

    The above functions allows to create code which operates on different
    string encoding, i.e. UTF8, UCS2/UTF16, some CPs and such code is
    independent from internal HVM string representation so we can use
    internally Unicode or not and it will not effect existing code.
2009-11-17 18:38:12 +00:00