Commit Graph

220 Commits

Author SHA1 Message Date
Lailton Fernando Mariano
28a0b4c3da 2023-01-17 13:10 UTC-0300 Lailton Fernando Mariano (lailton/at/paysoft.com.br)
* include/hbsocket.h
  * src/harbour.def
  * src/rtl/hbsocket.c
  * src/rtl/hbsockhb.c
    + added functions: Harbour socket API
      HB_SOCKETSETNOSIGPIPE( hSocket, lValue ) --> lSuccess
2023-01-17 13:10:04 -03:00
Przemysław Czerpak
2975eadbba 2023-01-15 11:17 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbwin/win_prn1.c
    ! fixed parameter type in font enum callback

  * include/harbour.hbx
  * src/harbour.def
  * src/rtl/hbgtcore.c
    + added two new PRG functions:
         hb_gtExists( <cGtName> ) -> <lExists>
         hb_gtList() -> <aGtNames>

  * src/rtl/hbgtcore.c
    * changed the order of defualt GT initialization. Now GT specified by -gt*
      hbmk2 option has higher priority then GT chosen by
         request HB_GT_<name>_DEFAULT

  * include/hbapi.h
  * src/vm/set.c
    + added two C functions for OS codepage translations:
         char * hb_osStrEncode2( const char * pszName,
                                 char * pszBuffer, HB_SIZE nSize );
         HB_WCHAR * hb_osStrU16Encode2( const char * pszName,
                                        HB_WCHAR * pszBufferW, HB_SIZE nSize );

  * include/hbwinuni.h
    + added HB_CHARDUP2() macro for UNICODE/ANSI OS codepage translation

  * src/common/hbgete.c
    ! fixed memory allocation in MS-Windows version of hb_getenv_buffer()

  * src/pp/hbpp.c
    ! added integer range to HB_VER_REVID definition to pacify warning

  * src/rtl/cdpapi.c
    * minor simplification
2023-01-15 11:17:33 +01:00
Przemysław Czerpak
889ef46369 2022-11-25 18:14 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapi.h
  * src/vm/cmdarg.c
    ! changed returned type in hb_verSvnID() form int to HB_MAXINT

  * src/nortl/nortl.c
    ! fixed void* pointer incrementation
    ! pacified warnings

  * src/rdd/dbcmd.c
    * accept NIL value in hb_FieldPut() according to Aleksander recommendation
2022-11-25 18:14:56 +01:00
Przemysław Czerpak
580ee59412 2022-11-11 20:47 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapi.h
  * src/common/hbver.c
  * src/main/harbour.c
  * src/pp/hbpp.c
  * src/rtl/version.c
  * src/vm/cmdarg.c
    ! fixed integer overflow in revision number calculated from
      the last ChangeLog entry date
2022-11-11 20:47:55 +01:00
Przemysław Czerpak
2807eb7bb5 2022-10-17 20:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
  * src/harbour.def
  * src/rdd/dbcmd.c
    + added two new functions:
         hb_FieldGet( <cFieldName> | <nFieldPos> )
               -> <xFieldValue> | NIL
         hb_FieldPut( <cFieldName> | <nFieldPos>, <xFieldValue> )
               -> <xFieldValue> | NIL
      They works like FieldGet() and FieldPut() but allows to use field
      name instead of field index.
2022-10-17 20:11:27 +02:00
Przemysław Czerpak
a68eec838f 2022-10-17 19:17 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbvm.h
  * include/harbour.hbx
  * src/harbour.def
  * src/vm/hvm.c
    + added new C function:
         extern HB_EXPORT HB_BOOL hb_vmSetKeyPool( HB_BOOL fEnable );
      It allows to disable keyboard pooling by GT driver in main HVM loop.
      It's important in programs which mix GT terminal with GUI library
      which use common event loop. Many GUI objects are not reentrant
      safe and activating event loop during big changes may cause crash.
      Such things can happen in applications which try to mix HBQT
      and GTQTC. To avoid such problems before PRG code is called it's
      enough to disable keyboard pooling in main HVM loop, eg.
         if( hb_vmRequestReenter() )
         {
            HB_BOOL fKeyPool = hb_vmSetKeyPool( HB_FALSE );
            hb_vmPushEvalSym();
            hb_vmPush( pBlockItm );
            hb_vmSend( 0 );
            hb_vmSetKeyPool( fKeyPool );
            hb_vmRequestRestore();
         }
    + added new PRG function:
         __vmKeyPool( [<fEnable>] ) -> <fPrevState>
      It's PRG interface to above C function. If application uses GT driver
      and GUI library using the same event loop and such GUI library does not
      disable keyboard pooling in main HVM loop before PRG code is activated
      then it's enough to call this function at the beginning of application,
      eg.
         PROCEDURE INIT Clip()
            __vmKeyPool( .f. )
         RETURN
      With above peace of code you can mix HBQT or other QT wrapper with GTQTC.
2022-10-17 19:17:26 +02:00
Aleksander Czajczynski
908527cc87 2021-04-28 20:02 UTC+0200 Aleksander Czajczynski (hb fki.pl) [ci skip]
* include/hbgtinfo.ch
    ! fixed comment, Alt+Numpad HB_GTI_KBDALT workaround was disabled by
      default here:
      2015-11-02 17:13 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
2021-04-28 20:01:51 +02:00
Aleksander Czajczynski
3069cd38a2 2021-04-14 22:25 UTC+0200 Aleksander Czajczynski (hb fki.pl)
+ src/rtl/vfilehi.prg
  * src/rtl/Makefile
  * src/harbour.def
  * include/harbour.hbx
    + added FILE API counterparts to hb_DirBuild() and hb_FNameExists()
      hb_vfDirBuild( <cDir> ) -> <lSuccess>
      hb_vfDirUnbuild( <cDir> ) -> <lSuccess>
      hb_vfNameExists( <cName> ) -> <lExists>
    ; their implementations are imported from 3.4
      https://github.com/vszakats/hb/blob/master/src/rtl/hbfilehi.prg
      but were renamed to fit in the hb_vf* namespace

  * src/rtl/hbfilehi.prg
    * use hb_LeftEq() instead of Left() ==
    ; partial merge of 3.4
      2015-07-27 14:26 UTC+0200 Viktor Szakats
    ! fix several sloppy checks where Empty() were
      used on strings while in fact a zero length
      check would have been correct.
    ; Empty() is a "weasel-word" when used on strings,
      should be used carefully and sparingly.

  * ChangeLog.txt
    % avoid spaces before EOLs
2021-04-14 22:25:13 +02:00
Przemysław Czerpak
e2ebc916a9 2020-04-19 16:32 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbct/dattime2.c
    % minor optimization

  * src/rdd/dbsql.c
    ; added somment with syntax info

  * include/inkey.ch
  * src/rtl/hbgtcore.c
    + added support for mouse wheel left and right events to base GT code
2020-04-19 16:32:11 +02:00
Przemysław Czerpak
49a289a1a3 2020-03-24 23:34 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* config/linux/clang.mk
    ! fixed rule for dynamic library

  * src/3rd/png/Makefile
    + added -DPNG_ARM_NEON_OPT=0 to build flags

  * contrib/3rd/sqlite3/sqlite3.c
  * contrib/3rd/sqlite3/sqlite3.diff
    ! pacified warning

  * contrib/gtwvg/gtwvgd.c
  * contrib/gtwvg/wvgwing.c
    ! fixed missing break/return in case statements - please verify it.

  * contrib/hbct/dattime3.c
    * added #define _DEFAULT_SOURCE necessay in new Linux distors

  * contrib/hblzf/3rd/liblzf/liblzf.diff
  * contrib/hblzf/3rd/liblzf/lzfP.h
    * do not use nested #define in #if statements - some C compilers do not
      support it

  * contrib/hbssl/bio.c
    ! tuned #if condition

  * contrib/hbmisc/hbeditc.c
    * simpliefied for condition and pacified warning

  * contrib/hbodbc/hbodbc.hbp
  * contrib/sddodbc/sddodbc.hbp
    + added check for iodbc library

  * utils/hbmk2/hbmk2.prg
    + added support for clang in android builds

  * include/hbdefs.h
    + added check for __BYTE_ORDER__ macro used in some new lib C
      implementations

  * include/hbapi.h
  * include/hbdefs.h
  * include/hbstack.h
  * include/hbvmpub.h
  * src/vm/classes.c
  * src/vm/dynsym.c
  * src/vm/estack.c
  * src/vm/memvars.c
    + extended the size of dynamic symbol table from 65535 to 4294967295.
      Adopting class code I decided to keep current algorithm of method indexes
      hashing with only some minor modifications. It's very fast anyhow it may
      cause noticeable (though static) quite big memory allocation for class
      definitions in applications using millions of symbols and which increase
      dynamic symbol table at runtime loading new classes dynamically form .hrb,
      .dll, .so or other dynamic libraries supported by Harbour. It's random
      and rather impossible to exploit situation in real life anyhow I cannot
      exclude it so I'd like to report it in ChangeLog. The solution is very
      simple, i.e. it's enough to use classic divide et impera algorithm using
      symbol numbers to find method definition anyhow it will be slower then
      current one and address only very seldom hypothetical situations so I
      decided to not implement it. Such static memory cost begins to be
      completely unimportant in the world of 64-bit architectures and extremely
      big memory address space.
      The modification was sponsored by TRES company.

  * src/vm/estack.c
    ! fixed __mvClear() in MT builds - due to stupid typo GetList variable
      was removed in MT programs by CLEAR MEMORY command (__mvClear())
      So far noone reported it and I've found it analyzing the code before
      increasing symbol table size.

  * contrib/hbwin/hbolesrv.c
    * updated for new size of dynamic symbol table
2020-03-24 23:34:35 +01:00
Aleksander Czajczynski
167a03a778 2020-02-10 15:34 UTC+0100 Aleksander Czajczynski (hb fki.pl)
+ src/codepage/cpde858.c
  * src/codepage/Makefile
  * include/hbcpage.hbx
  * src/harbour.def
    + added codepage DE858, it is essentially DE850 but with EURO SIGN
      (U+20AC) at position 0xD5 instead of Turkish dotless-i (U+0131)
      Issue #201

  * src/vm/fm.c
    * OpenWatcom remaining pragmas related to 201 warning (unreachable code)
      assigned to C mode (wcc386) build only - issue #202
2020-02-10 15:33:49 +01:00
Aleksander Czajczynski
01f968c2d3 2020-02-03 13:13 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* include/hbcpage.hbx
  * src/harbour.def
    ! updated to make some dynamic linkers happy about (not that)
      recently added EE, LV languages
2020-02-03 13:13:59 +01:00
Pavel Tsarenko
77f161c8bc 2019-09-09 17:50 UTC+0200 Pavel Tsarenko (tpe2 at mail.ru)
* include/hblang.hbx
  * src/codepage/Makefile
  + src/codepage/cpee775.c
  + src/codepage/cpeewin.c
  + src/codepage/cplv775.c
  + src/codepage/cplvwin.c
  * src/lang/Makefile
  + src/lang/l_ee.c
  + src/lang/l_ee.h
  + src/lang/l_lv.c
  + src/lang/l_lv.h
    + added estonian and latvian lang and codepage modules
2019-09-09 17:52:11 +02:00
Przemysław Czerpak
33f5c0eef4 2019-04-11 17:23 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/dbinfo.ch
  * src/rdd/dbf1.c
    + added DB_SETHEADER_EOL flag, it's used to force setting EOL marker
      when header is written. In Harbour's DBF* RDDs is set in CLOSE()
      method so just like in Clipper when DBF is closed and header has to
      be updated the EOL() marker is set.
      As side effect reducing header updates to minimal level (in such
      case DBF header is not updated after APPEND what is safe for Harbour,
      Clipper and compatible RDDs because they use file size to calculate
      number of records but some other DBF drivers may be confused)
      increase the APPEND speed and also forces EOL setting in all cases
      when CLOSE() method is called. Header updates can be reduce to minimal
      level by:
         hb_rddInfo( RDDI_SETHEADER, DB_SETHEADER_MINIMAL )

  * src/rdd/usrrdd/usrrdd.c
    ! fixed GPF in UsrRDD redirector for DROP(), EXISTS() and RENAME() methods

  * src/vm/cmdarg.c
    * use HB_MEM_STATISTICS instead of HB_MEM_USEDMAX to check if memory
      statistic module is enabled in //info message
2019-04-11 17:23:41 +02:00
Przemysław Czerpak
d0be194907 2019-02-11 13:43 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* bin/commit.hb
    ! fixed UTC offset formatting

  * contrib/hbwin/win_os.prg
    * updated win_osNetRegOk() for modern MS-Windows versions:
      - on Win7 and upper set
        System\CurrentControlSet\Services\LanmanServer\Parameters\DisableLeasing
        to disable opportunistic locks.
      - do not force SMB1 to disable oplocks on Win7 and upper - new MS-Win10
        does not support SMB1 at all so this setting on the server with
        such system completely disables SMB network and forcing SMB1 on the
        client side blocks access to new Win10 servers.
        Warning! this setting is still activated on Vista so it cannot
                 connect work with new Win10 but I do not know any other
                 working method to disable oplocks in Windows Vista.
    * synced with Viktor's branch

  * contrib/xhb/hbserv.c
    ! added missing return

  * include/harbour.hbx
  * src/harbour.def
  * src/rtl/version.c
    + added new PRG functions:
         hb_osIsWin7(), hb_osIsWin8(), hb_osIsWin81(), hb_osIsWin10()

  * src/rtl/gttrm/gttrm.c
    + added autodetection for few other XTerm compatible terminals
    + respect color extension in TERM name of all XTerm compatible
      terminals

  * utils/hbmk2/hbmk2.prg
    + added support for -cpp=isoXX borowed from Viktor's branch

  * contrib/gtqtc/gtqtc.hbc
  * contrib/gtqtc/gtqtc.hbp
    * use -cpp=iso11 required for QT 5.7.0 or upper
    * extended QT detection and partial syncing with Viktor's branch
2019-02-11 13:43:40 +01:00
Przemysław Czerpak
611a7ac281 2018-11-16 16:33 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/bio.c
  * contrib/hbssl/err.c
  * contrib/hbssl/evp.c
  * contrib/hbssl/evpciph.c
  * contrib/hbssl/evpenc.c
  * contrib/hbssl/evpmd.c
  * contrib/hbssl/evppkey.c
  * contrib/hbssl/hbssl.ch
  * contrib/hbssl/hbssl.h
  * contrib/hbssl/hbssl.hbx
  * contrib/hbssl/pem.c
  * contrib/hbssl/rand.c
  * contrib/hbssl/ssl.c
  * contrib/hbssl/ssl_hb.c
  * contrib/hbssl/ssl_inet.c
  * contrib/hbssl/ssl_sock.c
  * contrib/hbssl/sslciph.c
  * contrib/hbssl/sslctx.c
  * contrib/hbssl/sslsess.c
  * contrib/hbssl/x509.c
    * synced with Viktor's 3.4 branch and updated to OpenSSL 1.1

  * include/hbsocket.h
  * src/rtl/hbsocket.c
    + added new C function:
         HB_U16 hb_socketNToHS( HB_U16 netshort )

  * include/hbapiitm.h
  * src/vm/itemapi.c
    + added new C functions:
         const char * hb_itemGetCRef( PHB_ITEM pItem, void ** phRef,
                                      HB_SIZE * pnLen );
         void hb_itemFreeCRef( void * hRef );
      hb_itemGetCRef() locks string inside character item so it cannot be
      released when item is cleared an hb_itemFreeCRef() unlocks it and
      free if item holding it was cleared.
2018-11-16 16:33:28 +01:00
Przemysław Czerpak
8230fcc258 2018-09-14 15:36 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
  * include/hbchksum.h
  * src/harbour.def
  * src/rtl/hbmd5.c
    + added new C function
         void hb_hmac_md5( const void * key, HB_SIZE nKeyLen,
                           const void * message, HB_SIZE nMsgLen,
                           char * digest );
    + added new PRG function
         HB_HMAC_MD5( <cMessage>, <cKey> ) -> <cMAC>
    ; HMAC MD5 is used in some authentication methods i.e. CRAM-MD5
      authentication in SMTP protocol

  * src/rtl/gttrm/gttrm.c
    + enable extended XTERM colors automatically when xterm-16color,
      xterm-256color, xterm+256color, xterm-88color, rxvt-16color,
      rxvt-256color, rxvt-98color or putty terminal is detected
    + added support for HB_GTI_SCREENDEPTH

  * contrib/gtqtc/gtqtc1.cpp
    + set clipboard data also into selection buffer on platforms which
      support it
    + when main clipboard buffer is empty retrieve clipboard data from
      selection buffer and if it's empty too from find buffer

  * include/harbour.hbx
  * src/harbour.def
  * src/vm/memvars.c
    + added new PRG function
         __mvGetDef( <cMemvar> [, <xDefault> ] ) -> <xValue>
      it works in similar way to __mvGet() but if <cMemvar> does
      not exist then it returns <xDefault> or NIL instead of RTE

  * contrib/hbwin/hbwin.hbx
    + added missing declarations for win_osIs10() and win_osIs81()

  * contrib/hbssl/ssl.c
    ! fixed compilation with OpenSSL < 0.9.8k

  * contrib/sddodbc/core.c
    * pacified warning

  * contrib/xhb/hbxml.c
  * contrib/xhb/hbxml.h
    ! fixed CDATA terminator, it should be "]]>" instead of " ]]>"
    + added support for HBXML_STYLE_NONEWLINE flag

  * src/3rd/pcre/Makefile
    ! typo wince -> wce

  * src/main/Makefile
    * use harbour.rc only in MS-Windows builds - it fixes OS2 OpenWatcom
      builds

  * config/global.mk
    ! in DOS builds check if the 'uname' exists before running it

  * include/hbapigt.h
  * include/hbgtcore.h
  * src/rtl/hbgtcore.c
  * src/rtl/inkey.c
  * src/rtl/inkeyapi.c
  * contrib/xhb/xhbfunc.c
    + added 3-rd parameter to hb_inkeySetText() function. When this parameter
      is true then ';' is not translated to Chr( 13 ) but DOS and UNIX EOLs
      are translated to Chr( 13 )
    + added logical parameter to HB_GTI_CLIPBOARDPASTE which allows to set
      text without ';' translation but with platform independent EOLs

  * src/rtl/memoedit.prg
  * utils/hbmk2/hbmk2.prg
  * contrib/hbnetio/utils/hbnetio/_console.prg
  * extras/dbu/dbu52.patch
  * extras/dbu/dbu53.patch
    * use hb_gtInfo( HB_GTI_CLIPBOARDPASTE, .T. ) instead of
      hb_gtInfo( HB_GTI_CLIPBOARDPASTE ) for pasting data from clipboard
      with platform independent EOLs and ';' characters
2018-09-14 15:36:21 +02:00
Aleksander Czajczynski
de1d478d2c 2018-09-02 23:07 UTC+0200 Aleksander Czajczynski (hb fki.pl)
* include/hbsetup.h
    * changed to recognize ARM64 platform with modern GCC builds
2018-09-02 23:09:29 +02:00
Phil Krylov
19c4c58b3d 2018-03-16 19:10 UTC+0200 Phil Krylov (phil a t newstar.rinet.ru)
* include/hbexprb.c
  * src/compiler/complex.c
  * src/vm/memvars.c
  * src/vm/strapi.c
    ! fixed compiler warnings emitted by GCC 7+
2018-03-16 21:11:59 +03:00
Aleksander Czajczynski
8545d4b8b6 2018-02-11 23:40 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* include/hbapi.h
  * src/common/hbver.c
  * src/harbour.def
  * contrib/hbwin/win_osc.c
    * synced Windows version detection code with Viktor's work in 3.4

  * src/main/Makefile
  + src/main/harbour.rc
    * include Windows manifest in standalone compiler - "harbour.exe /build"
      should now correctly report Windows 10. "yourapp.exe //build" plus
      in-app results still depend on manual manifest inclusion within .rc
2018-02-11 23:40:11 +01:00
Przemysław Czerpak
12880a1b7f 2018-01-05 14:12 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapiitm.h
  * src/rtl/hbdef.c
  * src/vm/itemapi.c
  * src/harbour.def
    + added new public C function
         HB_BOOL hb_itemTypeCmp( PHB_ITEM pItem1, PHB_ITEM pItem2 );
      which uses low level item type comparison code taken from hb_default()
      and hb_defaultValue() PRG functions

  * include/harbour.hbx
  * src/harbour.def
  * src/vm/hashfunc.c
    + added new PRG function
         hb_HSetDef( <hVal>, <xKey> [, <xDefVal> ] )
      it checks if <xKey> exists and if not then adds it to hash array
      and optionally sets key value to <xDefVal> otherwise (the key
      exists in hash array) and <xDefVal> is given then it checks if
      the type of key's value is compatible with <xDefVal> and if not
      then replaces key's value with <xDefVal>.
      In other words it's combination of hb_HGetDef() and hb_default()
      and works like this PRG code:
            FUNCTION hb_HSetDef( hVal, xKey, xDefVal )
               IF xKey $ hVal
                  hb_default( @hVal[ xKey ], xDefVal )
               ELSE
                  hVal[ xKey ] := xDefVal
               ENDIF
            RETURN hVal
      but much faster.

  * src/rtl/dirscan.prg
    * remove READONLY attribute from deleted directories.
      Be careful. Now this function allows to recursively remove
      all directories even if they have READONLY attribute.
2018-01-05 14:12:06 +01:00
Przemysław Czerpak
b872d7b62c 2017-12-19 21:42 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* config/darwin/clang.mk
  * config/darwin/gcc.mk
  * config/darwin/global.mk
  * config/darwin/icc.mk
  * config/darwin/libs.mk
  * utils/hbmk2/hbmk2.prg
    * synced with Viktor's modifications in 3.4 branch:
    ; 2017-11-11 13:14 UTC Viktor Szakats:
    * switch to call the C compiler to link dynamic libs on darwin,
      which is the recommended way to do this, as suggested by Apple.
      This also aligns the platform better with other *nix platforms.
      'libtool' was used before, but that started having intermittent
      issues around Sierra (mitigated by disabling parallel build),
      which returned and got worse in High Sierra (with no remedy).
      The symptom was 'ld: file not found: ' errors with the filename
      not shown or appearing as garbage, then a 'libtool: internal link
      edit command failed'. This was reported and will be fixed in a
      future Xcode release.
      Ref: Apple Radar 34944562

  * config/global.mk
  * config/rules.mk
    + added new user build envvar HB_USER_DCFLAGS
      It allows to set C compiler parameters to compile .c code for
      dynamic libraries.

  * src/rtl/hbsocket.c
    ! fixed fcntl(F_SETFL) 3-rd parameter in hb_socketSetBlockingIO(),
      By mistake I used long instead of int. it created problem on big
      endian 64 bit machines.

  * include/hbgtcore.h
  * src/rtl/hbgtcore.c
    + added new C functions for GT programmers:
         void hb_gt_BaseUnlock( PHB_GT pGT );
         void hb_gt_BaseLock( PHB_GT pGT );
         void hb_gtSleep( PHB_GT pGT, double dSeconds );

  * src/rtl/hbgtcore.c
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/gtdos/gtdos.c
  * src/rtl/gtgui/gtgui.c
  * src/rtl/gtos2/gtos2.c
  * src/rtl/gtpca/gtpca.c
  * src/rtl/gtsln/gtsln.c
  * src/rtl/gtstd/gtstd.c
  * src/rtl/gttrm/gttrm.c
  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/gtxwc/gtxwc.c
    * use new functions to unblock GT when low level TONE() code is
      executed. It allows other threads to access shared GT driver
      when one of them executes TONE()

  * contrib/hbexpat/hbexpat.hbx
    * regenerated automatically
2017-12-19 21:42:15 +01:00
Aleksander Czajczynski
6e3fe511f0 2017-12-14 14:20 UTC+0100 Aleksander Czajczynski (hb fki.pl)
* contrib/hbamf/amfenc.c
    * update amf3_Encode() serialize function with great idea of Przemek
      implemented recenly in hb_Serialize(). Checking garbage collector
      reference count can save time here too, unique arrays and hashes won't
      be indexed as references.

  * contrib/hbexpat/3rd/expat/*
    ! updated to 2.2.5 (from 2.2.1) using 3rdpatch.hb, expat.diff from
      Viktor's 3.4 fork was used - but (again) adapted for DOS 8.3 naming
      scheme. Also i've kept local patches for WinCE, OpenWatcom DOS/OS2,
      please test. Compilation in CPP mode is explicitly disabled for libexpat
      now, as upstream decided to ignore such use cases completly.

   * contrib/hbexpat/*
     * synced with Viktor's 3.4 fork

   + include/hbarc4.h
   * src/harbour.def
     + export ARC4 core routines like in 3.4 fork, updated expat lib reuses it.

   * contrib/hbtip/hbtip.hbp
     ! adapt *.hbx file specifier to hbmk2 3.2 syntax
2017-12-14 14:21:03 +01:00
Przemysław Czerpak
2b4c4b3b5f 2017-12-12 12:26 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbnf/fttext.c
  * contrib/hbnf/hbnf.hbx
    * synced with Viktor's modifications:
         - use FILE API instead of FS API
         - protection against GPF when FT area has no valid file handle
         - alternative function names which exceeds 10 character Cl*pper limit
    ! fixed handle and memory leak when new file is open in FT area which
      already has open file

  * include/harbour.hbx
  * src/harbour.def
  * src/vm/hvm.c
    + added new PRG function: __vmItemRefs( <xVal> ) -> <nRefs>
      Please remember that passed <xVal> parameter increases the counter so
      if you want to eliminate it then pass it by reference, i,e.:
         aVal := {}
         ? __vmItemRefs( aVal ), __vmItemRefs( @aVal )

  * include/hbapi.h
  * src/harbour.def
  * src/vm/arrays.c
  * src/vm/codebloc.c
  * src/vm/hashes.c
    + added new C functions:
         HB_COUNTER hb_arrayRefs( PHB_ITEM pArray );
         HB_COUNTER hb_hashRefs( PHB_ITEM pHash );
         HB_COUNTER hb_codeblockRefs( PHB_ITEM pItem );

  * src/rtl/itemseri.c
    * added new internal function to replace 3 times repeated code for
      resizing array of references.
    % use new functions to check number of references to hashes, arrays and
      objects to ignore in system detecting multiple references the items
      which have reference counter smaller then 2. Such items cannot have
      multiple references.
      In practice this modification resolves the time problem when very big
      items are serialized to the level comparable to HB_SERIALIZE_IGNOREREF
      so now this flag is useless though I'll keep it because only in such
      mode serialization code can be used as filter in streams.
      I also created binary tree to store references but after this
      modifications it is not necessary so I decided to not commit it yet.
      Please only remember that practice limit of such serialization code
      is created by physical memory attached by OS to the process. When this
      limit is exceed then swap is actively used what completely kill the
      performance. The CPU usage is reduced to less then 1% because it waits
      for restoring swapped memory pages by extremely heavy used disks. In
      such case I cannot help.
2017-12-12 12:26:24 +01:00
Przemysław Czerpak
bf91e4c243 2017-11-15 11:32 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbjson.h
  * src/rtl/hbjson.c
    * changed 3-rd parameter 'HB_BOOL fHuman' in hb_jsonEncode() and
      hb_jsonEncodeCP() C functions to 'int iIndent'
         char * hb_jsonEncode( PHB_ITEM pValue, HB_SIZE * pnLen,
                               int iIndent );
         char * hb_jsonEncodeCP( PHB_ITEM pValue, HB_SIZE * pnLen,
                                 int iIndent, PHB_CODEPAGE cdp );
      Positive iIndent value defines number of spaces used for indenting,
      0 disables indenting and  -1 means TAB ( ASCII:9 ) indenting.
      This modification is binary compatible though in C code using HB_TRUE
      as 3-rd parameter it changes indenting from 2 spaces to 1 so please
      update the code if it's significant.

    + added optional support for numeric value in 2-nd parameter of
      hb_jsonEncode() PRG function. Current syntax is:
         hb_jsonEncode( <xValue>, [ <lHuman> | <nIndent> ], [ <cDestCP> ] )
               -> <cJSONString>

  * contrib/rddads/ads1.c
    * minor simplification

  * include/hbapigt.h
    * formatting
2017-11-15 11:32:19 +01:00
Przemysław Czerpak
990feed254 2017-09-28 14:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/pp/ppcore.c
    ! fixed line numbering in unclosed extended block
    * interrupt extended block processing if it contains internal
      FUNCTION or PROCEDURE declaration

  * include/hbcompdf.h
  * src/compiler/complex.c
  * src/compiler/harbour.y
  * src/compiler/hbmain.c
    ! fixed possible GPF when FUNCTION/PROCEDURE starts in unclosed
      control structure - thanks to Abe Buchinger for information
      about the problem
    * report all unclosed control structures when FUNCTION/PROCEDURE starts

  * src/compiler/harbour.yyc
  * src/compiler/harbour.yyh
    * regenerated
2017-09-28 14:55:41 +02:00
Viktor Szakats
31e48774dd 2017-09-27 09:24 UTC Viktor Szakats (vszakats users.noreply.github.com)
* include/hbgtinfo.ch
    * sync HB_GTI_* values between 3.2 and 3.4
2017-09-27 09:25:29 +00:00
Przemysław Czerpak
fbe077d628 2017-09-26 14:54 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbmemio/memio.c
    ! fixed FO_TRUNC attribute in MEM: file IO - thanks to Miroslav Georgiev
      for information about the problem

  * include/hbgtinfo.ch
  * src/rtl/gtwvt/gtwvt.h
  * src/rtl/gtwvt/gtwvt.c
    + added new hb_gtInfo() action HB_GTI_SYSMENUADD
      It allows to add new items to window system menu which
      selected add defined by user key code into keyboard queue, i.e.
         hb_gtInfo( HB_GTI_SYSMENUADD, HB_K_MENU, "Settings" )
    * In WinCE builds use DeleteMenu() + AppendMenu() instead of
      missing ModifyMenu()
    ! pacified warning in non UNICODE builds
2017-09-26 14:54:59 +02:00
Viktor Szakats
e00f50079e 2017-09-11 13:12 UTC Viktor Szakats (vszakats users.noreply.github.com)
* contrib/gtqtc/gtqtc1.cpp
  * contrib/gtwvg/gtwgud.c
  * contrib/gtwvw/wvwdraw.c
  * contrib/hbamf/amfdec.c
  * contrib/hbamf/amfstdio.c
  * contrib/hbbz2io/bz2io.c
  * contrib/hbgzio/gzio.c
  * contrib/hbhpdf/core.c
  * contrib/hbmemio/memio.c
  * contrib/hbmisc/irm.c
  * contrib/hbmisc/spd.c
  * contrib/hbnetio/netiosrv.c
  * contrib/hbssl/ssl_sock.c
  * contrib/hbwin/olecore.c
  * contrib/hbwin/wapi_commctrl.c
  * contrib/hbwin/wapi_winuser.c
  * contrib/hbwin/win_bmpd.c
  * contrib/hbwin/win_misc.c
  * contrib/hbzebra/qrcode.c
  * contrib/rddads/ads1.c
  * contrib/rddads/adsfunc.c
  * contrib/rddsql/sqlmix.c
  * contrib/sddfb/core.c
  * contrib/xhb/cstructc.c
  * contrib/xhb/hboutdbg.c
  * contrib/xhb/hbserv.c
  * include/hbdefs.h
  * include/hbexprb.c
  * include/hbrddcdx.h
  * include/hbthread.h
  * include/hbwmain.c
  * src/common/hbffind.c
  * src/compiler/complex.c
  * src/compiler/hbmain.c
  * src/compiler/hbopt.c
  * src/debug/dbgentry.c
  * src/rdd/dbf1.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/dbffpt/dbffpt1.c
  * src/rdd/dbfnsx/dbfnsx1.c
  * src/rdd/dbfntx/dbfntx1.c
  * src/rdd/hbsix/sxcompr.c
  * src/rdd/wacore.c
  * src/rdd/workarea.c
  * src/rtl/cputime.c
  * src/rtl/dates.c
  * src/rtl/gtchrmap.c
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/gtpca/gtpca.c
  * src/rtl/gtsln/gtsln.c
  * src/rtl/gtsln/kbsln.c
  * src/rtl/gtsln/keytrans.c
  * src/rtl/gtstd/gtstd.c
  * src/rtl/gttrm/gttrm.c
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/gtxwc/gtxwc.c
  * src/rtl/hbcom.c
  * src/rtl/hbproces.c
  * src/rtl/itemseri.c
  * src/rtl/langapi.c
  * src/rtl/run.c
  * src/rtl/sha1.c
  * src/rtl/space.c
  * src/vm/classes.c
  * src/vm/hvm.c
  * src/vm/itemapi.c
  * src/vm/set.c
  * src/vm/thread.c
    * convert commented C code to #if 0 blocks, or clean them up in
      different ways
2017-09-11 13:27:12 +00:00
Viktor Szakats
5a2a287752 2017-09-08 16:00 UTC Viktor Szakats (vszakats users.noreply.github.com)
* *
    * partial sync with the 3.4 fork codebase. These are the things
      synces for the most part:
      - copyright headers
      - grammar/typos in comments and some readmes
      - comment/whitespace/decorations
      - variable scoping in C files
      - DO CASE/SWITCH and some other alternate syntax usage
      - minimal amount of human readable text in strings
      - minor code updates
      - HB_TRACE() void * casts for pointers and few other changes to
        avoid C compiler warnings
      - various other, minor code cleanups
      - only Harbour/C code/headers were touched in src, utils, contrib,
        include. No 3rd party code, no make files, and with just a few
        exceptions, no 'tests' code was touched.
      - certain components were not touched were 3.4 diverged too much
        already, like f.e. hbmk2, hbssl, hbcurl, hbexpat
      - the goal was that no actual program logic should be altered by
        these changes. Except some possible minor exceptions, any such
        change is probably a bug in this patch.
      It's a massive patch, if you find anything broken after it, please
      open an Issue with the details. Build test was done on macOS.
      The goal is make it easier to see what actual code/logic was changed
      in 3.4 compared to 3.2 and to make patches easier to apply in both
      ways.
2017-09-08 16:25:13 +00:00
Viktor Szakats
9f16c2bf8e 2017-08-13 18:27 UTC Viktor Szakats (vszakats users.noreply.github.com)
* *
    * update copyright headers with new FSF postal address
    * COPYING.txt -> LICENSE.txt (rest of repo to be synced)
2017-08-13 18:38:59 +00:00
Przemysław Czerpak
9eccf9414a 2017-07-27 18:57 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbexpat/3rd/expat/_hbconf.h
  * contrib/hbexpat/3rd/expat/xmlparse.c
    ! fixed WINCE builds
    ! fixed OpenWatcom DOS builds
    ! fixed OpenWatcom OS2 builds

  * contrib/hbexpat/3rd/expat/expat.dif
    * rediffed

  * include/harbour.hbx
  * include/hbvm.h
  * src/harbour.def
  * src/vm/hvm.c
  * src/vm/thread.c
    + added new C function
         HB_BOOL hb_vmThreadIsMain( void * );
      it checks if given or current thread is main HVM thread
    + added new PRG function
         hb_threadIsMain( [ <pThID> ] ) -> <lMainHvmThread>
      it returns true if given or current thread is main HVM thread
    + added new PRG function
         hb_mutexExists( <pMtx> ) -> <lExists>
      it returns true if passed <pMtx> parameter is pointer item to
      fully functional mutex

  * src/rtl/tpersist.prg
    ! fixed problem with array item deserialization - many thanks
      to Peter Rees for exact information about the problem.

  * src/rtl/val.c
    * minor simplification
2017-07-27 18:57:32 +02:00
Przemysław Czerpak
d1a58966c8 2017-05-09 09:12 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbct/charswap.c
  * contrib/hbct/token1.c
  * contrib/hbnetio/netiosrv.c
  * contrib/hbssl/ssl_sock.c
  * contrib/rddads/ads1.c
  * include/hbexprb.c
  * src/common/hbprintf.c
  * src/compiler/cmdcheck.c
  * src/compiler/complex.c
  * src/compiler/gencc.c
  * src/compiler/hbmain.c
  * src/compiler/hbopt.c
  * src/pp/ppcore.c
  * src/rdd/dbf1.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/dbffpt/dbffpt1.c
  * src/rdd/dbfntx/dbfntx1.c
  * src/rdd/hsx/hsx.c
  * src/rdd/workarea.c
  * src/rtl/dates.c
  * src/rtl/gtclip.c
  * src/rtl/gtwin/gtwin.c
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/hbgtcore.c
  * src/rtl/itemseri.c
  * src/rtl/strtoexp.c
  * src/vm/classes.c
  * src/vm/task.c
    * added and verified (following Viktor's patch)
      /* fallthrough */ comment for GCC >= 7.
    ; I haven't found any errors in existing code.
      /cc @vszakats

  * src/rdd/dbf1.c
    * minor improvement in dbf1.c
2017-05-09 09:12:35 +02:00
Viktor Szakats
4a4f2c30ae 2017-04-25 17:45 UTC+0200 Aleksander Czajczynski (hb fki.pl)
* src/harbour.def
    ! add hb_rand*() functions, fixing hbtip regression (#154) after
      1938dd0a70

  ; import of 2014-12-10 14:38 UTC+0100 functions from Viktor's 3.4 fork
  * src/rtl/hbrand.c
    ! hb_randStr(): fixed possible GPF and other errors when passing
       negative size

  * include/harbour.hbx
  * include/hbapi.h
  * src/rtl/hbrandom.c
    + added C level hb_random_num_secure() which works like hb_random_num()
      but uses arc4 internally
    + added hb_randInt() which works the same as hb_RandomInt() but uses
      arc4 internally
    + added hb_randNum() which works the same as hb_Random() but uses
      arc4 internally
2017-04-25 17:47:05 +02:00
Przemysław Czerpak
d7193b8e14 2017-04-25 15:59 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbexprb.c
    ! added missing code to restore original expression type after
      direct type change in code like:
         <var> := <var> + <exp>
      It created problems when <var> was reused later, i.e. in FOR loop:
         FOR v := v + x TO 3
    * simplified code to restore original expression type and updated
      comments

  * src/compiler/harbour.y
    * minor cleanup
2017-04-25 15:59:35 +02:00
Przemysław Czerpak
66ee94abcc 2017-04-20 09:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbcomp.h
  * src/compiler/hbmain.c
    * removed not longer necessary calls to hb_compExprLstDealloc()

  * src/compiler/hbcomp.c
    ! do not generate internal error when nested expression deallocation
      is activated

  * contrib/rddads/ads1.c
    ! fixed bad typo which effectively completely broke
      AdsTestRecLocks( .t. ) mode
2017-04-20 09:14:04 +02:00
Przemysław Czerpak
76c62a447a 2017-04-15 21:35 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbcompdf.h
  * include/hbexprb.c
  * src/common/expropt1.c
    * redefined all HB_ET_MACRO_* macros as bitfields

  * src/compiler/complex.c
    * small modification for future extensions in macro usage

  * src/compiler/hbcomp.c
    ! replaced old temporrary hack with internal error.

  * src/compiler/hbmain.c
    * code reformating

  * src/compiler/harbour.y
    * separated DECLARE tokens

  * src/compiler/harbour.yyc
  * src/compiler/harbour.yyh
    * regenerated

  * src/rdd/dbffpt/dbffpt1.c
    ! fixed possible bad interaction (modified default memo type) due to
      uninitialized item returned by hb_stackAllocItem(). Such items may
      contain any simple value.

  * src/vm/memvars.c
    * minor variable name cleanup

  * utils/hbtest/rt_math.prg
    * repeat tests for macro messages and macro <op>=, pre/post ++/--
      operations with and without pass by reference (-ks) optimization
2017-04-15 21:35:32 +02:00
Przemysław Czerpak
e150da6f93 2017-04-14 16:36 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapifs.h
  * src/rtl/filesys.c
    + added new C functions for UNIX and DJGPP builds:
         int hb_fsPollFD( PHB_POLLFD pPollSet, int iCount,
                          HB_MAXINT nTimeOut );
         int hb_fsCanRead( HB_FHANDLE hFileHandle, HB_MAXINT nTimeOut );
         int hb_fsCanWrite( HB_FHANDLE hFileHandle, HB_MAXINT nTimeOut );
      These functions should be used instead of select() in C code to hide
      low level access to select()/poll() functionality in *nix builds
      (they are supported by DJGPP only to simplify existing code common
      for DJGPP and *nix builds). Maximum file handle value which can be
      used in select() is limited by FD_SETSIZE. Please note that it's
      file handle value not number of file handles in the set. It creates
      serious problem for applications which operate on great number of
      handles (i.e. servers which have to keep open many sockets, pipes,
      files, etc. for their clients) so the new file/socket/pipe/...
      handle value can easy exceed FD_SETSIZE limit and in such case
      cannot be used with select(). The modification on
         2016-04-05 21:24 UTC+0200 Przemyslaw Czerpak
      resolved the problem only for sockets and pipes in code which uses
      corresponding hb_socket*() and hb_fsPipe*() API but not for all
      other cases. This one is for POSIX compilant code which needs pure
      POSIX select()/poll() functionality.
      Please note that HB_POLLFD structure should is compatible with
      struct pollfd defined by POSIX.1-2001 anyhow not all platforms
      confirm this standard so portable Harbour code should always use
      HB_POLLFD and HB_POLL* constant values instead of POLL* ones.

  * include/hbdate.h
  * src/common/hbdate.c
    + added new C functions to calculate timeouts:
         HB_MAXUINT hb_timerGet( void );
         HB_MAXUINT hb_timerInit( HB_MAXINT nTimeOut );
         HB_MAXINT  hb_timerTest( HB_MAXINT nTimeOut, HB_MAXUINT * pnTimer );
      They are designed to be used instead of direct access to
      hb_dateMilliSeconds(). Now they internally use hb_dateMilliSeconds()
      but it can be easy replaced by any other system monotonic clock by
      one local modification inside hb_timerGet() function.

  * src/rtl/filesys.c
    * use hb_timer*() functions instead of hb_dateMilliSeconds()
    * use hb_fsCanRead()/hb_fsCanWrite() instead of select()/poll()
      It also fixed timeout processing inside hb_fsPipeIsData() and
      hb_fsPipeWrite() in builds using poll()

  * src/rtl/filesys.c
  * src/rtl/gtcrs/gtcrs.h
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/gtpca/gtpca.c
  * src/rtl/gtsln/gtsln.c
  * src/rtl/gtsln/mousesln.c
  * src/rtl/gtstd/gtstd.c
  * src/rtl/gttrm/gttrm.c
  * src/rtl/gtxwc/gtxwc.c
    * use hb_timer*() functions instead of hb_dateMilliSeconds()
    * use hb_fsCanRead()/hb_fsCanWrite() instead of select()/poll()

  * src/vm/thread.c:
  * src/rtl/gtwin/gtwin.c
  * src/rtl/hbcom.c
  * src/rtl/hbgtcore.c
  * src/rtl/hblpp.c
  * src/rtl/idle.c
  * contrib/hbnetio/netiosrv.c:
  * contrib/hbssl/ssl_sock.c:
    * use hb_timer*() functions instead of hb_dateMilliSeconds()

  * contrib/xhb/hboutdbg.c
    * use hb_fsCanWrite() instead of select()

  * src/rtl/hbsocket.c
    ! repeat select() interrupted by signal inside hb_socketSelect()
      when poll() function is not available

  * src/3rd/hbdossrl/serial.c
    ! fixed -Wshift-negative-value GCC warnings
2017-04-14 16:36:50 +02:00
Przemysław Czerpak
9153285bdf 2017-03-28 23:02 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbcomp.h
  * include/hbcompdf.h
  * include/hberrors.h
  * include/hbexprb.c
  * src/common/expropt1.c
  * src/compiler/hbgenerr.c
  * src/compiler/hbmain.c
    + added new macros HB_ET_MACRO_NOLIST and HB_ET_MACRO_NOPARE
    % use new HB_ET_MACRO_* macros
    + added new compile time error:
         "Code block contains both macro and with object messages ':%s'"
      NOTE: -kd compiler switch allows to compile codeblocks with macros
            and declared symbols / with object messages
    * replaced hb_compErrorCodeblock() with hb_compErrorCodeblockDecl() and
      hb_compErrorCodeblockWith()
    + added new C function hb_compPushMacroVar()
    * code simplification
    ; added few comments

  * utils/hbtest/rt_math.prg
    * extended test code for macro messages and macro <op>=, pre/post ++/--
      operations

  * src/vm/hvm.c
    ! protection against executing hb_threadStateNew() during GC pass
      inside hb_vmRequestReenterExt()

  * src/vm/garbage.c
    ! add volatile attribute to s_bCollecting variable
    * small modification in hb_gcAll() parameter

  * src/rtl/errsys.prg
    ; minor comment cleanup

  * doc/xhb-diff.txt
    * extended a little bit section STRONG TYPED VARIABLES
2017-03-28 23:02:28 +02:00
Przemysław Czerpak
5f1da37fd2 2017-03-24 20:02 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbcomp.h
  * src/compiler/hbmain.c
    * changed hb_compVariableScope() to static function

  * src/compiler/harbour.y
    ! added protection against GPF when nested function/procedure is
      declared inside extended block code

  * src/compiler/harbour.yyc
  * src/macro/macro.yyc
  * src/macro/macro.yyh
    * regenerated

  * include/hbexprb.c
    * minor simplification

  * include/hbexpra.c
    * use HB_SIZEOFARRAY() macro
2017-03-24 20:02:03 +01:00
Przemysław Czerpak
9eec626663 2017-03-22 09:39 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/compiler/hbdead.c
  * src/compiler/hbfix.c
  * src/compiler/hblbl.c
  * src/compiler/hbopt.c
  * src/compiler/hbpcode.c
  * src/compiler/hbstripl.c
    * small comment cleanup in PCODE tables

  * include/hberrors.h
  * src/compiler/hbgenerr.c
    + added new compile time error messages for incorrect
      ENDWITH, ENDSWITCH and END SEQUENCE
    * changed error message:
         "CASE or OTHERWISE does not match DO CASE"
      to
         "CASE or OTHERWISE does not match DO CASE or SWITCH"

  * src/compiler/harbour.y
    * if control structure is closed by wrong statement generate
      error and close it. Cl*pper works in similar way so now compile
      time errors are much more close to Clipper in such cases and
      this modification fixes also problem with long list of errors
      reported to the end of function when in fact only one control
      structure was wrongly closed.
    * generate error messages for parts of control structures used
      in wrong context

  * src/compiler/harbour.yyc
  * src/compiler/harbour.yyh
    * regenerated

  * src/compiler/complex.c
    - removed wrongly working old error messages - initially they were
      implemented in old Flex lexer but they couldn't work correctly
      inside any lexer. When I wrote new lexer I simply copied them to
      new code with old broken logic just for backward compatibility.
      Now such messages are generated by grammar parser for all cases
      not only chose ones so I can clean lexer code.
    * set more precisely lexer state for error messages generated by
      grammar parser
    * simplified the code after above modifications

  * tests/speedtst.prg
    ! fixed memory statistic detection
2017-03-22 09:39:47 +01:00
Przemysław Czerpak
34418933fa 2017-03-15 14:39 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdefs.h
    + added macros HB_CAST_*( double ) for conversions of double values
      to integer types - they are designed to hide some differences
      between C compilers and platforms in such conversions

  * src/common/expropt2.c
  * src/vm/extend.c
  * src/vm/itemapi.c
    * use new HB_CAST_*() macros
2017-03-15 14:39:47 +01:00
Przemysław Czerpak
0046cb2b8c 2017-03-15 13:54 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdefs.h
  * include/hbmather.h
  * src/common/hbprintf.c
  * contrib/gtwvg/wvgwing.c
  * contrib/hbfbird/firebird.c
  * contrib/hbxdiff/3rd/libxdiff/_hbconf.h
  * contrib/sddfb/core.c
    * use hexadecimal numbers checking __BORLAND__ macro

  * src/rtl/sha2.c
    * use standard harbour macros from hbdefs.h
2017-03-15 13:54:27 +01:00
Przemysław Czerpak
06c1134d2c 2017-03-15 09:50 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* package/harbour.spec
  * contrib/hbbz2/hbbz2.hbp
  * package/mpkg_rpm.sh
    + added support for '--with localbz2' RPM build parameter

  * include/hbpp.h
  * src/pp/ppcore.c
  * src/compiler/hbmain.c
    * modified hb_pp_inBuffer() parameters. Now it supports optional
      szFileName parameter.
      Warning: it's incompatible with previous version but I do not think
      that anyone used this function outside core code so I decided to not
      add new function but simply change the existing one.
      [INCOMPATIBLE]

  * src/rtl/filebuf.c
    ! do not resepct SET DEFAULT/PATH in hb_fileExists() when 2nd parameter
      is NULL in default file IO drivers. It also changes the behvior of
      PRG function hb_vfOpen() which now honors SET DEFAULT/PATH only if
      its 2nd parameter is passed by reference - this modification is
      compatible with 2016-01-25 18:16 UTC+0100 Viktor Szakats in his fork.

  * src/rdd/dbf1.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/dbfnsx/dbfnsx1.c
  * src/rdd/dbfntx/dbfntx1.c
    * updated to work correctly with modified hb_fileExists() behavior
    ; CL5.2 DBFCDX and Six3 CDX/NSX RDDs looking for production indexes
      respect SET PATH but Harbour in core DBF* index RDDs is CL5.3/COMIX
      compatible and looks for production indexes only in the directory
      where DBF file is located and only SIXCDX Harbour RDD is CL5.2/Six3
      compatible.
      Please also note that it's significant only for situations when
      DBF file is located in current directory. If it's open from
      SET DEFAULT/PATH directory then corresponding path is added
      to DBF file name what effectively disables SET DEFAULT/PATH
      processing when production index is open.

  * src/rtl/filebuf.c
  * src/rtl/filebufd.c
  * src/rtl/iousr.c
  * contrib/hbmemio/memio.c
    ; cleaned name of hb_fileCopy() paramter

  * include/hbapifs.h
  * src/rtl/filebuf.c
  * src/harbour.def
    + added new C function:
         HB_BOOL hb_fileMove( const char * pszSrcFile,
                              const char * pszDstFile );
  * src/rtl/vfile.c
  * include/harbour.hbx
  * src/harbour.def
    + added new PRG function:
         hb_vfMoveFile( <cFileSrc>, <cFileDst> ) -> <nResult>

  ; unlike hb_fileRename()/hb_vfRename() new hb_fileMove()/hb_vfMoveFile()
    functions allow to move files between different file systems/drives
    and also different Harbour file IO drivers. Please note that it means
    that file name IO driver prefix is significant in both source and
    destination file names unless it's local FS operation. New functions
    when both file names point to the same Harbour file IO driver try to
    use simple rename operation. If it fails then they try to copy the
    file and remove the source one.

  * ChangeLog.txt
    ! typo

  * include/hbfloat.h
  * contrib/xhb/xhbctbit.c
  * src/compiler/hbcmplib.c
  * src/compiler/hbcomp.c
  * src/compiler/hbusage.c
    ! pacified new GCC warnings and partially synced with Viktor's fork

  * src/compiler/hbusage.c
    * added Klas Engwall to credits list
    * added Rolf to credits list
    * updated April White email address
    ; please verify it and update if necessary
2017-03-15 09:50:10 +01:00
Przemysław Czerpak
459cd1a2c5 2017-02-08 19:36 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/gtqtc/gtqtc1.cpp
    ! fixed clipboard selection with shift + left mouse button to not report
      mouse events during selection

  * include/hbdate.h
  * src/common/hbdate.c
    + added support for ISO 8601 week dates (YYYY-Www-D) in timestamp
      literals
    + added support for ISO 8601 ordinal dates (YYYY-DDD) in timestamp
      literals
    + added new C functions:
         HB_BOOL hb_dateDecWeek( long lJulian, int * piYear,
                                 int * piWeek, int * piDay );
         long hb_dateEncWeek( int iYear, int iWeek, int iDay );
      to decode/encode ISO 8601 week dates

  * src/rtl/dateshb.c
    + added new PRG function get week number and other parts ISO 8601
      week date:
         hb_Week( <dDate>, [@<nYear>], [@<nDayOfWeek>] ) -> <nWeek>

  * include/harbour.hbx
  * src/harbour.def
    * updated for new functions
2017-02-08 19:36:46 +01:00
Przemysław Czerpak
a52a2e57a4 2016-12-15 12:51 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
  * src/harbour.def
  * src/rtl/dateshb.c
    + added new PRG functions which convert time difference to hours,
      minutes, seconds and milliseconds. Except milliseconds the results
      are floating point numbers with fractional part representing the
      rest of conversion:
         hb_NToHour( <nTimeDiff> )  => <nHours>
         hb_NToMin ( <nTimeDiff> )  => <nMinutes>
         hb_NToSec ( <nTimeDiff> )  => <nSeconds>
         hb_NToMSec( <nTimeDiff> )  => <nMilliseconds>
    + added new PRG functions which convert timestamp value to hours,
      minutes, seconds and milliseconds. Except milliseconds the results
      are floating point numbers with fractional part representing the
      rest of conversion:
         hb_TToHour( <tTimeStamp> ) => <nHours>
         hb_TToMin ( <tTimeStamp> ) => <nMinutes>
         hb_TToSec ( <tTimeStamp> ) => <nSeconds>
         hb_TToMSec( <tTimeStamp> ) => <nMilliseconds>

  * src/rtl/gtsln/gtsln.c
    ! fixed cleanup string sent to terminal to remove test UTF-8 character

  * src/rtl/gtsln/kbsln.c
    + added workaround for some broken Linux kernel which wrongly sets
      tty device as ready for reading

  * src/rtl/hbsocket.c
    * added comment

  * src/rdd/dbfnsx/dbfnsx1.c
  * src/rdd/dbfntx/dbfntx1.c
    ! added missing tag root page restoring cleared after discarding buffers
      due to concurrent access to multitag indexes.
      Many thanks for Karsten Stucker for self contain example.

  * src/rdd/dbfntx/dbfntx1.c
    * discard buffers when next free page is changed even without touching
      version number - minor protection for potentially broken 3-rd party
      NTX code or very old [x]Harbour NTX RDDs which do not increment
      version number on update.
2016-12-15 12:51:24 +01:00
Viktor Szakats
c80292f490 2016-10-28 12:29 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
* include/hbver.ch
    + add new HB_VER_* constants from 3.4

  * src/rtl/version.c
    + return meaningful value for HB_VERSION_URL_BASE
    * return dummy values for HB_VERSION_URL_SOURCE,
      HB_VERSION_BUILD_TIMESTAMP_UTC, HB_VERSION_OPTIONS
2016-10-28 12:32:02 +02:00
Przemysław Czerpak
35fe3becc7 2016-09-28 19:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/hbssl.h
  * contrib/hbssl/ssl_sock.c
  * contrib/hbssl/ssl_inet.c
    + added new 'PHB_ITEM pSSL' parameter to hb_sockexNewSSL() and
      hb_ssl_socketNew() C functions - it allows to bind harbour item
      with SSL pointer which should not be released before connection
      is closed. In new OpenSSL version such tricks can be replaced
      by SSL_up_ref()
      This modification also fixes possible GPF trap when SSL filter
      socket was create dynamically from C code without SSL pointer
      item on HVM stack in 2-nd parameter and removes old hack which
      saved internally 2-nd HVM stack parameter.
    + allow to pass SSL_CTX instead of SSL in "ssl", "ctx" or "key" items
      of hash array used to initialize SSL socket filter. Using SSL_CTX
      allows to use the same hash array to set SSL socket filter for
      different connections
    + allow to use codeblocks or function pointers as "ssl", "ctx" or
      "key" items of hash array used to initialize SSL socket filter

  * contrib/hbssl/hbssl.h
  * contrib/hbssl/sslctx.c
    + added new C function:
         SSL_CTX * hb_SSL_CTX_itemGet( PHB_ITEM pItem )

  * contrib/hbssl/ssl_sock.c
  * src/rtl/hbcom.c
  * src/rtl/hbsocket.c
    ! fixed timeout checking in select()/poll()

  * src/rtl/hbsockhb.c
    ! fixed possible GPF trap when socket filter refuse to create new
      socket wrapper

  * include/hbinit.h
    * in GCC C++ builds for startup code use GCC constructor function
      attribute instead of static variable initialization to avoid
      warnings in new GCC versions

  * src/rtl/hbntos.c
    ! fixed missing '-' in result of negative integer numbers - thanks
      to Luigi Ferraris

  * src/common/hbstr.c
    + added code to round integer part when the size of number is greater
      then double precision (~16 digits).
2016-09-28 19:55:11 +02:00
Przemysław Czerpak
72016f2bc3 2016-09-22 15:47 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapi.h
  * include/hbvmpub.h
    * removed casting C style casting from commonly used macros

  * contrib/gtqtc/gtqtc1.cpp
    * use C++ casting instead of C casting

  * contrib/rddads/ads1.c
  * contrib/rddads/adsx.c
  * contrib/rddsql/sqlmix.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/dbfnsx/dbfnsx1.c
  * src/rdd/dbfntx/dbfntx1.c
  * src/rdd/dbsql.c
  * src/rdd/workarea.c
    * cleaned HB_IT_* usage

  * contrib/rddads/ads1.c
    ! fixed typo in low level code of ordDescend() / DBOI_ISDESC,
      now ordDescend() should work with ADS* RDDs just like with
      native RDDs

  * contrib/hbfoxpro/relfunc.c
    ! fixed typo in Between() function - thanks to Petr Chorney

  * src/rtl/gtwvt/gtwvt.c
    ! added workaround for keyboard drivers which sets CTRL key modifier
      flag when only ALTGR is pressed - thanks to Maurizio la Cecilia
2016-09-22 15:47:08 +02:00
Przemysław Czerpak
085b9d828e 2016-09-20 17:38 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* doc/xhb-diff.txt
    + added information about support for strong typed variables in [x]Harbour
    * updated information about typed object items
    ! typos

  * include/hbclass.ch
    * updated information about initialization of typed object items

  * include/hbatomic.h
    * do not force OSSpinLock usage in OSX builds

  * include/hbapifs.h
  * src/rtl/filesys.c
    + added new C function hb_fsCloseRaw() - it works like hb_fsClose() but
      does not change hb_fsError()

  * src/rtl/filebuf.c
    * changed the condition in hb_fileLoadData() used to detect file
      descriptors without full support for file seek - now it's possible
      to use [hb_]MemoRead() to read /proc/* files in Linux

  * src/rtl/filesys.c
    ! detach printer process to not leave zombie processes after printing
      in programs which do not catch SIGCHLD signal in *nixes builds

  * src/rtl/filesys.c
  * src/rtl/hbproces.c
    * use hb_fsCloseRaw() instead of hb_fsClose() to safe original error code

  * src/rtl/hbsocket.c
    ! fixed OpenWatcom Linux builds
    + added HB_WINSOCK_USE_OLDFUNC macro which disables new WinSock functions
      in MS-Windows builds

  * src/rtl/gtxwc/gtxwc.c
    ! fixed recursive mutex lock
    ! added some missing locks
    + added support for X11 XLockDisplay()/XUnlockDisplay() in default builds
      when MT HVM is used. X11 locks can be disabled by HB_XWC_XLOCK_OFF
      macro - it may be necessary on some old platforms which do not support
      them.
    ! disabled resize step when font size is changed to reduce possible
      problem with reduced number of columns and rows by this operation.
      Please remember that X Server/Window Manager may still ignore
      suggested window size and force their own dimensions so application
      has to be ready to accept final screen size set by server/WM.

  * contrib/hbnf/shadow.c
    ! use 8 instead of 7 as default color attribute in FT_Shadow() function
2016-09-20 17:38:57 +02:00