From f221c5324d99757955927e4e57fc662645b806f4 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Thu, 18 Jun 2009 07:22:51 +0000 Subject: [PATCH] 2009-06-18 09:20 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/hbct/Makefile + contrib/hbct/dattime4.c * contrib/hbct/datetime.c * Moved STOD() into separate file to avoid linking problems when HB_COMPAT_XPP is defined. ! Removed HB_COMPAT_XPP protection. No longer needed. ! Restored my copyright for STOD(). * Updated STOD() content with core code. ; TOFIX: ? Probably it would be best to remove this function from here, otherwise it may just create syncing problems. Also from xpp lib. Opinions? * contrib/xpp/xpp.ch + Now defining HB_COMPAT_XPP. This can be helpful to enable some extra XPP feature in our core headers. (unless we find a better solution for this) + Added NOTE to include this header before Harbour ones. --- harbour/ChangeLog | 19 ++++++++ harbour/contrib/hbct/Makefile | 1 + harbour/contrib/hbct/datetime.c | 38 +-------------- harbour/contrib/hbct/dattime4.c | 85 +++++++++++++++++++++++++++++++++ harbour/contrib/xpp/xpp.ch | 6 +++ 5 files changed, 112 insertions(+), 37 deletions(-) create mode 100644 harbour/contrib/hbct/dattime4.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index d2143351b1..b6785d2a85 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,25 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-06-18 09:20 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/hbct/Makefile + + contrib/hbct/dattime4.c + * contrib/hbct/datetime.c + * Moved STOD() into separate file to avoid linking problems + when HB_COMPAT_XPP is defined. + ! Removed HB_COMPAT_XPP protection. No longer needed. + ! Restored my copyright for STOD(). + * Updated STOD() content with core code. + ; TOFIX: ? Probably it would be best to remove this function + from here, otherwise it may just create syncing + problems. Also from xpp lib. Opinions? + + * contrib/xpp/xpp.ch + + Now defining HB_COMPAT_XPP. This can be helpful to enable + some extra XPP feature in our core headers. (unless we find + a better solution for this) + + Added NOTE to include this header before Harbour ones. + 2009-06-18 08:52 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/gtwvg/wvgscrlb.prg * contrib/gtwvg/wvgclass.prg diff --git a/harbour/contrib/hbct/Makefile b/harbour/contrib/hbct/Makefile index b94e20e7a6..b61c6ce065 100644 --- a/harbour/contrib/hbct/Makefile +++ b/harbour/contrib/hbct/Makefile @@ -43,6 +43,7 @@ C_SOURCES =\ datetime.c \ dattime2.c \ dattime3.c \ + dattime4.c \ dbftools.c \ disk.c \ expand.c \ diff --git a/harbour/contrib/hbct/datetime.c b/harbour/contrib/hbct/datetime.c index c8b07593eb..a1a77da983 100644 --- a/harbour/contrib/hbct/datetime.c +++ b/harbour/contrib/hbct/datetime.c @@ -7,7 +7,7 @@ * CT3 Date & Time functions: - BOM() / EOM() * - BOQ() / EOQ() * - BOY() / EOY() - * - WOM() + * - WOM() * * Copyright 2005 Pavel Tsarenko * www - http://www.harbour-project.org @@ -453,39 +453,3 @@ HB_FUNC( WOM ) hb_retni( 0 ); } } - - -/* $DOC$ - * $FUNCNAME$ - * STOD() - * $CATEGORY$ - * CT3 date and time functions - * $ONELINER$ - * Convert ANSI date string to Harbour date - * $SYNTAX$ - * STOD ([]) -> dDate - * $ARGUMENTS$ - * $RETURNS$ - * $DESCRIPTION$ - * TODO: add documentation - * $EXAMPLES$ - * $TESTS$ - * $STATUS$ - * Started - * $COMPLIANCE$ - * STOD() is compatible with CT3's STOD(). - * $PLATFORMS$ - * All - * $FILES$ - * Source is datetime.prg, library is libct. - * $SEEALSO$ - * $END$ - */ - -/* this function is allready implemented in RTL when HB_COMPAT_XPP is set */ -#ifndef HB_COMPAT_XPP -HB_FUNC( STOD ) -{ - hb_retds( hb_parclen( 1 ) >= 7 ? hb_parc( 1 ) : NULL ); -} -#endif diff --git a/harbour/contrib/hbct/dattime4.c b/harbour/contrib/hbct/dattime4.c new file mode 100644 index 0000000000..c873778257 --- /dev/null +++ b/harbour/contrib/hbct/dattime4.c @@ -0,0 +1,85 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * STOD() function + * + * Copyright 1999-2001 Viktor Szakats (harbour.01 syenar.hu) + * www - http://www.harbour-project.org + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this software; see the file COPYING. If not, write to + * the Free Software Foundation, Inc., 59 Temple Place, Suite 330, + * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/). + * + * As a special exception, the Harbour Project gives permission for + * additional uses of the text contained in its release of Harbour. + * + * The exception is that, if you link the Harbour libraries with other + * files to produce an executable, this does not by itself cause the + * resulting executable to be covered by the GNU General Public License. + * Your use of that executable is in no way restricted on account of + * linking the Harbour library code into it. + * + * This exception does not however invalidate any other reasons why + * the executable file might be covered by the GNU General Public License. + * + * This exception applies only to the code released by the Harbour + * Project under the name Harbour. If you copy code from other + * Harbour Project or Free Software Foundation releases into a copy of + * Harbour, as the General Public License permits, the exception does + * not apply to the code that you add in this way. To avoid misleading + * anyone as to the status of such modified files, you must delete + * this exception notice from them. + * + * If you write modifications of your own for Harbour, it is your choice + * whether to permit this exception to apply to your modifications. + * If you do not wish that, delete this exception notice. + * + */ + +/* $DOC$ + * $FUNCNAME$ + * STOD() + * $CATEGORY$ + * CT3 date and time functions + * $ONELINER$ + * Convert ANSI date string to Harbour date + * $SYNTAX$ + * STOD ([]) -> dDate + * $ARGUMENTS$ + * $RETURNS$ + * $DESCRIPTION$ + * TODO: add documentation + * $EXAMPLES$ + * $TESTS$ + * $STATUS$ + * Started + * $COMPLIANCE$ + * STOD() is compatible with CT3's STOD(). + * $PLATFORMS$ + * All + * $FILES$ + * Source is datetime.prg, library is libct. + * $SEEALSO$ + * $END$ + */ + +HB_FUNC( STOD ) +{ + PHB_ITEM pDateString = hb_param( 1, HB_IT_STRING ); + + hb_retds( hb_itemGetCLen( pDateString ) >= 7 ? hb_itemGetCPtr( pDateString ) : NULL ); +} diff --git a/harbour/contrib/xpp/xpp.ch b/harbour/contrib/xpp/xpp.ch index 8ddeb75e77..fd186c411c 100644 --- a/harbour/contrib/xpp/xpp.ch +++ b/harbour/contrib/xpp/xpp.ch @@ -50,6 +50,8 @@ * */ +/* NOTE: Add this header before regular Harbour headers. */ + #ifdef __XPP__ /* Translations for Harbour programs compiled with Xbase++ compiler */ @@ -57,6 +59,10 @@ #else #ifdef __HARBOUR__ +#ifndef HB_COMPAT_XPP +#define HB_COMPAT_XPP +#endif + /* Translations for Xbase++ programs compiled with Harbour compiler */ #include "hbclass.ch"