From 14798590689906d8ba89daa41b3e237604974d41 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Mon, 19 Jun 2000 08:12:44 +0000 Subject: [PATCH] 2000-06-19 10:11 UTC+0100 Victor Szakats --- harbour/ChangeLog | 23 ++++++ harbour/include/gt.api | 22 +++++ harbour/include/hbapigt.h | 24 ++++++ harbour/makefile.bc | 5 ++ harbour/makefile.vc | 1 + harbour/source/compiler/harbour.c | 32 ++++---- harbour/source/rtl/Makefile | 1 + harbour/source/rtl/gtapiu.c | 130 ++++++++++++++++++++++++++++++ 8 files changed, 220 insertions(+), 18 deletions(-) create mode 100644 harbour/source/rtl/gtapiu.c diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 777e53c474..85d736fde8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,26 @@ +2000-06-19 10:11 UTC+0100 Victor Szakats + + * include/hbapigt.h + * include/gt.api + + source/rtl/gtapiu.c + * source/rtl/Makefile + * makefile.bc + * makefile.vc + + Added all the missing undocumented GT API calls found in CA-Clipper 5.x. + The implementation is still missing, but now there's a dummy skeleton + for them. + + * source/compiler/harbour.c + ! Fixed a bug, where the status returned from hb_compCompile() was + ignored. + * The PP reinitialization turned on even on non-STRICT mode, to be 100% + Clipper compatible. + +2000-06-17 20:34 UTC-0500 April White + + * include/hbapi.h + * forgot an end of comment tag + 2000-06-17 19:43 UTC+0500 April White * include/hbapi.h diff --git a/harbour/include/gt.api b/harbour/include/gt.api index 2fb70018dc..b408dfe3cc 100644 --- a/harbour/include/gt.api +++ b/harbour/include/gt.api @@ -72,4 +72,26 @@ #define _gtWriteAt hb_gtWriteAt #define _gtWriteCon hb_gtWriteCon +/* Undocumented part */ + +#define _gtInit hb_gtInit +#define _gtExit hb_gtExit + +#define _gtWCreate hb_gtWCreate +#define _gtWDestroy hb_gtWDestroy +#define _gtWFlash hb_gtWFlash +#define _gtWApp hb_gtWApp +#define _gtWCurrent hb_gtWCurrent +#define _gtWPos hb_gtWPos +#define _gtWVis hb_gtWVis + +#define _gtSLR hb_gtSLR +#define _gtModalRead hb_gtModalRead +#define _gtBeginWrite hb_gtBeginWrite +#define _gtEndWrite hb_gtEndWrite +#define _gtFlushCursor hb_gtFlushCursor +#define _gtSetColor hb_gtSetColor +#define _gtGetColor hb_gtGetColor +#define _gtSetBorder hb_gtSetBorder + #endif /* _GT_API */ diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 131478e109..af4d35eef9 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -150,6 +150,30 @@ extern USHORT hb_gtWriteAt( USHORT uiRow, USHORT uiCol, BYTE * pbyStr, ULONG ulL extern USHORT hb_gtWriteCon( BYTE * pbyStr, ULONG ulLen ); extern char * hb_gtVersion( void ); +/* Undocumented CA-Clipper 5.x GT API calls */ + +#define HB_GT_RECT void +#define HB_GT_WND void +#define HB_GT_RGB void +#define HB_GT_SLR void + +extern void hb_gtWCreate( HB_GT_RECT * rect, HB_GT_WND ** wnd ); +extern void hb_gtWDestroy( HB_GT_WND * wnd ); +extern BOOL hb_gtWFlash( void ); +extern void hb_gtWApp( HB_GT_WND ** wnd ); +extern void hb_gtWCurrent( HB_GT_WND * wnd ); +extern void hb_gtWPos( HB_GT_WND * wnd, HB_GT_RECT * rect ); +extern BOOL hb_gtWVis( HB_GT_WND * wnd, USHORT uiStatus ); + +extern USHORT hb_gtSLR( HB_GT_SLR * pSLR ); /* System Level Request */ +extern USHORT hb_gtModalRead( void * ); +extern USHORT hb_gtBeginWrite( void ); +extern USHORT hb_gtEndWrite( void ); +extern USHORT hb_gtFlushCursor( void ); +extern USHORT hb_gtSetColor( HB_GT_RGB * color ); +extern USHORT hb_gtGetColor( HB_GT_RGB * color ); +extern USHORT hb_gtSetBorder( HB_GT_RGB * color ); + /* Private interface listed below. these are common to all platforms */ extern void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ); diff --git a/harbour/makefile.bc b/harbour/makefile.bc index f6ce838bd4..85b2f7c88c 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -196,6 +196,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\gete.obj \ $(OBJ_DIR)\gt.obj \ $(OBJ_DIR)\gtapi.obj \ + $(OBJ_DIR)\gtapiu.obj \ $(OBJ_DIR)\gx.obj \ $(OBJ_DIR)\hardcr.obj \ $(OBJ_DIR)\inkey.obj \ @@ -1182,6 +1183,10 @@ $(OBJ_DIR)\gtapi.obj : $(RTL_DIR)\gtapi.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, +$(OBJ_DIR)\gtapiu.obj : $(RTL_DIR)\gtapiu.c + $(CC) $(CLIBFLAGS) -o$@ $** + tlib $(RTL_LIB) $(ARFLAGS) -+$@,, + $(OBJ_DIR)\gx.obj : $(RTL_DIR)\gx.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/makefile.vc b/harbour/makefile.vc index 0a0312ddd6..9967a77464 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -221,6 +221,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\gete.obj \ $(OBJ_DIR)\gt.obj \ $(OBJ_DIR)\gtapi.obj \ + $(OBJ_DIR)\gtapiu.obj \ $(OBJ_DIR)\gx.obj \ $(OBJ_DIR)\hardcr.obj \ $(OBJ_DIR)\inkey.obj \ diff --git a/harbour/source/compiler/harbour.c b/harbour/source/compiler/harbour.c index 28b37c5328..c76cc4c4bc 100644 --- a/harbour/source/compiler/harbour.c +++ b/harbour/source/compiler/harbour.c @@ -223,21 +223,19 @@ int main( int argc, char * argv[] ) for( i = 1; i < argc; i++ ) { - if( !HB_ISOPTSEP( argv[ i ][ 0 ] ) ) + if( ! HB_ISOPTSEP( argv[ i ][ 0 ] ) ) { - if( !bAnyFiles ) - { + if( ! bAnyFiles ) bAnyFiles = TRUE; - } - hb_compCompile( argv[i], argc, argv ); + iStatus = hb_compCompile( argv[ i ], argc, argv ); if( iStatus != EXIT_SUCCESS ) break; } } - if( !bAnyFiles ) + if( ! bAnyFiles ) { hb_compPrintUsage( argv[ 0 ] ); iStatus = EXIT_FAILURE; @@ -3758,9 +3756,7 @@ int hb_compAutoOpen( char * szPrg, BOOL * pbSkipGen ) printf( "Compiling module '%s'...\n", szFileName ); } - #if defined( HB_C52_STRICT ) - hb_pp_Init(); - #endif + hb_pp_Init(); /* yyrestart( yyin ); @@ -3770,15 +3766,15 @@ int hb_compAutoOpen( char * szPrg, BOOL * pbSkipGen ) if( hb_comp_bStartProc ) hb_compFunctionAdd( hb_strupr( hb_strdup( hb_comp_pFileName->szName ) ), HB_FS_PUBLIC, FUN_PROCEDURE ); - { - int i = hb_comp_iExitLevel ; - BOOL b = hb_comp_bAnyWarning; - - yyparse(); - - hb_comp_iExitLevel = ( i > hb_comp_iExitLevel ? i : hb_comp_iExitLevel ); - hb_comp_bAnyWarning = ( b ? b : hb_comp_bAnyWarning ); - } + { + int i = hb_comp_iExitLevel ; + BOOL b = hb_comp_bAnyWarning; + + yyparse(); + + hb_comp_iExitLevel = ( i > hb_comp_iExitLevel ? i : hb_comp_iExitLevel ); + hb_comp_bAnyWarning = ( b ? b : hb_comp_bAnyWarning ); + } /* Close processed file (it is opened in hb_compInclude() function ) */ fclose( yyin ); diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index e35b88af38..01a8291a1c 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -36,6 +36,7 @@ C_SOURCES=\ gete.c \ gt.c \ gtapi.c \ + gtapiu.c \ gx.c \ hardcr.c \ inkey.c \ diff --git a/harbour/source/rtl/gtapiu.c b/harbour/source/rtl/gtapiu.c new file mode 100644 index 0000000000..543b48054a --- /dev/null +++ b/harbour/source/rtl/gtapiu.c @@ -0,0 +1,130 @@ +/* + * $Id$ + */ + +/* + * Harbour Project source code: + * The Terminal API (undocumented part) + * + * Copyright 2000 Victor Szakats + * 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 of the License, or + * (at your option) any later version, with one exception: + * + * The exception is that if you link the Harbour Runtime Library (HRL) + * and/or the Harbour Virtual Machine (HVM) 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 HRL + * and/or HVM code into it. + * + * 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 program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA (or visit + * their web site at http://www.gnu.org/). + * + */ + +#include "hbapigt.h" + +void hb_gtWCreate( HB_GT_RECT * rect, HB_GT_WND ** wnd ) +{ + HB_SYMBOL_UNUSED( rect ); + HB_SYMBOL_UNUSED( wnd ); +} + +void hb_gtWDestroy( HB_GT_WND * wnd ) +{ + HB_SYMBOL_UNUSED( wnd ); +} + +BOOL hb_gtWFlash( void ) +{ + return FALSE; +} + +void hb_gtWApp( HB_GT_WND ** wnd ) +{ + HB_SYMBOL_UNUSED( wnd ); +} + +void hb_gtWCurrent( HB_GT_WND * wnd ) +{ + HB_SYMBOL_UNUSED( wnd ); +} + +void hb_gtWPos( HB_GT_WND * wnd, HB_GT_RECT * rect ) +{ + HB_SYMBOL_UNUSED( wnd ); + HB_SYMBOL_UNUSED( rect ); +} + +BOOL hb_gtWVis( HB_GT_WND * wnd, USHORT uiStatus ) +{ + HB_SYMBOL_UNUSED( wnd ); + HB_SYMBOL_UNUSED( uiStatus ); + + return FALSE; +} + +USHORT hb_gtSLR( HB_GT_SLR * pSLR ) /* System Level Request */ +{ + /* Do nothing in Harbour, since it the low-level GT API is + implemented with a different method. */ + + HB_SYMBOL_UNUSED( pSLR ); + + return 1; +} + +USHORT hb_gtModalRead( void * dummy ) +{ + HB_SYMBOL_UNUSED( dummy ); + + return 1; +} + +USHORT hb_gtBeginWrite( void ) +{ + return 1; +} + +USHORT hb_gtEndWrite( void ) +{ + return 1; +} + +USHORT hb_gtFlushCursor( void ) +{ + return 1; +} + +USHORT hb_gtSetColor( HB_GT_RGB * color ) +{ + HB_SYMBOL_UNUSED( color ); + + return 1; +} + +USHORT hb_gtGetColor( HB_GT_RGB * color ) +{ + HB_SYMBOL_UNUSED( color ); + + return 1; +} + +USHORT hb_gtSetBorder( HB_GT_RGB * color ) +{ + HB_SYMBOL_UNUSED( color ); + + return 1; +} +