Commit Graph

418 Commits

Author SHA1 Message Date
Przemysław Czerpak
a46d22c9d7 2015-09-30 11:18 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/hvm.c
    ! added missing support for non MT builds in last commit
2015-09-30 11:18:54 +02:00
Przemysław Czerpak
6458e3a963 2015-09-30 10:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
  * src/vm/hvm.c
    + added internal PRG function to test number of HVM threads and stacks
         __vmCountThreads( [ @<nStacks> ], [ @<nThreads> ] ) -> <nThreads>

  * src/rtl/filesys.c
  * contrib/gtqtc/gtqtc1.cpp
  * contrib/gtwvg/gtwvgd.c
  * contrib/gtwvg/wvgcore.c
  * contrib/hbamf/amfdec.c
  * contrib/xhb/fparse.c
  * contrib/xhb/hbserv.c
  * contrib/xhb/hbxml.c
    * cleaned ;; usage in C code
2015-09-30 10:55:41 +02:00
Przemysław Czerpak
5eca8eab92 2015-09-29 21:24 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/hvm.c
    ! delay locking of main HVM thread stack until HVM is initialized,
      it fixes issue #107
    ! protect access to HB_STACK_TLS_PRELOAD by s_fHVMActive in
      hb_vmLockForce()
2015-09-29 21:24:15 +02:00
Przemysław Czerpak
7c0914cd43 2015-09-25 11:41 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filebuf.c
    ! removed unnecessary HB_EXPORT attribute

  * contrib/hbwin/oleuuid.c
    ! added missing HB_EXPORT attrinute for OpenWatcom builds

  * contrib/hbcomio/comio.c
  * contrib/hbpipeio/pipeio.c
  * contrib/hbtcpio/tcpio.c
  * src/rtl/hbsockhb.c
    ! cleaned integer types and casting
2015-09-25 11:41:09 +02:00
Przemysław Czerpak
004399c75d 2015-09-24 22:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbcom.c
  * src/rtl/gtcrs/gtcrs.c
  * src/rtl/gtpca/gtpca.c
  * src/rtl/gtstd/gtstd.c
  * src/rtl/gttrm/gttrm.c
    * added workaround for bug in some Linux kernels (i.e.
      3.13.0-64-generic Ubuntu) in which select() unconditionally
      accepts terminal device for reading if c_cc[ VMIN ] = 0
      It's very serious problem, i.e. in GTTRM no input is possible
      in such kernels without this workaround.

  * src/rtl/dirscan.prg
    * modified hb_DirScan() and hb_DirRemoveAll() to work with Harbour
      File IO API (hb_vf*() functions)
    + added new PRG function:
         hb_FileDelete( <cFileMask> [, <cAttr> ] ) -> <lResult>
      this function removes files which match given <cFileMask>
      (it may contain path) and returns .T. if at least one file
      was deleted. Optional <cAttr> parameter can be used to include
      system ("S") and hidden ("H") files. If <cAttr> contains "R"
      letter then before deleting READONLY attribute is removed from
      files (it's necessary to remove files with READONLY attribute
      in systems like DOS, MS-Windows or OS2). This function uses
      Harbour File IO API (hb_vf*() functions)
    * remove READONLY attribute from files in hb_DirRemoveAll()

 * include/harbour.hbx
    + added hb_DirRemoveAll() and hb_FileDelete()

  * contrib/hbct/files.c
    ! do not allow to remove empty directories by FileDelete() function
      even if user explicitly sets directory attribute - CT3 compatible fix.
    ! remove READONLY attribute before deleting READONLY files if 2-nd
      parameter of FileDelete() contains READONLY bit

  * src/rtl/filesys.c
    * formatting

  * ChangeLog.txt
    ! typo
2015-09-24 22:14:14 +02:00
Przemysław Czerpak
2ca29eafd1 2015-09-18 13:15 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/common/hbffind.c
    + added support for link attribute (HB_FA_LINK -> "L") passed to
      Directory() and other functions using hb_fsFindFirst()/hb_fsFindNext()
      When this attribute is passed then softlinks are presented "as is"
      without following target.

  * src/rtl/dirscan.prg
    + added new PRG function hb_DirRemoveAll( <cDir> ) -> <lResult>
      BE CAREFUL! This function removed recursively whole directories
      with it's body so hb_DirRemoveAll( hb_ps() ) can remove all
      files and directories from your disk.
2015-09-18 13:16:00 +02:00
Przemysław Czerpak
9dfe637b94 2015-09-17 20:04 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
    ! added protection against writing more then 4096 bytes to unblocked
      pipe in MS-Windows builds of hb_fsProcessRun()
    ! close write side of child stdin handle if all data is sent in OS2
      builds of hb_fsProcessRun()
2015-09-17 20:04:03 +02:00
Przemysław Czerpak
4e94bbfa6c 2015-09-17 16:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
    * In OS2 builds use fGentle parameter of hb_fsProcessClose() to
      control if kill signal should be send only to child process or
      also to its all descendant processes.
2015-09-17 16:07:26 +02:00
Przemysław Czerpak
2f8794d92d 2015-09-17 15:58 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filesys.c
    * pacified warnings in GCC OS2 builds
2015-09-17 15:58:23 +02:00
Przemysław Czerpak
96a0d522c2 2015-09-17 15:52 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/fscopy.c
    * pacified BCC warning

  * src/rtl/hbproces.c
    * added HB_PROCESS_USEFILES macro which enable child process
      standard IO handles redirection to files instead of pipes
      in  hb_fsProcessRun() function. It's enabled by default in
      DOS and WinCE builds
    * enable HB_PROCESS_USEFILES for tests in OS2 builds
2015-09-17 15:52:17 +02:00
Przemysław Czerpak
ee07a735de 2015-09-17 12:23 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapicls.h
  * src/vm/classes.c
    * minor modification in variable name

  * src/rtl/filebuf.c
  * src/rtl/fscopy.c
  * src/rtl/fslink.c
  * src/rtl/vfile.c
    * cleaned FError() setting. It should not be changed by C file IO
      functions because they can be activated from RDD code so accessing
      work area field could change the FError() result, i.e. this code
      does not work when FError() is changed by C level IO operations:
         AnyFunc( FSeek( hFile, 0, FS_END ), field->MEMOVAL, FError() )
      Even simple field access may cause file IO operations in RDD code
      when relations are set because records in child area are repositioned
      only when necessary (when user tries to make some operations on this
      area). In the past RDD code was full of constructions like:
         uiSaveError = hb_fsFError();
         // make some IO operations
         hb_fsSetFerror( uiSaveError );
      to eliminate such overhead I separated PRG level FError() from
      C level IOError(). Please keep it.

  * ChangeLog.txt
    ! few typos
2015-09-17 12:23:29 +02:00
Przemysław Czerpak
964c5df36f 2015-09-15 21:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
    * minor formatting
2015-09-15 21:33:20 +02:00
Przemysław Czerpak
df5488ccad 2015-09-15 21:04 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
    ! fixed test for broken pipe when only one pipe to child process is
      active in OS2 builds
2015-09-15 21:04:34 +02:00
Przemysław Czerpak
010421f70e 2015-09-15 14:58 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbvmpub.h
  * src/vm/hvm.c
    + added support for hb_vmAtInit(), hb_vmAtExit() and hb_vmAtQuit()
      functions for dynamically loaded libraries
      This modification should also fix issue #33
2015-09-15 14:58:03 +02:00
Przemysław Czerpak
7a89939039 2015-09-14 19:30 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
    * use pipes instead of temporary files in OS2 builds of hb_fsProcessRun()
    ; please test in real OS2 env
2015-09-14 19:30:29 +02:00
Przemysław Czerpak
c0142512db 2015-09-14 17:36 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/gttrm/gttrm.c
    - removed unused macros and definitions
    * formatting and minor cleanup

  * src/rtl/gtcrs/gtcrs.h
  * src/rtl/gtcrs/gtcrs.c
    + added support for extended key codes, GTCRS does not support
      unicode so it's not fully functional just like in GTTRM
2015-09-14 17:36:57 +02:00
Przemysław Czerpak
1ff43722ed 2015-09-14 14:03 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rdd/dbf1.c
    * set HB_FF_BINARY flag in numeric and date fields stored in binary
      representation - VFP also does it.
2015-09-14 14:03:56 +02:00
Przemysław Czerpak
e25b622250 2015-09-14 12:40 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filesys.c
    * clear ERROR_BROKEN_PIPE (109) in MS-Windows and OS2 builds reported
      when pear closes the write end of the pipe.
      Now hb_PRead() returns -1 with FError() = 0 in such case in all builds.
2015-09-14 12:40:09 +02:00
Przemysław Czerpak
403c57741c 2015-09-11 12:50 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filesys.c
    + added code for anonymous pipes emulation by named pipes,
      now nonblocking access to pipe streams in OS2 builds should work

  * src/rtl/hbproces.c
    * pacified warnings in OS2 builds
2015-09-11 12:50:15 +02:00
Przemysław Czerpak
fcd32e5f59 2015-09-10 09:03 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filesys.c
    ! use CRTL eof() function only in non DJGPP DOS builds
2015-09-10 09:03:23 +02:00
Przemysław Czerpak
46fe44162b 2015-09-09 16:51 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/estack.c
    ! protect access to HB_STACK_TLS_PRELOAD by hb_stack_ready() macro,
      it's necessary for MT builds which do not use direct TLS access
      but need TLS key initialization, i.e. OS2

  * src/vm/hvm.c
    ! protect access to HB_STACK_TLS_PRELOAD by s_fHVMActive
2015-09-09 16:51:20 +02:00
Przemysław Czerpak
7159461d11 2015-09-09 12:55 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/common/hbfsapi.c
    * pacified warnings OS2 warnings reported by David
2015-09-09 12:55:05 +02:00
Przemysław Czerpak
03f2948f8a 2015-09-09 01:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filesys.c
    * implemented hb_fsSetDevMode() only for DOS builds,
      all other platforms always use O_BINARY mode

  * utils/hbmk2/hbmk2.prg
    ! fixed EOL handling in stdout and stderr output
2015-09-09 01:29:42 +02:00
Przemysław Czerpak
d090e26669 2015-09-08 20:10 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/nortl/nortl.c
    + added hb_fsSetError()

  * include/hbapifs.h
  * src/common/hbfsapi.c
    + added new C function for OS2 builds: hb_fsOS2QueryPathInfo()
      Unlike DosQueryPathInfo() it uses dir entries so it does not need to
      open the file what can create file sharing violation problem.
    + added new C function for OS2 builds: hb_isWSeB()
      It returns true if OS2 version supports long file API
      (IBM OS/2 Warp Server for e-Business)
    + added new C functions for OS2 builds:
         hb_fsOS2DosOpenL(), hb_fsOS2DosSetFileLocksL(),
         hb_fsOS2DosSetFilePtrL(), hb_fsOS2DosSetFileSizeL()
      These are dynamically initialized wrappers to OS2 long file API
      functions if such functions exists in given OS2 version.

  * src/common/hbfsapi.c
    * use hb_fsQueryPathInfo() in OS2 builds of hb_fsNameExists(),
      hb_fsFileExists() and hb_fsDirExists()

  * src/common/hbffind.c
    + added support for long files (longer then 4GB) in OS2 builds.
      It also detects OS2 version to check if long file API is supported.
    ! fixed file error setting in OS2 builds

  * src/rtl/filesys.c
    * use hb_fsQueryPathInfo() in OS2 builds of hb_fsGetFileTime() and
      hb_fsGetAttr()
    * use hb_fsOS2*() functions for long files

  * src/rtl/fssize.c
    * use hb_fsQueryPathInfo() in OS2 builds of hb_fsFSize()

  ; please make real life tests in OS2
2015-09-08 20:10:44 +02:00
Przemysław Czerpak
c2b2b5df90 2015-09-07 16:28 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/gtos2/gtos2.c
    * added missing modification in previous commit
2015-09-07 16:28:19 +02:00
Przemysław Czerpak
db664c6f61 2015-09-07 16:19 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/gtos2/gtos2.c
    + added support for HB_GTI_CODEPAGE
    ! removed code which sets CP437 at application start
      Now the default codepage is the same set by system.
      If someone wants to use CP437 regardless of default OS2 settings
      then he should add to his code:
         hb_gtInfo( HB_GTI_CODEPAGE, 437 )
2015-09-07 16:19:22 +02:00
Przemysław Czerpak
04839f11b4 2015-09-06 23:33 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbproces.c
    * use native OS2 system functions in hb_fsProcessOpen(),
      hb_fsProcessValue(), hb_fsProcessClose() - please test it
    ; TODO: change hb_fsProcessRun() to use real assynchrous execution in
            OS2 builds
2015-09-06 23:33:17 +02:00
Przemysław Czerpak
1d7ee5470b 2015-09-06 15:44 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/disksphb.c
  * src/rtl/filesys.c
    * use native system functions for disk and file IO operations in OS2
      builds.
    + added support for long files (> 2GB) in OS2 builds
    ! fixed file IO error setting in OS2 builds
    ; For above modifications I had to change nearly all file IO functions
      in OS2 build. I would like to OS2 users to make tests.
      In next step I'll update hb_process*() functions.
2015-09-06 15:44:49 +02:00
Przemysław Czerpak
1d300dddfe 2015-09-03 14:00 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rdd/sdf1.c
    ! use hb_fileResult() to process hb_fileRead() results - it fixes
      problem reported by Viktor.
2015-09-03 14:00:03 +02:00
Przemysław Czerpak
3fc5e437d9 2015-09-02 16:11 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdefs.h
    * changed reference 32-bit reference counters in Win64 builds to 64-bit
      ones. It resolves problems with data alignment in memory allocated
      by hb_xgrab().

  * src/vm/asort.c
    * removed hack for MinGW64 build from new array sort code,
      after switching to 64bit reference counters it should not
      be longer necessary because allocated that has 64bit alignment
2015-09-02 16:11:24 +02:00
Przemysław Czerpak
38af08e97d 2015-09-02 15:54 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapifs.h
  * src/rtl/filebuf.c
    * added new C function hb_fileLoadData() - it can be used to load data
      from already opened regular files and streams

  * include/harbour.hbx
  * src/rtl/vfile.c
    + added new PRG function:
         hb_vfLoad( <cFileName>, [ <nMaxSize> ] ) -> <cFileBody> | NIL

  * src/vm/runner.c
    * use hb_fileLoadData()

  * contrib/hbwin/win_bmp.c
    * use hb_fileLoad()
2015-09-02 15:54:08 +02:00
Przemysław Czerpak
00246c9048 2015-09-01 17:05 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbapifs.h
  * src/rtl/filebufd.c
    * moved HB_FILE_ERR_UNSUPPORTED macro to header file

  * include/hbapifs.h
  * src/rtl/filebuf.c
    * added new C function hb_fileLoad() - it can be used to load data
      from regular files and streams

  * src/rtl/memofile.c
    * modified [hb_]Memo{Read|Writ}() to work with streams, i.e. now
      this code works:

         REQUEST HB_PIPEIO
         cDir := hb_memoRead( "|ls -la" )
         ? upper( cDir )

      or:

         cData := hb_memoRead( "|xz -c data.gz" )
         ? hb_memoWrit( "data2.txt", cData )
         ? hb_memoWrit( "|sh -c 'xz -9 -e > data2.xz'", cData )

  * src/rtl/fscopy.c
    * removed not used in current code unix header files
2015-09-01 17:05:30 +02:00
Przemysław Czerpak
9a9128ea27 2015-09-01 15:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* ChangeLog.txt
    ! fixed typo in ChangeLog entry. I used hb_socketNew() instead of
      hb_socketSetFilter()

  * include/hbapifs.h
  * src/rtl/filebuf.c
    + added helper C function:
         HB_SIZE hb_fileResult( HB_SIZE nSize );
      It converts ( HB_SIZE ) FS_ERROR to 0 so it can be used to wrap
      hb_fileRead()/hb_fileWrite() to force previous results.

  * src/rdd/dbffpt/dbffpt1.c
    * reduced variable scope

  * src/rtl/copyfile.c
    ! fixed typo in last commit - thanks to Viktor.
2015-09-01 15:07:03 +02:00
Przemysław Czerpak
db3fe4b8d4 2015-08-31 23:43 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbmzip/mzip.c
  * contrib/hbnetio/netiocli.c
  * contrib/hbnetio/netiosrv.c
  * contrib/hbwin/win_prn2.c
  * contrib/xhb/xhbcopyf.c
  * src/rdd/dbffpt/dbffpt1.c
  * src/rdd/dbfnsx/dbfnsx1.c
  * src/rdd/delim1.c
  * src/rdd/hbsix/sxcompr.c
  * src/rdd/sdf1.c
  * src/rtl/copyfile.c
  * src/rtl/filesys.c
  * src/rtl/fscopy.c
  * src/rtl/hbmd5.c
  * src/rtl/memofile.c
  * src/rtl/philes.c
  * src/rtl/vfile.c
    * updated for possible -1 result returned by hb_fileRead()/hb_fileWrite()
2015-08-31 23:43:30 +02:00
Przemysław Czerpak
b6ddc55575 2015-08-31 16:49 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
    + added hb_socketAutoShutdown()

  * src/rtl/vfile.c
    * updated for possible -1 result returned by hb_fileRead()/hb_fileWrite()
2015-08-31 16:49:47 +02:00
Przemysław Czerpak
f90e0be4fd 2015-08-31 13:26 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbsockhb.c
    + added new PRG function:
         hb_socketAutoShutdown( hSocket, [ lNewSetting ] ) --> lPrevSetting
      it allows to enable/disable automatic shutdown when connected socket
      is closed.

  * contrib/hbpipeio/pipeio.c
    * removed trailing space

  * contrib/hbpipeio/tests/test.prg
    * cleaned the code and messages
2015-08-31 13:26:26 +02:00
Przemysław Czerpak
2606996d15 2015-08-31 12:45 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbtcpio/tcpio.c
  * contrib/hbpipeio/pipeio.c
    * modified hb_fileWrite() to return 0 in case of timeout or unblocking
      write and -1 on other errors.

  * contrib/hbcomio/comio.c
    * modified hb_fileRead() to return 0 in case of timeout or unblocking
      read and -1 on other errors.

  * src/rtl/filesys.c
    * return -1 instead of 0 from hb_fsPipeWrite() in MS-Windows and OS2
      builds if PIPE state cannot be read

  * ChangeLog.txt
    ! c&p typo in previous ChangeLog entry
2015-08-31 12:45:47 +02:00
Przemysław Czerpak
a5b0ab6fc2 2015-08-26 16:21 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/hbzsock.c
    * pacified warning
2015-08-26 16:21:20 +02:00
Przemysław Czerpak
41b8ecb6c7 2015-08-26 15:51 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbsocket.h
  * src/rtl/hbsockhb.c
    + added socket filters to standard socket API.
      At C level hb_sockex*() function with PHB_SOCKEX handler can be
      used to operate on socket filters. At PRG level standard hb_socket*()
      functions can be used.
      The following things has been changed in PRG hb_socket*() functions:
      hb_socketErorrString() can accept <pSocket> as 1-st or 2-nd parameter
      and redirect call to socket filter errorStr() method.
      hb_socketClose() executes automatically shutdown() for connected
      sockets - it is important in windows only where without explicit
      call to shutdown() before close transmitted data can be lost.
      hb_socketSend() and hb_socketRecv() can be redirected to filter
      streams if filter set such redirection. If filter does not redirect
      them then they operate on raw sockets. If hb_socketSend() is
      redirected then sent data is flushed automatically.
      The following new PRG functions has been added:
      Add/replace socket filter:
         hb_socketSetFilter( <pSocket>, [<cFilterName>], [<hParams>] )
               -> <pSocket> | NIL
            <cFilterName> is filter name, It's possible to set many filters
            in single hb_socketSetFilter() call separating filter names
            with "|" character, i.e.:
               pSock := hb_socketSetFilter( pSock, "ZSOCK|BFSOCK", hParams )
            <hParams> is hash array with initialization parameters used by
            given socket filter. The core implementation recognize the
            following settings:
               "readahead" - numeric value with size of read ahead buffer
               "flush" - numeric value with auto flush parameter (for more
                         information look at hb_socketAutoFlush() below)
               "redir" - logical value which can be use to enable/disable
                         hb_socketSend() and hb_socketRecv() redirection
                         to filter stream.
      Return filter name used by socket:
         hb_socketGetFilter( <pSocket> ) -> <cFilterName>
      Read from socket stream:
         hb_socketRead( <pSocket>, @<cData>, [<nLen> = Len( cData )],
                        [<nTimeout> = FOREVER] ) -> <nRead>
         this function is similar to hb_socketRecv() but is always
         redirected to socket stream filters.
      Write to socket stream:
         hb_socketWrite( <pSocket>, <cData>, [<nLen> = Len( cData )],
                         [<nTimeout> = FOREVER] ) -> <nWritten>
         this function is similar to hb_socketSend() but it is always
         redirected to socket stream filters. Written data is not flushed
         by default and it should be flushed explicitly by hb_socketFlush().
         Automatic flushing can be enabled by hb_socketAutoFlush() function.
      Flush data written to socket:
         hb_socketFlush( <pSocket>, [<nTimeout> = FOREVER], [<lSync>] )
                     -> <nNotFlushed>
            <lSync> parameter is logical value which can be used to force
            special synchronization method in some filters. Usually users
            do not have to use it in normal code.
      Enable/disable automatic flushing of written data.
         hb_socketAutoFlush( <pSocket>, [ <nTimeout> ] ) -> <nTimeout>
            <nTimeout> is timeout for automatic flush operation on written
            data in milliseconds. <nTimeout> = -1 means wait forever and
            <nTimeout> = 0 disables auto flush.
         automatic flushing can help in adopting existing code anyhow it
         may strongly reduce the performance in some filters, i.e.
         compression filters like ZSOCK have to add special data to the
         stream after each flush operation so it's suggested to call
         flush explicitly when we want to force delivering written data
         to the peer.

  * include/hbznet.h
  * src/rtl/hbznet.c
    + added ZNET socket filter - compressed and encrypted streams are
      compatible with hb_znet*() streams. The old hb_znet*() interface
      is obsolete for pure socket communication and if not used as
      hb_inet*() filter then should be replaced by hb_sockex*() in
      user programs.
      ZNET socket filter can be created by new PRG functions:
         hb_socketNewZNet( <pSocket>, [<cPass>], [<nCompressionLevel>], ;
                           [<nStrategy>] ) -> <pSocket> | NIL
      or by standard socket API with "ZNET" as filter name.
      ZNET filter recognize the following settings in initialization
      hash array:
         "key" or "pass" - string with encryption password
         "zlib" - numeric compression level (HB_ZLIB_COMPRESSION_*)
         "zs" - numeric ZLIB compression strategy (HB_ZLIB_STRATEGY_*)
      ZNET filter always disables any other filters and operates on raw
      socket.
      Please remember that it's optional module. If programmer does not
      use hb_socketNewZNet() explicitly and prefers using hb_socketNew()
      then he should force linking this module by REQUEST hb_socketNewZNet

    + added fSync parameter to hb_znetFlush()
      [INCOMPATIBLE]

  * src/rtl/hbinet.c
    * call flush filter function before socket is closed

  * src/rtl/Makefile
  + src/rtl/hbzsock.c
    + added ZSOCK socket filter - ZLIB and GZIP compression for socket
      streams.
      ZSOCK socket filter can be created by new PRG functions:
         hb_socketNewZSock( <pSocket>, [<hParams>] ) -> <pSocket> | NIL
      or by standard socket API with "ZSOCK" as filter name.
      Programmers using hb_socketNew() can force linking this module by
         REQUEST hb_socketNewZSock
      ZSOCK filter can be used with other filters.
      ZSOCK filter recognize the following settings in initialization
      hash array:
         "zlib" - numeric compression level (HB_ZLIB_COMPRESSION_*)
         "zs" - numeric ZLIB compression strategy (HB_ZLIB_STRATEGY_*)
         "zin" - logical value which allow to enable/disable ZLIB
                 decompression on input stream (default)
         "gzin" - logical value which allow to enable/disable GZIP
                  decompression on input stream - it's possible to
                  enable both ZLIB and GZIP decompression together
                  so both streams can be decompress
         "zout" - logical value which allow to enable/disable ZLIB
                  compression on output stream (default)
         "gzout" - logical value which allow to enable/disable GZIP
                   compression on output stream - if both "zout" and
                   "gzout" are enabled GZIP compression is used.

  * src/rtl/Makefile
  + src/rtl/hbbfsock.c
    + added BFSOCK socket filter - BlowFish input and output stream
      encryption in CTR mode.
      BFSOCK socket filter can be created by new PRG functions:
         hb_socketNewBFSock( <pSocket>, [<hParams>] ) -> <pSocket> | NIL
      or by standard socket API with "BFSOCK" as filter name.
      Programmers using hb_socketNew() can force linking this module by
         REQUEST hb_socketNewBFSock
      BFSOCK filter can be used with other filters, i.e. with ZSOCK.
      Please only remember that good encryption algorithms have to
      generate data which cannot be compressed so using "BFSOCK|ZSOCK"
      only wastes resources and correct filter order is "ZSOCK|BFSOCK".
      BFSOCK filter recognize the following settings in initialization
      hash array:
         "key" or "pass" - string with encryption password
         "iv" - string with initialization vector for CTR mode

  * contrib/hbssl/hbssl.ch
  * contrib/hbssl/hbssl.h
  * contrib/hbssl/hbssl.hbm
  * contrib/hbssl/hbssl.hbx
  * contrib/hbssl/ssl.c
  * contrib/hbssl/ssl_inet.c
  + contrib/hbssl/ssl_sock.c
    + added SSL socket filter
      SSL socket filter can be created by new PRG functions:
         hb_socketNewSSL_connect( <pSocket>, <pSSL> [, <nTimeout> ] )
               -> <pSocketSSL> | NIL
         hb_socketNewSSL_accept( <pSocket>, <pSSL> [, <nTimeout> ] )
               -> <pSocketSSL> | NIL
      or by standard socket API with "SSL" as filter name.
      Programmers using hb_socketNew() can force linking this module by
         REQUEST hb_socketNewSSL_connect
      or
         REQUEST hb_socketNewSSL_accept
      SSL filter always disables any other filters and operates on raw
      socket.
      SSL filter recognize the following settings in initialization hash
      array:
         "ctx" or "key" - pointer SSL item <pSSL>
         "timeout" - timeout (numeric)
         "client" - logical value indicating client mode (SSL_connect())
         "server" - logical value indicating server mode (SSL_accept())

  * contrib/hbssl/tests/inetssl.prg
    ! cleaned typo in local function name

  * contrib/hbnetio/netiocli.c
  * contrib/hbnetio/netiosrv.c
    * use new Harbour extended socket API (hb_sockex*()) instead of
      raw sockets and hb_znet*()

  * contrib/hbtcpio/tcpio.c
    * use new Harbour extended socket API (hb_sockex*()) instead of
      raw sockets
    + implemented hb_fileFlush()
2015-08-26 15:51:35 +02:00
Przemysław Czerpak
864a1a106e 2015-08-17 15:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbznet.h
    + include hbsocket.h

  * src/rtl/hbznet.c
    * set socket error HB_SOCKET_ERR_OTHER if problems with
      ZLIB decompression appear
    * updated headers
2015-08-17 15:39:58 +02:00
Przemysław Czerpak
482e06d0fd 2015-08-17 15:29 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbsocket.h
  * src/rtl/hbsocket.c
  * src/rtl/hbsockhb.c
    + added new C functions:
         hb_socketAutoInit( void );
         hb_socketSetError( int iError );

  * contrib/hbtcpio/tcpio.c
    ! initialize socket subsystem - it fixes issue #105
2015-08-17 15:29:43 +02:00
Przemysław Czerpak
8bc6d4a0e9 2015-08-07 16:07 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/filesys.c
    * removed dummy code left by mistake
2015-08-07 16:07:30 +02:00
Przemysław Czerpak
dc5937b990 2015-08-07 15:40 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbtcpio/tcpio.c
  * contrib/hbtcpio/hbtcpio.hbx
    + added new PRG function
         hb_vfFromSocket( <pSocket> ) -> <pFile>
      It converts socket created by socket open into TCPIP virtual file
      which works just like files created by hb_vfOpen( "tcp:...", ... )

  * include/hbapifs.h
  * src/rtl/filesys.c
    + added new C function
         HB_SIZE hb_fsPipeWrite( HB_FHANDLE hPipe, const void * buffer,
                                 HB_SIZE nSize, HB_MAXINT nTimeOut );
    + implemented hb_fsPipeUnblock() in OS2 builds
    + set IO error in hb_fsPipeCreate(), hb_fsIsPipeOrSock() and
      hb_fsPipeUnblock()
    * return ( HB_SIZE ) -1 from hb_fsPipeRead() if end of stream is
      reached or read error appears on non empty buffer. This modification
      also change the behavior of PRG hb_PRead() function so now result -1
      can be used to detect end of stream.

  * src/rtl/philes.c
  * include/harbour.hbx
    + added new PRG function:
         hb_PWrite( <nPipeHandle>, <cBuffer>, [<nBytes>], [<nTimeOut>] )
               -> <nBytesWritten>
    % removed unnecessary assignment

  * include/hbapiitm.h
    + added HVM internal macro hb_itemRawSwap()

  * src/vm/asort.c
    % use hb_itemRawSwap()
    * in old code use comparison which prefers < and > operators
      instead of <= and >=
2015-08-07 15:40:40 +02:00
Przemysław Czerpak
7a80a882ab 2015-08-01 13:14 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/asort.c
    * restored original loop and added different workaround which for
      the problem in 64 bit MinGW we exploited. It's dummy function call
      inside a loop so probably link time optimization (LTO is enabled
      by -O4 in the newest GCC versions) ignore it and the problem will
      reappear. Anyhow it only temporary solution which should give time
      to create self contain example and report the problem to MinGW
      authors - it's highly possible that also other code exploited this
      problem so be careful with MinGW64.
    % fixed index range checking to eliminate unnecessary index verification
2015-08-01 13:14:30 +02:00
Przemysław Czerpak
f9dd95c243 2015-08-01 01:28 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/asort.c
    * added workaround for bug in 64 bit MinGW builds
2015-08-01 01:28:33 +02:00
Przemysław Czerpak
748cf7e81f 2015-07-31 17:12 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/asort.c
    ! fixed missing nStart checking during array items reordering

  * utils/hbtest/rt_array.prg
    * updated Harbour specific results - I thought that someone
      invested time to exactly replicate CA-Cl*pper ASort() sorting
      but in fact Harbour specific resutls where hardcoded inside
      HBTEST so previous code was not Cl*pper compatible in the
      same way as current one.
2015-07-31 17:12:25 +02:00
Przemysław Czerpak
964e9a6695 2015-07-31 16:42 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/gtxwc/gtxwc.c
  * src/rtl/mlcfunc.c
    * pacified new GCC C++ warnings

  * src/rtl/hbsocket.c
    * do not execute select() if HVM exception was generated when
      socket handlers are extracted but return an error immediately
2015-07-31 16:42:52 +02:00
Przemysław Czerpak
9e318add44 2015-07-31 16:01 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/vm/asort.c
    % added new code for ASort()
      Warning: new sorting algorithm is stable (does not change the
               order of equal items). It means is not strictly Cl*pper
               compatible and it can be seen some dummy ASort() tests
               in HBTEST results.
2015-07-31 16:01:33 +02:00
Przemysław Czerpak
78c1d987db 2015-07-31 14:51 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
2015-07-31 14:04 UTC+0200 Viktor Szakats (vszakats users.noreply.github.com)
  * include/hbapifs.h
  * src/rtl/filebuf.c
  * src/rtl/vfile.c
    + add C-level hb_fileSizeGet() function
    * update HB_VFSIZE() to use hb_fileSizeGet() when passed a filename
      It means now HB_VFSIZE() works for non-virtual filenames
      just like HB_FSIZE() did.
2015-07-31 14:51:22 +02:00
Przemysław Czerpak
72d3e97284 2015-07-28 01:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/padx.c
    ! fixed typo in hb_UPad[LRC]() functions - thanks to Grigory Filatov
2015-07-28 01:39:58 +02:00