ChangeLogTag:Thu Oct 21 11:56:55 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>

This commit is contained in:
Gonzalo A. Diethelm
1999-10-21 15:32:32 +00:00
parent e57bc40ccd
commit 1a7088b7d4
39 changed files with 1001 additions and 136 deletions

View File

@@ -1,3 +1,55 @@
Thu Oct 21 11:56:55 1999 Gonzalo A. Diethelm <Gonzalo.Diethelm@jda.cl>
* source/common/hbtrace.c:
Modified the TRACE function so that it does no superfluous copying
anymore.
* source/compiler/Makefile:
* source/runner/stdalone/Makefile:
* tests/Makefile:
Added the common library to the list of dependencies.
* source/pp/hbpp.c:
* source/pp/hbppint.c:
* source/pp/hbpplib.c:
* source/pp/table.c:
* source/pp/stdalone/hbpp.c:
Made sure tracing is enabled only when both HB_DO_TRACE and
HB_REALLY_DO_TRACE are defined; this way, the user can just set
HB_DO_TRACE to enable tracing in harbour, but not see all the
tracing output while compiling harbour itself.
* source/rtl/arrays.c:
* source/rtl/classes.c:
* source/rtl/codebloc.c:
* source/rtl/console.c:
* source/rtl/copyfile.c:
* source/rtl/dates.c:
* source/rtl/descend.c:
* source/rtl/dir.c:
* source/rtl/environ.c:
* source/rtl/errorapi.c:
* source/rtl/extend.c:
* source/rtl/filesys.c:
* source/rtl/fm.c:
* source/rtl/gtapi.c:
* source/rtl/hardcr.c:
* source/rtl/inkey.c:
* source/rtl/itemapi.c:
* source/rtl/langapi.c:
* source/rtl/math.c:
* source/rtl/memvars.c:
* source/rtl/mouseapi.c:
* source/rtl/mtran.c:
* source/rtl/natmsg.c:
* source/rtl/samples.c:
* source/rtl/set.c:
* source/rtl/setcolor.c:
* source/rtl/strings.c:
* source/rtl/tone.c:
* source/rtl/transfrm.c:
Added tracing to all functions.
19991021-15:35 GMT+2 Ryszard Glab <rglab@imid.med.pl>
*include/extend.h

View File

@@ -44,32 +44,53 @@ int hb_tr_line_ = 0;
void hb_tr_trace( char * fmt, ... )
{
char buf[ 1024 ];
char file[ 256 ];
int i, j;
va_list ap;
char file[256];
int i, j;
va_list ap;
va_start( ap, fmt );
vsprintf( buf, fmt, ap );
va_end( ap );
/*
* Clean up the file, so that instead of showing
*
* ../../../foo/bar/baz.c
*
* we just show
*
* baz.c
*/
for (i = 0; hb_tr_file_[i] != '\0'; ++i) {
if (hb_tr_file_[i] != '.' &&
hb_tr_file_[i] != '/' &&
hb_tr_file_[i] != '\\')
break;
}
for (j = 0; hb_tr_file_[i] != '\0'; ++i, ++j) {
file[j] = hb_tr_file_[i];
}
file[j] = '\0';
for( i = 0; hb_tr_file_[ i ] != '\0'; ++i )
{
if( hb_tr_file_[ i ] != '.' &&
hb_tr_file_[ i ] != '/' &&
hb_tr_file_[ i ] != '\\' )
break;
}
/*
* Print file and line.
*/
fprintf(stderr, "%s:%d: ",
file, hb_tr_line_);
for( j = 0; hb_tr_file_[ i ] != '\0'; ++i, ++j )
file[ j ] = hb_tr_file_[ i ];
/*
* Print the name and arguments for the function.
*/
va_start(ap, fmt);
vfprintf(stderr, fmt, ap);
va_end(ap);
file[ j ] = '\0';
/*
* Print a new-line.
*/
fprintf(stderr, "\n");
fprintf( stderr, "%s:%d: %s\n", file, hb_tr_line_, buf );
hb_tr_file_ = "";
hb_tr_line_ = 0;
/*
* Reset file and line.
*/
hb_tr_file_ = "";
hb_tr_line_ = 0;
}
#endif /* #if defined(HB_DO_TRACE) */

View File

@@ -34,5 +34,6 @@ C_MAIN=harbour.c
LIBS=\
pp \
common \
include $(TOP)$(ROOT)config/bin.cf

View File

@@ -33,6 +33,15 @@
*
*/
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#endif
#endif
#include <stdlib.h>
#if ( defined(_MSC_VER) || defined(__IBMCPP__) || defined(__MINGW32_) )
#include <memory.h>
@@ -419,8 +428,7 @@ void ParseCommand( char* sLine, int com_or_xcom, int com_or_tra )
int mlen,rlen;
int ipos;
HB_TRACE(("ParseCommand(%s, $d, $d)",
sLine, com_or_xcom, com_or_tra));
HB_TRACE(("ParseCommand(%s, $d, $d)", sLine, com_or_xcom, com_or_tra));
NextWord( &sLine, cmdname, FALSE );
stroupper( cmdname );
@@ -461,8 +469,7 @@ void ConvertPatterns ( char *mpatt, int mlen, char *rpatt, int rlen )
char lastchar = '@', exptype;
char *ptr;
HB_TRACE(("ConvertPatterns(%s, $d, %s, $d)",
mpatt, mlen, rpatt, rlen));
HB_TRACE(("ConvertPatterns(%s, $d, %s, $d)", mpatt, mlen, rpatt, rlen));
while ( *(mpatt+i) != '\0' )
{
@@ -584,8 +591,7 @@ int ParseExpression( char* sLine, char* sOutLine )
DEFINES *stdef;
COMMANDS *stcmd;
HB_TRACE(("ParseExpression(%s, %s)",
sLine, sOutLine));
HB_TRACE(("ParseExpression(%s, %s)", sLine, sOutLine));
do
{
@@ -729,8 +735,7 @@ int WorkDefine ( char** ptri, char* ptro, DEFINES *stdef )
int npars, lens;
char *ptr;
HB_TRACE(("WorkDefine(%p, %s, %p)",
ptri, ptro, stdef));
HB_TRACE(("WorkDefine(%p, %s, %p)", ptri, ptro, stdef));
if ( stdef->npars < 0 )
lens = strocpy( ptro,stdef->value );
@@ -762,8 +767,7 @@ int WorkPseudoF ( char** ptri, char* ptro, DEFINES *stdef )
int ipos, ifou, ibeg;
int lenfict, lenreal, lenres;
HB_TRACE(("WorkPseudoF(%p, %s, %p)",
ptri, ptro, stdef));
HB_TRACE(("WorkPseudoF(%p, %s, %p)", ptri, ptro, stdef));
lenres = strocpy( ptro, stdef->value ); /* Copying value of macro to destination string */
@@ -817,8 +821,7 @@ int WorkCommand ( char* ptri, char* ptro, COMMANDS *stcmd )
char *ptrmp;
char *sToken = stcmd->name;
HB_TRACE(("WorkCommand(%s, %s, %p)",
ptri, ptro, stcmd));
HB_TRACE(("WorkCommand(%s, %s, %p)", ptri, ptro, stcmd));
do
{
@@ -845,8 +848,7 @@ int WorkTranslate ( char* ptri, char* ptro, COMMANDS *sttra, int *lens )
char *ptrmp;
char *sToken = sttra->name;
HB_TRACE(("WorkTranslate(%s, %s, %p, %p)",
ptri, ptro, sttra, lens));
HB_TRACE(("WorkTranslate(%s, %s, %p, %p)", ptri, ptro, sttra, lens));
do
{
@@ -876,9 +878,7 @@ int CommandStuff ( char *ptrmp, char *inputLine, char * ptro, int *lenres, int c
char *lastopti[3], *strtopti = NULL, *strtptri = NULL;
char *ptri = inputLine, *ptr, tmpname[MAX_NAME];
HB_TRACE(("CommandStuff(%s, %s, %s, %p, %d, %d)",
ptrmp, inputLine, ptro, lenres,
com_or_tra, com_or_xcom));
HB_TRACE(("CommandStuff(%s, %s, %s, %p, %d, %d)", ptrmp, inputLine, ptro, lenres, com_or_tra, com_or_xcom));
numBrackets = 0;
SKIPTABSPACES( ptri );
@@ -1070,8 +1070,7 @@ int WorkMarkers( char **ptrmp, char **ptri, char *ptro, int *lenres, int com_or_
int rezrestr, ipos;
char *ptr, *ptrtemp;
HB_TRACE(("WorkMarkers(%p, %p, %s, %p)",
ptrmp, ptri, ptro, lenres));
HB_TRACE(("WorkMarkers(%p, %p, %s, %p)", ptrmp, ptri, ptro, lenres));
/* Copying a match pattern to 'exppatt' */
lenpatt = stroncpy ( exppatt, *ptrmp, 4 );
@@ -1219,8 +1218,7 @@ int getExpReal ( char *expreal, char **ptri, int prlist, int maxrez )
int StBr1 = 0, StBr2 = 0, StBr3 = 0;
int rez = 0;
HB_TRACE(("getExpReal(%s, %p, %d, %d)",
expreal, ptri, prlist, maxrez));
HB_TRACE(("getExpReal(%s, %p, %d, %d)", expreal, ptri, prlist, maxrez));
SKIPTABSPACES ( *ptri );
State = (**ptri=='\'' || **ptri=='\"')? STATE_EXPRES:STATE_ID;
@@ -1372,8 +1370,7 @@ int CheckOptional( char* ptrmp, char* ptri, char* ptro, int* lenres, int com_or_
char *lastInputptr[5];
char *lastopti[3], *ptr;
HB_TRACE(("CheckOptional(%s, %s, %s, %p, %d, %d)",
ptrmp, ptri, ptro, lenres, com_or_tra, com_or_xcom));
HB_TRACE(("CheckOptional(%s, %s, %s, %p, %d, %d)", ptrmp, ptri, ptro, lenres, com_or_tra, com_or_xcom));
lReplacePat = FALSE;
lastInputptr[Repeate] = ptri;
@@ -1503,8 +1500,7 @@ void SearnRep( char *exppatt,char *expreal,int lenreal,char *ptro, int *lenres)
char expnew[MAX_NAME];
char *ptr, *ptr2, *ptrOut = ptro;
HB_TRACE(("SearnRep(%s, %s, %d, %s, %p)",
exppatt, expreal, lenreal, ptro, lenres));
HB_TRACE(("SearnRep(%s, %s, %d, %s, %p)", exppatt, expreal, lenreal, ptro, lenres));
if( *(exppatt+1) == '\0' ) *( ptro + *lenres ) = '\0';
while ( (ifou = md_strAt( exppatt, (*(exppatt+1))? 2:1, ptrOut, FALSE, FALSE )) > 0 )
@@ -1604,8 +1600,7 @@ int ReplacePattern ( char patttype, char *expreal, int lenreal, char *ptro, int
int rmlen = lenreal, ifou, lenitem, i;
char sQuotes[ 4 ] = "\"\",";
HB_TRACE(("ReplacePattern(%c, %s, %d, %s, %p)",
patttype, expreal, lenreal, ptro, lenres));
HB_TRACE(("ReplacePattern(%c, %s, %d, %s, %p)", patttype, expreal, lenreal, ptro, lenres));
switch ( *(ptro+2) ) {
case '0': /* Regular result marker */
@@ -1785,9 +1780,7 @@ int pp_RdStr(FILE* handl_i,char *buffer,int maxlen,int lDropSpaces,char* sBuffer
int State = 0;
char cha,cLast='\0';
HB_TRACE(("pp_RdStr(%p, %s, %d, %d, %s, %p, %p)",
handl_i, buffer, maxlen, lDropSpaces,
sBuffer, lenBuffer, iBuffer));
HB_TRACE(("pp_RdStr(%p, %s, %d, %d, %s, %p, %p)", handl_i, buffer, maxlen, lDropSpaces, sBuffer, lenBuffer, iBuffer));
if ( *lenBuffer == 0 ) return -1;
while(1)
@@ -1868,8 +1861,7 @@ int pp_WrStr(FILE* handl_o,char *buffer)
/* locates a substring in a string */
int pp_strAt(char *szSub, int lSubLen, char *szText, int lLen)
{
HB_TRACE(("pp_strAt(%s, %d, %s, %d)",
szSub, lSubLen, szText, lLen));
HB_TRACE(("pp_strAt(%s, %d, %s, %d)", szSub, lSubLen, szText, lLen));
if( lSubLen )
{
@@ -1904,8 +1896,7 @@ int md_strAt(char *szSub, int lSubLen, char *szText, int checkword, int checkPrt
long lPos = 0, lSubPos = 0;
int kolPrth = 0;
HB_TRACE(("md_strAt(%s, %d, %s, %d, %d)",
szSub, lSubLen, szText, checkword, checkPrth));
HB_TRACE(("md_strAt(%s, %d, %s, %d, %d)", szSub, lSubLen, szText, checkword, checkPrth));
while( *(szText+lPos) != '\0' && lSubPos < lSubLen )
{
@@ -1975,8 +1966,7 @@ void pp_Stuff (char *ptri, char * ptro, int len1, int len2, int lenres )
char *ptr1, *ptr2;
int i;
HB_TRACE(("pp_Stuff(%s, %s, %d, %d, %d)",
ptri, ptro, len1, len2, lenres));
HB_TRACE(("pp_Stuff(%s, %s, %d, %d, %d)", ptri, ptro, len1, len2, lenres));
if ( len1 > len2 )
{
@@ -2232,8 +2222,7 @@ BOOL OpenInclude( char * szFileName, PATHNAMES *pSearch, FILE** fptr, BOOL bStan
PHB_FNAME pFileName;
char szFName[ _POSIX_PATH_MAX ]; /* filename to parse */
HB_TRACE(("OpenInclude(%s, %p, %p, %d)",
szFileName, pSearch, fptr, (int) bStandardOnly));
HB_TRACE(("OpenInclude(%s, %p, %p, %d)", szFileName, pSearch, fptr, (int) bStandardOnly));
if ( bStandardOnly )
{

View File

@@ -33,6 +33,15 @@
*
*/
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#endif
#endif
#if ( defined(_MSC_VER) || defined(__IBMCPP__) || defined(__MINW32__) )
#include <memory.h>
#include <stdlib.h>
@@ -73,8 +82,7 @@ int PreProcess( FILE * handl_i, FILE * handl_o, char * sOut )
int lens = 0, rdlen;
int rezParse;
HB_TRACE(("PreProcess(%p, %p, %s)",
handl_i, handl_o, sOut));
HB_TRACE(("PreProcess(%p, %p, %s)", handl_i, handl_o, sOut));
HB_SYMBOL_UNUSED( handl_o );

View File

@@ -33,6 +33,15 @@
*
*/
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#endif
#endif
#include <stdio.h>
#include <setjmp.h>
@@ -96,8 +105,7 @@ HARBOUR HB___PREPROCESS( void )
void GenError( char * _szErrors[], char cPrefix, int iError, char * szError1, char * szError2 )
{
HB_TRACE(("GenError(%p, %c, %d, %s, %s)",
_szErrors, cPrefix, iError, szError1, szError2));
HB_TRACE(("GenError(%p, %c, %d, %s, %s)", _szErrors, cPrefix, iError, szError1, szError2));
/* TODO: The internal buffers allocated by the preprocessor should be
* deallocated here
@@ -112,8 +120,7 @@ void GenError( char * _szErrors[], char cPrefix, int iError, char * szError1, ch
void GenWarning( char* _szWarnings[], char cPrefix, int iWarning, char * szWarning1, char * szWarning2)
{
HB_TRACE(("GenWarning(%p, %c, %d, %s, %s)",
_szWarnings, cPrefix, iWarning, szWarning1, szWarning2));
HB_TRACE(("GenWarning(%p, %c, %d, %s, %s)", _szWarnings, cPrefix, iWarning, szWarning1, szWarning2));
/* NOTE:
* All warnings are simply ignored

View File

@@ -33,6 +33,15 @@
*
*/
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#endif
#endif
#include <stdlib.h>
#if ( defined(_MSC_VER) || defined(__IBMCPP__) || defined(__MINGW32__) )
#include <memory.h>
@@ -453,8 +462,7 @@ void AddSearchPath( char * szPath, PATHNAMES * * pSearchList )
void GenError( char * _szErrors[], char cPrefix, int iError, char * szError1, char * szError2 )
{
HB_TRACE(("GenError(%p, %c, %d, %s, %s)",
_szErrors, cPrefix, iError, szError1, szError2));
HB_TRACE(("GenError(%p, %c, %d, %s, %s)", _szErrors, cPrefix, iError, szError1, szError2));
printf( "\r(%i) ", nline );
printf( "Error %c%04i ", cPrefix, iError );
@@ -466,8 +474,7 @@ void GenError( char * _szErrors[], char cPrefix, int iError, char * szError1, ch
void GenWarning( char* _szWarnings[], char cPrefix, int iWarning, char * szWarning1, char * szWarning2)
{
HB_TRACE(("GenWarning(%p, %c, %d, %s, %s)",
_szWarnings, cPrefix, iWarning, szWarning1, szWarning2));
HB_TRACE(("GenWarning(%p, %c, %d, %s, %s)", _szWarnings, cPrefix, iWarning, szWarning1, szWarning2));
if( _iWarnings )
{

View File

@@ -33,6 +33,15 @@
*
*/
/*
* Avoid tracing in preprocessor/compiler.
*/
#if ! defined(HB_REALLY_DO_TRACE)
#if defined(HB_DO_TRACE)
#undef HB_DO_TRACE
#endif
#endif
#include <stdio.h>
#include "hbpp.h"

View File

@@ -62,6 +62,8 @@ BOOL hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */
PHB_BASEARRAY pBaseArray = ( PHB_BASEARRAY ) hb_xgrab( sizeof( HB_BASEARRAY ) );
ULONG ulPos;
HB_TRACE(("hb_arrayNew(%p, %lu)", pItem, ulLen));
hb_itemClear( pItem );
pItem->type = IT_ARRAY;
@@ -86,6 +88,8 @@ BOOL hb_arrayNew( PHB_ITEM pItem, ULONG ulLen ) /* creates a new array */
BOOL hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pValue )
{
HB_TRACE(("hb_arrayAdd(%p, %p)", pArray, pValue));
if( IS_ARRAY( pArray ) )
{
PHB_BASEARRAY pBaseArray = ( PHB_BASEARRAY ) pArray->item.asArray.value;
@@ -105,6 +109,8 @@ BOOL hb_arrayAdd( PHB_ITEM pArray, PHB_ITEM pValue )
ULONG hb_arrayLen( PHB_ITEM pArray )
{
HB_TRACE(("hb_arrayLen(%p)", pArray));
if( IS_ARRAY( pArray ) )
return pArray->item.asArray.value->ulLen;
else
@@ -113,6 +119,8 @@ ULONG hb_arrayLen( PHB_ITEM pArray )
BOOL hb_arrayIsObject( PHB_ITEM pArray )
{
HB_TRACE(("hb_arrayIsObject(%p)", pArray));
if( IS_ARRAY( pArray ) )
return pArray->item.asArray.value->uiClass != 0;
else
@@ -121,6 +129,8 @@ BOOL hb_arrayIsObject( PHB_ITEM pArray )
BOOL hb_arraySize( PHB_ITEM pArray, ULONG ulLen )
{
HB_TRACE(("hb_arraySize(%p, %lu)", pArray, ulLen));
if( IS_ARRAY( pArray ) )
{
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
@@ -169,6 +179,8 @@ BOOL hb_arraySize( PHB_ITEM pArray, ULONG ulLen )
BOOL hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayDel(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) )
{
ULONG ulLen = pArray->item.asArray.value->ulLen;
@@ -193,6 +205,8 @@ BOOL hb_arrayDel( PHB_ITEM pArray, ULONG ulIndex )
BOOL hb_arrayIns( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayIns(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) )
{
ULONG ulLen = pArray->item.asArray.value->ulLen;
@@ -219,6 +233,8 @@ BOOL hb_arrayError( PHB_ITEM pArray, ULONG ulIndex, BOOL bAssign )
{
BOOL bError;
HB_TRACE(("hb_arrayError(%p, %lu, %d)", pArray, ulIndex, (int) bAssign));
if( IS_ARRAY( pArray ) )
{
if( ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
@@ -246,6 +262,8 @@ BOOL hb_arrayError( PHB_ITEM pArray, ULONG ulIndex, BOOL bAssign )
BOOL hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem )
{
HB_TRACE(("hb_arrayError(%p, %lu, %p)", pArray, ulIndex, pItem));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
{
hb_itemCopy( pArray->item.asArray.value->pItems + ( ulIndex - 1 ), pItem );
@@ -257,6 +275,8 @@ BOOL hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem )
BOOL hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem )
{
HB_TRACE(("hb_arrayGet(%p, %lu, %p)", pArray, ulIndex, pItem));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
{
hb_itemCopy( pItem, pArray->item.asArray.value->pItems + ( ulIndex - 1 ) );
@@ -271,6 +291,8 @@ BOOL hb_arrayGet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem )
char * hb_arrayGetDS( PHB_ITEM pArray, ULONG ulIndex, char * szDate )
{
HB_TRACE(("hb_arrayGetDS(%p, %lu, %s)", pArray, ulIndex, szDate));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
hb_itemGetDS( pArray->item.asArray.value->pItems + ulIndex - 1, szDate );
else
@@ -283,6 +305,8 @@ char * hb_arrayGetDS( PHB_ITEM pArray, ULONG ulIndex, char * szDate )
BOOL hb_arrayGetBool( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetBool(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) )
{
if( ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
@@ -298,6 +322,8 @@ BOOL hb_arrayGetBool( PHB_ITEM pArray, ULONG ulIndex )
*/
PHB_ITEM hb_arrayGetItemPtr( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetItemPtr(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) )
{
if( ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
@@ -309,6 +335,8 @@ PHB_ITEM hb_arrayGetItemPtr( PHB_ITEM pArray, ULONG ulIndex )
BOOL hb_arrayGetL( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetL(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetL( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -317,6 +345,8 @@ BOOL hb_arrayGetL( PHB_ITEM pArray, ULONG ulIndex )
int hb_arrayGetNI( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetNI(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetNI( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -325,6 +355,8 @@ int hb_arrayGetNI( PHB_ITEM pArray, ULONG ulIndex )
long hb_arrayGetNL( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetNL(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetNL( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -333,6 +365,8 @@ long hb_arrayGetNL( PHB_ITEM pArray, ULONG ulIndex )
double hb_arrayGetND( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetND(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetND( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -341,6 +375,8 @@ double hb_arrayGetND( PHB_ITEM pArray, ULONG ulIndex )
ULONG hb_arrayCopyC( PHB_ITEM pArray, ULONG ulIndex, char * szBuffer, ULONG ulLen )
{
HB_TRACE(("hb_arrayCopyC(%p, %lu, %s, %lu)", pArray, ulIndex, szBuffer, ulLen));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemCopyC( pArray->item.asArray.value->pItems + ulIndex - 1, szBuffer, ulLen );
else
@@ -349,6 +385,8 @@ ULONG hb_arrayCopyC( PHB_ITEM pArray, ULONG ulIndex, char * szBuffer, ULONG ulLe
char * hb_arrayGetC( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetC(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetC( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -357,6 +395,8 @@ char * hb_arrayGetC( PHB_ITEM pArray, ULONG ulIndex )
char * hb_arrayGetCPtr( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetCPtr(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetCPtr( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -365,6 +405,8 @@ char * hb_arrayGetCPtr( PHB_ITEM pArray, ULONG ulIndex )
ULONG hb_arrayGetCLen( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetCLen(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemGetCLen( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -373,6 +415,8 @@ ULONG hb_arrayGetCLen( PHB_ITEM pArray, ULONG ulIndex )
USHORT hb_arrayGetType( PHB_ITEM pArray, ULONG ulIndex )
{
HB_TRACE(("hb_arrayGetType(%p, %lu)", pArray, ulIndex));
if( IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen )
return hb_itemType( pArray->item.asArray.value->pItems + ulIndex - 1 );
else
@@ -381,6 +425,8 @@ USHORT hb_arrayGetType( PHB_ITEM pArray, ULONG ulIndex )
BOOL hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult )
{
HB_TRACE(("hb_arrayLast(%p, %p)", pArray, pResult));
if( IS_ARRAY( pArray ) )
{
if( pArray->item.asArray.value->ulLen > 0 )
@@ -399,6 +445,8 @@ BOOL hb_arrayLast( PHB_ITEM pArray, PHB_ITEM pResult )
BOOL hb_arrayFill( PHB_ITEM pArray, PHB_ITEM pValue, ULONG * pulStart, ULONG * pulCount )
{
HB_TRACE(("hb_arrayFill(%p, %p, %p, %p)", pArray, pValue, pulStart, pulCount));
if( IS_ARRAY( pArray ) )
{
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
@@ -433,6 +481,8 @@ BOOL hb_arrayFill( PHB_ITEM pArray, PHB_ITEM pValue, ULONG * pulStart, ULONG * p
ULONG hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, ULONG * pulStart, ULONG * pulCount )
{
HB_TRACE(("hb_arrayScan(%p, %p, %p, %p)", pArray, pValue, pulStart, pulCount));
if( IS_ARRAY( pArray ) )
{
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
@@ -536,6 +586,8 @@ ULONG hb_arrayScan( PHB_ITEM pArray, PHB_ITEM pValue, ULONG * pulStart, ULONG *
BOOL hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, ULONG * pulStart, ULONG * pulCount )
{
HB_TRACE(("hb_arrayEval(%p, %p, %p, %p)", pArray, bBlock, pulStart, pulCount));
if( IS_ARRAY( pArray ) && IS_BLOCK( bBlock ) )
{
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
@@ -578,6 +630,8 @@ BOOL hb_arrayEval( PHB_ITEM pArray, PHB_ITEM bBlock, ULONG * pulStart, ULONG * p
BOOL hb_arrayRelease( PHB_ITEM pArray )
{
HB_TRACE(("hb_arrayRelease(%p)", pArray));
if( IS_ARRAY( pArray ) )
{
PHB_BASEARRAY pBaseArray = pArray->item.asArray.value;
@@ -606,6 +660,8 @@ BOOL hb_arrayRelease( PHB_ITEM pArray )
BOOL hb_arrayCopy( PHB_ITEM pSrcArray, PHB_ITEM pDstArray, ULONG * pulStart,
ULONG * pulCount, ULONG * pulTarget )
{
HB_TRACE(("hb_arrayCopy(%p, %p, %p, %p, %p)", pSrcArray, pDstArray, pulStart, pulCount, pulTarget));
if( IS_ARRAY( pSrcArray ) && IS_ARRAY( pDstArray ) )
{
PHB_BASEARRAY pSrcBaseArray = pSrcArray->item.asArray.value;
@@ -669,6 +725,8 @@ PHB_ITEM hb_arrayClone( PHB_ITEM pSrcArray )
{
PHB_ITEM pDstArray = hb_itemNew( NULL );
HB_TRACE(("hb_arrayClone(%p)", pSrcArray));
if( IS_ARRAY( pSrcArray ) )
{
PHB_BASEARRAY pSrcBaseArray = pSrcArray->item.asArray.value;

View File

@@ -137,6 +137,8 @@ static HARBOUR hb___msgSetData( void );
static void hb_clsDictRealloc( PCLASS pClass )
{
HB_TRACE(("hb_clsDictRealloc(%p)", pClass));
if( pClass )
{
PMETHOD pNewMethods;
@@ -181,6 +183,8 @@ static void hb_clsRelease( PCLASS pClass )
USHORT uiLimit = pClass->uiHashKey * BUCKET;
PMETHOD pMeth = pClass->pMethods;
HB_TRACE(("hb_clsRelease(%p)", pClass));
for( uiAt = 0; uiAt < uiLimit; uiAt++, pMeth++ ) /* Release initializers */
if( pMeth->pInitValue && pMeth->uiData > pClass->uiDataFirst )
hb_itemRelease( pMeth->pInitValue );
@@ -202,6 +206,8 @@ void hb_clsReleaseAll( void )
{
USHORT uiClass;
HB_TRACE(("hb_clsReleaseAll()"));
for( uiClass = 0; uiClass < s_uiClasses; uiClass++ )
hb_clsRelease( s_pClasses + uiClass );
@@ -222,6 +228,8 @@ char * hb_objGetClsName( PHB_ITEM pObject )
{
char * szClassName;
HB_TRACE(("hb_objGetClsName(%p)", pObject));
if( IS_ARRAY( pObject ) )
{
if( ! pObject->item.asArray.value->uiClass )
@@ -284,6 +292,8 @@ PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage )
USHORT uiClass;
PHB_DYNS pMsg = pMessage->pDynSym;
HB_TRACE(("hb_objGetMethod(%p, %p)", pObject, pMessage));
if( pObject->type == IT_ARRAY )
uiClass = pObject->item.asArray.value->uiClass;
else
@@ -345,6 +355,9 @@ PHB_FUNC hb_objGetMethod( PHB_ITEM pObject, PHB_SYMB pMessage )
ULONG hb_objHasMsg( PHB_ITEM pObject, char *szString )
{
PHB_DYNS pDynSym = hb_dynsymFindName( szString );
HB_TRACE(("hb_objHasMsg(%p, %s)", pObject, szString));
if( pDynSym )
return ( ULONG ) hb_objGetMethod( pObject, pDynSym->pSymbol );
else

View File

@@ -60,6 +60,8 @@ HB_CODEBLOCK_PTR hb_codeblockNew( BYTE * pBuffer,
{
HB_CODEBLOCK_PTR pCBlock;
HB_TRACE(("hb_codeblockNew(%p, %hu, %p, %p)", pBuffer, uiLocals, pLocalPosTable, pSymbols));
pCBlock = ( HB_CODEBLOCK_PTR ) hb_xgrab( sizeof( HB_CODEBLOCK ) );
/* Store the number of referenced local variables
@@ -176,6 +178,9 @@ HB_CODEBLOCK_PTR hb_codeblockNew( BYTE * pBuffer,
void hb_codeblockDelete( HB_ITEM_PTR pItem )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
HB_TRACE(("hb_codeblockDelete(%p)", pItem));
#ifdef CODEBLOCKDEBUG
printf( "\ndelete a codeblock (%li) %lx", pCBlock->ulCounter, pCBlock );
#endif
@@ -217,6 +222,8 @@ void hb_codeblockEvaluate( HB_ITEM_PTR pItem )
{
int iStatics = hb_stack.iStatics;
HB_TRACE(("hb_codeblockEvaluate(%p)", pItem));
hb_stack.iStatics = pItem->item.asBlock.statics;
hb_vmExecute( pItem->item.asBlock.value->pCode, pItem->item.asBlock.value->pSymbols );
hb_stack.iStatics = iStatics;
@@ -227,6 +234,9 @@ void hb_codeblockEvaluate( HB_ITEM_PTR pItem )
PHB_ITEM hb_codeblockGetVar( PHB_ITEM pItem, LONG iItemPos )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
HB_TRACE(("hb_codeblockGetVar(%p, %ld)", pItem, iItemPos));
/* local variables accessed in a codeblock are always stored as reference */
return hb_itemUnRef( pCBlock->pLocals - iItemPos );
}
@@ -237,6 +247,8 @@ PHB_ITEM hb_codeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer )
{
HB_CODEBLOCK_PTR pCBlock = pItem->item.asBlock.value;
HB_TRACE(("hb_codeblockGetRef(%p, %p)", pItem, pRefer));
return pCBlock->pLocals - pRefer->item.asRefer.value;
}
@@ -246,6 +258,8 @@ PHB_ITEM hb_codeblockGetRef( PHB_ITEM pItem, PHB_ITEM pRefer )
*/
void hb_codeblockCopy( PHB_ITEM pDest, PHB_ITEM pSource )
{
HB_TRACE(("hb_codeblockCopy(%p, %p)", pDest, pSource));
pDest->item.asBlock.value = pSource->item.asBlock.value;
pDest->item.asBlock.value->ulCounter++;
#ifdef CODEBLOCKDEBUG

View File

@@ -111,6 +111,8 @@ void hb_consoleInitialize( void )
{
int iStderr;
HB_TRACE(("hb_consoleInitialize()"));
#if defined(OS_DOS_COMPATIBLE)
s_szCrLf[ 0 ] = HB_CHAR_CR;
s_szCrLf[ 1 ] = HB_CHAR_LF;
@@ -155,6 +157,8 @@ void hb_consoleInitialize( void )
void hb_consoleRelease( void )
{
HB_TRACE(("hb_consoleRelease()"));
hb_fsSetDevMode( s_iFilenoStdout, FD_TEXT );
hb_fsSetDevMode( s_iFilenoStderr, FD_TEXT );
@@ -171,6 +175,8 @@ void hb_consoleRelease( void )
char * hb_consoleGetNewLine( void )
{
HB_TRACE(("hb_consoleGetNewLine()"));
return s_szCrLf;
}
@@ -220,6 +226,8 @@ HARBOUR HB_HB_OSNEWLINE( void )
USHORT hb_max_row( void )
{
HB_TRACE(("hb_max_row()"));
#ifdef HARBOUR_USE_GTAPI
return hb_gtMaxRow();
#else
@@ -233,6 +241,8 @@ USHORT hb_max_row( void )
USHORT hb_max_col( void )
{
HB_TRACE(("hb_max_col()"));
#ifdef HARBOUR_USE_GTAPI
return hb_gtMaxCol();
#else
@@ -246,6 +256,8 @@ static void adjust_pos( char * pStr, ULONG ulLen, SHORT * row, SHORT * col, USHO
ULONG ulCount;
char * pPtr = pStr;
HB_TRACE(("adjust_pos(%s, %lu, %p, %p, %hu, %hu)", pStr, ulLen, row, col, max_row, max_col));
for( ulCount = 0; ulCount < ulLen; ulCount++ )
{
switch( *pPtr++ )
@@ -288,8 +300,14 @@ typedef void hb_out_func_typedef( char *, ULONG );
static void hb_out( USHORT uiParam, hb_out_func_typedef * hb_out_func )
{
ULONG ulLen;
PHB_ITEM pItem = hb_param( uiParam, IT_ANY );
char * pString = hb_itemString( pItem, &ulLen );
PHB_ITEM pItem;
char * pString;
HB_TRACE(("hb_out(%hu, %p)", uiParam, hb_out_func));
pItem = hb_param( uiParam, IT_ANY );
pString = hb_itemString( pItem, &ulLen );
hb_out_func( pString, ulLen );
}
@@ -298,6 +316,8 @@ void hb_outstd( char * pStr, ULONG ulLen )
{
USHORT user_ferror;
HB_TRACE(("hb_outstd(%s, %lu)", pStr, ulLen));
if( ulLen == 0 )
ulLen = strlen( pStr );
@@ -333,6 +353,8 @@ void hb_outerr( char * pStr, ULONG ulLen )
{
USHORT user_ferror;
HB_TRACE(("hb_outerr(%s, %lu)", pStr, ulLen));
if( ulLen == 0 )
ulLen = strlen( pStr );
@@ -366,6 +388,8 @@ void hb_outerr( char * pStr, ULONG ulLen )
/* Output an item to the screen and/or printer and/or alternate */
static void hb_altout( char * pStr, ULONG ulLen )
{
HB_TRACE(("hb_altout(%s, %lu)", pStr, ulLen));
if( hb_set.HB_SET_CONSOLE )
{
#ifdef HARBOUR_USE_GTAPI
@@ -408,6 +432,8 @@ static void hb_altout( char * pStr, ULONG ulLen )
/* Output an item to the screen and/or printer */
static void hb_devout( char * pStr, ULONG ulLen )
{
HB_TRACE(("hb_devout(%s, %lu)", pStr, ulLen));
if( hb_set.hb_set_printhan != FS_ERROR && hb_stricmp( hb_set.HB_SET_DEVICE, "PRINTER" ) == 0 )
{
/* Display to printer if SET DEVICE TO PRINTER and valid printer file */
@@ -434,6 +460,8 @@ static void hb_devout( char * pStr, ULONG ulLen )
/* Output an item to the screen */
static void hb_dispout( char * pStr, ULONG ulLen )
{
HB_TRACE(("hb_dispout(%s, %lu)", pStr, ulLen));
#ifdef HARBOUR_USE_GTAPI
/* Display to console */
hb_gtWriteAt( s_iDevRow, s_iDevCol, ( BYTE * ) pStr, ulLen );
@@ -448,6 +476,8 @@ static void hb_dispout( char * pStr, ULONG ulLen )
void hb_setpos( SHORT row, SHORT col )
{
HB_TRACE(("hb_setpos(%hd, %hd)", row, col));
#ifdef HARBOUR_USE_GTAPI
hb_gtSetPos( row, col );
#else
@@ -473,6 +503,8 @@ void hb_setpos( SHORT row, SHORT col )
void hb_devpos( SHORT row, SHORT col )
{
HB_TRACE(("hb_devpos(%hd, %hd)", row, col));
/* Position printer if SET DEVICE TO PRINTER and valid printer file
otherwise position console */
if( hb_set.hb_set_printhan != FS_ERROR && hb_stricmp( hb_set.HB_SET_DEVICE, "PRINTER" ) == 0 )
@@ -1048,6 +1080,9 @@ HARBOUR HB_RESTSCREEN( void )
USHORT hb_setCursor( BOOL bSetCursor, USHORT usNewCursor )
{
USHORT usPreviousCursor;
HB_TRACE(("hb_setCursor(%d, %hu)", (int) bSetCursor, usNewCursor));
#ifdef HARBOUR_USE_GTAPI
hb_gtGetCursor( &usPreviousCursor );
if( bSetCursor )

View File

@@ -51,6 +51,8 @@ static BOOL hb_fsCopy( char * szSource, char * szDest )
FHANDLE fhndSource;
FHANDLE fhndDest;
HB_TRACE(("hb_fsCopy(%s, %s)", szSource, szDest));
while( ( fhndSource = hb_fsOpen( ( BYTE * ) szSource, FO_READ | FO_SHARED | FO_PRIVATE ) ) == FS_ERROR )
{
USHORT uiAction = hb_errRT_BASE_Ext1( EG_OPEN, 2012, NULL, szSource, hb_fsError(), EF_CANDEFAULT | EF_CANRETRY );

View File

@@ -98,6 +98,8 @@ double hb_secondsToday( void )
struct timeb tb;
struct tm *oTime;
HB_TRACE(("hb_secondsToday()"));
ftime( &tb );
oTime = localtime( &tb.time );
return ( oTime->tm_hour * 3600 ) +
@@ -108,6 +110,8 @@ double hb_secondsToday( void )
char * hb_cmonth( int iMonth )
{
HB_TRACE(("hb_cmonth(%d)", iMonth));
if( iMonth >= 1 && iMonth <= 12 )
return hb_monthsname[ iMonth - 1 ];
else
@@ -116,6 +120,8 @@ char * hb_cmonth( int iMonth )
char * hb_cdow( int iDay )
{
HB_TRACE(("hb_cdow(%d)", iDay));
if( iDay >= 1 && iDay <= 7 )
return hb_daysname[ iDay - 1 ];
else
@@ -127,6 +133,8 @@ long hb_dateEncode( long lDay, long lMonth, long lYear )
BOOL bValid = FALSE;
long lFactor = ( lMonth < 3 ) ? -1 : 0;
HB_TRACE(("hb_dateEncode(%ld, %ld, %ld)", lDay, lMonth, lYear));
/* Perform date validation */
if( lMonth >= 1 && lMonth <= 12 && lDay >= 1
&& lYear >= 1 && lYear <= 2999 )
@@ -153,6 +161,8 @@ long hb_dateEncode( long lDay, long lMonth, long lYear )
void hb_dateDecode( long julian, long * plDay, long * plMonth, long * plYear )
{
HB_TRACE(("hb_dateDecode(%ld, %p, %p, %p)", julian, plDay, plMonth, plYear));
if( julian > 0 )
{
long U, V, W, X;
@@ -177,6 +187,8 @@ void hb_dateDecode( long julian, long * plDay, long * plMonth, long * plYear )
void hb_dateStrPut( char * szDate, long lDay, long lMonth, long lYear )
{
HB_TRACE(("hb_dateStrPut(%s, %ld, %ld, %ld)", szDate, lDay, lMonth, lYear));
if( lDay && lMonth && lYear )
{
szDate[ 0 ] = ( lYear / 1000 ) + '0';
@@ -196,6 +208,8 @@ void hb_dateStrPut( char * szDate, long lDay, long lMonth, long lYear )
void hb_dateStrGet( const char * szDate, long * plDay, long * plMonth, long * plYear )
{
HB_TRACE(("hb_dateStrGet(%s, %p, %p, %p)", szDate, plDay, plMonth, plYear));
if( szDate && strlen( szDate ) == 8 )
{
/* Date string has correct length, so attempt to convert */
@@ -218,6 +232,8 @@ char * hb_dateDecStr( char * szDate, long lJulian )
{
long lDay, lMonth, lYear;
HB_TRACE(("hb_dateDecStr(%s, %ld)", szDate, lJulian));
hb_dateDecode( lJulian, &lDay, &lMonth, &lYear );
hb_dateStrPut( szDate, lDay, lMonth, lYear );
szDate[ 8 ] = '\0';
@@ -229,6 +245,8 @@ long hb_dateEncStr( char * szDate )
{
long lDay, lMonth, lYear;
HB_TRACE(("hb_dateEncStr(%s)", szDate));
hb_dateStrGet( szDate, &lDay, &lMonth, &lYear );
return hb_dateEncode( lDay, lMonth, lYear );
@@ -330,6 +348,8 @@ char * hb_dtoc( const char * szDate, char * szFormattedDate, const char * szDate
*/
int format_count, digit_count, size;
HB_TRACE(("hb_dtoc(%s, %s, %s)", szDate, szFormattedDate, szDateFormat));
/*
* Determine the maximum size of the formatted date string
*/
@@ -650,6 +670,8 @@ HARBOUR HB_DATE( void )
long hb_dow( long d, long m, long y )
{
HB_TRACE(("hb_dow(%ld, %ld, %ld)", d, m, y));
if( m < 3 )
{
m += 13;

View File

@@ -69,6 +69,8 @@
void hb_strDescend( char * szStringTo, char * szStringFrom, ULONG ulLen )
{
HB_TRACE(("hb_strDescend(%s, %s, %lu)", szStringTo, szStringFrom, ulLen));
if( ulLen == 1 && szStringFrom[ 0 ] == '\0' )
szStringTo[ 0 ] = '\0';
else

View File

@@ -221,6 +221,8 @@ static USHORT osToHarbourMask( USHORT usMask )
{
USHORT usRetMask;
HB_TRACE(("osToHarbourMask(%hu)", usMask));
usRetMask = usMask;
#if defined(OS_UNIX_COMPATIBLE)
@@ -264,6 +266,8 @@ static USHORT HarbourToOsMask( USHORT usMask )
{
USHORT usRetMask = usMask;
HB_TRACE(("HarbourToOsMask(%hu)", usMask));
#if defined(OS_UNIX_COMPATIBLE)
/* TODO: Need to look into this one */
/* what to do with Hidden and System? */
@@ -313,6 +317,8 @@ static USHORT osAttributesToMask( BYTE * byAttrib )
{
USHORT usRetMask = 0;
HB_TRACE(("osAttributes(%p)", byAttrib));
#if defined(OS_UNIX_COMPATIBLE)
#else
#if defined(__IBMCPP__)
@@ -333,6 +339,8 @@ static BYTE * osMaskToAttributes( USHORT usMask, BYTE * byAttrib )
{
char * cAttrib = ( char * ) byAttrib;
HB_TRACE(("osMaskToAttributes(%hu, %p)", usMask, byAttrib));
#if defined(OS_UNIX_COMPATIBLE)
#else
#if defined(__IBMCPP__)
@@ -356,6 +364,8 @@ static USHORT HarbourAttributesToMask( BYTE * byAttrib )
BYTE c;
USHORT usMask = 0;
HB_TRACE(("HarbourAttributesToMask(%p)", byAttrib));
while( ( c = toupper( *pos++ ) ) != '\0' )
{
switch( c )
@@ -386,6 +396,8 @@ static BYTE * HarbourMaskToAttributes( USHORT usMask, BYTE * byAttrib )
{
char * cAttrib = ( char * ) byAttrib;
HB_TRACE(("HarbourMaskToAttributes(%hu, %p)", usMask, byAttrib));
*cAttrib = '\0';
if( usMask & FA_RDONLY )
strcat( cAttrib, "R" );

View File

@@ -282,7 +282,11 @@ HARBOUR HB_OS( void )
char * hb_version( USHORT uiMode )
{
char * pszVersion = ( char * ) hb_xgrab( HB_VERSION_BUFFER_LEN );
char * pszVersion;
HB_TRACE(("hb_version(%hu)", uiMode));
pszVersion = ( char * ) hb_xgrab( HB_VERSION_BUFFER_LEN );
sprintf( pszVersion, "Harbour %d.%d Intl. (Build %d%s) (%04d.%02d.%02d)",
hb_major, hb_minor, hb_build, hb_revision, hb_year, hb_month, hb_day );

View File

@@ -78,6 +78,8 @@ extern HARBOUR HB_ERRORNEW( void );
/* that it gets linked. WARNING ! DON'T make this function static. */
void hb_errForceLink()
{
HB_TRACE(("hb_errForceLink()"));
HB_ERRORNEW();
}
@@ -116,17 +118,25 @@ HARBOUR HB_DOSERROR( void )
void hb_errInit( void )
{
HB_TRACE(("hb_errInit()"));
hb_itemClear( &s_errorBlock );
}
void hb_errExit( void )
{
HB_TRACE(("hb_errExit()"));
hb_itemClear( &s_errorBlock );
}
PHB_ITEM hb_errNew( void )
{
PHB_ITEM pReturn = hb_itemNew( NULL );
PHB_ITEM pReturn;
HB_TRACE(("hb_errNew()"));
pReturn = hb_itemNew( NULL );
hb_vmPushSymbol( hb_dynsymGet( "ERRORNEW" )->pSymbol );
hb_vmPushNil();
@@ -141,6 +151,8 @@ USHORT hb_errLaunch( PHB_ITEM pError )
{
USHORT uiAction;
HB_TRACE(("hb_errLaunch(%p)", pError));
if( pError )
{
PHB_ITEM pResult;
@@ -226,6 +238,8 @@ PHB_ITEM hb_errLaunchSubst( PHB_ITEM pError )
{
PHB_ITEM pResult;
HB_TRACE(("hb_errLaunchSubst(%p)", pError));
if( pError )
{
/* Check if we have a valid error handler */
@@ -276,12 +290,16 @@ PHB_ITEM hb_errLaunchSubst( PHB_ITEM pError )
void hb_errRelease( PHB_ITEM pError )
{
HB_TRACE(("hb_errRelease(%p)", pError));
/* NOTE: NULL pointer is checked by hb_itemRelease() */
hb_itemRelease( pError );
}
char * hb_errGetDescription( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetDescription(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "DESCRIPTION" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -291,6 +309,8 @@ char * hb_errGetDescription( PHB_ITEM pError )
PHB_ITEM hb_errPutDescription( PHB_ITEM pError, char * szDescription )
{
HB_TRACE(("hb_errPutDescription(%p, %s)", pError, szDescription));
hb_vmPushSymbol( hb_dynsymGet( "_DESCRIPTION" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szDescription, strlen( szDescription ) );
@@ -301,6 +321,8 @@ PHB_ITEM hb_errPutDescription( PHB_ITEM pError, char * szDescription )
char * hb_errGetFileName( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetFileName(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "FILENAME" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -310,6 +332,8 @@ char * hb_errGetFileName( PHB_ITEM pError )
PHB_ITEM hb_errPutFileName( PHB_ITEM pError, char * szFileName )
{
HB_TRACE(("hb_errPutFileName(%p, %s)", pError, szFileName));
hb_vmPushSymbol( hb_dynsymGet( "_FILENAME" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szFileName, strlen( szFileName ) );
@@ -320,6 +344,8 @@ PHB_ITEM hb_errPutFileName( PHB_ITEM pError, char * szFileName )
USHORT hb_errGetGenCode( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetGenCode(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "GENCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -329,6 +355,8 @@ USHORT hb_errGetGenCode( PHB_ITEM pError )
PHB_ITEM hb_errPutGenCode( PHB_ITEM pError, USHORT uiGenCode )
{
HB_TRACE(("hb_errPutGenCode(%p, %hu)", pError, uiGenCode));
hb_vmPushSymbol( hb_dynsymGet( "_GENCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiGenCode );
@@ -339,6 +367,8 @@ PHB_ITEM hb_errPutGenCode( PHB_ITEM pError, USHORT uiGenCode )
char * hb_errGetOperation( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetOperation(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "OPERATION" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -348,6 +378,8 @@ char * hb_errGetOperation( PHB_ITEM pError )
PHB_ITEM hb_errPutOperation( PHB_ITEM pError, char * szOperation )
{
HB_TRACE(("hb_errPutOperation(%p, %s)", pError, szOperation));
hb_vmPushSymbol( hb_dynsymGet( "_OPERATION" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szOperation, strlen( szOperation ) );
@@ -358,6 +390,8 @@ PHB_ITEM hb_errPutOperation( PHB_ITEM pError, char * szOperation )
USHORT hb_errGetOsCode( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetOsCode(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "OSCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -367,6 +401,8 @@ USHORT hb_errGetOsCode( PHB_ITEM pError )
PHB_ITEM hb_errPutOsCode( PHB_ITEM pError, USHORT uiOsCode )
{
HB_TRACE(("hb_errPutOsCode(%p, %hu)", pError, uiOsCode));
hb_vmPushSymbol( hb_dynsymGet( "_OSCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiOsCode );
@@ -377,6 +413,8 @@ PHB_ITEM hb_errPutOsCode( PHB_ITEM pError, USHORT uiOsCode )
USHORT hb_errGetSeverity( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetSeverity(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "SEVERITY" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -386,6 +424,8 @@ USHORT hb_errGetSeverity( PHB_ITEM pError )
PHB_ITEM hb_errPutSeverity( PHB_ITEM pError, USHORT uiSeverity )
{
HB_TRACE(("hb_errPutSeverity(%p, %hu)", pError, uiSeverity));
hb_vmPushSymbol( hb_dynsymGet( "_SEVERITY" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiSeverity );
@@ -396,6 +436,8 @@ PHB_ITEM hb_errPutSeverity( PHB_ITEM pError, USHORT uiSeverity )
USHORT hb_errGetSubCode( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetSubCode(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "SUBCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -405,6 +447,8 @@ USHORT hb_errGetSubCode( PHB_ITEM pError )
PHB_ITEM hb_errPutSubCode( PHB_ITEM pError, USHORT uiSubCode )
{
HB_TRACE(("hb_errPutSubCode(%p, %hu)", pError, uiSubCode));
hb_vmPushSymbol( hb_dynsymGet( "_SUBCODE" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiSubCode );
@@ -415,6 +459,8 @@ PHB_ITEM hb_errPutSubCode( PHB_ITEM pError, USHORT uiSubCode )
char * hb_errGetSubSystem( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetSubSytem(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "SUBSYSTEM" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -424,6 +470,8 @@ char * hb_errGetSubSystem( PHB_ITEM pError )
PHB_ITEM hb_errPutSubSystem( PHB_ITEM pError, char * szSubSystem )
{
HB_TRACE(("hb_errPutSubSytem(%p, %s)", pError, szSubSystem));
hb_vmPushSymbol( hb_dynsymGet( "_SUBSYSTEM" )->pSymbol );
hb_vmPush( pError );
hb_vmPushString( szSubSystem, strlen( szSubSystem ) );
@@ -434,6 +482,8 @@ PHB_ITEM hb_errPutSubSystem( PHB_ITEM pError, char * szSubSystem )
USHORT hb_errGetTries( PHB_ITEM pError )
{
HB_TRACE(("hb_errGetTries(%p)", pError));
hb_vmPushSymbol( hb_dynsymGet( "TRIES" )->pSymbol );
hb_vmPush( pError );
hb_vmDo( 0 );
@@ -443,6 +493,8 @@ USHORT hb_errGetTries( PHB_ITEM pError )
PHB_ITEM hb_errPutTries( PHB_ITEM pError, USHORT uiTries )
{
HB_TRACE(("hb_errPutTries(%p, %hu)", pError, uiTries));
hb_vmPushSymbol( hb_dynsymGet( "_TRIES" )->pSymbol );
hb_vmPush( pError );
hb_vmPushInteger( uiTries );
@@ -455,6 +507,8 @@ USHORT hb_errGetFlags( PHB_ITEM pError )
{
USHORT uiFlags = EF_NONE;
HB_TRACE(("hb_errGetFlags(%p)", pError));
/* ; */
hb_vmPushSymbol( hb_dynsymGet( "CANRETRY" )->pSymbol );
@@ -489,6 +543,8 @@ USHORT hb_errGetFlags( PHB_ITEM pError )
PHB_ITEM hb_errPutFlags( PHB_ITEM pError, USHORT uiFlags )
{
HB_TRACE(("hb_errPutFlags(%p, %hu)", pError, uiFlags));
hb_vmPushSymbol( hb_dynsymGet( "_CANRETRY" )->pSymbol );
hb_vmPush( pError );
hb_vmPushLogical( ( uiFlags & EF_CANRETRY ) ? TRUE : FALSE );
@@ -515,10 +571,14 @@ PHB_ITEM hb_errPutFlags( PHB_ITEM pError, USHORT uiFlags )
PHB_ITEM hb_errPutArgs( PHB_ITEM pError, USHORT uiArgCount, ... )
{
PHB_ITEM pArray = hb_itemArrayNew( uiArgCount );
PHB_ITEM pArray;
USHORT uiArgPos;
va_list va;
HB_TRACE(("hb_errPutArgs(%p, %hu, ...)", pError, uiArgCount));
pArray = hb_itemArrayNew( uiArgCount );
/* Build the array from the passed arguments. */
va_start( va, uiArgCount );
@@ -681,6 +741,8 @@ void hb_errInternal( ULONG ulIntCode, char * szText, char * szPar1, char * szPar
{
char buffer[ 128 ];
HB_TRACE(("hb_errInternal(%lu, %s, %s, %s)", ulIntCode, szText, szPar1, szPar2));
hb_outerr( hb_consoleGetNewLine(), 0 );
sprintf( buffer, "Unrecoverable error %lu: ", ulIntCode );
hb_outerr( buffer, 0 );

View File

@@ -57,6 +57,8 @@
PHB_ITEM hb_param( int iParam, int iMask )
{
HB_TRACE(("hb_param(%d, %d)", iParam, iMask));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -83,6 +85,8 @@ PHB_ITEM hb_param( int iParam, int iMask )
char * hb_parc( int iParam, ... )
{
HB_TRACE(("hb_parc(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -116,6 +120,8 @@ char * hb_parc( int iParam, ... )
ULONG hb_parclen( int iParam, ... )
{
HB_TRACE(("hb_parclen(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -153,6 +159,8 @@ ULONG hb_parclen( int iParam, ... )
ULONG hb_parcsiz( int iParam, ... )
{
HB_TRACE(("hb_parcsiz(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -194,6 +202,8 @@ ULONG hb_parcsiz( int iParam, ... )
char * hb_pards( int iParam, ... )
{
HB_TRACE(("hb_pards(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -227,6 +237,8 @@ char * hb_pards( int iParam, ... )
int hb_parl( int iParam, ... )
{
HB_TRACE(("hb_parl(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -269,6 +281,8 @@ int hb_parl( int iParam, ... )
double hb_parnd( int iParam, ... )
{
HB_TRACE(("hb_parnd(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -308,6 +322,8 @@ double hb_parnd( int iParam, ... )
int hb_parni( int iParam, ... )
{
HB_TRACE(("hb_parni(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -347,6 +363,8 @@ int hb_parni( int iParam, ... )
long hb_parnl( int iParam, ... )
{
HB_TRACE(("hb_parnl(%d, ...)", iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -389,7 +407,11 @@ long hb_parnl( int iParam, ... )
ULONG hb_parinfa( int iParamNum, ULONG uiArrayIndex )
{
PHB_ITEM pArray = hb_param( iParamNum, IT_ARRAY );
PHB_ITEM pArray;
HB_TRACE(("hb_parinfa(%d, %lu)", iParamNum, uiArrayIndex));
pArray = hb_param( iParamNum, IT_ARRAY );
if( pArray )
{
@@ -404,6 +426,8 @@ ULONG hb_parinfa( int iParamNum, ULONG uiArrayIndex )
int hb_parinfo( int iParam )
{
HB_TRACE(("hb_parinfo(%d)", iParam));
if( iParam == 0 )
return ( int ) hb_stack.pBase->item.asSymbol.paramcnt;
else
@@ -439,26 +463,36 @@ int hb_parinfo( int iParam )
int hb_pcount( void )
{
HB_TRACE(("hb_pcount()"));
return ( int ) hb_stack.pBase->item.asSymbol.paramcnt;
}
void hb_ret( void )
{
HB_TRACE(("hb_ret()"));
hb_itemClear( &hb_stack.Return );
}
void hb_reta( ULONG ulLen ) /* undocumented hb_reta() */
{
HB_TRACE(("hb_reta(%lu)", ulLen));
hb_arrayNew( &hb_stack.Return, ulLen );
}
void hb_retc( char * szText )
{
HB_TRACE(("hb_retc(%s)", szText));
hb_itemPutC( &hb_stack.Return, szText );
}
void hb_retclen( char * szText, ULONG ulLen )
{
HB_TRACE(("hb_retclen(%s, %lu)", szText, ulLen));
hb_itemPutCL( &hb_stack.Return, szText, ulLen );
}
@@ -466,51 +500,71 @@ void hb_retclen( char * szText, ULONG ulLen )
void hb_retds( char * szDate )
{
HB_TRACE(("hb_retds(%s)", szDate));
hb_itemPutDS( &hb_stack.Return, szDate );
}
void hb_retl( int iLogical )
{
HB_TRACE(("hb_retl(%d)", iLogical));
hb_itemPutL( &hb_stack.Return, iLogical ? TRUE : FALSE );
}
void hb_retnd( double dNumber )
{
HB_TRACE(("hb_retnd(%lf)", dNumber));
hb_itemPutND( &hb_stack.Return, dNumber );
}
void hb_retni( int iNumber )
{
HB_TRACE(("hb_retni(%d)", iNumber));
hb_itemPutNI( &hb_stack.Return, iNumber );
}
void hb_retnl( long lNumber )
{
HB_TRACE(("hb_retnl(%ld)", lNumber));
hb_itemPutNL( &hb_stack.Return, lNumber );
}
void hb_retnlen( double dNumber, int iWidth, int iDec )
{
HB_TRACE(("hb_retnlen(%lf, %d, %d)", dNumber, iWidth, iDec));
hb_itemPutNLen( &hb_stack.Return, dNumber, iWidth, iDec );
}
void hb_retndlen( double dNumber, int iWidth, int iDec )
{
HB_TRACE(("hb_retndlen(%lf, %d, %d)", dNumber, iWidth, iDec));
hb_itemPutNDLen( &hb_stack.Return, dNumber, iWidth, iDec );
}
void hb_retnilen( int iNumber, int iWidth )
{
HB_TRACE(("hb_retnilen(%d, %d)", iNumber, iWidth));
hb_itemPutNILen( &hb_stack.Return, iNumber, iWidth );
}
void hb_retnllen( long lNumber, int iWidth )
{
HB_TRACE(("hb_retnllen(%ld, %d)", lNumber, iWidth));
hb_itemPutNLLen( &hb_stack.Return, lNumber, iWidth );
}
void hb_storc( char * szText, int iParam, ... )
{
HB_TRACE(("hb_storc(%s, %d, ...)", szText, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -537,6 +591,8 @@ void hb_storc( char * szText, int iParam, ... )
void hb_storclen( char * szText, ULONG ulLen, int iParam, ... )
{
HB_TRACE(("hb_storclen(%s, %lu, %d, ...)", szText, ulLen, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -565,6 +621,8 @@ void hb_storclen( char * szText, ULONG ulLen, int iParam, ... )
void hb_stords( char * szDate, int iParam, ... )
{
HB_TRACE(("hb_stords(%s, %d, ...)", szDate, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -591,6 +649,8 @@ void hb_stords( char * szDate, int iParam, ... )
void hb_storl( int iLogical, int iParam, ... )
{
HB_TRACE(("hb_storl(%d, %d, ...)", iLogical, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -617,6 +677,8 @@ void hb_storl( int iLogical, int iParam, ... )
void hb_storni( int iValue, int iParam, ... )
{
HB_TRACE(("hb_storni(%d, %d, ...)", iValue, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -643,6 +705,8 @@ void hb_storni( int iValue, int iParam, ... )
void hb_stornl( long lValue, int iParam, ... )
{
HB_TRACE(("hb_stornl(%ld, %d, ...)", lValue, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;
@@ -669,6 +733,8 @@ void hb_stornl( long lValue, int iParam, ... )
void hb_stornd( double dNumber, int iParam, ... )
{
HB_TRACE(("hb_stornd(%lf, %d, ...)", dNumber, iParam));
if( ( iParam >= 0 && iParam <= hb_pcount() ) || ( iParam == -1 ) )
{
PHB_ITEM pItem;

View File

@@ -210,6 +210,8 @@ static int convert_open_flags( USHORT uiFlags )
/* by default FO_READ + FO_COMPAT is set */
int result_flags = 0;
HB_TRACE(("convert_open_flags(%hu)", uiFlags));
/* DEBUG: printf("\nHarbour open flags: 0x%04x", uiFlags); */
result_flags |= O_BINARY;
@@ -285,6 +287,8 @@ static int convert_seek_flags( USHORT uiFlags )
/* by default FS_SET is set */
int result_flags = 0;
HB_TRACE(("convert_seek_flags(%hu)", uiFlags));
result_flags = SEEK_SET;
if( uiFlags & FS_RELATIVE )
@@ -298,6 +302,8 @@ static int convert_seek_flags( USHORT uiFlags )
static void convert_create_flags( USHORT uiFlags, int * result_flags, unsigned * result_pmode )
{
HB_TRACE(("convert_create_flags(%hu, %p, %p)", uiFlags, result_flags, result_pmode));
/* by default FC_NORMAL is set */
*result_flags = O_BINARY | O_CREAT | O_TRUNC | O_RDWR;
@@ -327,6 +333,9 @@ static void convert_create_flags( USHORT uiFlags, int * result_flags, unsigned *
FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags )
{
FHANDLE hFileHandle;
int iShare;
HB_TRACE(("hb_fsOpen(%p, %hu)", pFilename, uiFlags));
#if defined(HAVE_POSIX_IO) && ! defined(__IBMCPP__)
@@ -356,7 +365,7 @@ FHANDLE hb_fsOpen( BYTE * pFilename, USHORT uiFlags )
#elif defined(__MINGW32__) || defined(__IBMCPP__)
int iShare = SH_DENYNO;
iShare = SH_DENYNO;
if( ( uiFlags & FO_DENYREAD ) == FO_DENYREAD )
iShare = SH_DENYRD;
@@ -390,6 +399,8 @@ FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiFlags )
int oflag;
unsigned pmode;
HB_TRACE(("hb_fsCreate(%p, %hu)", pFilename, uiFlags));
s_uiErrorLast = 0;
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
@@ -417,6 +428,8 @@ FHANDLE hb_fsCreate( BYTE * pFilename, USHORT uiFlags )
void hb_fsClose( FHANDLE hFileHandle )
{
HB_TRACE(("hb_fsClose(%p)", hFileHandle));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -437,6 +450,7 @@ void hb_fsClose( FHANDLE hFileHandle )
void hb_fsSetDevMode( FHANDLE hFileHandle, USHORT uiDevMode )
{
HB_TRACE(("hb_fsSetDevMode(%p, %hu)", hFileHandle, uiDevMode));
#if defined(__BORLANDC__) || defined(__IBMCPP__) || defined(__DJGPP__) || defined(__CYGWIN__) || defined(__WATCOMC__)
@@ -490,6 +504,8 @@ USHORT hb_fsRead( FHANDLE hFileHandle, BYTE * pBuff, USHORT uiCount )
{
USHORT uiRead;
HB_TRACE(("hb_fsRead(%p, %p, %hu)", hFileHandle, pBuff, uiCount));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -512,6 +528,8 @@ USHORT hb_fsWrite( FHANDLE hFileHandle, BYTE * pBuff, USHORT uiCount )
{
USHORT uiWritten;
HB_TRACE(("hb_fsWrite(%p, %p, %hu)", hFileHandle, pBuff, uiCount));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -540,6 +558,8 @@ ULONG hb_fsReadLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount )
USHORT uiToRead, uiRead;
BYTE * pPtr = pBuff;
HB_TRACE(("hb_fsReadLarge(%p, %p, %lu)", hFileHandle, pBuff, ulCount));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -583,6 +603,8 @@ ULONG hb_fsWriteLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount )
USHORT uiToWrite, uiWritten;
BYTE * pPtr = pBuff;
HB_TRACE(("hb_fsWriteLarge(%p, %p, %lu)", hFileHandle, pBuff, ulCount));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -625,8 +647,11 @@ ULONG hb_fsWriteLarge( FHANDLE hFileHandle, BYTE * pBuff, ULONG ulCount )
ULONG hb_fsSeek( FHANDLE hFileHandle, LONG lOffset, USHORT uiFlags )
{
ULONG ulPos = -1;
USHORT Flags = convert_seek_flags( uiFlags );
USHORT Flags;
HB_TRACE(("hb_fsSeek(%p, %ld, %hu)", hFileHandle, lOffset, uiFlags));
Flags = convert_seek_flags( uiFlags );
if( lOffset < 0 && Flags == SEEK_SET )
{
/* 'Seek Error' */
@@ -671,6 +696,8 @@ ULONG hb_fsTell( FHANDLE hFileHandle )
{
ULONG ulPos;
HB_TRACE(("hb_fsTell(%p)", hFileHandle));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -689,11 +716,15 @@ ULONG hb_fsTell( FHANDLE hFileHandle )
USHORT hb_fsError( void )
{
HB_TRACE(("hb_fsError()"));
return s_uiErrorLast;
}
void hb_fsSetError( USHORT uiError )
{
HB_TRACE(("hb_fsSetError(%hu)", uiError));
s_uiErrorLast = uiError;
}
@@ -701,6 +732,8 @@ int hb_fsDelete( BYTE * pFilename )
{
int iResult;
HB_TRACE(("hb_fsDelete(%s)", (char*) pFilename));
#if defined(HAVE_POSIX_IO)
errno = 0;
@@ -731,6 +764,8 @@ int hb_fsRename( BYTE * pOldName, BYTE * pNewName )
{
int iResult;
HB_TRACE(("hb_fsRename(%s, %s)", (char*) pOldName, (char*) pNewName));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
@@ -756,6 +791,8 @@ BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart,
ULONG ulOldPos;
#endif
HB_TRACE(("hb_fsLock(%p, %lu, %lu, %hu)", hFileHandle, ulStart, ulLength, uiMode));
#if defined(HAVE_POSIX_IO) && !defined(__GNUC__) && !defined(__IBMCPP__)
errno = 0;
@@ -817,10 +854,12 @@ BOOL hb_fsLock ( FHANDLE hFileHandle, ULONG ulStart,
void hb_fsCommit( FHANDLE hFileHandle )
{
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
int dup_handle;
HB_TRACE(("hb_fsCommit(%p)", hFileHandle));
#if defined(HAVE_POSIX_IO) || defined(_MSC_VER) || defined(__MINGW32__)
errno = 0;
dup_handle = dup( hFileHandle );
s_uiErrorLast = errno;
@@ -835,6 +874,8 @@ void hb_fsCommit( FHANDLE hFileHandle )
s_uiErrorLast = FS_ERROR;
HB_SYMBOL_UNUSED( dup_handle );
#endif
}
@@ -842,6 +883,8 @@ BOOL hb_fsMkDir( BYTE * pDirname )
{
int iResult;
HB_TRACE(("hb_fsMkDir(%s)", (char*) pDirname));
#if defined(HAVE_POSIX_IO)
errno = 0;
@@ -868,6 +911,8 @@ BOOL hb_fsChDir( BYTE * pDirname )
{
int iResult;
HB_TRACE(("hb_fsChDir(%s)", (char*) pDirname));
#if defined(HAVE_POSIX_IO)
errno = 0;
@@ -888,6 +933,8 @@ BOOL hb_fsRmDir( BYTE * pDirname )
{
int iResult;
HB_TRACE(("hb_fsRmDir(%s)", (char*) pDirname));
#if defined(HAVE_POSIX_IO)
errno = 0;
@@ -911,6 +958,8 @@ BYTE * hb_fsCurDir( USHORT uiDrive )
{
static char cwd_buff[ PATH_MAX + 1 ];
HB_TRACE(("hb_fsCurDir(%hu)", uiDrive));
HB_SYMBOL_UNUSED( uiDrive );
#if defined(HAVE_POSIX_IO)
@@ -935,10 +984,14 @@ BYTE * hb_fsCurDir( USHORT uiDrive )
USHORT hb_fsChDrv( BYTE nDrive )
{
USHORT uiResult;
USHORT uiSave;
USHORT uiTotal;
HB_TRACE(("hb_fsChDrv(%d)", (int) nDrive));
#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) || defined(__MINGW32__) ) && ! defined(__CYGWIN__)
USHORT uiSave = _getdrive();
uiSave = _getdrive();
errno = 0;
_chdrive( nDrive + 1 );
@@ -954,10 +1007,9 @@ USHORT hb_fsChDrv( BYTE nDrive )
s_uiErrorLast = FS_ERROR;
}
#elif defined( __WATCOMC__ )
HB_SYMBOL_UNUSED( uiTotal );
unsigned uiSave;
unsigned uiTotal;
#elif defined( __WATCOMC__ )
/* 1= A:, 2 = B:, 3 = C:, etc
* _dos_*() functions don't set 'errno'
@@ -983,6 +1035,9 @@ USHORT hb_fsChDrv( BYTE nDrive )
uiResult = FS_ERROR;
s_uiErrorLast = FS_ERROR;
HB_SYMBOL_UNUSED( uiSave );
HB_SYMBOL_UNUSED( uiTotal );
#endif
return uiResult;
@@ -998,10 +1053,14 @@ USHORT hb_fsChDrv( BYTE nDrive )
USHORT hb_fsIsDrv( BYTE nDrive )
{
USHORT uiResult;
USHORT uiSave;
USHORT uiTotal;
HB_TRACE(("hb_fsIsDrv(%d)", (int) nDrive));
#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) || defined(__MINGW32__) ) && ! defined(__CYGWIN__)
USHORT uiSave = _getdrive();
uiSave = _getdrive();
errno = 0;
_chdrive( nDrive + 1 );
@@ -1018,10 +1077,9 @@ USHORT hb_fsIsDrv( BYTE nDrive )
_chdrive( uiSave );
#elif defined( __WATCOMC__ )
HB_SYMBOL_UNUSED( uiTotal );
unsigned uiSave;
unsigned uiTotal;
#elif defined( __WATCOMC__ )
/* 1= A:, 2 = B:, 3 = C:, etc
* _dos_*() functions don't set 'errno'
@@ -1044,6 +1102,9 @@ USHORT hb_fsIsDrv( BYTE nDrive )
uiResult = FS_ERROR;
s_uiErrorLast = FS_ERROR;
HB_SYMBOL_UNUSED( uiSave );
HB_SYMBOL_UNUSED( uiTotal );
#endif
return uiResult;
@@ -1053,6 +1114,8 @@ BOOL hb_fsIsDevice( FHANDLE hFileHandle )
{
BOOL bResult;
HB_TRACE(("hb_fsIsDevice(%p)", hFileHandle));
#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) || defined(__MINGW32__) ) && ! defined(__CYGWIN__)
errno = 0;
@@ -1075,6 +1138,9 @@ BOOL hb_fsIsDevice( FHANDLE hFileHandle )
BYTE hb_fsCurDrv( void )
{
USHORT uiResult;
USHORT uiDrive;
HB_TRACE(("hb_fsCurDrv()"));
#if defined(HAVE_POSIX_IO) && ( defined(OS2) || defined(DOS) || defined(_Windows) || defined(__MINGW32__) ) && ! defined(__CYGWIN__)
@@ -1082,9 +1148,9 @@ BYTE hb_fsCurDrv( void )
uiResult = _getdrive();
s_uiErrorLast = errno;
#elif defined( __WATCOMC__ )
HB_SYMBOL_UNUSED( uiDrive );
unsigned uiDrive;
#elif defined( __WATCOMC__ )
/* 1= A:, 2 = B:, 3 = C:, etc
* _dos_*() functions don't set 'errno'
@@ -1098,6 +1164,8 @@ BYTE hb_fsCurDrv( void )
uiResult = 0;
s_uiErrorLast = FS_ERROR;
HB_SYMBOL_UNUSED( uiDrive );
#endif
return uiResult;
@@ -1108,6 +1176,7 @@ BYTE hb_fsCurDrv( void )
FHANDLE hb_fsExtOpen( BYTE * pFilename, BYTE * pDefExt,
USHORT uiFlags, BYTE * pPaths, PHB_ITEM pError )
{
HB_TRACE(("hb_fsExtOpen(%s, %s, %hu, %p, %p)", (char*) pFilename, (char*) pDefExt, uiFlags, pPaths, pError));
s_uiErrorLast = FS_ERROR;
@@ -1254,6 +1323,9 @@ HARBOUR HB_FSEEK( void )
BOOL hb_fsFile ( BYTE * pFilename )
{
BOOL is_file = FALSE;
HB_TRACE(("hb_fsFile(%s)", (char*) pFilename));
/* TODO: Check if F_OK is defined in all compilers */
#ifdef OS_UNIX_COMPATIBLE
@@ -1478,13 +1550,16 @@ HARBOUR HB_DISKNAME( void )
/* Split given filename into path, name and extension */
PHB_FNAME hb_fsFNameSplit( char * szFileName )
{
PHB_FNAME pFileName = ( PHB_FNAME ) hb_xgrab( sizeof( HB_FNAME ) );
int iLen = strlen( szFileName );
PHB_FNAME pFileName;
int iLen;
int iSlashPos;
int iDotPos;
int iPos;
HB_TRACE(("hb_fsFNameSplit(%s)", szFileName));
pFileName = ( PHB_FNAME ) hb_xgrab( sizeof( HB_FNAME ) );
iLen = strlen( szFileName );
pFileName->szPath =
pFileName->szName =
pFileName->szExtension = NULL;
@@ -1575,6 +1650,8 @@ PHB_FNAME hb_fsFNameSplit( char * szFileName )
/* This function joins path, name and extension into a string with a filename */
char * hb_fsFNameMerge( char * szFileName, PHB_FNAME pFileName )
{
HB_TRACE(("hb_fsFNameMerge(%s, %p)", szFileName, pFileName));
if( pFileName->szPath && pFileName->szPath[ 0 ] )
{
/* we have not empty path specified */

View File

@@ -67,7 +67,11 @@ static ULONG s_ulMemoryConsumed = 0; /* memory max size consumed */
void * hb_xalloc( ULONG ulSize ) /* allocates fixed memory, returns NULL on failure */
{
void * pMem = malloc( ulSize + sizeof( ULONG ) );
void * pMem;
HB_TRACE(("hb_xalloc(%lu)", ulSize));
pMem = malloc( ulSize + sizeof( ULONG ) );
if( ! pMem )
{
@@ -88,7 +92,11 @@ void * hb_xalloc( ULONG ulSize ) /* allocates fixed memory, returns NULL
void * hb_xgrab( ULONG ulSize ) /* allocates fixed memory, exits on failure */
{
void * pMem = malloc( ulSize + sizeof( ULONG ) );
void * pMem;
HB_TRACE(("hb_xgrab(%lu)", ulSize));
pMem = malloc( ulSize + sizeof( ULONG ) );
if( ! pMem )
{
@@ -109,8 +117,13 @@ void * hb_xgrab( ULONG ulSize ) /* allocates fixed memory, exits on fail
void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */
{
ULONG ulMemSize = * ( ULONG * ) ( ( char * ) pMem - sizeof( ULONG ) );
void * pResult = realloc( ( char * ) pMem - sizeof( ULONG ), ulSize + sizeof( ULONG ) );
ULONG ulMemSize;
void * pResult;
HB_TRACE(("hb_xrealloc(%p, %lu)", pMem, ulSize));
ulMemSize = * ( ULONG * ) ( ( char * ) pMem - sizeof( ULONG ) );
pResult = realloc( ( char * ) pMem - sizeof( ULONG ), ulSize + sizeof( ULONG ) );
if( ! pResult )
{
@@ -133,7 +146,11 @@ void * hb_xrealloc( void * pMem, ULONG ulSize ) /* reallocates memory */
void hb_xfree( void * pMem ) /* frees fixed memory */
{
ULONG ulMemSize = * ( ULONG * ) ( ( char * ) pMem - sizeof( ULONG ) );
ULONG ulMemSize;
HB_TRACE(("hb_xfree(%p)", pMem));
ulMemSize = * ( ULONG * ) ( ( char * ) pMem - sizeof( ULONG ) );
if( pMem )
free( ( char * ) pMem - sizeof( ULONG ) );
@@ -148,16 +165,20 @@ void hb_xfree( void * pMem ) /* frees fixed memory */
ULONG hb_xsize( void * pMem ) /* returns the size of an allocated memory block */
{
HB_TRACE(("hb_xsize(%p)", pMem));
return * ( ULONG * ) ( ( char * ) pMem - sizeof( ULONG ) );
}
void hb_xinit( void ) /* Initialize fixed memory subsystem */
{
;
HB_TRACE(("hb_xinit()"));
}
void hb_xexit( void ) /* Deinitialize fixed memory subsystem */
{
HB_TRACE(("hb_xexit()"));
#ifdef HB_FM_STATISTICS
if( s_ulMemoryBlocks || hb_cmdargCheck( "INFO" ) )
{
@@ -166,13 +187,13 @@ void hb_xexit( void ) /* Deinitialize fixed memory subsystem */
hb_outerr( hb_consoleGetNewLine(), 0 );
hb_outerr( "----------------------------------------", 0 );
hb_outerr( hb_consoleGetNewLine(), 0 );
sprintf( buffer, "Total memory allocated: %ld bytes (%lu blocks)", s_ulMemoryMaxConsumed, s_ulMemoryMaxBlocks );
sprintf( buffer, "Total memory allocated: %lu bytes (%lu blocks)", s_ulMemoryMaxConsumed, s_ulMemoryMaxBlocks );
hb_outerr( buffer, 0 );
if( s_ulMemoryBlocks )
{
hb_outerr( hb_consoleGetNewLine(), 0 );
sprintf( buffer, "WARNING! Memory allocated but not released: %ld bytes (%ld blocks)", s_ulMemoryConsumed, s_ulMemoryBlocks );
sprintf( buffer, "WARNING! Memory allocated but not released: %lu bytes (%lu blocks)", s_ulMemoryConsumed, s_ulMemoryBlocks );
hb_outerr( buffer, 0 );
}
}
@@ -186,11 +207,17 @@ void hb_xexit( void ) /* Deinitialize fixed memory subsystem */
void * hb_xmemcpy( void * pDestArg, void * pSourceArg, ULONG ulLen )
{
BYTE * pDest = ( BYTE * ) pDestArg;
BYTE * pSource = ( BYTE * ) pSourceArg;
ULONG ulRemaining = ulLen;
BYTE * pDest;
BYTE * pSource;
ULONG ulRemaining;
int iCopySize;
HB_TRACE(("hb_xmemcpy(%p, %p, %lu)", pDestArg, pSourceArg, ulLen));
pDest = ( BYTE * ) pDestArg;
pSource = ( BYTE * ) pSourceArg;
ulRemaining = ulLen;
while( ulRemaining )
{
/* Overcome the memcpy() size_t limitation */
@@ -213,10 +240,15 @@ void * hb_xmemcpy( void * pDestArg, void * pSourceArg, ULONG ulLen )
void * hb_xmemset( void * pDestArg, int iFill, ULONG ulLen )
{
BYTE * pDest = ( BYTE * ) pDestArg;
ULONG ulRemaining = ulLen;
BYTE * pDest;
ULONG ulRemaining;
int iSetSize;
HB_TRACE(("hb_xmemset(%p, %d, %lu)", pDestArg, iFill, ulLen));
pDest = ( BYTE * ) pDestArg;
ulRemaining = ulLen;
while( ulRemaining )
{
/* Overcome the memset() size_t limitation */

View File

@@ -124,6 +124,8 @@ static int s_ColorCount;
void hb_gtInit( void )
{
HB_TRACE(("hb_gtInit()"));
/* ptucker */
s_Color = ( int * ) hb_xgrab( 5 * sizeof( int ) );
@@ -135,6 +137,8 @@ void hb_gtInit( void )
void hb_gtExit( void )
{
HB_TRACE(("hb_gtExit()"));
/* ptucker */
while( s_uiDispCount )
@@ -153,11 +157,19 @@ USHORT hb_gtBox( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, B
USHORT uiCol;
USHORT height, width, tmp;
USHORT uiTopBak = uiTop;
USHORT uiLeftBak = uiLeft;
USHORT uiTopBak;
USHORT uiLeftBak;
USHORT uiMaxRow = hb_gtMaxRow();
USHORT uiMaxCol = hb_gtMaxCol();
USHORT uiMaxRow;
USHORT uiMaxCol;
HB_TRACE(("hb_gtBox(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, pbyFrame));
uiTopBak = uiTop;
uiLeftBak = uiLeft;
uiMaxRow = hb_gtMaxRow();
uiMaxCol = hb_gtMaxCol();
/* TODO: Would be better to support these cases, Clipper implementation */
/* was quite messy for these cases, which can be considered as */
@@ -256,6 +268,8 @@ USHORT hb_gtBoxS( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight )
USHORT hb_gtColorSelect( USHORT uiColorIndex )
{
HB_TRACE(("hb_gtColorSelect(%hu)", uiColorIndex));
if( uiColorIndex > s_ColorCount )
return 1;
else
@@ -266,6 +280,8 @@ USHORT hb_gtColorSelect( USHORT uiColorIndex )
USHORT hb_gtDispBegin( void )
{
HB_TRACE(("hb_gtDispBegin()"));
/* ptucker */
if( s_uiPreCount == 0 )
@@ -281,11 +297,15 @@ USHORT hb_gtDispBegin( void )
USHORT hb_gtDispCount( void )
{
HB_TRACE(("hb_gtDispCount()"));
return s_uiDispCount;
}
USHORT hb_gtDispEnd( void )
{
HB_TRACE(("hb_gtDispEnd()"));
/* ptucker */
if( s_uiPreCount == 0 )
@@ -301,6 +321,8 @@ USHORT hb_gtDispEnd( void )
USHORT hb_gtPreExt( void )
{
HB_TRACE(("hb_gtPreExt()"));
/* ptucker */
/* an external (printf...) write is about to take place */
@@ -330,6 +352,8 @@ USHORT hb_gtPreExt( void )
USHORT hb_gtPostExt( void )
{
HB_TRACE(("hb_gtPostExt()"));
/* ptucker */
if( s_uiPreCNest == 1 )
@@ -352,10 +376,12 @@ USHORT hb_gtPostExt( void )
USHORT hb_gtGetColorStr( char * fpColorString )
{
/* ptucker */
char * sColors;
int i, k = 0;
HB_TRACE(("hb_gtGetColorStr(%s)", fpColorString));
/* ptucker */
sColors = ( char * ) hb_xgrab( s_ColorCount * 8 + 1 ); /* max possible */
for( i = 0; i < s_ColorCount; i++ )
@@ -415,7 +441,6 @@ USHORT hb_gtGetColorStr( char * fpColorString )
USHORT hb_gtSetColorStr( char * fpColorString )
{
/* ptucker */
char c, buff[ 6 ];
BOOL bHasI = FALSE;
BOOL bHasU = FALSE;
@@ -426,6 +451,10 @@ USHORT hb_gtSetColorStr( char * fpColorString )
int nColor = 0;
int nCount = -1, i = 0, y;
HB_TRACE(("hb_gtSetColorStr(%s)", fpColorString));
/* ptucker */
if( !fpColorString )
return 1;
if( ! *fpColorString )
@@ -573,9 +602,13 @@ USHORT hb_gtSetColorStr( char * fpColorString )
USHORT hb_gtGetCursor( USHORT * uipCursorShape )
{
int i = s_uiCursorShape = hb_gt_GetCursorStyle();
int i;
int rc = 0;
HB_TRACE(("hb_gtGetCursor(%p)", uipCursorShape));
i = s_uiCursorShape = hb_gt_GetCursorStyle();
if( i <= SC_SPECIAL2 )
{
*uipCursorShape = i;
@@ -590,6 +623,8 @@ USHORT hb_gtGetCursor( USHORT * uipCursorShape )
USHORT hb_gtSetCursor( USHORT uiCursorShape )
{
HB_TRACE(("hb_gtSetCursor(%hu)", uiCursorShape));
hb_gt_SetCursorStyle( uiCursorShape );
s_uiCursorShape = uiCursorShape;
@@ -598,6 +633,8 @@ USHORT hb_gtSetCursor( USHORT uiCursorShape )
USHORT hb_gtGetPos( SHORT * piRow, SHORT * piCol )
{
HB_TRACE(("hb_gtGetPos(%p, %p)", piRow, piCol));
if( s_iCurrentRow >= 0 && s_iCurrentRow <= hb_gtMaxRow()
&& s_iCurrentCol >= 0 && s_iCurrentCol <= hb_gtMaxCol() )
{
@@ -616,6 +653,8 @@ USHORT hb_gtSetPos( SHORT iRow, SHORT iCol )
{
BOOL set_cursor = TRUE;
HB_TRACE(("hb_gtSetPos(%hd, %hd)", iRow, iCol));
/* Validate the new cursor position */
if( iRow < 0 || iCol < 0 || iRow > hb_gtMaxRow() || iCol > hb_gtMaxCol() )
{
@@ -642,21 +681,29 @@ USHORT hb_gtSetPos( SHORT iRow, SHORT iCol )
BOOL hb_gtIsColor( void )
{
HB_TRACE(("hb_gtIsColor()"));
return hb_gt_IsColor();
}
USHORT hb_gtMaxCol( void )
{
HB_TRACE(("hb_gtMaxCol()"));
return hb_gt_GetScreenWidth() - 1;
}
USHORT hb_gtMaxRow( void )
{
HB_TRACE(("hb_gtMaxRow()"));
return hb_gt_GetScreenHeight() - 1;
}
USHORT hb_gtRectSize( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, USHORT * uipBuffSize )
{
HB_TRACE(("hb_gtRectSize(%hu, %hu, %hu, %hu, %p)", uiTop, uiLeft, uiBottom, uiRight, uipBuffSize));
*uipBuffSize = ( uiBottom - uiTop + 1 ) * ( uiRight - uiLeft + 1 ) * 2;
return 0;
@@ -667,6 +714,8 @@ USHORT hb_gtRepChar( USHORT uiRow, USHORT uiCol, BYTE byChar, USHORT uiCount )
int rc;
BYTE buff[ 255 ];
HB_TRACE(("hb_gtRepChar(%hu, %hu, %d, %hu)", uiRow, uiCol, (int) byChar, uiCount));
if( uiCount > sizeof( buff ) )
return 1;
@@ -696,6 +745,8 @@ USHORT hb_gtSave( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight,
USHORT hb_gtScrDim( USHORT * uipHeight, USHORT * uipWidth )
{
HB_TRACE(("hb_gtScrDim(%p, %p)", uipHeight, uipWidth));
*uipHeight = hb_gtMaxRow();
*uipWidth = hb_gtMaxCol();
@@ -704,6 +755,8 @@ USHORT hb_gtScrDim( USHORT * uipHeight, USHORT * uipWidth )
USHORT hb_gtGetBlink( BOOL * bBlink )
{
HB_TRACE(("hb_gtGetBlink(%p)", bBlink));
*bBlink = hb_gt_GetBlink();
return 0;
@@ -711,6 +764,8 @@ USHORT hb_gtGetBlink( BOOL * bBlink )
USHORT hb_gtSetBlink( BOOL bBlink )
{
HB_TRACE(("hb_gtSetBlink(%d)", (int) bBlink));
hb_gt_SetBlink( bBlink );
return 0;
@@ -718,12 +773,16 @@ USHORT hb_gtSetBlink( BOOL bBlink )
USHORT hb_gtSetMode( USHORT uiRows, USHORT uiCols )
{
HB_TRACE(("hb_gtSetMode(%hu, %hu)", uiRows, uiCols));
/* ptucker */
return hb_gt_SetMode( uiRows, uiCols ) ? 0 : 1;
}
USHORT hb_gtSetSnowFlag( BOOL bNoSnow )
{
HB_TRACE(("hb_gtSetSnowFlag(%d)", (int) bNoSnow));
/* COMMENT: This is a compatibility function.
If you're running on a CGA and snow is a problem
speak up!
@@ -739,6 +798,8 @@ USHORT hb_gtWrite( BYTE * fpStr, ULONG length )
ULONG size = length;
BYTE attr = s_Color[ s_uiColorIndex ] & 0xFF;
HB_TRACE(("hb_gtWrite(%p, %lu)", fpStr, length));
/* Optimize access to max row and col positions */
iMaxRow = hb_gtMaxRow();
iMaxCol = hb_gtMaxCol();
@@ -759,6 +820,8 @@ USHORT hb_gtWrite( BYTE * fpStr, ULONG length )
USHORT hb_gtWriteAt( USHORT uiRow, USHORT uiCol, BYTE * fpStr, ULONG length )
{
HB_TRACE(("hb_gtWriteAt(%hu, %hu, %p, %lu)", uiRow, uiCol, fpStr, length));
hb_gtSetPos( uiRow, uiCol );
return hb_gtWrite( fpStr, length );
}
@@ -768,14 +831,20 @@ USHORT hb_gtWriteCon( BYTE * fpStr, ULONG length )
int rc = 0, nLen = 0;
BOOL ldisp = FALSE;
BOOL lnewline = FALSE;
SHORT iRow = s_iCurrentRow, iCol = s_iCurrentCol;
SHORT iMaxRow = hb_gtMaxRow();
SHORT iMaxCol = hb_gtMaxCol();
SHORT iRow, iCol;
SHORT iMaxRow, iMaxCol;
BYTE ch;
BYTE * fpPtr = fpStr;
#define STRNG_SIZE 500
BYTE strng[ STRNG_SIZE ];
HB_TRACE(("hb_gtWriteCon(%p, %lu)", fpStr, length));
iRow = s_iCurrentRow;
iCol = s_iCurrentCol;
iMaxRow = hb_gtMaxRow();
iMaxCol = hb_gtMaxCol();
/* Limit the starting cursor position to maxrow(),maxcol()
on the high end, but don't limit it on the low end. */
if( iRow > iMaxRow ) iRow = iMaxRow;
@@ -869,6 +938,8 @@ USHORT hb_gtWriteCon( BYTE * fpStr, ULONG length )
USHORT hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHORT iRows, SHORT iCols )
{
HB_TRACE(("hb_gtScroll(%hu, %hu, %hu, %hu, %hd, %hd)", uiTop, uiLeft, uiBottom, uiRight, iRows, iCols));
hb_gt_Scroll( uiTop, uiLeft, uiBottom, uiRight, s_Color[ s_uiColorIndex ], iRows, iCols );
return 0;
}

View File

@@ -76,6 +76,8 @@ char * hb_strHardCR( char * pszString, ULONG ulStringLen )
{
ULONG ulStringPos;
HB_TRACE(("hb_strHardCR(%s, %lu)", pszString, ulStringLen));
for( ulStringPos = 0; ulStringPos < ulStringLen; ulStringPos++ )
{
if( pszString[ ulStringPos ] == CHR_SOFT1 &&

View File

@@ -150,6 +150,8 @@ static struct termios startup_attributes;
static void restore_input_mode( void )
{
HB_TRACE(("restore_input_mode()"));
tcsetattr( STDIN_FILENO, TCSANOW, &startup_attributes );
}
@@ -178,6 +180,8 @@ static HB_inkey_enum s_eventmask;
void hb_releaseCPU( void )
{
HB_TRACE(("releaseCPU()"));
/* TODO: Add code to release time slices on all platforms */
#if defined(_Windows) || defined(__MINGW32__)
/* according to ms docs, you should not do this in a Win app. dos only */
@@ -220,6 +224,9 @@ int hb_inkey( double seconds, HB_inkey_enum event_mask, BOOL wait, BOOL forever
{
int key;
clock_t end_clock;
HB_TRACE(("hb_inkey(%lf, %d, %d, %d)", seconds, (int) event_mask, (int) wait, (int) forever));
s_eventmask = event_mask; /* Set current input event mask */
/* Check or wait for input events */
if( wait ) end_clock = clock() + seconds * CLOCKS_PER_SEC;
@@ -243,6 +250,9 @@ int hb_inkey( double seconds, HB_inkey_enum event_mask, BOOL wait, BOOL forever
int hb_inkeyGet( void ) /* Extract the next key from the keyboard buffer */
{
int key;
HB_TRACE(("hb_inkeyGet()"));
hb_inkeyPoll();
if( hb_set.HB_SET_TYPEAHEAD )
{
@@ -265,6 +275,8 @@ int hb_inkeyGet( void ) /* Extract the next key from the keyboard buffer *
int hb_inkeyLast( void ) /* Return the value of the last key that was extracted */
{
HB_TRACE(("hb_inkeyLast()"));
hb_inkeyPoll();
return s_inkeyLast;
}
@@ -272,6 +284,9 @@ int hb_inkeyLast( void ) /* Return the value of the last key that was extra
int hb_inkeyNext( void ) /* Return the next key without extracting it */
{
int key;
HB_TRACE(("hb_inkeyNext()"));
hb_inkeyPoll();
if( hb_set.HB_SET_TYPEAHEAD )
{
@@ -285,6 +300,8 @@ int hb_inkeyNext( void ) /* Return the next key without extracting it */
void hb_inkeyPoll( void ) /* Poll the console keyboard to stuff the Harbour buffer */
{
HB_TRACE(("hb_inkeyPoll()"));
/* TODO: Add mouse support */
if( hb_set.HB_SET_TYPEAHEAD || s_inkeyPoll )
{
@@ -776,6 +793,8 @@ printf("\nhb_inkeyPoll: wKey is %d", wKey);
void hb_inkeyReset( BOOL allocate ) /* Reset the keyboard buffer */
{
HB_TRACE(("hb_inkeyReset(%d)", (int) allocate));
/* Reset the buffer head and tail pointers, the last key value,
and the polling override flag */
s_inkeyHead = 0;
@@ -979,6 +998,8 @@ HARBOUR HB___KEYBOARD( void )
void hb_inkeyPut( int ch )
{
HB_TRACE(("hb_inkeyPut(%d)", ch));
if( ch )
{
if( hb_set.HB_SET_TYPEAHEAD )

View File

@@ -78,6 +78,8 @@ BOOL hb_evalNew( PEVALINFO pEvalInfo, PHB_ITEM pItem )
{
BOOL bResult;
HB_TRACE(("hb_evalNew(%p, %p)", pEvalInfo, pItem));
if( pEvalInfo )
{
memset( pEvalInfo, 0, sizeof( EVALINFO ) );
@@ -98,6 +100,8 @@ BOOL hb_evalPutParam( PEVALINFO pEvalInfo, PHB_ITEM pItem )
{
BOOL bResult;
HB_TRACE(("hb_evalPutParam(%p, %p)", pEvalInfo, pItem));
if( pEvalInfo && pItem && pEvalInfo->paramCount < HB_EVAL_PARAM_MAX_ )
{
pEvalInfo->pItems[ ++pEvalInfo->paramCount ] = pItem;
@@ -113,6 +117,8 @@ PHB_ITEM hb_evalLaunch( PEVALINFO pEvalInfo )
{
PHB_ITEM pResult;
HB_TRACE(("hb_evalLaunch(%p)", pEvalInfo));
if( pEvalInfo )
{
USHORT uiParam = 1;
@@ -152,6 +158,8 @@ BOOL hb_evalRelease( PEVALINFO pEvalInfo )
{
BOOL bResult;
HB_TRACE(("hb_evalRelease(%p)", pEvalInfo));
if( pEvalInfo )
{
USHORT uiParam;
@@ -185,6 +193,8 @@ PHB_ITEM hb_itemDo( PHB_ITEM pItem, USHORT uiPCount, PHB_ITEM pItemArg1, ... )
{
PHB_ITEM pResult;
HB_TRACE(("hb_itemDo(%p, %hu, %p, ...)", pItem, uiPCount, pItemArg1));
if( pItem )
{
if( IS_STRING( pItem ) )
@@ -264,6 +274,8 @@ PHB_ITEM hb_itemDoC( char * szFunc, USHORT uiPCount, PHB_ITEM pItemArg1, ... )
{
PHB_ITEM pResult;
HB_TRACE(("hb_itemDoC(%s, %hu, %p, ...)", szFunc, uiPCount, pItemArg1));
if( szFunc )
{
PHB_DYNS pDynSym = hb_dynsymFindName( szFunc );
@@ -296,10 +308,14 @@ PHB_ITEM hb_itemDoC( char * szFunc, USHORT uiPCount, PHB_ITEM pItemArg1, ... )
PHB_ITEM hb_itemNew( PHB_ITEM pNull )
{
PHB_ITEM pItem = ( PHB_ITEM ) hb_xgrab( sizeof( HB_ITEM ) );
PHB_ITEM pItem;
HB_TRACE(("hb_itemNew(%p)", pNull));
HB_SYMBOL_UNUSED( pNull );
pItem = ( PHB_ITEM ) hb_xgrab( sizeof( HB_ITEM ) );
memset( pItem, 0, sizeof( HB_ITEM ) );
pItem->type = IT_NIL;
@@ -308,8 +324,13 @@ PHB_ITEM hb_itemNew( PHB_ITEM pNull )
PHB_ITEM hb_itemParam( USHORT uiParam )
{
PHB_ITEM pNew = hb_itemNew( NULL );
PHB_ITEM pItem = hb_param( uiParam, IT_ANY );
PHB_ITEM pNew;
PHB_ITEM pItem;
HB_TRACE(("hb_itemParam(%hu)", uiParam));
pNew = hb_itemNew( NULL );
pItem = hb_param( uiParam, IT_ANY );
if( pItem )
hb_itemCopy( pNew, pItem );
@@ -321,11 +342,15 @@ PHB_ITEM hb_itemParam( USHORT uiParam )
PHB_ITEM hb_itemParamPtr( USHORT uiParam, int iMask )
{
HB_TRACE(("hb_itemParamPtr(%hu, %d)", uiParam, iMask));
return hb_param( ( int ) uiParam, iMask );
}
USHORT hb_itemPCount( void )
{
HB_TRACE(("hb_itemPCount()"));
return ( USHORT ) hb_pcount();
}
@@ -333,6 +358,8 @@ BOOL hb_itemRelease( PHB_ITEM pItem )
{
BOOL bResult = FALSE;
HB_TRACE(("hb_itemRelease(%p)", pItem));
if( pItem )
{
hb_itemClear( pItem );
@@ -345,7 +372,11 @@ BOOL hb_itemRelease( PHB_ITEM pItem )
PHB_ITEM hb_itemArrayNew( ULONG ulLen )
{
PHB_ITEM pItem = hb_itemNew( NULL );
PHB_ITEM pItem;
HB_TRACE(("hb_itemArrayNew(%lu)", ulLen));
pItem = hb_itemNew( NULL );
hb_arrayNew( pItem, ulLen );
@@ -354,7 +385,11 @@ PHB_ITEM hb_itemArrayNew( ULONG ulLen )
PHB_ITEM hb_itemArrayGet( PHB_ITEM pArray, ULONG ulIndex )
{
PHB_ITEM pItem = hb_itemNew( NULL );
PHB_ITEM pItem;
HB_TRACE(("hb_itemArrayGet(%p, %lu)", pArray, ulIndex));
pItem = hb_itemNew( NULL );
if( pArray )
hb_arrayGet( pArray, ulIndex, pItem );
@@ -364,6 +399,8 @@ PHB_ITEM hb_itemArrayGet( PHB_ITEM pArray, ULONG ulIndex )
PHB_ITEM hb_itemArrayPut( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem )
{
HB_TRACE(("hb_itemArrayPut(%p, %lu, %p)", pArray, ulIndex, pItem));
if( pArray )
hb_arraySet( pArray, ulIndex, pItem );
@@ -372,6 +409,8 @@ PHB_ITEM hb_itemArrayPut( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem )
PHB_ITEM hb_itemPutC( PHB_ITEM pItem, char * szText )
{
HB_TRACE(("hb_itemPutC(%p, %s)", pItem, szText));
if( pItem )
hb_itemClear( pItem );
else
@@ -390,6 +429,8 @@ PHB_ITEM hb_itemPutC( PHB_ITEM pItem, char * szText )
PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, char * szText, ULONG ulLen )
{
HB_TRACE(("hb_itemPutCL(%p, %s, %lu)", pItem, szText, ulLen));
if( pItem )
hb_itemClear( pItem );
else
@@ -415,6 +456,8 @@ PHB_ITEM hb_itemPutCL( PHB_ITEM pItem, char * szText, ULONG ulLen )
PHB_ITEM hb_itemPutCPtr( PHB_ITEM pItem, char * szText, ULONG ulLen )
{
HB_TRACE(("hb_itemPutCPtr(%p, %s, %lu)", pItem, szText, ulLen));
if( pItem )
hb_itemClear( pItem );
else
@@ -430,6 +473,8 @@ PHB_ITEM hb_itemPutCPtr( PHB_ITEM pItem, char * szText, ULONG ulLen )
char * hb_itemGetC( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetC(%p)", pItem));
if( pItem && IS_STRING( pItem ) )
{
char * szResult = ( char * ) hb_xgrab( pItem->item.asString.length + 1 );
@@ -446,6 +491,8 @@ char * hb_itemGetC( PHB_ITEM pItem )
char * hb_itemGetCPtr( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetCPtr(%p)", pItem));
if( pItem && IS_STRING( pItem ) )
return pItem->item.asString.value;
else
@@ -454,6 +501,8 @@ char * hb_itemGetCPtr( PHB_ITEM pItem )
ULONG hb_itemGetCLen( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetCLen(%p)", pItem));
if( pItem && IS_STRING( pItem ) )
return pItem->item.asString.length;
else
@@ -462,6 +511,8 @@ ULONG hb_itemGetCLen( PHB_ITEM pItem )
ULONG hb_itemCopyC( PHB_ITEM pItem, char * szBuffer, ULONG ulLen )
{
HB_TRACE(("hb_itemCopyC(%p, %s, %lu)", pItem, szBuffer, ulLen));
if( pItem && IS_STRING( pItem ) )
{
if( ulLen == 0 )
@@ -479,6 +530,8 @@ BOOL hb_itemFreeC( char * szText )
{
BOOL bResult = FALSE;
HB_TRACE(("hb_itemFreeC(%s)", szText));
if( szText )
{
hb_xfree( szText );
@@ -495,6 +548,8 @@ BOOL hb_itemFreeC( char * szText )
char * hb_itemGetDS( PHB_ITEM pItem, char * szDate )
{
HB_TRACE(("hb_itemGetDS(%p, %s)", szDate));
if( pItem && IS_DATE( pItem ) )
hb_dateDecStr( szDate, pItem->item.asDate.value );
else
@@ -505,6 +560,8 @@ char * hb_itemGetDS( PHB_ITEM pItem, char * szDate )
BOOL hb_itemGetL( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetL(%p)", pItem));
if( pItem )
{
switch( pItem->type )
@@ -528,6 +585,8 @@ BOOL hb_itemGetL( PHB_ITEM pItem )
double hb_itemGetND( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetND(%p)", pItem));
if( pItem )
{
switch( pItem->type )
@@ -548,6 +607,8 @@ double hb_itemGetND( PHB_ITEM pItem )
int hb_itemGetNI( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetNI(%p)", pItem));
if( pItem )
{
switch( pItem->type )
@@ -568,6 +629,8 @@ int hb_itemGetNI( PHB_ITEM pItem )
long hb_itemGetNL( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemGetNL(%p)", pItem));
if( pItem )
{
switch( pItem->type )
@@ -591,6 +654,8 @@ long hb_itemGetNL( PHB_ITEM pItem )
PHB_ITEM hb_itemReturn( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemReturn(%p)", pItem));
if( pItem )
hb_itemCopy( &hb_stack.Return, pItem );
@@ -601,11 +666,15 @@ PHB_ITEM hb_itemReturn( PHB_ITEM pItem )
PHB_ITEM hb_itemReturnPtr( void )
{
HB_TRACE(("hb_itemReturnPtr()"));
return &hb_stack.Return;
}
PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, char * szDate )
{
HB_TRACE(("hb_itemPutDS(%p, %s)", pItem, szDate));
if( pItem )
hb_itemClear( pItem );
else
@@ -619,6 +688,8 @@ PHB_ITEM hb_itemPutDS( PHB_ITEM pItem, char * szDate )
PHB_ITEM hb_itemPutDL( PHB_ITEM pItem, long lJulian )
{
HB_TRACE(("hb_itemPutDL(%p, %ld)", pItem, lJulian));
if( pItem )
hb_itemClear( pItem );
else
@@ -632,6 +703,8 @@ PHB_ITEM hb_itemPutDL( PHB_ITEM pItem, long lJulian )
PHB_ITEM hb_itemPutL( PHB_ITEM pItem, BOOL bValue )
{
HB_TRACE(("hb_itemPutL(%p, %d)", pItem, (int) bValue));
if( pItem )
hb_itemClear( pItem );
else
@@ -645,6 +718,8 @@ PHB_ITEM hb_itemPutL( PHB_ITEM pItem, BOOL bValue )
PHB_ITEM hb_itemPutND( PHB_ITEM pItem, double dNumber )
{
HB_TRACE(("hb_itemPutND(%p, %lf)", pItem, dNumber));
if( pItem )
hb_itemClear( pItem );
else
@@ -660,6 +735,8 @@ PHB_ITEM hb_itemPutND( PHB_ITEM pItem, double dNumber )
PHB_ITEM hb_itemPutNI( PHB_ITEM pItem, int iNumber )
{
HB_TRACE(("hb_itemPutNI(%p, %d)", pItem, iNumber));
if( pItem )
hb_itemClear( pItem );
else
@@ -674,6 +751,8 @@ PHB_ITEM hb_itemPutNI( PHB_ITEM pItem, int iNumber )
PHB_ITEM hb_itemPutNL( PHB_ITEM pItem, long lNumber )
{
HB_TRACE(("hb_itemPutNL(%p, %ld)", pItem, lNumber));
if( pItem )
hb_itemClear( pItem );
else
@@ -688,6 +767,8 @@ PHB_ITEM hb_itemPutNL( PHB_ITEM pItem, long lNumber )
PHB_ITEM hb_itemPutNLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
{
HB_TRACE(("hb_itemPutNLen(%p, %lf, %d, %d)", pItem, dNumber, iWidth, iDec));
if( iWidth <= 0 || iWidth > 99 )
iWidth = ( dNumber > 10000000000.0 ) ? 20 : 10;
@@ -708,6 +789,8 @@ PHB_ITEM hb_itemPutNLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
PHB_ITEM hb_itemPutNDLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
{
HB_TRACE(("hb_itemPutNDLen(%p, %lf, %d, %d)", pItem, dNumber, iWidth, iDec));
if( pItem )
hb_itemClear( pItem );
else
@@ -729,6 +812,8 @@ PHB_ITEM hb_itemPutNDLen( PHB_ITEM pItem, double dNumber, int iWidth, int iDec )
PHB_ITEM hb_itemPutNILen( PHB_ITEM pItem, int iNumber, int iWidth )
{
HB_TRACE(("hb_itemPutNILen(%p, %d, %d)", pItem, iNumber, iWidth));
if( pItem )
hb_itemClear( pItem );
else
@@ -746,6 +831,8 @@ PHB_ITEM hb_itemPutNILen( PHB_ITEM pItem, int iNumber, int iWidth )
PHB_ITEM hb_itemPutNLLen( PHB_ITEM pItem, long lNumber, int iWidth )
{
HB_TRACE(("hb_itemPutNLLen(%p, %ld, %d)", pItem, lNumber, iWidth));
if( pItem )
hb_itemClear( pItem );
else
@@ -763,6 +850,8 @@ PHB_ITEM hb_itemPutNLLen( PHB_ITEM pItem, long lNumber, int iWidth )
void hb_itemGetNLen( PHB_ITEM pItem, int * piWidth, int * piDecimal )
{
HB_TRACE(("hb_itemGetNLen(%p, %p, %p)", pItem, piWidth, piDecimal));
if( pItem )
{
switch( pItem->type )
@@ -791,6 +880,8 @@ void hb_itemGetNLen( PHB_ITEM pItem, int * piWidth, int * piDecimal )
ULONG hb_itemSize( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemSize(%p)", pItem));
if( pItem )
{
switch( pItem->type )
@@ -808,6 +899,8 @@ ULONG hb_itemSize( PHB_ITEM pItem )
USHORT hb_itemType( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemType(%p)", pItem));
if( pItem )
return ( USHORT ) pItem->type;
else
@@ -818,6 +911,8 @@ USHORT hb_itemType( PHB_ITEM pItem )
void hb_itemClear( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemClear(%p)", pItem));
if( IS_STRING( pItem ) )
{
if( pItem->item.asString.value )
@@ -845,6 +940,8 @@ void hb_itemClear( PHB_ITEM pItem )
void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
{
HB_TRACE(("hb_itemCopy(%p, %p)", pDest, pSource));
if( pDest->type )
hb_itemClear( pDest );
@@ -875,6 +972,8 @@ void hb_itemCopy( PHB_ITEM pDest, PHB_ITEM pSource )
PHB_ITEM hb_itemUnRef( PHB_ITEM pItem )
{
HB_TRACE(("hb_itemUnRef(%p)", pItem));
while( IS_BYREF( pItem ) )
{
if( IS_MEMVAR( pItem ) )
@@ -908,14 +1007,21 @@ PHB_ITEM hb_itemUnRef( PHB_ITEM pItem )
/* Check whether two strings are equal (0), smaller (-1), or greater (1) */
int hb_itemStrCmp( PHB_ITEM pFirst, PHB_ITEM pSecond, BOOL bForceExact )
{
char * szFirst = pFirst->item.asString.value;
char * szSecond = pSecond->item.asString.value;
ULONG ulLenFirst = pFirst->item.asString.length;
ULONG ulLenSecond = pSecond->item.asString.length;
char * szFirst;
char * szSecond;
ULONG ulLenFirst;
ULONG ulLenSecond;
ULONG ulMinLen;
ULONG ulCounter;
int iRet = 0; /* Current status */
HB_TRACE(("hb_itemStrCmp(%p, %p, %d)", pFirst, pSecond, (int) bForceExact));
szFirst = pFirst->item.asString.value;
szSecond = pSecond->item.asString.value;
ulLenFirst = pFirst->item.asString.length;
ulLenSecond = pSecond->item.asString.length;
if( hb_set.HB_SET_EXACT && !bForceExact )
{
/* SET EXACT ON and not using == */
@@ -978,6 +1084,8 @@ char * hb_itemStr( PHB_ITEM pNumber, PHB_ITEM pWidth, PHB_ITEM pDec )
{
char * szResult = NULL;
HB_TRACE(("hb_itemStr(%p, %p, %p)", pNumber, pWidth, pDec));
if( pNumber )
{
/* Default to the width and number of decimals specified by the item,
@@ -1089,6 +1197,9 @@ char * hb_itemString( PHB_ITEM pItem, ULONG * ulLen )
{
static char buffer[ 32 ]; /* NOTE: Not re-entrant. Probably not thread safe. */
char * pointer;
HB_TRACE(("hb_itemString(%p, %p)", pItem, ulLen));
switch( pItem->type )
{
case IT_STRING:
@@ -1141,6 +1252,10 @@ char * hb_itemString( PHB_ITEM pItem, ULONG * ulLen )
PHB_ITEM hb_itemValToStr( PHB_ITEM pItem )
{
ULONG ulLen;
char * pointer = hb_itemString( pItem, &ulLen );
char * pointer;
HB_TRACE(("hb_itemValToStr(%p)", pItem));
pointer = hb_itemString( pItem, &ulLen );
return hb_itemPutCL( NULL, pointer, ulLen );
}

View File

@@ -151,47 +151,64 @@ static PHB_LANG s_langDef = &langEN;
void hb_langDSet ( PHB_LANG lang )
{
HB_TRACE(("hb_langDSet(%p)", lang));
if( lang )
s_langDef = lang;
}
PHB_LANG hb_langDGet ( void )
{
HB_TRACE(("hb_langDGet()"));
return s_langDef;
}
char * hb_langDGetName ( void )
{
HB_TRACE(("hb_langDGetName()"));
return s_langDef->szName;
}
char * hb_langDGetID ( void )
{
HB_TRACE(("hb_langDGetID()"));
return s_langDef->szID;
}
char * hb_langDGetText ( ULONG ulIndex )
{
HB_TRACE(("hb_langDGetText(%lu)", ulIndex));
return s_langDef->szTextList[ ( ulIndex < sizeof( s_langDef->szTextList ) / sizeof( s_langDef->szTextList[ 0 ] ) ) ? ulIndex : 0 ];
}
char * hb_langDGetDayName ( ULONG ulIndex )
{
HB_TRACE(("hb_langDGetDayName(%lu)", ulIndex));
return s_langDef->szDayNameList[ ( ulIndex < sizeof( s_langDef->szDayNameList ) / sizeof( s_langDef->szDayNameList[ 0 ] ) ) ? ulIndex : 0 ];
}
char * hb_langDGetMonthName ( ULONG ulIndex )
{
HB_TRACE(("hb_langDGetMonthName(%lu)", ulIndex));
return s_langDef->szMonthNameList[ ( ulIndex < sizeof( s_langDef->szMonthNameList ) / sizeof( s_langDef->szMonthNameList[ 0 ] ) ) ? ulIndex : 0 ];
}
char * hb_langDGetErrorDesc ( ULONG ulIndex )
{
HB_TRACE(("hb_langDGetErrorDesc(%lu)", ulIndex));
return s_langDef->szErrorDescList[ ( ulIndex < sizeof( s_langDef->szErrorDescList ) / sizeof( s_langDef->szErrorDescList[ 0 ] ) ) ? ulIndex : 0 ];
}
char * hb_langDGetErrorIntr ( ULONG ulIndex )
{
HB_TRACE(("hb_langDGetErrorIntr(%lu)", ulIndex));
return s_langDef->szErrorIntrList[ ( ulIndex < sizeof( s_langDef->szErrorIntrList ) / sizeof( s_langDef->szErrorIntrList[ 0 ] ) ) ? ulIndex : 0 ];
}

View File

@@ -56,6 +56,8 @@ static int internal_math_error = 0;
*/
int matherr( struct exception *err )
{
HB_TRACE(("matherr(%p)", err));
switch( err->type )
{
case DOMAIN:
@@ -421,6 +423,8 @@ FUNCTION MOD(cl_num, cl_base)
double hb_numRound( double dResult, int iDec )
{
HB_TRACE(("hb_numRound(%lf, %d)", dResult, iDec));
if( dResult != 0.0 )
{
double dAdjust;

View File

@@ -94,6 +94,8 @@ static void hb_memvarAddPrivate( PHB_DYNS );
void hb_memvarsInit( void )
{
HB_TRACE(("hb_memvarsInit()"));
s_globalTable = ( HB_VALUE_PTR ) hb_xgrab( sizeof( HB_VALUE ) * TABLE_INITHB_VALUE );
s_globalTableSize = TABLE_INITHB_VALUE;
s_globalFreeCnt = 0;
@@ -109,6 +111,8 @@ void hb_memvarsRelease( void )
{
ULONG ulCnt = s_globalLastFree;
HB_TRACE(("hb_memvarsRelease()"));
if( s_globalTable )
{
while( ulCnt )
@@ -158,6 +162,8 @@ HB_HANDLE hb_memvarValueNew( HB_ITEM_PTR pSource, BOOL bTrueMemvar )
HB_VALUE_PTR pValue;
HB_HANDLE hValue = 1; /* handle 0 is reserved */
HB_TRACE(("hb_memvarValueNew(%p, %d)", pSource, (int) bTrueMemvar));
if( s_globalFreeCnt )
{
/* There are holes in the table
@@ -228,6 +234,8 @@ HB_HANDLE hb_memvarValueNew( HB_ITEM_PTR pSource, BOOL bTrueMemvar )
*/
static void hb_memvarAddPrivate( PHB_DYNS pDynSym )
{
HB_TRACE(("hb_memvarAddPrivate(%p)", pDynSym));
/* Allocate the value from the end of table
*/
if( s_privateStackCnt == s_privateStackSize )
@@ -259,6 +267,8 @@ void hb_memvarSetPrivatesBase( ULONG ulBase )
{
HB_HANDLE hVar, hOldValue;
HB_TRACE(("hb_memvarSetPrivatesBase(%lu)", ulBase));
while( s_privateStackCnt > s_privateStackBase )
{
--s_privateStackCnt;
@@ -279,6 +289,8 @@ void hb_memvarSetPrivatesBase( ULONG ulBase )
*/
void hb_memvarValueIncRef( HB_HANDLE hValue )
{
HB_TRACE(("hb_memvarValueIncRef(%p)", hValue));
#ifdef MEMVARDEBUG
if( hValue < 1 || hValue > s_globalTableSize )
{
@@ -303,6 +315,8 @@ void hb_memvarValueDecRef( HB_HANDLE hValue )
{
HB_VALUE_PTR pValue;
HB_TRACE(("hb_memvarValueDecRef(%p)", hValue));
#ifdef MEMVARDEBUG
if( hValue < 1 || hValue > s_globalTableSize )
{
@@ -364,8 +378,11 @@ void hb_memvarValueDecRef( HB_HANDLE hValue )
*/
void hb_memvarSetValue( PHB_SYMB pMemvarSymb, HB_ITEM_PTR pItem )
{
PHB_DYNS pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
PHB_DYNS pDyn;
HB_TRACE(("hb_memvarSetValue(%p, %p)", pMemvarSymb, pItem));
pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
if( pDyn )
{
#ifdef MEMVARDEBUG
@@ -393,9 +410,12 @@ void hb_memvarSetValue( PHB_SYMB pMemvarSymb, HB_ITEM_PTR pItem )
ERRCODE hb_memvarGet( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
{
PHB_DYNS pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
PHB_DYNS pDyn;
ERRCODE bSuccess = FAILURE;
HB_TRACE(("hb_memvarGet(%p, %p)", pItem, pMemvarSymb));
pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
if( pDyn )
{
#ifdef MEMVARDEBUG
@@ -421,6 +441,8 @@ ERRCODE hb_memvarGet( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
void hb_memvarGetValue( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
{
HB_TRACE(("hb_memvarGetValue(%p, %p)", pItem, pMemvarSymb));
if( hb_memvarGet( pItem, pMemvarSymb ) == FAILURE )
{
/* Generate an error with retry possibility
@@ -447,8 +469,11 @@ void hb_memvarGetValue( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
void hb_memvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
{
PHB_DYNS pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
PHB_DYNS pDyn;
HB_TRACE(("hb_memvarGetRefer(%p, %p)", pItem, pMemvarSymb));
pDyn = ( PHB_DYNS ) pMemvarSymb->pDynSym;
if( pDyn )
{
#ifdef MEMVARDEBUG
@@ -502,6 +527,8 @@ void hb_memvarGetRefer( HB_ITEM_PTR pItem, PHB_SYMB pMemvarSymb )
*/
void hb_memvarNewParameter( PHB_SYMB pSymbol, PHB_ITEM pValue )
{
HB_TRACE(("hb_memvarNewParameter(%p, %p)", pSymbol, pValue));
hb_memvarCreateFromDynSymbol( pSymbol->pDynSym, MV_PRIVATE, pValue );
}
@@ -523,6 +550,8 @@ static void hb_memvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pVa
{
PHB_DYNS pDynVar;
HB_TRACE(("hb_memvarCreateFromItem(%p, %c, %p)", pMemvar, bScope, pValue));
/* find dynamic symbol or creeate one */
if( IS_SYMBOL( pMemvar ) )
pDynVar = hb_dynsymGet( pMemvar->item.asSymbol.value->szName );
@@ -537,6 +566,8 @@ static void hb_memvarCreateFromItem( PHB_ITEM pMemvar, BYTE bScope, PHB_ITEM pVa
static void hb_memvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITEM pValue )
{
HB_TRACE(("hb_memvarCreateFromDynSymbol(%p, %c, %p)", pDynVar, bScope, pValue));
if( bScope & VS_PUBLIC )
{
/* If the variable with the same name exists already
@@ -586,6 +617,8 @@ static void hb_memvarCreateFromDynSymbol( PHB_DYNS pDynVar, BYTE bScope, PHB_ITE
*/
static void hb_memvarRelease( HB_ITEM_PTR pMemvar )
{
HB_TRACE(("hb_memvarRelease(%p)", pMemvar));
if( IS_STRING( pMemvar ) )
{
ULONG ulBase = s_privateStackCnt;
@@ -628,6 +661,8 @@ static void hb_memvarReleaseWithMask( char *szMask, BOOL bInclude )
ULONG ulBase = s_privateStackCnt;
PHB_DYNS pDynVar;
HB_TRACE(("hb_memvarReleaseWithMask(%s, %d)", szMask, (int) bInclude));
while( ulBase > s_privateStackBase )
{
--ulBase;
@@ -652,6 +687,8 @@ static void hb_memvarReleaseWithMask( char *szMask, BOOL bInclude )
*/
static int hb_memvarScopeGet( PHB_DYNS pDynVar )
{
HB_TRACE(("hb_memvarScopeGet(%p)", pDynVar));
if( pDynVar->hMemvar == 0 )
return MV_UNKNOWN;
else
@@ -682,6 +719,8 @@ static int hb_memvarScope( char * szVarName, ULONG ulLength )
int iMemvar = MV_ERROR;
char * szName;
HB_TRACE(("hb_memvarScope(%s, %lu)", szVarName, ulLength));
szName = ( char * ) hb_xalloc( ulLength );
if( szName )
{
@@ -730,6 +769,8 @@ static HB_DYNS_FUNC( hb_memvarCountPublics )
*/
static int hb_memvarCount( int iScope )
{
HB_TRACE(("hb_memvarCount(%d)", iScope));
if( iScope == MV_PUBLIC )
{
int iPublicCnt = 0;
@@ -772,6 +813,8 @@ static HB_ITEM_PTR hb_memvarDebugVariable( int iScope, int iPos, char * *pszName
HB_ITEM_PTR pValue = NULL;
*pszName = NULL;
HB_TRACE(("hb_memvarDebugVariable(%d, %d, %p)", iScope, iPos, pszName));
if( iPos > 0 )
{
--iPos;
@@ -810,6 +853,8 @@ static HB_DYNS_PTR hb_memvarFindSymbol( HB_ITEM_PTR pName )
{
HB_DYNS_PTR pDynSym = NULL;
HB_TRACE(("hb_memvarFindSymbol(%p)", pName));
if( pName )
{
ULONG ulLen = pName->item.asString.length;

View File

@@ -62,6 +62,8 @@ static int s_iRightButton;
void hb_mouseInit( void )
{
HB_TRACE(("hb_mouseInit()"));
hb_mouse_Init();
s_bPresent = hb_mouse_IsPresent();
@@ -75,21 +77,29 @@ void hb_mouseInit( void )
void hb_mouseExit( void )
{
HB_TRACE(("hb_mouseExit()"));
hb_mouse_Exit();
}
BOOL hb_mouseIsPresent( void )
{
HB_TRACE(("hb_mouseIsPresent()"));
return hb_mouse_IsPresent();
}
BOOL hb_mouseGetCursor( void )
{
HB_TRACE(("hb_mouseGetCursor()"));
return s_bVisible;
}
void hb_mouseSetCursor( BOOL bVisible )
{
HB_TRACE(("hb_mouseSetCursor(%d)", (int) bVisible));
if( bVisible )
{
hb_mouse_Show();
@@ -104,36 +114,50 @@ void hb_mouseSetCursor( BOOL bVisible )
int hb_mouseCol( void )
{
HB_TRACE(("hb_mouseCol()"));
return hb_mouse_Col();
}
int hb_mouseRow( void )
{
HB_TRACE(("hb_mouseRow()"));
return hb_mouse_Row();
}
void hb_mouseSetPos( int iRow, int iCol )
{
HB_TRACE(("hb_mouseSetPos(%d, %d)", iRow, iCol));
hb_mouse_SetPos( iRow, iCol );
}
BOOL hb_mouseIsButtonPressed( int iButton )
{
HB_TRACE(("hb_mouseIsButtonPressed(%d)", iButton));
return hb_mouse_IsButtonPressed( iButton );
}
int hb_mouseCountButton( void )
{
HB_TRACE(("hb_mouseCountButton()"));
return hb_mouse_CountButton();
}
void hb_mouseSetBounds( int iTop, int iLeft, int iBottom, int iRight )
{
HB_TRACE(("hb_mouseSetBounds(%d, %d, %d, %d)", iTop, iLeft, iBottom, iRight));
hb_mouse_SetBounds( iTop, iLeft, iBottom, iRight );
}
void hb_mouseGetBounds( int * piTop, int * piLeft, int * piBottom, int * piRight )
{
HB_TRACE(("hb_mouseSetBounds(%p, %p, %p, %p)", piTop, piLeft, piBottom, piRight));
hb_mouse_GetBounds( piTop, piLeft, piBottom, piRight );
}

View File

@@ -85,6 +85,8 @@ char * hb_strMemotran( char * pszResult, ULONG * ulResultLen, const char * pszSt
ULONG ulStringPos = 0;
ULONG ulResultPos = 0;
HB_TRACE(("hb_strMemotran(%s, %p, %s, %lu, %x, %x)", pszResult, ulResultLen, pszString, ulStringLen, cHardcr, cSoftcr));
while( ulStringPos < ulStringLen )
{
if( pszString[ ulStringPos ] == CHR_HARD1 &&

View File

@@ -87,6 +87,8 @@ static char * s_szMessages[] =
char * hb_nationGetMsg( USHORT uiMsg )
{
HB_TRACE(("hb_nationGetMsg(%hu)", uiMsg));
return ( uiMsg >= 1 && uiMsg <= ( sizeof( s_szMessages ) / sizeof( char * ) ) ) ? s_szMessages[ uiMsg - 1 ] : "";
}

View File

@@ -42,6 +42,8 @@ static char * hb_SecToTimeStr( char * pszTime, ULONG ulTime )
{
USHORT uiValue;
HB_TRACE(("hb_SecToTimeStr(%s, %lu)", pszTime, ulTime));
uiValue = ( ulTime / 3600 ) % 24;
pszTime[ 0 ] = ( char ) ( uiValue / 10 ) + '0';
pszTime[ 1 ] = ( char ) ( uiValue % 10 ) + '0';
@@ -60,9 +62,12 @@ static char * hb_SecToTimeStr( char * pszTime, ULONG ulTime )
static ULONG hb_TimeStrToSec( char * pszTime )
{
ULONG ulLen = strlen( pszTime );
ULONG ulLen;
ULONG ulTime = 0;
HB_TRACE(("hb_TimeStrToSec(%s)", pszTime));
ulLen = strlen( pszTime );
if( ulLen >= 0 )
ulTime += ( ULONG ) hb_strVal( pszTime ) * 3600;

View File

@@ -204,6 +204,8 @@ static BOOL set_logical( PHB_ITEM pItem )
{
BOOL bLogical = FALSE;
HB_TRACE(("set_logical(%p)", pItem));
if( IS_LOGICAL( pItem ) )
bLogical = hb_itemGetL( pItem );
else if( IS_STRING( pItem ) )
@@ -227,6 +229,8 @@ static BOOL set_logical( PHB_ITEM pItem )
static int set_number( PHB_ITEM pItem, int iOldValue )
{
HB_TRACE(("set_number(%p, %d)", pItem, iOldValue));
if( IS_NUMERIC( pItem ) )
return hb_itemGetNI( pItem );
else
@@ -237,6 +241,8 @@ static char * set_string( PHB_ITEM pItem, char * szOldString )
{
char * szString;
HB_TRACE(("set_string(%p, %s)", pItem, szOldString));
if( IS_STRING( pItem ) )
{
/* Limit size of SET strings to 64K, truncating if source is longer */
@@ -258,6 +264,8 @@ static char * set_string( PHB_ITEM pItem, char * szOldString )
static void close_binary( FHANDLE handle )
{
HB_TRACE(("close_binary(%p)", handle));
if( handle != FS_ERROR )
{
/* Close the file handle without disrupting the current
@@ -270,6 +278,8 @@ static void close_binary( FHANDLE handle )
static void close_text( FHANDLE handle )
{
HB_TRACE(("close_text(%p)", handle));
if( handle != FS_ERROR )
{
/* Close the file handle without disrupting the current
@@ -285,11 +295,14 @@ static void close_text( FHANDLE handle )
static FHANDLE open_handle( char * file_name, BOOL bAppend, char * def_ext, HB_set_enum set_specifier )
{
USHORT user_ferror = hb_fsError(); /* Save the current user file error code */
USHORT user_ferror;
FHANDLE handle;
PHB_FNAME pFilename;
char path[ _POSIX_PATH_MAX + 1 ];
HB_TRACE(("open_handle(%s, %d, %s, %d)", file_name, (int) bAppend, def_ext, (int) set_specifier));
user_ferror = hb_fsError(); /* Save the current user file error code */
/* Create full filename */
pFilename = hb_fsFNameSplit( file_name );
@@ -1013,6 +1026,8 @@ HARBOUR HB_SET( void )
void hb_setInitialize( void )
{
HB_TRACE(("hb_setInitialize()"));
hb_set.HB_SET_ALTERNATE = FALSE;
hb_set.HB_SET_ALTFILE = NULL;
hb_set.hb_set_althan = FS_ERROR;
@@ -1076,6 +1091,8 @@ void hb_setInitialize( void )
void hb_setRelease( void )
{
HB_TRACE(("hb_setRelease()"));
close_text( hb_set.hb_set_althan );
close_text( hb_set.hb_set_extrahan );
close_binary( hb_set.hb_set_printhan );

View File

@@ -43,6 +43,8 @@
char * hb_setColor( char * sColor )
{
HB_TRACE(("hb_setColor(%s)", sColor));
#ifdef HARBOUR_USE_GTAPI
hb_gtGetColorStr( hb_set.HB_SET_COLOR );
#else

View File

@@ -83,6 +83,8 @@ BOOL hb_strEmpty( char * szText, ULONG ulLen )
{
BOOL bRetVal = TRUE;
HB_TRACE(("hb_strEmpty(%s, %lu)", szText, ulLen));
while( ulLen-- )
{
char c = szText[ ulLen ];
@@ -100,10 +102,14 @@ BOOL hb_strEmpty( char * szText, ULONG ulLen )
int hb_stricmp( const char * s1, const char * s2 )
{
int rc = 0;
ULONG l1 = strlen( s1 );
ULONG l2 = strlen( s2 );
ULONG l1;
ULONG l2;
ULONG count;
HB_TRACE(("hb_stricmp(%s, %s)", s1, s2));
l1 = strlen( s1 );
l2 = strlen( s2 );
if( l1 < l2 )
count = l1;
else
@@ -134,9 +140,13 @@ int hb_stricmp( const char * s1, const char * s2 )
int hb_strnicmp( const char * s1, const char * s2, ULONG count )
{
int rc = 0;
ULONG l1 = strlen( s1 );
ULONG l2 = strlen( s2 );
ULONG l1;
ULONG l2;
HB_TRACE(("hb_strnicmp(%s, %s, %lu)", s1, s2, count));
l1 = strlen( s1 );
l2 = strlen( s2 );
if( l1 > count )
l1 = count;
@@ -169,6 +179,8 @@ int hb_strnicmp( const char * s1, const char * s2, ULONG count )
static BOOL hb_strMatchDOS( char *pszString, char *pszMask )
{
HB_TRACE(("hb_strMatchDOS(%s, %s)", pszString, pszMask));
while( *pszMask && *pszString )
{
if( *pszMask == '*' )
@@ -215,6 +227,8 @@ static BOOL hb_strMatchDOS( char *pszString, char *pszMask )
*/
BOOL hb_strMatchRegExp( char *szString, char *szMask )
{
HB_TRACE(("hb_strMatchRegExp(%s, %s)", szString, szMask));
return hb_strMatchDOS( szString, szMask );
}
@@ -255,6 +269,8 @@ HARBOUR HB_ISLOWER( void )
/* also returns the new length in lLen */
char *hb_strLTrim( char *szText, ULONG *lLen )
{
HB_TRACE(("hb_strLTrim(%s, %p)", szText, lLen));
while( *lLen && HB_ISSPACE( *szText ) )
{
szText++;
@@ -289,6 +305,8 @@ HARBOUR HB_LTRIM( void )
/* returns szText and the new length in lLen */
ULONG hb_strRTrimLen( char *szText, ULONG lLen, BOOL bAnySpace )
{
HB_TRACE(("hb_strRTrimLen(%s, %lu. %d)", szText, lLen, (int) bAnySpace));
if( bAnySpace )
{
while( lLen && HB_ISSPACE( szText[ lLen - 1 ] ) )
@@ -384,6 +402,8 @@ static char * hb_itemPadConv( PHB_ITEM pItem, char * buffer, ULONG * pulSize )
{
char * szText;
HB_TRACE(("hb_itemPadCond(%p, %s, %p)", pItem, buffer, pulSize));
if( pItem )
{
if( IS_STRING( pItem ) )
@@ -558,6 +578,8 @@ HARBOUR HB_PADC( void )
ULONG hb_strAt( char * szSub, ULONG ulSubLen, char * szText, ULONG ulLen )
{
HB_TRACE(("hb_strAt(%s, %lu, %s, %lu)", szSub, ulSubLen, szText, ulLen));
if( ulSubLen )
{
if( ulLen >= ulSubLen )
@@ -815,6 +837,8 @@ char *hb_strLower( char *szText, ULONG ulLen )
{
ULONG i;
HB_TRACE(("hb_strLower(%s, %lu)", szText, ulLen));
for( i = 0; i < ulLen; i++ )
szText[ i ] = tolower( szText[ i ] );
@@ -845,6 +869,8 @@ void hb_strupr( char * szText )
{
char *p;
HB_TRACE(("hb_strupr(%s)", szText));
for( p = szText; *p; p++ )
*p = toupper( *p );
}
@@ -854,6 +880,8 @@ char *hb_strUpper( char *szText, ULONG ulLen )
{
ULONG i;
HB_TRACE(("hb_strUpper(%s, %lu)", szText, ulLen));
for( i = 0; i < ulLen; i++ )
szText[ i ] = toupper( szText[ i ] );
@@ -866,6 +894,8 @@ char *hb_strncpyUpper( char * pDest, char *pSource, ULONG ulLen )
{
char *pStart = pDest;
HB_TRACE(("hb_strncpyUpper(%s, %s, %lu)", pDest, pSource, ulLen));
pDest[ ulLen ] ='\0';
while( ulLen-- )
*pDest++ = toupper( *pSource++ );
@@ -1162,6 +1192,8 @@ HARBOUR HB_STRTRAN( void )
/* returns the numeric value of a character string representation of a number */
double hb_strVal( char *szText )
{
HB_TRACE(("hb_strVal(%s)", szText));
return atof( szText );
}
@@ -1480,6 +1512,8 @@ HARBOUR HB_STRZERO( void )
int hb_strgreater( char * szText1, char * szText2 )
{
HB_TRACE(("hb_strgreater(%s, %s)", szText1, szText2));
while( *( szText1 ) && *( szText2 ) && *( szText1 ) == *( szText2 ) )
{
szText1++;

View File

@@ -154,6 +154,9 @@ void hb_tone( double dFrequency, double dDuration )
ULONG temp; /* Avoid unreferenced temp */
dDuration = -1.0; /* Exit without delay */
#endif
HB_TRACE(("hb_tone(%lf, %lf)", dFrequency, dDuration));
#if defined(HARBOUR_GCC_OS2) || defined(OS2) || defined(WINNT) || defined(_Windows) || defined(__MINGW32__)
dFrequency = HB_MIN_( HB_MAX_( 0.0, dFrequency ), 32767.0 );
dDuration = dDuration * 1000.0 / 18.2; /* milliseconds */

View File

@@ -97,6 +97,8 @@ static USHORT PictFunc( char ** szPict, ULONG * pulPicLen )
char * szPic = *szPict;
HB_TRACE(("PictFunc(%p, %p)", szPict, pulPicLen));
szPic++;
( *pulPicLen )--;
while( *pulPicLen && ! bDone )
@@ -177,6 +179,8 @@ static char * NumPicture( char * szPic, ULONG ulPic, USHORT uiPicFlags, double d
double dPush;
HB_TRACE(("NumPicture(%s, %lu, %hu, %lf)", szPic, ulPic, uiPicFlags, dValue));
szRet = ( char * ) hb_xgrab( ulPic + 4 ); /* Grab enough */
*szRet = '\0';
for( i = 0; i < ulPic && !bFound; i++ ) /* Count number in front */
@@ -370,6 +374,8 @@ static char * NumPicture( char * szPic, ULONG ulPic, USHORT uiPicFlags, double d
*/
static char * DatePicture( char * szDate, USHORT uiPicFlags, char * szResult )
{
HB_TRACE(("DatePicture(%s, %hu, %s)", szDate, uiPicFlags, szResult));
if( uiPicFlags & PF_BRITISH )
hb_dtoc( szDate, szResult, hb_set.hb_set_century ? "DD/MM/YYYY" : "DD/MM/YY" );
else

View File

@@ -7,7 +7,7 @@ ROOT = ../../../
PRG_SOURCES=\
hbrun.prg \
external.prg \
PRG_MAIN=hbrun.prg
LIBS=\
@@ -19,5 +19,6 @@ LIBS=\
rdd \
rtl \
pp \
common \
include $(TOP)$(ROOT)config/bin.cf

View File

@@ -18,6 +18,7 @@ LIBS=\
rtl \
pp \
runner \
common \
ifeq ($(PM),)
PM := $(pm)