diff --git a/harbour/config/dos/global.cf b/harbour/config/dos/global.cf index d587141361..316b56a3cb 100644 --- a/harbour/config/dos/global.cf +++ b/harbour/config/dos/global.cf @@ -7,6 +7,7 @@ ifndef MK all : first HB_GT_LIBS=\ + gtcgi \ gtdos \ gtpca \ gtstd \ diff --git a/harbour/config/linux/global.cf b/harbour/config/linux/global.cf index 321472926d..41519d5999 100644 --- a/harbour/config/linux/global.cf +++ b/harbour/config/linux/global.cf @@ -5,6 +5,7 @@ all : first HB_GT_LIBS=\ + gtcgi \ gtcrs \ gtpca \ gtsln \ diff --git a/harbour/config/os2/global.cf b/harbour/config/os2/global.cf index 4a3e852be3..73db5a2e6f 100644 --- a/harbour/config/os2/global.cf +++ b/harbour/config/os2/global.cf @@ -5,6 +5,7 @@ all : first HB_GT_LIBS=\ + gtcgi \ gtos2 \ gtpca \ gtstd \ diff --git a/harbour/config/w32/global.cf b/harbour/config/w32/global.cf index 76ebbb331c..9068bcfa86 100644 --- a/harbour/config/w32/global.cf +++ b/harbour/config/w32/global.cf @@ -5,6 +5,7 @@ all : first HB_GT_LIBS=\ + gtcgi \ gtpca \ gtstd \ gtwin \ diff --git a/harbour/include/Makefile b/harbour/include/Makefile index da8b761700..878f4efdf5 100644 --- a/harbour/include/Makefile +++ b/harbour/include/Makefile @@ -16,6 +16,7 @@ C_HEADERS=\ hbapirdd.h \ hbcomp.h \ hbdate.h \ + hbdbsort.h \ hbdefs.h \ hberrors.h \ hbexprop.h \ @@ -24,6 +25,10 @@ C_HEADERS=\ hbmacro.h \ hbpcode.h \ hbpp.h \ + hbrdddbf.h \ + hbrdddel.h \ + hbrddsdf.h \ + hbrddwrk.h \ hbset.h \ hbsetup.h \ hbtrace.h \ diff --git a/harbour/source/compiler/hbusage.c b/harbour/source/compiler/hbusage.c index a1f25162d6..4a63682dc3 100644 --- a/harbour/source/compiler/hbusage.c +++ b/harbour/source/compiler/hbusage.c @@ -52,7 +52,7 @@ void hb_compPrintUsage( char * szSelf ) "\n %cgo output type: Windows/DOS OBJ32 (.obj)", "\n %cgh output type: Harbour Portable Object (.hrb)", "\n %cgj output type: Java source (.java)", - "\n %ci add #include file search path", + "\n %ci #include file search path", "\n %cl suppress line number information", "\n %cm compile module only", "\n %cn no implicit starting procedure", diff --git a/harbour/source/rdd/dbsort.prg b/harbour/source/rdd/dbsort.prg index 935a1c24eb..5fc133f097 100644 --- a/harbour/source/rdd/dbsort.prg +++ b/harbour/source/rdd/dbsort.prg @@ -38,7 +38,6 @@ FUNCTION __dbSort( cToFileName, aFields, bFor, bWhile, nNext, nRecord, lRest ) LOCAL nToArea LOCAL aStruct LOCAL oError - LOCAL lError := .F. nArea := Select() @@ -55,9 +54,6 @@ FUNCTION __dbSort( cToFileName, aFields, bFor, bWhile, nNext, nRecord, lRest ) __dbArrange( nToArea, aStruct, bFor, bWhile, nNext, nRecord, lRest, aFields ) RECOVER USING oError - - lError := .T. - END SEQUENCE IF nToArea != NIL @@ -67,8 +63,8 @@ FUNCTION __dbSort( cToFileName, aFields, bFor, bWhile, nNext, nRecord, lRest ) dbSelectArea( nArea ) - IF lError + IF oError != NIL Break( oError ) ENDIF - RETURN .T. \ No newline at end of file + RETURN .T. diff --git a/harbour/source/rdd/dbstrux.prg b/harbour/source/rdd/dbstrux.prg index a5a227ab6a..1e306c0d36 100644 --- a/harbour/source/rdd/dbstrux.prg +++ b/harbour/source/rdd/dbstrux.prg @@ -57,10 +57,10 @@ FUNCTION __dbCopyXStruct( cFileName ) dbSelectArea( 0 ) __dbCreate( cFileName, NIL, NIL, .F., NIL ) - aEval( aStruct, {| aField | iif( aField[ DBS_TYPE ] == "C" .AND. aField[ DBS_LEN ] > 255, ; + AEval( aStruct, {| aField | iif( aField[ DBS_TYPE ] == "C" .AND. aField[ DBS_LEN ] > 255, ; ( aField[ DBS_DEC ] := Int( aField[ DBS_LEN ] / 256 ), aField[ DBS_LEN ] := aField[ DBS_LEN ] % 256 ), NIL ) } ) - aEval( aStruct, {| aField | dbAppend(),; + AEval( aStruct, {| aField | dbAppend(),; FIELD->FIELD_NAME := aField[ DBS_NAME ],; FIELD->FIELD_TYPE := aField[ DBS_TYPE ],; FIELD->FIELD_LEN := aField[ DBS_LEN ], ; @@ -109,7 +109,7 @@ FUNCTION __dbCreate( cFileName, cFileFrom, cRDDName, lNew, cAlias ) dbUseArea( lNew,, cFileFrom ) - dbEval( {|| aAdd( aStruct, { FIELD->FIELD_NAME ,; + dbEval( {|| AAdd( aStruct, { FIELD->FIELD_NAME ,; FIELD->FIELD_TYPE ,; FIELD->FIELD_LEN ,; FIELD->FIELD_DEC } ) } ) @@ -119,7 +119,7 @@ FUNCTION __dbCreate( cFileName, cFileFrom, cRDDName, lNew, cAlias ) dbSelectArea( nOldArea ) ENDIF - aEval( aStruct, {| aField | iif( aField[ DBS_TYPE ] == "C" .AND. aField[ DBS_DEC ] != 0, ; + AEval( aStruct, {| aField | iif( aField[ DBS_TYPE ] == "C" .AND. aField[ DBS_DEC ] != 0, ; aField[ DBS_LEN ] := aField[ DBS_LEN ] + aField[ DBS_DEC ] * 256, NIL ) } ) dbCreate( cFileName, aStruct, cRDDName ) @@ -159,8 +159,8 @@ FUNCTION __dbStructFilter( aStruct, aFieldList ) aStructFiltered := {} bFindName := {| aField | aField[ DBS_NAME ] == RTrim( Upper(cName ) ) } - aEval( aFieldList, {| cFieldName, nIndex | cName := cFieldName, nIndex := aScan( aStruct, bFindName ),; - iif( nIndex == 0, NIL, aAdd( aStructFiltered, aStruct[ nIndex] ) ) } ) + AEval( aFieldList, {| cFieldName, nIndex | cName := cFieldName, nIndex := aScan( aStruct, bFindName ),; + iif( nIndex == 0, NIL, AAdd( aStructFiltered, aStruct[ nIndex] ) ) } ) RETURN aStructFiltered diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 08cbf15923..43dd6ef5d6 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -398,7 +398,7 @@ static void hb_conDevPos( SHORT iRow, SHORT iCol ) hb_gtSetPos( iRow, iCol ); } -/* NOTE: This should be placed after the hb_devpos() definition. */ +/* NOTE: This should be placed after the hb_conDevPos() definition. */ HB_FUNC( DEVPOS ) /* Sets the screen and/or printer position */ { diff --git a/harbour/source/rtl/filesys.c b/harbour/source/rtl/filesys.c index 6ccba7dfc2..3d9a2860ff 100644 --- a/harbour/source/rtl/filesys.c +++ b/harbour/source/rtl/filesys.c @@ -861,25 +861,7 @@ BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart, HB_TRACE(HB_TR_DEBUG, ("hb_fsLock(%p, %lu, %lu, %hu)", hFileHandle, ulStart, ulLength, uiMode)); -#if defined(HAVE_POSIX_IO) && !defined(__GNUC__) && !defined(__IBMCPP__) && !defined(HB_OS_OS2) - - errno = 0; - switch( uiMode ) - { - case FL_LOCK: - iResult = lock( hFileHandle, ulStart, ulLength ); - break; - - case FL_UNLOCK: - iResult = unlock( hFileHandle, ulStart, ulLength ); - break; - - default: - iResult = 0; - } - s_uiErrorLast = errno; - -#elif defined(HB_OS_OS2) +#if defined(HB_OS_OS2) { struct _FILELOCK fl, ful; @@ -1015,6 +997,24 @@ BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart, s_uiErrorLast = errno; } +#elif defined(HAVE_POSIX_IO) && !defined(__IBMCPP__) + + errno = 0; + switch( uiMode ) + { + case FL_LOCK: + iResult = lock( hFileHandle, ulStart, ulLength ); + break; + + case FL_UNLOCK: + iResult = unlock( hFileHandle, ulStart, ulLength ); + break; + + default: + iResult = 0; + } + s_uiErrorLast = errno; + #else iResult = 1; diff --git a/harbour/source/rtl/inkey.c b/harbour/source/rtl/inkey.c index 53e3c5518d..0bebbe98fe 100644 --- a/harbour/source/rtl/inkey.c +++ b/harbour/source/rtl/inkey.c @@ -84,9 +84,7 @@ int hb_inkey( BOOL bWait, double dSeconds, HB_inkey_enum event_mask ) if( ( event_mask & ( INKEY_ALL + INKEY_RAW ) ) != 0 ) { while( hb_inkeyNext() == 0 ) - { hb_idleState(); - } } } else @@ -94,9 +92,7 @@ int hb_inkey( BOOL bWait, double dSeconds, HB_inkey_enum event_mask ) clock_t end_clock = clock() + ( clock_t ) ( dSeconds * CLOCKS_PER_SEC ); while( hb_inkeyNext() == 0 && clock() < end_clock ) - { hb_idleState(); - } } } @@ -127,8 +123,11 @@ int hb_inkeyGet( void ) /* Extract the next key from the keyboard buffer * key = s_inkeyLast; } } - else key = s_inkeyLast = s_inkeyForce; /* Typeahead support is disabled */ + else + key = s_inkeyLast = s_inkeyForce; /* Typeahead support is disabled */ + s_inkeyForce = 0; + return key; } @@ -143,8 +142,6 @@ int hb_inkeyLast( void ) /* Return the value of the last key that was extra int hb_inkeyNext( void ) /* Return the next key without extracting it */ { - int key; - HB_TRACE(HB_TR_DEBUG, ("hb_inkeyNext()")); hb_inkeyPoll(); @@ -153,14 +150,12 @@ int hb_inkeyNext( void ) /* Return the next key without extracting it */ { /* Proper typeahead support is enabled */ if( s_inkeyHead == s_inkeyTail ) - key = 0; /* No key */ + return 0; /* No key */ else - key = s_inkeyBuffer[ s_inkeyTail ]; /* Next key */ + return s_inkeyBuffer[ s_inkeyTail ]; /* Next key */ } - else - key = s_inkeyForce; /* Typeahead support is disabled */ - return key; + return s_inkeyForce; /* Typeahead support is disabled */ } void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour buffer */ @@ -202,7 +197,8 @@ void hb_inkeyReset( BOOL allocate ) /* Reset the keyboard buffer */ if( allocate ) { /* If the buffer already exists, free it */ - if( s_inkeyBuffer ) hb_xfree( s_inkeyBuffer ); + if( s_inkeyBuffer ) + hb_xfree( s_inkeyBuffer ); /* Always allocate a new buffer, unless it's being freed from hb_setRelease() */ if( hb_set.HB_SET_TYPEAHEAD > -1 ) @@ -253,7 +249,8 @@ HB_FUNC( __KEYBOARD ) while( size-- ) { int ch = *fPtr++; - if( ch == 59 ) ch = 13; /* Convert ";" to CR, like Clipper does */ + if( ch == 59 ) + ch = 13; /* Convert ";" to CR, like Clipper does */ hb_inkeyPut( ch ); } } @@ -270,6 +267,7 @@ void hb_inkeyPut( int ch ) { /* Proper typeahead support is set */ int head = s_inkeyHead; + s_inkeyBuffer[ head++ ] = ch; if( head >= hb_set.HB_SET_TYPEAHEAD ) head = 0; if( head != s_inkeyTail ) s_inkeyHead = head; diff --git a/harbour/source/rtl/objfunc.prg b/harbour/source/rtl/objfunc.prg index 0a61db10c6..9727a9ec49 100644 --- a/harbour/source/rtl/objfunc.prg +++ b/harbour/source/rtl/objfunc.prg @@ -234,7 +234,7 @@ FUNCTION __objDelData( oObject, cSymbol ) RETURN oObject FUNCTION __objDerivedFrom( oObject, xSuper ) - Local cClassName + LOCAL cClassName IF !ISOBJECT( oObject ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) @@ -248,5 +248,5 @@ FUNCTION __objDerivedFrom( oObject, xSuper ) __errRT_BASE( EG_ARG, 3101, NIL, ProcName( 0 ) ) ENDIF - RETURN __ClsParent( oObject:ClassH, cClassName ) + RETURN __clsParent( oObject:ClassH, cClassName ) diff --git a/harbour/source/rtl/run.c b/harbour/source/rtl/run.c index 78a417f4e3..8c05014ce7 100644 --- a/harbour/source/rtl/run.c +++ b/harbour/source/rtl/run.c @@ -43,16 +43,14 @@ HB_FUNC( __RUN ) { #if defined(__TURBOC__) || defined(__BORLANDC__) || defined(_MSC_VER) || defined(__IBMCPP__) || defined(__GNUC__) - if( ISCHAR( 1 ) ) + if( ISCHAR( 1 ) && hb_gtSuspend() ) { - if ( hb_gtSuspend() ) + system( hb_parc( 1 ) ); + + if( ! hb_gtResume() ) { - system( hb_parc( 1 ) ); - if ( !hb_gtResume() ) - { - /* an error should be generated here !! Something like */ - /* hb_errRT_BASE_Ext1( EG_GTRESUME, 9999, NULL, "__RUN", 0, EF_CANDEFAULT ); */ - } + /* an error should be generated here !! Something like */ + /* hb_errRT_BASE_Ext1( EG_GTRESUME, 9999, NULL, "__RUN", 0, EF_CANDEFAULT ); */ } } #else diff --git a/harbour/source/rtl/tobject.prg b/harbour/source/rtl/tobject.prg index a6dfc52b7b..160fc7a421 100644 --- a/harbour/source/rtl/tobject.prg +++ b/harbour/source/rtl/tobject.prg @@ -47,7 +47,6 @@ * Improving class(y) compatibility * adding messages :error() and ::MsgNotFound() * - * * See doc/license.txt for licensing terms. * */ diff --git a/harbour/utils/hbtest/rt_main.ch b/harbour/utils/hbtest/rt_main.ch index 08c68eb321..df8c142546 100644 --- a/harbour/utils/hbtest/rt_main.ch +++ b/harbour/utils/hbtest/rt_main.ch @@ -37,7 +37,7 @@ #ifndef __HARBOUR__ #ifndef __XPP__ - #ifndef __FLAGSHIP__ /* QUESTION: is this the correct constant ? */ + #ifndef FlagShip #ifndef __VO__ /* QUESTION: is this the correct constant ? */ #define __CLIPPER__ #endif