2015-02-17 12:06 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* contrib/hbssl/tests/inetssl.prg
  * contrib/rddads/ads1.c
  * src/rtl/teditor.prg
    * formatting of my recent modifications taken from Viktor's branch

  * src/common/hbfsapi.c
  * src/compiler/complex.c
    * formatting

  * include/hbset.h
  * src/vm/set.c
  * src/nortl/nortl.c
    + add new C functions to change HVM set values:
         hb_setSetFileCase(), hb_setSetDirCase(), hb_setSetDirSeparator(),
         hb_setSetTrimFileName()

  * include/hbcomp.h
  * include/hbcompdf.h
  * src/compiler/cmdcheck.c
  * src/compiler/hbmain.c
  * src/compiler/ppcomp.c
  * src/compiler/genc.c
  * src/compiler/hbusage.c
  * src/nortl/nortl.c
    * rewritten code used to parse command line and environment parameters.
      New code is covered by GPL + Harbour exception license.
      All parameters are decoded by only one function and whole code is
      smaller so it's much easier to modify this code.
    ! fixed some small bugs and incompatibilities with Cl*pper in parameter
      parsing
    ! fixed -y undocumented (YYDEBUG) switch
    - removed -x[<prefix>] set symbol init function name prefix (for .c only)
      compiler command line switch
    * moved -fn[:[l|u]|-] -fd[:[l|u]|-] -fp[:<char>] and -fs[-] switches
      parsing to core compiler library. Now these switches are also works
      with compiler library linked with HBMK2.
    ; TOFIX: HBMK2 ignores -fn/-fd switches and allocates temporary names
             which are not compatible with names used later by harbour
             compiler when above switches are activated. HBMK2 should
             parse parameters and update SET FILECASE / SET DIRCASE before
             it creates temporary files.
This commit is contained in:
Przemysław Czerpak
2015-02-17 12:06:51 +01:00
parent be90db3802
commit 418caaac51
17 changed files with 1017 additions and 1365 deletions

View File

@@ -10,6 +10,49 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2015-02-17 12:06 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* contrib/hbssl/tests/inetssl.prg
* contrib/rddads/ads1.c
* src/rtl/teditor.prg
* formatting of my recent modifications taken from Viktor's branch
* src/common/hbfsapi.c
* src/compiler/complex.c
* formatting
* include/hbset.h
* src/vm/set.c
* src/nortl/nortl.c
+ add new C functions to change HVM set values:
hb_setSetFileCase(), hb_setSetDirCase(), hb_setSetDirSeparator(),
hb_setSetTrimFileName()
* include/hbcomp.h
* include/hbcompdf.h
* src/compiler/cmdcheck.c
* src/compiler/hbmain.c
* src/compiler/ppcomp.c
* src/compiler/genc.c
* src/compiler/hbusage.c
* src/nortl/nortl.c
* rewritten code used to parse command line and environment parameters.
New code is covered by GPL + Harbour exception license.
All parameters are decoded by only one function and whole code is
smaller so it's much easier to modify this code.
! fixed some small bugs and incompatibilities with Cl*pper in parameter
parsing
! fixed -y undocumented (YYDEBUG) switch
- removed -x[<prefix>] set symbol init function name prefix (for .c only)
compiler command line switch
* moved -fn[:[l|u]|-] -fd[:[l|u]|-] -fp[:<char>] and -fs[-] switches
parsing to core compiler library. Now these switches are also works
with compiler library linked with HBMK2.
; TOFIX: HBMK2 ignores -fn/-fd switches and allocates temporary names
which are not compatible with names used later by harbour
compiler when above switches are activated. HBMK2 should
parse parameters and update SET FILECASE / SET DIRCASE before
it creates temporary files.
2015-02-15 21:31 UTC+0100 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rdd/dbf1.c
* slightly modified code which tries to detect if field flags were

View File

@@ -9,25 +9,25 @@
#define EOL e"\r\n"
#define PEM_CERT_FILE "inetssl.pem"
STATIC s_lReady := .f.
STATIC s_lStop := .f.
STATIC s_lReady := .F.
STATIC s_lStop := .F.
STATIC s_lDelaySrv := .f.
STATIC s_lDelayCli := .f.
STATIC s_lDelaySrv := .F.
STATIC s_lDelayCli := .F.
REQUEST HB_MT
PROCEDURE Main( delay )
LOCAL thrd
if !empty( delay )
s_lDelayCli := "C" $ upper( delay )
s_lDelaySrv := "S" $ upper( delay )
endif
IF ! Empty( delay )
s_lDelayCli := "C" $ Upper( delay )
s_lDelaySrv := "S" $ Upper( delay )
ENDIF
/* initialize SSL library */
SSL_init()
RAND_seed( Time() + hb_tsToStr( hb_dateTime() ) + hb_DirBase() + NetName() )
RAND_seed( Time() + hb_TSToStr( hb_DateTime() ) + hb_DirBase() + NetName() )
/* start server thread */
thrd := hb_threadStart( @Server() )
@@ -45,14 +45,14 @@ PROCEDURE Main( delay )
Client()
/* inform server it should finish and wait for it */
s_lStop := .t.
s_lStop := .T.
hb_threadJoin( thrd )
?
RETURN
FUNCTION Client()
STATIC FUNCTION Client()
LOCAL sock, ssl_ctx, ssl, nResult, nErr, cLine
ssl_ctx := SSL_CTX_new()
@@ -62,7 +62,7 @@ FUNCTION Client()
hb_inetTimeout( sock, 5000 )
? "CLIENT: connecting..."
IF empty( hb_inetConnectIP( "127.0.0.1", N_PORT, sock ) )
IF Empty( hb_inetConnectIP( "127.0.0.1", N_PORT, sock ) )
? "CLIENT: cannot connect to server."
ELSE
? "CLIENT: connected to the server."
@@ -76,29 +76,28 @@ FUNCTION Client()
? "CLIENT: SSL CONNECT..."
nResult := hb_inetSSL_CONNECT( sock, ssl )
nErr := ERR_get_error()
?? hb_strFormat( e"\nCLIENT: hb_inetSSL_CONNECT()=>%d (%d), '%s'\n", ;
?? hb_StrFormat( e"\nCLIENT: hb_inetSSL_CONNECT()=>%d (%d), '%s'\n", ;
nResult, nErr, ;
ERR_error_string( nErr ) )
IF nResult == 1
? "CLIENT: connected with " + SSL_get_cipher( ssl ) + " encryption."
? "CLIENT: connected with", SSL_get_cipher( ssl ), "encryption."
DipsCertInfo( ssl, "CLIENT: " )
hb_inetSendAll( sock, hb_tsToStr( hb_dateTime() ) + EOL )
DO WHILE ! empty( cLine := hb_inetRecvLine( sock ) )
? "CLIENT: RECV:", hb_valToExp( cLine )
hb_inetSendAll( sock, hb_TSToStr( hb_DateTime() ) + EOL )
DO WHILE ! Empty( cLine := hb_inetRecvLine( sock ) )
? "CLIENT: RECV:", hb_ValToExp( cLine )
ENDDO
ENDIF
ENDIF
hb_inetClose( sock )
RETURN NIL
FUNCTION Server()
STATIC FUNCTION Server()
LOCAL sockSrv, sockConn, ssl_ctx, ssl, nResult, nErr, cLine
? "SERVER: create listen socekt..."
? "SERVER: create listen socket..."
IF Empty( sockSrv := hb_inetServer( N_PORT ) )
? "SERVER: cannot create listen socket."
ELSE
@@ -107,11 +106,11 @@ FUNCTION Server()
LoadCertificates( ssl_ctx, PEM_CERT_FILE, PEM_CERT_FILE )
ssl := SSL_new( ssl_ctx )
? "SERVER: waiting for connecitons..."
? "SERVER: waiting for connections..."
hb_inetTimeout( sockSrv, 100 )
s_lReady := .t.
s_lReady := .T.
DO WHILE ! s_lStop
IF !Empty( sockConn := hb_inetAccept( sockSrv ) )
IF ! Empty( sockConn := hb_inetAccept( sockSrv ) )
? "SERVER: accepted new connection."
hb_inetTimeout( sockConn, 3000 )
@@ -123,18 +122,18 @@ FUNCTION Server()
? "SERVER: SSL ACCEPT..."
nResult := hb_inetSSL_ACCEPT( sockConn, ssl )
nErr := ERR_get_error()
?? hb_strFormat( e"\nSERVER: hb_inetSSL_ACCEPT()=>%d (%d), '%s'\n", ;
?? hb_StrFormat( e"\nSERVER: hb_inetSSL_ACCEPT()=>%d (%d), '%s'\n", ;
nResult, nErr, ;
ERR_error_string( nErr ) )
IF nResult == 1
cLine := hb_inetRecvLine( sockConn )
? "SERVER: RECV:", hb_valToExp( cLine )
? "SERVER: RECV:", hb_ValToExp( cLine )
hb_inetSendAll( sockConn, ;
"ECHO[ " + cLine + " ]" + EOL + ;
hb_tsToStr( hb_dateTime() ) + EOL + ;
hb_TSToStr( hb_DateTime() ) + EOL + ;
OS() + EOL + ;
VERSION() + EOL + ;
Version() + EOL + ;
EOL )
ENDIF
@@ -143,21 +142,20 @@ FUNCTION Server()
ENDIF
ENDDO
s_lReady := .f.
s_lReady := .F.
ENDIF
RETURN NIL
FUNCTION LoadCertificates( ssl_ctx, cCertFile, cKeyFile )
STATIC FUNCTION LoadCertificates( ssl_ctx, cCertFile, cKeyFile )
/* Server using hb_inetSSL_ACCEPT() needs certificates,
they can be generated using the following command:
openssl req -x509 -nodes -days 365 -newkey rsa:1024 \
-out <cCertFile> -keyout <cKeyFile>
*/
IF ! hb_fileExists( cCertFile ) .AND. ! hb_fileExists( cKeyFile )
IF ! hb_FileExists( cCertFile ) .AND. ! hb_FileExists( cKeyFile )
? "SERVER: generating certificates..."
hb_run( "openssl req -x509 -nodes -days 365 -newkey rsa:1024 " + ;
"-out " + cCertFile + " -keyout " + cKeyFile )
@@ -165,14 +163,14 @@ FUNCTION LoadCertificates( ssl_ctx, cCertFile, cKeyFile )
/* set the local certificate from CertFile */
IF SSL_CTX_use_certificate_file( ssl_ctx, cCertFile, HB_SSL_FILETYPE_PEM ) <= 0
OutErr( hb_strFormat( e"SERVER: SSL_CTX_use_certificate_file()=> '%s'\n", ;
OutErr( hb_StrFormat( e"SERVER: SSL_CTX_use_certificate_file()=> '%s'\n", ;
ERR_error_string( ERR_get_error() ) ) )
QUIT
ENDIF
/* set the private key from KeyFile (may be the same as CertFile) */
IF SSL_CTX_use_PrivateKey_file( ssl_ctx, cKeyFile, HB_SSL_FILETYPE_PEM ) <= 0
OutErr( hb_strFormat( e"SERVER: SSL_CTX_use_PrivateKey_file()=> '%s'\n", ;
OutErr( hb_StrFormat( e"SERVER: SSL_CTX_use_PrivateKey_file()=> '%s'\n", ;
ERR_error_string( ERR_get_error() ) ) )
QUIT
ENDIF
@@ -186,13 +184,13 @@ FUNCTION LoadCertificates( ssl_ctx, cCertFile, cKeyFile )
RETURN NIL
FUNCTION DipsCertInfo( ssl, cWho )
STATIC FUNCTION DipsCertInfo( ssl, cWho )
LOCAL cert
IF !Empty( cert := SSL_get_peer_certificate( ssl ) )
IF ! Empty( cert := SSL_get_peer_certificate( ssl ) )
? cWho + "Server certificates:"
? cWho + "Subject:", X509_NAME_oneline( X509_get_subject_name( cert ), 0, 0 )
? cWho + "Issuer:", X509_NAME_oneline( X509_get_issuer_name( cert ), 0, 0 )
? cWho + "Subject:", X509_name_oneline( X509_get_subject_name( cert ), 0, 0 )
? cWho + "Issuer:", X509_name_oneline( X509_get_issuer_name( cert ), 0, 0 )
ELSE
? cWho + "No certificates."
ENDIF

View File

@@ -170,9 +170,7 @@ static HB_ERRCODE commonError( ADSAREAP pArea,
AdsGetLastError( &ulErrCode, aucError, &usLength );
if( ulErrCode != ( UNSIGNED32 ) errSubCode )
{
AdsGetErrorString( ( UNSIGNED32 ) errSubCode, aucError, &usLength );
}
hb_errPutDescription( pError, ( char * ) aucError );
}
else
@@ -1597,65 +1595,65 @@ static HB_ERRCODE adsCreateFields( ADSAREAP pArea, PHB_ITEM pStruct )
if( iNameLen > 1 )
{
if ( ! hb_strnicmp( szFieldType, "autoinc", 2 ) )
if( ! hb_strnicmp( szFieldType, "autoinc", 2 ) )
iData = '+';
else if ( ! hb_strnicmp( szFieldType, "binary", 2 ) )
else if( ! hb_strnicmp( szFieldType, "binary", 2 ) )
iData = 'W';
else if( ! hb_strnicmp( szFieldType, "character", 2 ) )
iData = 'C';
#if ADS_LIB_VERSION >= 710
else if ( ! hb_strnicmp( szFieldType, "cicharacter", 2 ) )
else if( ! hb_strnicmp( szFieldType, "cicharacter", 2 ) )
iData = 'c';
#endif
else if ( ! hb_strnicmp( szFieldType, "curdouble", 2 ) )
else if( ! hb_strnicmp( szFieldType, "curdouble", 2 ) )
iData = 'Z';
else if( ! hb_strnicmp( szFieldType, "date", 2 ) )
iData = 'D';
else if( ! hb_strnicmp( szFieldType, "double", 2 ) )
iData = 'B';
else if ( ! hb_strnicmp( szFieldType, "image", 2 ) )
else if( ! hb_strnicmp( szFieldType, "image", 2 ) )
iData = 'P';
else if ( ! hb_strnicmp( szFieldType, "integer", 2 ) )
else if( ! hb_strnicmp( szFieldType, "integer", 2 ) )
iData = 'I';
else if ( ! hb_strnicmp( szFieldType, "logical", 3 ) )
else if( ! hb_strnicmp( szFieldType, "logical", 3 ) )
iData = 'L';
#if ADS_LIB_VERSION >= 700
else if ( ! hb_strnicmp( szFieldType, "longlong", 3 ) )
else if( ! hb_strnicmp( szFieldType, "longlong", 3 ) )
{
iData = 'I';
uiLen = 8;
}
#endif
else if ( ! hb_strnicmp( szFieldType, "memo", 3 ) )
else if( ! hb_strnicmp( szFieldType, "memo", 3 ) )
iData = 'M';
#if ADS_LIB_VERSION >= 800
else if ( ! hb_strnicmp( szFieldType, "modtime", 3 ) )
else if( ! hb_strnicmp( szFieldType, "modtime", 3 ) )
iData = '=';
#endif
#if ADS_LIB_VERSION >= 700
else if ( ! hb_strnicmp( szFieldType, "money", 3 ) )
else if( ! hb_strnicmp( szFieldType, "money", 3 ) )
iData = 'Y';
#endif
else if ( ! hb_strnicmp( szFieldType, "numeric", 2 ) )
else if( ! hb_strnicmp( szFieldType, "numeric", 2 ) )
iData = 'N';
#if ADS_LIB_VERSION >= 1000
else if ( ! hb_strnicmp( szFieldType, "nchar", 2 ) )
else if( ! hb_strnicmp( szFieldType, "nchar", 2 ) )
{
iData = 'C';
dbFieldInfo.uiFlags |= HB_FF_UNICODE;
}
else if ( ! hb_strnicmp( szFieldType, "nmemo", 2 ) )
else if( ! hb_strnicmp( szFieldType, "nmemo", 2 ) )
{
iData = 'M';
dbFieldInfo.uiFlags |= HB_FF_UNICODE;
}
else if ( ! hb_strnicmp( szFieldType, "nvarchar", 2 ) )
else if( ! hb_strnicmp( szFieldType, "nvarchar", 2 ) )
{
iData = 'Q';
dbFieldInfo.uiFlags |= HB_FF_UNICODE;
}
#endif
else if ( ! hb_strnicmp( szFieldType, "shortdate", 6 ) )
else if( ! hb_strnicmp( szFieldType, "shortdate", 6 ) )
{
iData = 'D';
#if ADS_LIB_VERSION >= 900
@@ -1665,33 +1663,33 @@ static HB_ERRCODE adsCreateFields( ADSAREAP pArea, PHB_ITEM pStruct )
uiLen = pArea->iFileType == ADS_ADT ? 4 : 3;
#endif
}
else if ( ! hb_strnicmp( szFieldType, "shortint", 6 ) )
else if( ! hb_strnicmp( szFieldType, "shortint", 6 ) )
{
iData = 'I';
uiLen = 2;
}
else if ( ! hb_stricmp( szFieldType, "time" ) )
else if( ! hb_stricmp( szFieldType, "time" ) )
{
iData = 'T';
uiLen = 4;
}
else if ( ! hb_strnicmp( szFieldType, "timestamp", 5 ) )
else if( ! hb_strnicmp( szFieldType, "timestamp", 5 ) )
{
iData = '@';
uiLen = 8;
}
else if ( ! hb_strnicmp( szFieldType, "raw", 2 ) )
else if( ! hb_strnicmp( szFieldType, "raw", 2 ) )
{
iData = 'C';
dbFieldInfo.uiFlags |= HB_FF_BINARY;
}
else if ( ! hb_strnicmp( szFieldType, "rowversion", 2 ) )
else if( ! hb_strnicmp( szFieldType, "rowversion", 2 ) )
iData = '^';
else if ( ! hb_strnicmp( szFieldType, "varchar", 4 ) )
else if( ! hb_strnicmp( szFieldType, "varchar", 4 ) )
{
iData = 'Q';
}
else if ( ! hb_strnicmp( szFieldType, "varbinary", 4 ) )
else if( ! hb_strnicmp( szFieldType, "varbinary", 4 ) )
{
iData = 'Q';
dbFieldInfo.uiFlags |= HB_FF_BINARY;

View File

@@ -72,9 +72,7 @@ extern void hb_compPCodeTrace( PHB_HFUNC, const PHB_PCODE_FUNC *, void * );
extern void hb_compGenLabelTable( PHB_HFUNC pFunc, PHB_LABEL_INFO label_info );
extern PHB_DEBUGINFO hb_compGetDebugInfo( HB_COMP_DECL );
extern void hb_compChkFileSwitches( int argc, char * argv[] );
extern void hb_compInitPP( HB_COMP_DECL, int argc, const char * const argv[], PHB_PP_OPEN_FUNC pOpenFunc );
extern void hb_compInitPP( HB_COMP_DECL, PHB_PP_OPEN_FUNC pOpenFunc );
extern void hb_compCompileEnd( HB_COMP_DECL );
extern int hb_comp_yyparse( HB_COMP_DECL );
@@ -294,9 +292,10 @@ extern void hb_compCodeBlockRewind( HB_COMP_DECL ); /* resta
extern HB_SIZE hb_compExprListEval( HB_COMP_DECL, PHB_EXPR pExpr, PHB_COMP_CARGO_FUNC pEval );
extern HB_SIZE hb_compExprListEval2( HB_COMP_DECL, PHB_EXPR pExpr1, PHB_EXPR pExpr2, PHB_COMP_CARGO2_FUNC pEval );
extern void hb_compChkCompilerSwitch( HB_COMP_DECL, int iArg, const char * const args[] );
extern void hb_compChkPaths( HB_COMP_DECL );
extern void hb_compChkDefines( HB_COMP_DECL, int iArg, const char * const args[] );
extern void hb_compChkCommandLine( HB_COMP_DECL, int argc, const char * const argv[] );
extern void hb_compChkEnvironment( HB_COMP_DECL );
extern void hb_compChkAddIncPaths( HB_COMP_DECL );
extern void hb_compChkSetDefines( HB_COMP_DECL );
extern void hb_compPrintUsage( HB_COMP_DECL, const char * szSelf );
extern void hb_compPrintCredits( HB_COMP_DECL );

View File

@@ -534,6 +534,14 @@ typedef struct _HB_HFUNC
HB_USHORT wWithObjectCnt;
} HB_HFUNC, * PHB_HFUNC;
/* structure to hold PP #define variables passed as command line parameters */
typedef struct _HB_PPDEFINE
{
char * szName; /* name of PP #define variable */
const char * szValue; /* value of PP #define variable */
struct _HB_PPDEFINE * pNext; /* pointer to the next var */
} HB_PPDEFINE, * PHB_PPDEFINE;
/* structure to hold an INLINE block of source */
typedef struct _HB_HINLINE
{
@@ -750,6 +758,7 @@ typedef struct _HB_COMP
PHB_MODULE modules;
PHB_VARTYPE pVarType;
PHB_INCLST incfiles;
PHB_PPDEFINE ppdefines;
PHB_HDECLARED pFirstDeclared;
PHB_HDECLARED pLastDeclared;
@@ -783,7 +792,6 @@ typedef struct _HB_COMP
const char * szAnnounce;
const char * szDeclaredFun;
const char * szFile; /* Source file name of compiled module */
char szPrefix[ 20 ]; /* holds the prefix added to the generated symbol init function name (in C output currently) */
char * szDepExt; /* destination file extension used in decencies list */
char * szStdCh; /* standard definitions file name (-u) */
char ** szStdChExt; /* extended definitions file names (-u+<file>) */

View File

@@ -264,6 +264,18 @@ extern HB_EXPORT HB_PATHNAMES * hb_setGetFirstSetPath( void );
extern HB_EXPORT HB_BOOL hb_setGetCentury( void );
extern HB_EXPORT HB_BOOL hb_setSetCentury( HB_BOOL );
extern HB_EXPORT int hb_setGetFileCase( void );
extern HB_EXPORT void hb_setSetFileCase( int iFileCase );
extern HB_EXPORT int hb_setGetDirCase( void );
extern HB_EXPORT void hb_setSetDirCase( int iDirCase );
extern HB_EXPORT int hb_setGetDirSeparator( void );
extern HB_EXPORT void hb_setSetDirSeparator( int iSeparator );
extern HB_EXPORT HB_BOOL hb_setGetTrimFileName( void );
extern HB_EXPORT void hb_setSetTrimFileName( HB_BOOL fTrim );
extern HB_EXPORT PHB_FILE hb_setGetAltHan( void );
extern HB_EXPORT PHB_FILE hb_setGetExtraHan( void );
extern HB_EXPORT PHB_FILE hb_setGetPrintHan( void );
@@ -315,9 +327,6 @@ extern HB_EXPORT HB_BOOL hb_setGetSoftSeek( void );
extern HB_EXPORT HB_BOOL hb_setGetStrictRead( void );
extern HB_EXPORT int hb_setGetTypeAhead( void );
extern HB_EXPORT HB_BOOL hb_setGetUnique( void );
extern HB_EXPORT int hb_setGetFileCase( void );
extern HB_EXPORT int hb_setGetDirCase( void );
extern HB_EXPORT int hb_setGetDirSeparator( void );
extern HB_EXPORT int hb_setGetVideoMode( void );
extern HB_EXPORT HB_BOOL hb_setGetWrap( void );
extern HB_EXPORT int hb_setGetDBFLockScheme( void );
@@ -325,7 +334,6 @@ extern HB_EXPORT HB_BOOL hb_setGetHardCommit( void );
extern HB_EXPORT HB_BOOL hb_setGetForceOpt( void );
extern HB_EXPORT HB_BOOL hb_setGetDefExtension( void );
extern HB_EXPORT const char * hb_setGetEOL( void );
extern HB_EXPORT HB_BOOL hb_setGetTrimFileName( void );
extern HB_EXPORT const char * hb_setGetHBOUTLOG( void );
extern HB_EXPORT const char * hb_setGetHBOUTLOGINFO( void );
extern HB_EXPORT const char * hb_setGetOSCODEPAGE( void );

View File

@@ -100,18 +100,16 @@ void hb_fsAddSearchPath( const char * szPath, HB_PATHNAMES ** pSearchList )
HB_BOOL fFree = HB_TRUE;
while( *pSearchList )
{
pSearchList = &( *pSearchList )->pNext;
}
pPath = hb_strdup( szPath );
while( ( pDelim = strchr( pPath, HB_OS_PATH_LIST_SEP_CHR ) ) != NULL )
{
*pDelim = '\0';
*pSearchList = ( HB_PATHNAMES * ) hb_xgrab( sizeof( HB_PATHNAMES ) );
(*pSearchList)->szPath = pPath;
(*pSearchList)->fFree = fFree;
pSearchList = &(*pSearchList)->pNext;
( *pSearchList )->szPath = pPath;
( *pSearchList )->fFree = fFree;
pSearchList = &( *pSearchList )->pNext;
pPath = pDelim + 1;
fFree = HB_FALSE;
}

File diff suppressed because it is too large Load Diff

View File

@@ -47,7 +47,6 @@
*
*/
#include "hbpp.h"
#include "hbcomp.h"
#include "hbdate.h"

View File

@@ -277,7 +277,7 @@ void hb_compGenCCode( HB_COMP_DECL, PHB_FNAME pFileName ) /* generates the
szFileName[ i ] = '_';
}
}
fprintf( yyc, "\n\nHB_INIT_SYMBOLS_BEGIN( hb_vm_SymbolInit_%s%s )\n", HB_COMP_PARAM->szPrefix, szFileName );
fprintf( yyc, "\n\nHB_INIT_SYMBOLS_BEGIN( hb_vm_SymbolInit_%s )\n", szFileName );
pSym = HB_COMP_PARAM->symbols.pFirst;
while( pSym )
@@ -439,9 +439,7 @@ void hb_compGenCCode( HB_COMP_DECL, PHB_FNAME pFileName ) /* generates the
static void hb_writeEndInit( HB_COMP_DECL, FILE * yyc, const char * szModulname, const char * szSourceFile )
{
fprintf( yyc,
"\nHB_INIT_SYMBOLS_EX_END( hb_vm_SymbolInit_%s%s, ",
HB_COMP_PARAM->szPrefix, szModulname );
fprintf( yyc, "\nHB_INIT_SYMBOLS_EX_END( hb_vm_SymbolInit_%s, ", szModulname );
if( HB_COMP_PARAM->fHideSource )
szSourceFile = "";
hb_compGenCString( yyc, ( const HB_BYTE * ) szSourceFile, strlen( szSourceFile ) );
@@ -449,13 +447,12 @@ static void hb_writeEndInit( HB_COMP_DECL, FILE * yyc, const char * szModulname,
fprintf( yyc,
"#if defined( HB_PRAGMA_STARTUP )\n"
" #pragma startup hb_vm_SymbolInit_%s%s\n"
" #pragma startup hb_vm_SymbolInit_%s\n"
"#elif defined( HB_DATASEG_STARTUP )\n"
" #define HB_DATASEG_BODY HB_DATASEG_FUNC( hb_vm_SymbolInit_%s%s )\n"
" #define HB_DATASEG_BODY HB_DATASEG_FUNC( hb_vm_SymbolInit_%s )\n"
" #include \"hbiniseg.h\"\n"
"#endif\n\n",
HB_COMP_PARAM->szPrefix, szModulname,
HB_COMP_PARAM->szPrefix, szModulname );
szModulname, szModulname );
}
static void hb_compGenCFunc( FILE * yyc, const char * cDecor, const char * szName,

View File

@@ -82,11 +82,12 @@ int hb_compMainExt( int argc, const char * const argv[],
HB_COMP_PARAM->pOutPath = NULL;
/* First check the environment variables */
hb_compChkCompilerSwitch( HB_COMP_PARAM, 0, NULL );
hb_compChkEnvironment( HB_COMP_PARAM );
/* Then check command line arguments
This will override duplicated environment settings */
hb_compChkCompilerSwitch( HB_COMP_PARAM, argc, argv );
hb_compChkCommandLine( HB_COMP_PARAM, argc, argv );
if( ! HB_COMP_PARAM->fExit )
{
if( HB_COMP_PARAM->iTraceInclude == 0 &&
@@ -122,10 +123,10 @@ int hb_compMainExt( int argc, const char * const argv[],
/* Set Search Path */
if( HB_COMP_PARAM->fINCLUDE )
hb_compChkPaths( HB_COMP_PARAM );
hb_compChkAddIncPaths( HB_COMP_PARAM );
/* Set standard rules */
hb_compInitPP( HB_COMP_PARAM, argc, argv, pOpenFunc );
hb_compInitPP( HB_COMP_PARAM, pOpenFunc );
/* Prepare the table of identifiers */
hb_compIdentifierOpen( HB_COMP_PARAM );
@@ -3960,6 +3961,15 @@ void hb_compCompileEnd( HB_COMP_DECL )
hb_xfree( pIncFile );
}
while( HB_COMP_PARAM->ppdefines )
{
PHB_PPDEFINE pDefine = HB_COMP_PARAM->ppdefines;
HB_COMP_PARAM->ppdefines = pDefine->pNext;
hb_xfree( pDefine->szName );
hb_xfree( pDefine );
}
while( HB_COMP_PARAM->inlines.pFirst )
{
PHB_HINLINE pInline = HB_COMP_PARAM->inlines.pFirst;

View File

@@ -99,7 +99,6 @@ void hb_compPrintUsage( HB_COMP_DECL, const char * szSelf )
"\n -undef:<id> #undef <id>",
"\n -v variables are assumed M->",
"\n -w[<level>] set warning level number (0..3, default 1)",
"\n -x[<prefix>] set symbol init function name prefix (for .c only)",
#ifdef YYDEBUG
"\n -y trace lex & yacc activity",
#endif

View File

@@ -391,8 +391,7 @@ static void hb_pp_fileIncluded( void * cargo, const char * szFileName )
*pIncFilePtr = pIncFile;
}
void hb_compInitPP( HB_COMP_DECL, int argc, const char * const argv[],
PHB_PP_OPEN_FUNC pOpenFunc )
void hb_compInitPP( HB_COMP_DECL, PHB_PP_OPEN_FUNC pOpenFunc )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_compInitPP()" ) );
@@ -419,7 +418,7 @@ void hb_compInitPP( HB_COMP_DECL, int argc, const char * const argv[],
hb_pp_initDynDefines( HB_COMP_PARAM->pLex->pPP, ! HB_COMP_PARAM->fNoArchDefs );
/* Add /D and /undef: command line or envvar defines */
hb_compChkDefines( HB_COMP_PARAM, argc, argv );
hb_compChkSetDefines( HB_COMP_PARAM );
/* add extended definitions files (-u+<file>) */
if( HB_COMP_PARAM->iStdChExt > 0 )

View File

@@ -124,8 +124,6 @@ int main( int argc, char * argv[] )
{
int iResult;
hb_compChkFileSwitches( argc, argv );
iResult = hb_compMain( argc, ( const char * const * ) argv );
hb_xexit();

View File

@@ -691,108 +691,22 @@ int hb_setGetDirSeparator( void )
return s_cDirSep;
}
void hb_compChkFileSwitches( int argc, char * argv[] )
void hb_setSetFileCase( int iFileCase )
{
int i, n;
for( i = 1; i < argc; ++i )
{
if( HB_ISOPTSEP( argv[ i ][ 0 ] ) && argv[ i ][ 1 ] == 'f' )
{
n = 0;
switch( argv[ i ][ 2 ] )
{
case 'n':
if( ! argv[ i ][ 3 ] )
{
s_iFileCase = HB_SET_CASE_MIXED;
n = 3;
}
else if( argv[ i ][ 3 ] == ':' )
{
if( argv[ i ][ 4 ] == 'u' )
{
s_iFileCase = HB_SET_CASE_UPPER;
n = 5;
}
else if( argv[ i ][ 4 ] == 'l' )
{
s_iFileCase = HB_SET_CASE_LOWER;
n = 5;
}
}
else if( argv[ i ][ 3 ] == '-' )
{
s_iFileCase = HB_SET_CASE_MIXED;
n = 4;
}
break;
case 'd':
if( ! argv[ i ][ 3 ] )
{
s_iDirCase = HB_SET_CASE_MIXED;
n = 3;
}
else if( argv[ i ][ 3 ] == ':' )
{
if( argv[ i ][ 4 ] == 'u' )
{
s_iDirCase = HB_SET_CASE_UPPER;
n = 5;
}
else if( argv[ i ][ 4 ] == 'l' )
{
s_iDirCase = HB_SET_CASE_LOWER;
n = 5;
}
}
else if( argv[ i ][ 3 ] == '-' )
{
s_iDirCase = HB_SET_CASE_MIXED;
n = 4;
}
break;
case 'p':
if( ! argv[ i ][ 3 ] )
{
s_cDirSep = HB_OS_PATH_DELIM_CHR;
n = 3;
}
else if( argv[ i ][ 3 ] == '-' )
{
s_cDirSep = HB_OS_PATH_DELIM_CHR;
n = 4;
}
else if( argv[ i ][ 3 ] == ':' && argv[ i ][ 4 ] )
{
s_cDirSep = argv[ i ][ 4 ];
n = 5;
}
break;
case 's':
if( ! argv[ i ][ 3 ] )
{
s_fFnTrim = HB_TRUE;
n = 3;
}
else if( argv[ i ][ 3 ] == '-' )
{
s_fFnTrim = HB_FALSE;
n = 4;
}
break;
}
if( n )
{
argv[ i ] += n;
if( argv[ i ][ 0 ] )
--i;
else
argv[ i ] = ( char * ) "-";
}
}
}
s_iFileCase = iFileCase;
}
void hb_setSetDirCase( int iDirCase )
{
s_iDirCase = iDirCase;
}
void hb_setSetDirSeparator( int iSeparator )
{
s_cDirSep = ( char ) iSeparator;
}
void hb_setSetTrimFileName( HB_BOOL fTrim )
{
s_fFnTrim = fTrim;
}

View File

@@ -613,7 +613,7 @@ METHOD BrowseText( nPassedKey ) CLASS HBEditor
nKeyStd := hb_keyStd( nKey )
IF ( bKeyBlock := SetKey( nKeyStd ) ) != NIL
Eval( bKeyBlock )
ELSEIF nKeyStd == K_ESC
ELSEIF nKeyStd == K_ESC
::lExitEdit := .T.
ELSEIF ! ::MoveCursor( nKey )
::KeyboardHook( nKey )

View File

@@ -2591,18 +2591,48 @@ int hb_setGetFileCase( void )
return hb_stackSetStruct()->HB_SET_FILECASE;
}
void hb_setSetFileCase( int iFileCase )
{
HB_STACK_TLS_PRELOAD
hb_stackSetStruct()->HB_SET_FILECASE = iFileCase;
}
int hb_setGetDirCase( void )
{
HB_STACK_TLS_PRELOAD
return hb_stackSetStruct()->HB_SET_DIRCASE;
}
void hb_setSetDirCase( int iDirCase )
{
HB_STACK_TLS_PRELOAD
hb_stackSetStruct()->HB_SET_DIRCASE = iDirCase;
}
int hb_setGetDirSeparator( void )
{
HB_STACK_TLS_PRELOAD
return hb_stackSetStruct()->HB_SET_DIRSEPARATOR;
}
void hb_setSetDirSeparator( int iSeparator )
{
HB_STACK_TLS_PRELOAD
hb_stackSetStruct()->HB_SET_DIRSEPARATOR = iSeparator;
}
HB_BOOL hb_setGetTrimFileName( void )
{
HB_STACK_TLS_PRELOAD
return hb_stackSetStruct()->HB_SET_TRIMFILENAME;
}
void hb_setSetTrimFileName( HB_BOOL fTrim )
{
HB_STACK_TLS_PRELOAD
hb_stackSetStruct()->HB_SET_TRIMFILENAME = fTrim;
}
int hb_setGetVideoMode( void )
{
HB_STACK_TLS_PRELOAD
@@ -2645,12 +2675,6 @@ const char * hb_setGetEOL( void )
return hb_stackSetStruct()->HB_SET_EOL;
}
HB_BOOL hb_setGetTrimFileName( void )
{
HB_STACK_TLS_PRELOAD
return hb_stackSetStruct()->HB_SET_TRIMFILENAME;
}
const char * hb_setGetHBOUTLOG( void )
{
HB_STACK_TLS_PRELOAD