19991211-14:51 GMT+1 Victor Szel <info@szelvesz.hu>

This commit is contained in:
Viktor Szakats
1999-12-11 15:03:10 +00:00
parent 4597f2ff39
commit 9ac4a23deb
9 changed files with 202 additions and 22 deletions

View File

@@ -1,3 +1,20 @@
19991211-14:51 GMT+1 Victor Szel <info@szelvesz.hu>
* source/compiler/harbour.y
+ Missing #include <malloc.h> added.
* source/vm/hvm.c
source/vm/cmdarg.c
include/extend.h
+ Added //BUILD internal command line switch.
* Internal command line switch check moved to cmdarg.c from hvm.c.
Contribution by Jose Lalin <dezac@corevia.com>
* source/rtl/harbinit.prg
+ Added documentation by Chen Kedem.
* source/compiler/cmdcheck.c
* Some functions put under a separate copyright holder (unkown BTW).
* source/common/reserved.c
* Reapplied some minor changes.
( I could not test any of these, since I cannot build Harbour right now )
19991211-12:47 GMT+1 Antonio Linares <alinares@fivetech.com>
* updated makefile.b32 for reserved.c file.
@@ -124,7 +141,8 @@ NOTE: Add macro.lib to all non-GNU make scripts or batch files.
include/compiler.h
+ Additional function renaming (prefixing with hb_comp), some functions
moved to other files. Declarations fixed, some static vars prefixed
with s_.
with s_. Some functions made static, some declaration moved to
compiler.h.
hb_Chk*() -> hb_compChk*()
Print*() -> hb_compPrint*()
Gen*() -> hb_Gen*()

View File

@@ -375,6 +375,7 @@ extern BOOL hb_cmdargIsInternal( const char * szArg );
extern BOOL hb_cmdargCheck( const char * pszName ); /* Check if a given internal switch (like //INFO) was set */
extern char * hb_cmdargString( const char * pszName ); /* Returns the string value of an internal switch (like //TEMPPATH:"C:\") */
extern int hb_cmdargNum( const char * pszName ); /* Returns the numeric value of an internal switch (like //F:90) */
extern void hb_cmdargProcessVM( void );
/* Symbol management */
extern PHB_SYMB hb_symbolNew( char * szName );

View File

@@ -104,6 +104,7 @@ static const char * s_szReservedFun[] = {
"WORD" ,
"YEAR"
};
#define RESERVED_FUNCTIONS sizeof( s_szReservedFun ) / sizeof( char * )
char * hb_compReservedName( char * szName )
@@ -123,9 +124,7 @@ char * hb_compReservedName( char * szName )
iFound = strncmp( szName, s_szReservedFun[ wNum ], strlen( szName ) );
++wNum;
}
if( iFound )
return NULL;
else
return (char *) s_szReservedFun[ wNum - 1 ];
return iFound == 0 ? ( char * ) s_szReservedFun[ wNum - 1 ] : NULL;
}

View File

@@ -37,6 +37,11 @@
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999 {list of individual authors and e-mail addresses}
* hb_compChkEnvironVar()
* hb_compCheckPaths()
* AddSearchPath()
*
* Copyright 1999 Victor Szel <info@szelvesz.hu>
* PackDateTime()
*
@@ -80,7 +85,7 @@ static void AddSearchPath( char * szPath, PATHNAMES * * pSearchList )
is only stored in 6 bits, 1980 will result in the same bit pattern
as 2044. The purpose of this value is only used to *differenciate*
between the dates ( the exact dates are not significant ), so this
can be used here without problems. */
can be used here without problems. [vszel] */
/* 76543210765432107654321076543210
|.......|.......|.......|.......

View File

@@ -41,6 +41,8 @@
* 4) Support this syntax: nPtr := @Hello()
*/
#include <malloc.h>
#include "compiler.h"
/* Compile using: bison -d -v harbour.y */

View File

@@ -1,4 +1,3 @@
%pure_parser
%{
/*
* $Id$

View File

@@ -33,6 +33,18 @@
*
*/
/*
* The following parts are Copyright of the individual authors.
* www - http://www.harbour-project.org
*
* Copyright 1999 Chen Kedem <niki@actcom.co.il>
* CLIPINIT() documentation
* __SETHELPK() documentation
*
* See doc/license.txt for licensing terms.
*
*/
#include "inkey.ch"
ANNOUNCE SysInit
@@ -41,6 +53,38 @@ ANNOUNCE SysInit
ANNOUNCE CLIPPER520
ANNOUNCE CLIPPER530
/* $DOC$
* $FUNCNAME$
* CLIPINIT()
* $CATEGORY$
* Internal
* $ONELINER$
* Initialize various Harbour sub-systems
* $SYNTAX$
* CLIPINIT() --> NIL
* $ARGUMENTS$
* none.
* $RETURNS$
* CLIPINIT() always return NIL.
* $DESCRIPTION$
* CLIPINIT() is one of the pre-defined INIT PROCEDURE and is executed
* at program startup. It declare an empty MEMVAR PUBLIC array called
* GetList that is going to be used by the Get system, It activate the
* default error handler, and (at least for the moment) call the
* function that set the default help key.
* $EXAMPLES$
* $TESTS$
* $STATUS$
* $COMPLIANCE$
* It is said that CLIPINIT() should not call that function that set
* the default help key since CA-Clipper do it in some other place.
* $PLATFORMS$
* $FILES$
* $SEEALSO$
* INIT PROCEDURE
* $END$
*/
INIT PROCEDURE ClipInit
MEMVAR GetList
@@ -55,6 +99,34 @@ INIT PROCEDURE ClipInit
RETURN
/* $DOC$
* $FUNCNAME$
* __SetHelpK()
* $CATEGORY$
* Internal
* $ONELINER$
* Set F1 as the default help key
* $SYNTAX$
* __SetHelpK() --> NIL
* $ARGUMENTS$
* none.
* $RETURNS$
* __SetHelpK() always return NIL.
* $DESCRIPTION$
* Set F1 to execute a function called HELP if such a function is
* linked into the program.
* $EXAMPLES$
* $TESTS$
* $STATUS$
* $COMPLIANCE$
* __SetHelpK() works exactly like CA-Clipper's __SetHelpK()
* $PLATFORMS$
* $FILES$
* $SEEALSO$
* __XHelp(), SET KEY, SETKEY()
* $END$
*/
PROCEDURE __SetHelpK
SET KEY K_F1 TO __XHELP

View File

@@ -34,6 +34,7 @@
*/
#include "extend.h"
#include "hbmemory.ch"
/* Command line argument management */
static int s_argc = 0;
@@ -268,3 +269,100 @@ void hb_cmdargTEST( void )
#endif
/* Check for command line internal arguments */
void hb_cmdargProcessVM( void )
{
if( hb_cmdargCheck( "INFO" ) )
{
char * pszVersion = hb_version( 1 );
char buffer[ 128 ];
hb_outerr( pszVersion, 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
sprintf( buffer, "DS avail=%luKB OS avail=%luKB EMM avail=%luKB", hb_xquery( HB_MEM_BLOCK ), hb_xquery( HB_MEM_VM ), hb_xquery( HB_MEM_EMS ) );
hb_outerr( buffer, 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
hb_xfree( pszVersion );
}
if( hb_cmdargCheck( "BUILD" ) )
{
hb_outerr( "Harbour Compiler Build Info", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
/*
hb_outerr( "---------------------------", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
*/
#if defined( HARBOUR_STRICT_CLIPPER_COMPATIBILITY )
hb_outerr( "* Strict CA-Clipper compatibility: Yes", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#else
hb_outerr( "* Strict CA-Clipper compatibility: No", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#endif
#if defined( HB_COMPAT_XPP ) || defined( HB_COMPAT_XPP ) || defined( HB_COMPAT_VO )
hb_outerr( " With some support for:", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#if defined( HB_COMPAT_C53 )
hb_outerr( " CA-Clipper 5.3[a,b]", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#endif
#if defined( HB_COMPAT_XPP )
hb_outerr( " Alaska XBase++", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#endif
#if defined( HB_COMPAT_VO )
hb_outerr( " CA-Visual Objects", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#endif
#endif
#if defined( HARBOUR_USE_GTAPI )
hb_outerr( "* GT API: ", 0 );
#if defined( HARBOUR_USE_STD_GTAPI )
hb_outerr( "Standard", 0 );
#elif defined( HARBOUR_USE_DOS_GTAPI )
hb_outerr( "DOS", 0 );
#elif defined( HARBOUR_USE_OS2_GTAPI )
hb_outerr( "OS/2", 0 );
#elif defined( HARBOUR_USE_WIN_GTAPI )
hb_outerr( "Windows", 0 );
#elif defined( HARBOUR_USE_CRS_GTAPI )
hb_outerr( "Unix Curses", 0 );
#elif defined( HARBOUR_USE_SLN_GTAPI )
hb_outerr( "Unix Slang", 0 );
#endif
#else
hb_outerr( "* GT API: No", 0 );
#endif
hb_outerr( hb_consoleGetNewLine(), 0 );
#if defined( HARBOUR_OBJ_GENERATION )
hb_outerr( "With object file generation", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
#endif
hb_outerr( "* ANSI C: ", 0 );
#if defined( HARBOUR_STRICT_ANSI_C )
hb_outerr( "Strict", 0 );
#else
hb_outerr( "Non Strict", 0 );
#endif
hb_outerr( hb_consoleGetNewLine(), 0 );
hb_outerr( "* Debug mode: ", 0 );
#if defined( HARBOUR_YYDEBUG )
hb_outerr( "On", 0 );
#else
hb_outerr( "Off", 0 );
#endif
hb_outerr( hb_consoleGetNewLine(), 0 );
}
}

View File

@@ -59,7 +59,6 @@
#include "pcode.h"
#include "set.h"
#include "inkey.h"
#include "hbmemory.ch"
typedef struct _SYMBOLS
{
@@ -243,20 +242,7 @@ void hb_vmInit( BOOL bStartMainProc )
hb_vmSymbolInit_RT(); /* initialize symbol table with runtime support functions */
/* Check for some internal switches */
if( hb_cmdargCheck( "INFO" ) )
{
char * pszVersion = hb_version( 1 );
char buffer[ 128 ];
hb_outerr( pszVersion, 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
sprintf( buffer, "DS avail=%luKB OS avail=%luKB EMM avail=%luKB", hb_xquery( HB_MEM_BLOCK ), hb_xquery( HB_MEM_VM ), hb_xquery( HB_MEM_EMS ) );
hb_outerr( buffer, 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
hb_xfree( pszVersion );
}
hb_cmdargProcessVM();
/* Call functions that initializes static variables
* Static variables have to be initialized before any INIT functions