diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 4c87e5f19e..6d2580b32b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,11 @@ +19990509-18:00 CET Victor Szel + + * source/rtl/strings.c: + hb_At() -> hb_strAt() + * source/rtl/*.c, source/include/extend.h + hb_julian2greg() -> hb_dateDecode() + hb_greg2julian() -> hb_dateEncode() + 19990508-20:57 Eddie Runia * source/rtl/arrays.c: Fixed unreleased memory block in aEval. @@ -76,7 +84,7 @@ Sat May 8 03:02:04 1999 Ryszard Glab Thu May 07 17:00:00 1999 Victor Szel * source/rtl/strings.c: - Adapted changes by "Matthew Hamilton" + Adapted changes by Matthew Hamilton Some internal functions renamed long type changed to ULONG. diff --git a/harbour/include/extend.h b/harbour/include/extend.h index e9e2b60591..424c960c5e 100644 --- a/harbour/include/extend.h +++ b/harbour/include/extend.h @@ -152,8 +152,8 @@ ULONG ArrayGetStringLen( PITEM pArray, ULONG ulIndex ); /* retrieves the string int hb_itemStrCmp( PITEM pFirst, PITEM pSecond ); /* our string compare */ BOOL hb_strempty( char * szText, ULONG ulLen ); -long hb_greg2julian( long lDay, long lMonth, long lYear ); -void hb_julian2greg( long julian, long * plDay, long * plMonth, long * plYear ); +long hb_dateEncode( long lDay, long lMonth, long lYear ); +void hb_dateDecode( long julian, long * plDay, long * plMonth, long * plYear ); HARBOURFUNC GetMethod( PITEM pObject, PSYMBOL pSymMsg ); /* returns the method pointer of a object class */ char * _GetClassName( PITEM pObject ); /* retrieves an object class name */ diff --git a/harbour/source/rtl/dates.c b/harbour/source/rtl/dates.c index 2c34c8b3d5..fcaaa12108 100644 --- a/harbour/source/rtl/dates.c +++ b/harbour/source/rtl/dates.c @@ -11,7 +11,7 @@ #define _OPTIMIZE_DTOS #endif -long hb_greg2julian( long lDay, long lMonth, long lYear ) +long hb_dateEncode( long lDay, long lMonth, long lYear ) { long lFactor = ( lMonth < 3 ) ? -1: 0; @@ -21,7 +21,7 @@ long hb_greg2julian( long lDay, long lMonth, long lYear ) lDay - 32075; } -void hb_julian2greg( long julian, long * plDay, long * plMonth, long * plYear ) +void hb_dateDecode( long julian, long * plDay, long * plMonth, long * plYear ) { long U, V, W, X; @@ -299,7 +299,7 @@ HARBOUR DAY( void ) if( pDate ) { - hb_julian2greg( pDate->value.lDate, &lDay, &lMonth, &lYear ); + hb_dateDecode( pDate->value.lDate, &lDay, &lMonth, &lYear ); _retni( lDay ); } else @@ -318,7 +318,7 @@ HARBOUR MONTH( void ) if( pDate ) { - hb_julian2greg( pDate->value.lDate, &lDay, &lMonth, &lYear ); + hb_dateDecode( pDate->value.lDate, &lDay, &lMonth, &lYear ); _retni( lMonth ); } else @@ -337,7 +337,7 @@ HARBOUR YEAR( void ) if( pDate ) { - hb_julian2greg( pDate->value.lDate, &lDay, &lMonth, &lYear ); + hb_dateDecode( pDate->value.lDate, &lDay, &lMonth, &lYear ); _retni( lYear ); } else diff --git a/harbour/source/rtl/extend.c b/harbour/source/rtl/extend.c index 6eb9d8a080..ce02c1ce21 100644 --- a/harbour/source/rtl/extend.c +++ b/harbour/source/rtl/extend.c @@ -110,7 +110,7 @@ char * _pards( WORD wParam, ... ) else if( IS_DATE( pItem ) ) { - hb_julian2greg( pItem->value.lDate, &lDay, &lMonth, &lYear ); + hb_dateDecode( pItem->value.lDate, &lDay, &lMonth, &lYear ); stack.szDate[ 0 ] = ( lYear / 1000 ) + '0'; stack.szDate[ 1 ] = ( ( lYear % 1000 ) / 100 ) + '0'; @@ -323,7 +323,7 @@ void _retds( char * szDate ) /* szDate must have yyyymmdd format */ /* QUESTION: Is this ok ? we are going to use a long to store the date */ /* QUESTION: What happens if we use sizeof( LONG ) instead ? */ /* QUESTION: Would it break Clipper language code ? */ - stack.Return.value.lDate = hb_greg2julian( lDay, lMonth, lYear ); + stack.Return.value.lDate = hb_dateEncode( lDay, lMonth, lYear ); } void _retnd( double dNumber ) @@ -450,7 +450,7 @@ void _stords( char * szDate, WORD wParam, ... ) /* szDate must have yyyymmdd for pItemRef = stack.pItems + pItem->value.wItem; ItemRelease( pItemRef ); pItemRef->wType = IT_DATE; - pItemRef->value.lDate = hb_greg2julian( lDay, lMonth, lYear ); + pItemRef->value.lDate = hb_dateEncode( lDay, lMonth, lYear ); } } } diff --git a/harbour/source/rtl/itemapi.c b/harbour/source/rtl/itemapi.c index 7e8b7d4b2b..4ad5e7b135 100644 --- a/harbour/source/rtl/itemapi.c +++ b/harbour/source/rtl/itemapi.c @@ -224,7 +224,7 @@ char *_itemGetDS( PITEM pItem, char *szDate ) if( pItem && IS_DATE(pItem) ) { long lDay, lMonth, lYear; - hb_julian2greg(pItem->value.lDate, &lDay, &lMonth, &lYear); + hb_dateDecode(pItem->value.lDate, &lDay, &lMonth, &lYear); szDate[ 0 ] = ( lYear / 1000 ) + '0'; szDate[ 1 ] = ( ( lYear % 1000 ) / 100 ) + '0'; @@ -314,7 +314,7 @@ PITEM _itemPutDS( PITEM pItem, char *szDate ) /* QUESTION: Is this ok ? we are going to use a long to store the date */ /* QUESTION: What happens if we use sizeof( LONG ) instead ? */ /* QUESTION: Would it break Clipper language code ? */ - pItem->value.lDate = hb_greg2julian(lDay, lMonth, lYear); + pItem->value.lDate = hb_dateEncode(lDay, lMonth, lYear); return pItem; } diff --git a/harbour/source/rtl/strings.c b/harbour/source/rtl/strings.c index 31a2276577..07f5053613 100644 --- a/harbour/source/rtl/strings.c +++ b/harbour/source/rtl/strings.c @@ -271,7 +271,7 @@ HARBOUR PADC( void ) _retc(""); } -ULONG hb_At(char *szSub, long lSubLen, char *szText, long lLen) +ULONG hb_strAt(char *szSub, long lSubLen, char *szText, long lLen) { if( lSubLen ) { @@ -311,7 +311,7 @@ HARBOUR AT( void ) { if( pText->wType == IT_STRING && pSub->wType == IT_STRING ) { - _retnl( hb_At(pSub->value.szText, pSub->wLength, pText->value.szText, pText->wLength) ); + _retnl( hb_strAt(pSub->value.szText, pSub->wLength, pText->value.szText, pText->wLength) ); } else { diff --git a/harbour/source/rtl/transfrm.c b/harbour/source/rtl/transfrm.c index 1d620fde0e..0fe2563293 100644 --- a/harbour/source/rtl/transfrm.c +++ b/harbour/source/rtl/transfrm.c @@ -376,7 +376,7 @@ char *DatePicture( long lDate, int iPicFlags, long *lRetSize ) else { iPicFlags |= PF_ZERO; /* Pad with zeros */ - hb_julian2greg( lDate, &lDay, &lMonth, &lYear ); + hb_dateDecode( lDate, &lDay, &lMonth, &lYear ); /* Calculate d/m/y */ } iLenPic = strlen( szDateFormat );