13 Commits

Author SHA1 Message Date
Przemysław Czerpak
1411ce7f9c 2025-12-13 19:38 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdate.h
  * src/common/hbdate.c
    * changed the following C functions:
         HB_BOOL hb_timeStrGetUTC( const char * szTime,
                                   int * piHour, int * piMinutes,
                                   int * piSeconds,
                                   int * piMSec, int * piUTCOffset );
         HB_BOOL hb_timeStampStrGetUTC( const char * szDateTime,
                                        int * piYear, int * piMonth,
                                        int * piDay, int * piHour,
                                        int * piMinutes, int * piSeconds,
                                        int * piMSec, int * piUTCOffset );
      to
         HB_BOOL hb_timeStrGetUTC( const char * szTime,
                                   int * piHour, int * piMinutes,
                                   int * piSeconds,
                                   int * piMSec, int * piUTCOffset,
                                   HB_BOOL * pfUTC );
         HB_BOOL hb_timeStampStrGetUTC( const char * szDateTime,
                                        int * piYear, int * piMonth,
                                        int * piDay, int * piHour,
                                        int * piMinutes, int * piSeconds,
                                        int * piMSec, int * piUTCOffset,
                                        HB_BOOL * pfUTC );
      Warning: incompatibility !!! New parameter HB_BOOL * pfUTC has been
               added. These functions are used by Harbour internally but
               if someone uses them in his code then he should add NULL
               to passed parameters.
    + added new C function:
         HB_BOOL hb_timeStampStrGetDTU( const char * szDateTime,
                                        long * plJulian, long * plMilliSec,
                                        HB_BOOL * pfUTC );
    ; the parameter pfUTC is used to retrieve information if time string
      represents UTC time.

  * src/rtl/dateshb.c
    * added 2-nd parameter to hb_StrToTS() function which can be passed by
      reference to retrieve information if time string represents UTC time.
      Current syntax is:
         hb_StrToTS( <cTimeStr> [, @<lUTC> ] ) -> <tTime>
2025-12-13 19:38:15 +01:00
Przemysław Czerpak
5b05d5335d 2025-12-12 04:09 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/harbour.hbx
  * src/harbour.def
  * src/rtl/dateshb.c
    + added new PRG function which converts UTC time to local time:
          hb_UTCToTS( <tUTCTime> [, @<lUTCOffset> ) -> <tLocalTime>

  * include/hbdate.h
  * src/harbour.def
  * src/common/hbdate.c
    + added new C function which converts UTC time to local time:
         double hb_timeUTCToLocal( double dTimeStamp, int * piUTCOffset );
2025-12-12 04:09:11 +01:00
Przemysław Czerpak
b3ee8c65fb 2025-01-23 17:45 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdate.h
  * src/common/hbdate.c
  * src/harbour.def
    + added new C functions:
         HB_BOOL hb_timeStrGetUTC( const char * szTime,
                                   int * piHour, int * piMinutes,
                                   int * piSeconds, int * piMSec,
                                   int * piUTCOffset );
         HB_BOOL hb_timeStampStrGetUTC( const char * szDateTime,
                                        int * piYear, int * piMonth,
                                        int * piDay, int * piHour,
                                        int * piMinutes, int * piSeconds,
                                        int * piMSec, int * piUTCOffset );
      They can decode timestamp value with ISO 8601 UTC offset.

  * src/common/hbdate.c
    * use hb_timeStampStrGetUTC() in hb_timeStampStrGetDT() and return UTC
      time if it was with UTC offset
      Now Harbour compiler accept timestamp strings with with UTC offset, i.e.
         ? t"2025-01-22 00:45 UTC+0100" // => 2025-01-21 23:45:00.000
      Also HB_StrToTS() supports it.

  * src/pp/hbpp.c
    * use new hb_timeStampStrGetDT() to decode timestamp from ChangeLog to
      build revision number. It also fixes bug with decoding negative UTC
      offsets.
2025-01-23 17:45:49 +01: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
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
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
Viktor Szakats
58faf91453 2016-01-14 19:17 UTC+0100 Viktor Szakats (vszakats users.noreply.github.com)
* *
    % remove brandings and homepage [1] from copyright header. Pass 1 - using script.
      [1] nobody has access to it anymore AFAIK - and it's also just
          a redirect since long
    ! update url in copyright header
    ; this should make the diff between 3.4 and 3.2 easier to manage
2016-01-14 19:18:17 +01:00
Przemysław Czerpak
dc326d6f4a 2015-09-09 23:16 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbhpdf/3rd/libhpdf/hpdfimac.c
    ! removed obsolete memory.h

  * contrib/hbhpdf/3rd/libhpdf/libhpdf.dif
    * rediffed

  * include/hbdate.h
    * enabled reentrant safe version of localtime() and gmtime() in all
      OpenWatcom builds
2015-09-09 23:16:24 +02:00
Viktor Szakáts
6752936b57 use web url instead of obfuscated email 2013-10-09 20:08:24 +02:00
Przemysław Czerpak
e8c7f2067d 2013-07-18 02:24 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdate.h
  * src/common/hbdate.c
    + added new C functions:
         double hb_timeLocalToUTC( double dTimeStamp );
         long hb_timeStampUTCOffset( int iYear, int iMonth, int iDay,
                                     int iHour, int iMinutes, int iSeconds );
    ; warning: some C RTLs may not correctly detect Summer time for all past
               dates in few countries.

  * include/harbour.hbx
  * src/rtl/dateshb.c
    + added new PRG function:
         hb_TSToUTC( <tsLocal> ) -> <tsUTC>
    + added support for optional timestamp parameter in hb_UTCOffset()
      function, current syntax is:
         hb_UTCOffset( [ <tsLocal> ] ) -> <nSeconds>

  * contrib/hbtip/hbtip.hbx
  * contrib/hbtip/utils.c
    + added new PRG function:
         tip_FileNameMimeType( <cFileName> ) -> <cMimeType>
      It's a wrapper to old C function s_findFileMimeType()
      TODO: replace few independent mimetype functions by single one.
    ! fixed tip_FileMimeType() to not call hb_fsClose() or any other FS
      function with wrong handler.
    ! fixed tip_TimeStamp() using hb_timeStampUTCOffset() instead of
      hb_timeUTCOffset() to correctly calculate UTC offset for dates
      different then current one.
    ! decode time passed as numeric second() value in 2-nd parameter of
      tip_TimeStamp() only when the 1-st one contains pure date value.
2013-07-18 02:24:58 +02:00
vszakats
9687850865 2013-03-16 02:10 UTC+0100 Viktor Szakats (harbour syenar.net)
* (all files)
    * stripped svn header
    * minor cleanups
    ; use following command to find out the history of files:
       git log
       git log --follow
       git blame
       git annotate
2013-03-16 02:11:42 +01:00
vszakats
a4a357a18b 2013-03-15 11:12 UTC+0100 Viktor Szakats (harbour syenar.net)
* /harbour/* -> /*
    * moved whole Harbour source tree one level up to
      avoid single 'harbour' top dir
2013-03-15 11:13:30 +01:00