From 8560e7a374b77dca1333ab1f05accd78faf10d93 Mon Sep 17 00:00:00 2001 From: Antonio Linares Date: Tue, 5 Oct 1999 06:02:30 +0000 Subject: [PATCH] *** empty log message *** --- harbour/makefile.b32 | 4 +++- harbour/source/vm/hvm.c | 15 ++++----------- harbour/source/vm/mainstd.c | 15 +++++++++++++++ harbour/source/vm/mainwin.c | 29 +++++++++++++++++++++++++++++ harbour/tests/bld_b32.bat | 3 +-- 5 files changed, 52 insertions(+), 14 deletions(-) create mode 100644 harbour/source/vm/mainstd.c create mode 100644 harbour/source/vm/mainwin.c diff --git a/harbour/makefile.b32 b/harbour/makefile.b32 index 31722cf03e..50d400d691 100644 --- a/harbour/makefile.b32 +++ b/harbour/makefile.b32 @@ -23,7 +23,7 @@ harbour.lib : achoice.obj adir.obj alert.obj arrays.obj asort.obj \ dir.obj do.obj dynsym.obj environ.obj terror.obj cmdarg.obj \ errorapi.obj errorsys.obj harbinit.obj extend.obj fileread.obj filesys.obj fm.obj \ hardcr.obj hb_f.obj hvm.obj initsymb.obj inkey.obj itemapi.obj \ - langapi.obj math.obj mathx.obj memofile.obj memvars.obj menuto.obj mtran.obj msges.obj \ + langapi.obj mainstd.obj mainwin.obj math.obj mathx.obj memofile.obj memvars.obj menuto.obj mtran.obj msges.obj \ objfunc.obj readvar.obj xsavescr.obj memvarbl.obj \ set.obj setcolor.obj setkey.obj strfmt.obj strings.obj symbols.obj stringp.obj \ stringsx.obj tbcolumn.obj tbrowse.obj tbrwtext.obj tclass.obj tget.obj tgetlist.obj tone.obj transfrm.obj @@ -65,6 +65,8 @@ initsymb.obj : initsymb.c extend.h hbdefs.h inkey.obj : inkey.c extend.h hbdefs.h itemapi.obj : itemapi.c extend.h hbdefs.h langapi.obj : langapi.c extend.h hbdefs.h +mainstd.obj : mainstd.c extend.h hbdefs.h +mainwin.obj : mainwin.c extend.h hbdefs.h math.obj : math.c extend.h hbdefs.h mathx.obj : mathx.c extend.h hbdefs.h memofile.obj : memofile.c extend.h hbdefs.h diff --git a/harbour/source/vm/hvm.c b/harbour/source/vm/hvm.c index 1e7ae9e5c0..e8a55dfa0b 100644 --- a/harbour/source/vm/hvm.c +++ b/harbour/source/vm/hvm.c @@ -230,11 +230,9 @@ static USHORT s_uiActionRequest = 0; /* application entry point */ -int main( int argc, char * argv[] ) +void hb_vmInit( void ) { - HB_DEBUG( "main\n" ); - - hb_cmdargInit( argc, argv ); + HB_DEBUG( "hb_vmInit\n" ); /* initialize internal data structures */ aStatics.type = IT_NIL; @@ -305,8 +303,9 @@ int main( int argc, char * argv[] ) hb_vmPushNil(); /* places NIL at self */ iArgCount = 0; - for( i = 1; i < argc; i++ ) /* places application parameters on the stack */ + for( i = 1; i < hb_cmdargARGC(); i++ ) /* places application parameters on the stack */ { + char ** argv = hb_cmdargARGV(); /* Filter out any parameters beginning with //, like //INFO */ if( ! hb_cmdargIsInternal( argv[ i ] ) ) { @@ -317,12 +316,6 @@ int main( int argc, char * argv[] ) hb_vmDo( iArgCount ); /* invoke it with number of supplied parameters */ } - - hb_vmQuit(); - - /* This point is never reached */ - - return 0; } void hb_vmQuit( void ) diff --git a/harbour/source/vm/mainstd.c b/harbour/source/vm/mainstd.c new file mode 100644 index 0000000000..06200ce8f5 --- /dev/null +++ b/harbour/source/vm/mainstd.c @@ -0,0 +1,15 @@ +/* + * $Id + */ + +/* Std applications entry point */ + +void hb_vmInit( void ); +void hb_vmQuit( void ); + +int main( int argc, char * argv[] ) +{ + hb_cmdargInit( argc, argv ); + hb_vmInit(); + hb_vmQuit(); +} diff --git a/harbour/source/vm/mainwin.c b/harbour/source/vm/mainwin.c new file mode 100644 index 0000000000..a61321e9a3 --- /dev/null +++ b/harbour/source/vm/mainwin.c @@ -0,0 +1,29 @@ +/* + * $Id + */ + +/* Windows applications entry point */ + +#include + +void hb_cmdargInit( int argc, char * argv[] ); +void hb_vmInit( void ); +void hb_vmQuit( void ); + +HANDLE hb_hInstance = 0, hb_hPrevInstance = 0; + +int WINAPI WinMain( HINSTANCE hInstance, /* handle to current instance */ + HINSTANCE hPrevInstance, /* handle to previous instance */ + LPSTR lpCmdLine, /* pointer to command line */ + int nCmdShow ) /* show state of window */ +{ + char * argv[ 1 ]; /* TO DO: parse lpCmdLine and generate the proper values */ + + argv[ 0 ] = 0; /* temporary workaround */ + + hb_cmdargInit( 0, argv ); + hb_vmInit(); + hb_vmQuit(); + + return 0; /* TO DO: return the proper exit value */ +} diff --git a/harbour/tests/bld_b32.bat b/harbour/tests/bld_b32.bat index 052c4d21f4..b450dbaea0 100644 --- a/harbour/tests/bld_b32.bat +++ b/harbour/tests/bld_b32.bat @@ -4,5 +4,4 @@ rem $Id$ rem ..\bin\harbour %1 /n /i..\include -bcc32 %1.c -e%1.exe -O2 -I..\include -L..\lib\b32 -v harbour.lib terminal.lib hbpp.lib hbgt.lib rdd.lib -del %1.c +bcc32 -e%1.exe -O2 -I..\include -L..\lib\b32 -v harbour.lib terminal.lib hbpp.lib hbgt.lib rdd.lib %1.c