2007-06-26 23:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
* harbour/bin/hb-func.sh
* harbour/harbour.spec
* added description for -L<path> in hb* scripts
* harbour/include/hbapicls.h
* harbour/source/vm/classes.c
* changed hb_objSendMsg() and hb_objSendMessage() to return
hb_stackReturnItem() - xHarbour users asked about it. It does
not change binary compatibility with existing code.
* harbour/common.mak
* replaced some hard coded values like file extensions with variables
for future use on other platforms
* harbour/contrib/mysql/mysql.c
* changed code to not use non standard function filelength()
and optimized
* harbour/source/compiler/cmdcheck.c
* recognize --version on platforms where '-' is option separator
* harbour/source/compiler/hbusage.c
* changed syntax description from:
Syntax: harbour <file[s][.prg]> [options]
to:
Syntax: harbour <file[s][.prg]|@file> [options]
This commit is contained in:
@@ -8,6 +8,34 @@
|
||||
2002-12-01 13:30 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2007-06-26 23:55 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/bin/hb-func.sh
|
||||
* harbour/harbour.spec
|
||||
* added description for -L<path> in hb* scripts
|
||||
|
||||
* harbour/include/hbapicls.h
|
||||
* harbour/source/vm/classes.c
|
||||
* changed hb_objSendMsg() and hb_objSendMessage() to return
|
||||
hb_stackReturnItem() - xHarbour users asked about it. It does
|
||||
not change binary compatibility with existing code.
|
||||
|
||||
* harbour/common.mak
|
||||
* replaced some hard coded values like file extensions with variables
|
||||
for future use on other platforms
|
||||
|
||||
* harbour/contrib/mysql/mysql.c
|
||||
* changed code to not use non standard function filelength()
|
||||
and optimized
|
||||
|
||||
* harbour/source/compiler/cmdcheck.c
|
||||
* recognize --version on platforms where '-' is option separator
|
||||
|
||||
* harbour/source/compiler/hbusage.c
|
||||
* changed syntax description from:
|
||||
Syntax: harbour <file[s][.prg]> [options]
|
||||
to:
|
||||
Syntax: harbour <file[s][.prg]|@file> [options]
|
||||
|
||||
2007-06-26 22:00 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl)
|
||||
* harbour/source/rtl/gttrm/gttrm.c
|
||||
* use separate trnaslation tables for dispout() and dispbox() like
|
||||
|
||||
@@ -190,6 +190,7 @@ if [ \$# = 0 ]; then
|
||||
-xbgtk # link with xbgtk library (xBase GTK+ interface)
|
||||
-hwgui # link with HWGUI library (GTK+ interface)
|
||||
-l<libname> # link with <libname> library
|
||||
-L<libpath> # additional path to search for libraries
|
||||
-fmstat # link with the memory statistics lib
|
||||
-nofmstat # do not link with the memory statistics lib (default)
|
||||
-[no]strip # strip (no strip) binaries
|
||||
|
||||
1125
harbour/common.mak
1125
harbour/common.mak
File diff suppressed because it is too large
Load Diff
@@ -361,26 +361,6 @@ HB_FUNC( SQLSRVINFO )
|
||||
hb_retc( mysql_get_server_info( (MYSQL *)_parnl(1) ) );
|
||||
}
|
||||
|
||||
#ifdef __GNUC__
|
||||
long filelength( int handle )
|
||||
{
|
||||
int nEnd = hb_fsSeek( handle, 0 , 2 );
|
||||
int nStart = hb_fsSeek( handle , 0 , 0 );
|
||||
return nEnd - nStart;
|
||||
}
|
||||
#endif
|
||||
|
||||
char *filetoBuff(char *f,char *s)
|
||||
{
|
||||
|
||||
int i;
|
||||
int fh = hb_fsOpen( ( BYTE * ) s , 2 );
|
||||
i = hb_fsReadLarge( fh , ( BYTE * ) f , filelength( fh ) );
|
||||
f[ i ] = '\0';
|
||||
hb_fsClose( fh );
|
||||
return f ;
|
||||
}
|
||||
|
||||
HB_FUNC( DATATOSQL )
|
||||
{
|
||||
const char *from;
|
||||
@@ -394,24 +374,38 @@ HB_FUNC( DATATOSQL )
|
||||
hb_retclen_buffer( (char*)buffer,iSize );
|
||||
}
|
||||
|
||||
static char * filetoBuff( char * fname, int * size )
|
||||
{
|
||||
char * buffer = NULL;
|
||||
int handle = hb_fsOpen( ( BYTE * ) fname, 2 );
|
||||
|
||||
if( handle != FS_ERROR )
|
||||
{
|
||||
* size = ( int ) hb_fsSeek( handle, 0, FS_END );
|
||||
* size -= ( int ) hb_fsSeek( handle, 0, FS_SET );
|
||||
buffer = ( char * ) hb_xgrab( * size + 1 );
|
||||
* size = hb_fsReadLarge( handle, ( BYTE * ) buffer, * size );
|
||||
buffer[ * size ] = '\0';
|
||||
hb_fsClose( handle );
|
||||
}
|
||||
else
|
||||
* size = 0;
|
||||
return buffer;
|
||||
}
|
||||
|
||||
HB_FUNC( FILETOSQLBINARY )
|
||||
{
|
||||
char *szFile = hb_parc(1);
|
||||
const char *from;
|
||||
int fh;
|
||||
int iSize;
|
||||
int iLen;
|
||||
char *from;
|
||||
char *buffer;
|
||||
char *FromBuffer;
|
||||
int iSize;
|
||||
|
||||
fh = hb_fsOpen( (BYTE*)szFile,2 );
|
||||
iSize = filelength( fh );
|
||||
iLen = ( iSize*2 );
|
||||
FromBuffer = (char*)hb_xgrab( iSize+1 );
|
||||
hb_fsClose( fh );
|
||||
from = (char*)filetoBuff( FromBuffer,szFile );
|
||||
buffer = (char*)hb_xgrab( iLen+1 );
|
||||
iSize = mysql_escape_string( buffer,from,iSize );
|
||||
hb_retclen_buffer( (char*)buffer, iSize );
|
||||
hb_xfree( FromBuffer );
|
||||
from = filetoBuff( szFile, &iSize );
|
||||
if( from )
|
||||
{
|
||||
buffer = ( char * ) hb_xgrab( iSize * 2 + 1 );
|
||||
iSize = mysql_escape_string( buffer, from, iSize );
|
||||
hb_retclen_buffer( buffer, iSize );
|
||||
hb_xfree( from );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,6 +422,7 @@ All these scripts accept command line switches:
|
||||
-xbgtk # link with xbgtk library (xBase GTK+ interface)
|
||||
-hwgui # link with HWGUI library (GTK+ interface)
|
||||
-l<libname> # link with <libname> library
|
||||
-L<libpath> # additional path to search for libraries
|
||||
-fmstat # link with the memory statistics lib
|
||||
-nofmstat # do not link with the memory statistics lib (default)
|
||||
-[no]strip # strip (no strip) binaries
|
||||
|
||||
@@ -121,8 +121,8 @@ HB_EXPORT extern const char * hb_objGetRealClsName( PHB_ITEM pObject, const char
|
||||
|
||||
HB_EXPORT extern BOOL hb_objHasMsg( PHB_ITEM pObject, const char * szString ); /* returns TRUE/FALSE whether szString is an existing message for object */
|
||||
HB_EXPORT extern BOOL hb_objHasMessage( PHB_ITEM pObject, PHB_DYNS pMessage );
|
||||
HB_EXPORT extern void hb_objSendMsg( PHB_ITEM pObj, const char *sMsg, ULONG ulArg, ... );
|
||||
HB_EXPORT extern void hb_objSendMessage( PHB_ITEM pObj, PHB_DYNS pMessage, ULONG ulArg, ... );
|
||||
HB_EXPORT extern PHB_ITEM hb_objSendMsg( PHB_ITEM pObj, const char *sMsg, ULONG ulArg, ... );
|
||||
HB_EXPORT extern PHB_ITEM hb_objSendMessage( PHB_ITEM pObj, PHB_DYNS pMessage, ULONG ulArg, ... );
|
||||
|
||||
|
||||
/* Harbour equivalent for Clipper internal __mdCreate() */
|
||||
|
||||
@@ -839,6 +839,23 @@ void hb_compChkCompilerSwitch( HB_COMP_DECL, int iArg, char *Args[] )
|
||||
j = strlen( Args[i] );
|
||||
continue;
|
||||
|
||||
case '-':
|
||||
{
|
||||
int l = ++j;
|
||||
while( Args[i][j] && !HB_ISOPTSEP( Args[i][j] ) )
|
||||
j++;
|
||||
if( Args[i][l-1] == '-' && j-l == 7 &&
|
||||
memcmp( &Args[i][l], "version", 7 ) == 0 )
|
||||
{
|
||||
HB_COMP_PARAM->fLogo = TRUE;
|
||||
HB_COMP_PARAM->fQuiet = TRUE;
|
||||
}
|
||||
else
|
||||
hb_compGenError( HB_COMP_PARAM, hb_comp_szErrors, 'F', HB_COMP_ERR_BADOPTION, &Args[i][l], NULL );
|
||||
if( Args[i][j] )
|
||||
++j;
|
||||
continue;
|
||||
}
|
||||
default:
|
||||
Switch[2] = '\0';
|
||||
hb_compChkEnvironVar( HB_COMP_PARAM, ( char * ) Switch );
|
||||
|
||||
@@ -104,7 +104,7 @@ void hb_compPrintUsage( char * szSelf )
|
||||
|
||||
int iLine;
|
||||
|
||||
printf( "\nSyntax: %s <file[s][.prg]> [options]"
|
||||
printf( "\nSyntax: %s <file[s][.prg]|@file> [options]"
|
||||
"\n", szSelf );
|
||||
|
||||
for( iLine = 0; iLine < ( int ) ( sizeof( szOptions ) / sizeof( char * ) ); iLine++ )
|
||||
|
||||
@@ -1861,7 +1861,7 @@ HB_EXPORT BOOL hb_objHasMsg( PHB_ITEM pObject, const char *szString )
|
||||
}
|
||||
}
|
||||
|
||||
HB_EXPORT void hb_objSendMessage( PHB_ITEM pObject, PHB_DYNS pMsgSym, ULONG ulArg, ... )
|
||||
HB_EXPORT PHB_ITEM hb_objSendMessage( PHB_ITEM pObject, PHB_DYNS pMsgSym, ULONG ulArg, ... )
|
||||
{
|
||||
if( pObject && pMsgSym )
|
||||
{
|
||||
@@ -1886,9 +1886,11 @@ HB_EXPORT void hb_objSendMessage( PHB_ITEM pObject, PHB_DYNS pMsgSym, ULONG ulAr
|
||||
{
|
||||
hb_errRT_BASE( EG_ARG, 3000, NULL, "__ObjSendMessage()", 0 );
|
||||
}
|
||||
|
||||
return hb_stackReturnItem();
|
||||
}
|
||||
|
||||
HB_EXPORT void hb_objSendMsg( PHB_ITEM pObject, const char *sMsg, ULONG ulArg, ... )
|
||||
HB_EXPORT PHB_ITEM hb_objSendMsg( PHB_ITEM pObject, const char *sMsg, ULONG ulArg, ... )
|
||||
{
|
||||
hb_vmPushSymbol( hb_dynsymGet( sMsg )->pSymbol );
|
||||
hb_vmPush( pObject );
|
||||
@@ -1905,6 +1907,8 @@ HB_EXPORT void hb_objSendMsg( PHB_ITEM pObject, const char *sMsg, ULONG ulArg, .
|
||||
va_end( ap );
|
||||
}
|
||||
hb_vmSend( (USHORT) ulArg );
|
||||
|
||||
return hb_stackReturnItem();
|
||||
}
|
||||
|
||||
static PHB_DYNS hb_objGetMsgSym( PHB_ITEM pMessage )
|
||||
|
||||
Reference in New Issue
Block a user