2014-09-17 16:45 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)

* include/hbdebug.ch
    + added HB_DBG_* constant values for arrays returned by __dbg*()
      functions

  * include/hbset.h
  * src/vm/set.c
    + added new C function: hb_setGetItem();

  * src/debug/dbgentry.c
    * use HB_DBG_* constant values
    + added new debugger function: __dbgGetSETs() - it returns array with
      all HVM SETs: { { <nSet>, <cSetName>, <xSetValue> }, ... }
    % optimized hb_dbgActivateCallStackArray() and hb_dbgActivateModuleArray()

  * src/debug/debugger.prg
    * use HB_DBG_* constant values
    * use __dbgGetSETs() for "System Settings" window
    + added support for Harbour SET extensions

  * ChangeLog.txt
    * updated description for structure of array returned
      by __dbgGetBreakPoints()
This commit is contained in:
Przemysław Czerpak
2014-09-17 16:45:44 +02:00
parent b30c509fb0
commit 030baa1068
6 changed files with 538 additions and 364 deletions

View File

@@ -10,6 +10,30 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
2014-09-17 16:45 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* include/hbdebug.ch
+ added HB_DBG_* constant values for arrays returned by __dbg*()
functions
* include/hbset.h
* src/vm/set.c
+ added new C function: hb_setGetItem();
* src/debug/dbgentry.c
* use HB_DBG_* constant values
+ added new debugger function: __dbgGetSETs() - it returns array with
all HVM SETs: { { <nSet>, <cSetName>, <xSetValue> }, ... }
% optimized hb_dbgActivateCallStackArray() and hb_dbgActivateModuleArray()
* src/debug/debugger.prg
* use HB_DBG_* constant values
* use __dbgGetSETs() for "System Settings" window
+ added support for Harbour SET extensions
* ChangeLog.txt
* updated description for structure of array returned
by __dbgGetBreakPoints()
2014-09-15 12:39 UTC+0200 Przemyslaw Czerpak (druzus/at/poczta.onet.pl)
* src/rtl/gtwvt/gtwvt.c
! update state of close button [x] and "Close" window menu item
@@ -2903,6 +2927,8 @@
+ added new PRG functions:
__dbgIsBreak( <pDbg>, <cModule>, <nLine> ) -> <nPos>
__dbgGetBreakPoints( <pDbg> ) -> <aBreakPoints>
<aBreakPoints> contains subarrays in one of the following form:
{ <nLine>, <cModule>, NIL } or { NIL, NIL, >cFuncName> }
* src/debug/debugger.prg
- removed old and long time unused PRG function __dbgAltDEntry()

View File

@@ -61,4 +61,50 @@
#define HB_DBG_ACTIVATE 7 /* activate debugger interface */
#define HB_DBG_VMQUIT 8 /* call internal debugger destructors */
/* Information structure stored in aCallStack */
#define HB_DBG_CS_MODULE 1 /* module name (.prg file) */
#define HB_DBG_CS_FUNCTION 2 /* function name */
#define HB_DBG_CS_LINE 3 /* start line */
#define HB_DBG_CS_LEVEL 4 /* eval stack level of the function */
#define HB_DBG_CS_LOCALS 5 /* an array with local variables */
#define HB_DBG_CS_STATICS 6 /* an array with static variables */
#define HB_DBG_CS_LEN 6
/* Information structure stored in aModules */
#define HB_DBG_MOD_NAME 1 /* module name */
#define HB_DBG_MOD_STATICS 2 /* module static variables */
#define HB_DBG_MOD_GLOBALS 3 /* module global variables */
#define HB_DBG_MOD_EXTGLOBALS 4 /* module extern global variables */
#define HB_DBG_MOD_LEN 4
/* Information structure stored in:
* aCallStack[ n ][ HB_DBG_CS_LOCALS | HB_DBG_CS_STATICS ]
* aModules[ n ][ HB_DBG_MOD_STATICS | HB_DBG_MOD_GLOBALS | HB_DBG_MOD_EXTGLOBALS ]
*/
#define HB_DBG_VAR_NAME 1 /* variable name */
#define HB_DBG_VAR_INDEX 2 /* index */
#define HB_DBG_VAR_TYPE 3 /* type of variable: "L", "S", "G" */
#define HB_DBG_VAR_FRAME 4 /* eval stack level of the function or static frame */
#define HB_DBG_VAR_LEN 4
/* Information structure stored in __dbgGetWatchPoints() array */
#define HB_DBG_WP_EXPR 1 /* expression */
#define HB_DBG_WP_ISTRACE 2 /* .T. -> tracepoint, .F. -> watchpoint */
#define HB_DBG_WP_VALID 3 /* is valid expression? */
#define HB_DBG_WP_RESULT 4 /* expression result */
#define HB_DBG_WP_LEN 4
/* Information structure stored in __dbgGetBreakPoints array */
#define HB_DBG_BP_LINE 1 /* line number */
#define HB_DBG_BP_MODULE 2 /* module name */
#define HB_DBG_BP_FUNC 3 /* function name */
#define HB_DBG_BP_LEN 3
/* Information structure stored in __dbgGetSETs() array */
#define HB_DBG_SET_POS 1 /* expression */
#define HB_DBG_SET_NAME 2 /* .T. -> tracepoint, .F. -> watchpoint */
#define HB_DBG_SET_VALUE 3 /* is valid expression? */
#define HB_DBG_SET_LEN 3
#endif /* HB_DEBUGGER_CH_ */

View File

@@ -254,6 +254,7 @@ extern HB_EXPORT HB_BOOL hb_setGetL( HB_set_enum set_specifier );
extern HB_EXPORT const char * hb_setGetCPtr( HB_set_enum set_specifier );
extern HB_EXPORT int hb_setGetNI( HB_set_enum set_specifier );
extern HB_EXPORT long hb_setGetNL( HB_set_enum set_specifier );
extern HB_EXPORT PHB_ITEM hb_setGetItem( HB_set_enum set_specifier, PHB_ITEM pResult, PHB_ITEM pArg1, PHB_ITEM pArg2 );
extern HB_EXPORT HB_BOOL hb_setSetItem( HB_set_enum set_specifier, PHB_ITEM pItem );
extern HB_EXPORT HB_BOOL hb_setSetItem2( HB_set_enum set_specifier, PHB_ITEM pItem1, PHB_ITEM pItem2 );

View File

@@ -54,6 +54,7 @@
#include "hbdebug.ch"
#include "hbmacro.ch"
#include "set.ch"
/* dummy function declaration */
static HB_BOOL hb_clsSetScope( HB_BOOL fScope )
@@ -199,6 +200,122 @@ static void hb_dbgRelease( void );
static PHB_ITEM hb_dbgVarGet( HB_VARINFO * scope );
static void hb_dbgVarSet( HB_VARINFO * scope, PHB_ITEM xNewValue );
static const char * hb_dbgSetName( HB_set_enum setId )
{
switch( setId )
{
case HB_SET_EXACT: return "Exact";
case HB_SET_FIXED: return "Fixed";
case HB_SET_DECIMALS: return "Decimals";
case HB_SET_DATEFORMAT: return "DateFormat";
case HB_SET_EPOCH: return "Epoch";
case HB_SET_PATH: return "Path";
case HB_SET_DEFAULT: return "Default";
case HB_SET_EXCLUSIVE: return "Exclusive";
case HB_SET_SOFTSEEK: return "SoftSeek";
case HB_SET_UNIQUE: return "Unique";
case HB_SET_DELETED: return "Deleted";
case HB_SET_CANCEL: return "Cancel";
case HB_SET_DEBUG: return "Debug";
case HB_SET_TYPEAHEAD: return "TypeAhead";
case HB_SET_COLOR: return "Color";
case HB_SET_CURSOR: return "Cursor";
case HB_SET_CONSOLE: return "Console";
case HB_SET_ALTERNATE: return "Alternate";
case HB_SET_ALTFILE: return "AltFile";
case HB_SET_DEVICE: return "Device";
case HB_SET_EXTRA: return "Extra";
case HB_SET_EXTRAFILE: return "ExtraFile";
case HB_SET_PRINTER: return "Printer";
case HB_SET_PRINTFILE: return "PrintFile";
case HB_SET_MARGIN: return "Margin";
case HB_SET_BELL: return "Bell";
case HB_SET_CONFIRM: return "Confirm";
case HB_SET_ESCAPE: return "Escape";
case HB_SET_INSERT: return "Insert";
case HB_SET_EXIT: return "Exit";
case HB_SET_INTENSITY: return "Intensity";
case HB_SET_SCOREBOARD: return "ScoreBoard";
case HB_SET_DELIMITERS: return "Delimeters";
case HB_SET_DELIMCHARS: return "DelimChars";
case HB_SET_WRAP: return "Wrap";
case HB_SET_MESSAGE: return "Message";
case HB_SET_MCENTER: return "MCenter";
case HB_SET_SCROLLBREAK: return "ScrollBreak";
case HB_SET_EVENTMASK: return "EventMask";
case HB_SET_VIDEOMODE: return "VideoMode";
case HB_SET_MBLOCKSIZE: return "MBlockSize";
case HB_SET_MFILEEXT: return "MFileExt";
case HB_SET_STRICTREAD: return "StrictRead";
case HB_SET_OPTIMIZE: return "Optimize";
case HB_SET_AUTOPEN: return "Autopen";
case HB_SET_AUTORDER: return "Autorder";
case HB_SET_AUTOSHARE: return "AutoShare";
/* Harbour SET extensions */
case HB_SET_LANGUAGE: return "Language";
case HB_SET_IDLEREPEAT: return "IdleRepeat";
case HB_SET_FILECASE: return "FileCase";
case HB_SET_DIRCASE: return "DirCase";
case HB_SET_DIRSEPARATOR: return "DirSeparator";
case HB_SET_EOF: return "EOF";
case HB_SET_HARDCOMMIT: return "HardCommit";
case HB_SET_FORCEOPT: return "ForceOpt";
case HB_SET_DBFLOCKSCHEME: return "DBFLockScheme";
case HB_SET_DEFEXTENSIONS: return "DefExtensions";
case HB_SET_EOL: return "EOL";
case HB_SET_TRIMFILENAME: return "TrimFileName";
case HB_SET_HBOUTLOG: return "OutLogFile";
case HB_SET_HBOUTLOGINFO: return "OutLogInfo";
case HB_SET_CODEPAGE: return "CodePage";
case HB_SET_OSCODEPAGE: return "OSCodePage";
case HB_SET_TIMEFORMAT: return "TimeFormat";
case HB_SET_DBCODEPAGE: return "DBCodePage";
case HB_SET_INVALID_:
break;
}
return NULL;
}
static PHB_ITEM hb_dbgSetArray( void )
{
PHB_ITEM pArray;
int iSet, iPos;
pArray = hb_itemArrayNew( _SET_COUNT + HB_SET_COUNT );
iPos = iSet = 1;
while( iPos <= _SET_COUNT + HB_SET_COUNT )
{
const char * szName = hb_dbgSetName( ( HB_set_enum ) iSet );
PHB_ITEM pSet = hb_arrayGetItemPtr( pArray, iPos++ );
hb_arrayNew( pSet, HB_DBG_SET_LEN );
hb_arraySetNI( pSet, HB_DBG_SET_POS, iSet );
hb_arraySetC( pSet, HB_DBG_SET_NAME, szName );
hb_setGetItem( ( HB_set_enum ) iSet,
hb_arrayGetItemPtr( pSet, HB_DBG_SET_VALUE ),
NULL, NULL );
if( iSet == _SET_COUNT )
iSet = HB_SET_BASE;
else
iSet++;
}
return pArray;
}
static PHB_ITEM hb_dbgActivateBreakArray( HB_DEBUGINFO * info )
{
int i;
@@ -208,14 +325,14 @@ static PHB_ITEM hb_dbgActivateBreakArray( HB_DEBUGINFO * info )
{
PHB_ITEM pBreak = hb_arrayGetItemPtr( pArray, i + 1 );
hb_arrayNew( pBreak, 3 );
hb_arrayNew( pBreak, HB_DBG_BP_LEN );
if( ! info->aBreak[ i ].szFunction )
{
hb_arraySetNI( pBreak, 1, info->aBreak[ i ].nLine );
hb_arraySetC( pBreak, 2, info->aBreak[ i ].szModule );
hb_arraySetNI( pBreak, HB_DBG_BP_LINE, info->aBreak[ i ].nLine );
hb_arraySetC( pBreak, HB_DBG_BP_MODULE, info->aBreak[ i ].szModule );
}
else
hb_arraySetC( pBreak, 3, info->aBreak[ i ].szFunction );
hb_arraySetC( pBreak, HB_DBG_BP_FUNC, info->aBreak[ i ].szFunction );
}
return pArray;
}
@@ -236,13 +353,13 @@ static PHB_ITEM hb_dbgActivateWatchArray( HB_DEBUGINFO * info )
break;
}
xValue = hb_dbgEval( info, &info->aWatch[ i ] );
hb_arrayNew( pWatch, 4 );
hb_arraySetC( pWatch, 1, info->aWatch[ i ].szExpr );
hb_arraySetL( pWatch, 2, j < info->nTracePoints );
hb_arraySetL( pWatch, 3, xValue != NULL );
hb_arrayNew( pWatch, HB_DBG_WP_LEN );
hb_arraySetC( pWatch, HB_DBG_WP_EXPR, info->aWatch[ i ].szExpr );
hb_arraySetL( pWatch, HB_DBG_WP_ISTRACE, j < info->nTracePoints );
hb_arraySetL( pWatch, HB_DBG_WP_VALID, xValue != NULL );
if( xValue )
{
hb_arraySetForward( pWatch, 4, xValue );
hb_arraySetForward( pWatch, HB_DBG_WP_RESULT, xValue );
hb_itemRelease( xValue );
}
}
@@ -250,24 +367,24 @@ static PHB_ITEM hb_dbgActivateWatchArray( HB_DEBUGINFO * info )
}
static PHB_ITEM hb_dbgActivateVarArray( int nVars, HB_VARINFO * aVars )
static PHB_ITEM hb_dbgActivateVarArray( PHB_ITEM pArray, int nVars, HB_VARINFO * aVars )
{
int i;
PHB_ITEM pArray = hb_itemArrayNew( nVars );
hb_arrayNew( pArray, nVars );
for( i = 0; i < nVars; i++ )
{
PHB_ITEM aVar = hb_arrayGetItemPtr( pArray, i + 1 );
hb_arrayNew( aVar, 4 );
hb_arrayNew( aVar, HB_DBG_VAR_LEN );
hb_arraySetC( aVar, 1, aVars[ i ].szName );
hb_arraySetNL( aVar, 2, aVars[ i ].nIndex );
hb_arraySetCL( aVar, 3, &aVars[ i ].cType, 1 );
hb_arraySetC( aVar, HB_DBG_VAR_NAME, aVars[ i ].szName );
hb_arraySetNL( aVar, HB_DBG_VAR_INDEX, aVars[ i ].nIndex );
hb_arraySetCL( aVar, HB_DBG_VAR_TYPE, &aVars[ i ].cType, 1 );
if( aVars[ i ].cType == 'S' )
hb_arraySet( aVar, 4, aVars[ i ].frame.ptr );
hb_arraySet( aVar, HB_DBG_VAR_FRAME, aVars[ i ].frame.ptr );
else
hb_arraySetNL( aVar, 4, aVars[ i ].frame.num );
hb_arraySetNL( aVar, HB_DBG_VAR_FRAME, aVars[ i ].frame.num );
}
return pArray;
}
@@ -284,26 +401,19 @@ static PHB_ITEM hb_dbgActivateModuleArray( void )
for( i = 0; i < s_common.nModules; i++ )
{
PHB_ITEM pModule = hb_arrayGetItemPtr( pArray, i + 1 ), item;
PHB_ITEM pModule = hb_arrayGetItemPtr( pArray, i + 1 );
hb_arrayNew( pModule, 4 );
hb_arraySetC( pModule, 1, s_common.aModules[ i ].szModule );
item = hb_dbgActivateVarArray( s_common.aModules[ i ].nStatics,
s_common.aModules[ i ].aStatics );
hb_arraySetForward( pModule, 2, item );
hb_itemRelease( item );
item = hb_dbgActivateVarArray( s_common.aModules[ i ].nGlobals,
s_common.aModules[ i ].aGlobals );
hb_arraySetForward( pModule, 3, item );
hb_itemRelease( item );
item = hb_dbgActivateVarArray( s_common.aModules[ i ].nExternGlobals,
s_common.aModules[ i ].aExternGlobals );
hb_arraySetForward( pModule, 4, item );
hb_itemRelease( item );
hb_arrayNew( pModule, HB_DBG_MOD_LEN );
hb_arraySetC( pModule, HB_DBG_MOD_NAME, s_common.aModules[ i ].szModule );
hb_dbgActivateVarArray( hb_arrayGetItemPtr( pModule, HB_DBG_MOD_STATICS ),
s_common.aModules[ i ].nStatics,
s_common.aModules[ i ].aStatics );
hb_dbgActivateVarArray( hb_arrayGetItemPtr( pModule, HB_DBG_MOD_GLOBALS ),
s_common.aModules[ i ].nGlobals,
s_common.aModules[ i ].aGlobals );
hb_dbgActivateVarArray( hb_arrayGetItemPtr( pModule, HB_DBG_MOD_EXTGLOBALS ),
s_common.aModules[ i ].nExternGlobals,
s_common.aModules[ i ].aExternGlobals );
}
HB_DBGCOMMON_UNLOCK();
@@ -320,23 +430,19 @@ static PHB_ITEM hb_dbgActivateCallStackArray( HB_DEBUGINFO * info )
for( i = 0; i < info->nCallStackLen; i++ )
{
HB_CALLSTACKINFO * pEntry = &info->aCallStack[ i ];
PHB_ITEM aEntry, pItem;
PHB_ITEM aEntry;
aEntry = hb_arrayGetItemPtr( aCallStack, info->nCallStackLen - i );
hb_arrayNew( aEntry, 6 );
hb_arrayNew( aEntry, HB_DBG_CS_LEN );
hb_arraySetC( aEntry, 1, pEntry->szModule );
hb_arraySetC( aEntry, 2, pEntry->szFunction );
hb_arraySetNL( aEntry, 3, pEntry->nLine );
hb_arraySetNL( aEntry, 4, pEntry->nProcLevel );
pItem = hb_dbgActivateVarArray( pEntry->nLocals, pEntry->aLocals );
hb_arraySetForward( aEntry, 5, pItem );
hb_itemRelease( pItem );
pItem = hb_dbgActivateVarArray( pEntry->nStatics, pEntry->aStatics );
hb_arraySetForward( aEntry, 6, pItem );
hb_itemRelease( pItem );
hb_arraySetC( aEntry, HB_DBG_CS_MODULE, pEntry->szModule );
hb_arraySetC( aEntry, HB_DBG_CS_FUNCTION, pEntry->szFunction );
hb_arraySetNL( aEntry, HB_DBG_CS_LINE, pEntry->nLine );
hb_arraySetNL( aEntry, HB_DBG_CS_LEVEL, pEntry->nProcLevel );
hb_dbgActivateVarArray( hb_arrayGetItemPtr( aEntry, HB_DBG_CS_LOCALS ),
pEntry->nLocals, pEntry->aLocals );
hb_dbgActivateVarArray( hb_arrayGetItemPtr( aEntry, HB_DBG_CS_STATICS ),
pEntry->nStatics, pEntry->aStatics );
}
return aCallStack;
@@ -1898,6 +2004,11 @@ HB_FUNC( __DBGGETWATCHPOINTS )
hb_itemReturnRelease( hb_dbgActivateWatchArray( ( HB_DEBUGINFO * ) ptr ) );
}
HB_FUNC( __DBGGETSETS )
{
hb_itemReturnRelease( hb_dbgSetArray() );
}
HB_FUNC( __DBGGETMODULENAME )
{
void * ptr = hb_parptr( 1 );

View File

@@ -70,31 +70,13 @@
#include "setcurs.ch"
/* Information structure stored in DATA aCallStack */
#define CSTACK_MODULE 1 // module name (.prg file)
#define CSTACK_FUNCTION 2 // function name
#define CSTACK_LINE 3 // start line
#define CSTACK_LEVEL 4 // eval stack level of the function
#define CSTACK_LOCALS 5 // an array with local variables
#define CSTACK_STATICS 6 // an array with static variables
/* Information structure stored in aCallStack[ n ][ CSTACK_LOCALS ]
{ cLocalName, nLocalIndex, "Local", ProcName( 1 ), nLevel } */
#define VAR_NAME 1
#define VAR_POS 2
#define VAR_TYPE 3
#define VAR_LEVEL 4 // eval stack level of the function
/* Public or Private created in ::LoadVars(), value stored in HB_DBG_VAR_INDEX */
#define HB_DBG_VAR_MVALUE HB_DBG_VAR_INDEX
/* Information structure stored in ::aWatch (watchpoints) */
#define WP_TYPE 1 // wp: watchpoint, tr: tracepoint
#define WP_EXPR 2 // source of an expression
/* Information structure stored in ::aModules */
#define MODULE_NAME 1
#define MODULE_STATICS 2
#define MODULE_GLOBALS 3
#define MODULE_EXTERNGLOBALS 4
/* The dimensions of the debugger window */
#define DEBUGGER_MINROW 0
#define DEBUGGER_MINCOL 0
@@ -102,7 +84,7 @@
#define DEBUGGER_MAXCOL 77
/* command window scroll history */
#define DEBUGGER_CMDHIST_SIZE 64
#define DEBUGGER_CMDHIST_SIZE 128
THREAD STATIC t_oDebugger
@@ -304,7 +286,7 @@ CREATE CLASS HBDebugger
METHOD ShowHelp( cTopic )
METHOD ShowVars()
METHOD LocatePrgPath( cPrgName )
METHOD Sort() INLINE ASort( ::aVars,,, {| x, y | x[ 1 ] < y[ 1 ] } ), ;
METHOD Sort() INLINE ASort( ::aVars,,, {| x, y | x[ HB_DBG_VAR_NAME ] < y[ HB_DBG_VAR_NAME ] } ), ;
::lSortVars := .T., ;
iif( ::oBrwVars != NIL, ::oBrwVars:RefreshAll(), NIL ), ;
iif( ::oWndVars != NIL .AND. ::oWndVars:lVisible, iif( ! ::lGo .AND. ::oBrwVars != NIL, ::oBrwVars:ForceStable(), NIL ), NIL )
@@ -456,7 +438,7 @@ METHOD PROCEDURE Activate() CLASS HBDebugger
ENDIF
// show the topmost procedure
::ShowCodeLine( 1 ) // ::aCallStack[ 1 ][ CSTACK_LINE ], ::aCallStack[ 1 ][ CSTACK_MODULE ] )
::ShowCodeLine( 1 ) // ::aCallStack[ 1 ][ HB_DBG_CS_LINE ], ::aCallStack[ 1 ][ HB_DBG_CS_MODULE ] )
// Most commands can be executed only after activation
IF lFirst
@@ -520,7 +502,7 @@ METHOD PROCEDURE BuildBrowseStack() CLASS HBDebugger
::oBrwStack:Cargo := 1 // Actual highligthed row
::oBrwStack:AddColumn( HBDbColumnNew( "", {|| iif( Len( ::aProcStack ) > 0, ;
PadC( ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_FUNCTION ], 14 ), Space( 14 ) ) } ) )
PadC( ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_FUNCTION ], 14 ), Space( 14 ) ) } ) )
ENDIF
RETURN
@@ -642,8 +624,8 @@ METHOD PROCEDURE CallStackProcessKey( nKey ) CLASS HBDebugger
// jump to source line for a function
#if 0
IF ::aCallStack[ ::oBrwStack:Cargo ][ CSTACK_LINE ] != NIL
::ShowCodeLine( ::aCallStack[ ::oBrwStack:Cargo ][ CSTACK_LINE ], ::aCallStack[ ::oBrwStack:Cargo ][ CSTACK_MODULE ] )
IF ::aCallStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_LINE ] != NIL
::ShowCodeLine( ::aCallStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_LINE ], ::aCallStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_MODULE ] )
ELSE
::GotoLine( 1 )
ENDIF
@@ -746,14 +728,15 @@ METHOD PROCEDURE Colors() CLASS HBDebugger
oBrwColors:skipBlock := {| nPos | ( nPos := ArrayBrowseSkip( nPos, oBrwColors ), oBrwColors:cargo[ 1 ] := ;
oBrwColors:cargo[ 1 ] + nPos, nPos ) }
oBrwColors:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( aColors[ oBrwColors:Cargo[ 1 ] ], 14 ) } ) )
oBrwColors:AddColumn( oCol := HBDbColumnNew( "", {|| aColors[ oBrwColors:Cargo[ 1 ] ] } ) )
oCol:Width := 14
oCol:defColor := { 1, 2 }
AAdd( oBrwColors:Cargo[ 2 ], aColors )
oBrwColors:AddColumn( oCol := HBDbColumnNew( "", ;
{|| PadR( '"' + ::aColors[ oBrwColors:Cargo[ 1 ] ] + '"', nWidth - 15 ) } ) )
AAdd( oBrwColors:Cargo[ 2 ], aColors )
oCol:defColor := { 1, 3 }
ocol:width := 50
oCol:Width := 50
oBrwColors:autolite := .F.
oWndColors:bPainted := {|| oBrwColors:ForceStable(), RefreshVarsS( oBrwColors ) }
@@ -1287,7 +1270,8 @@ METHOD PROCEDURE EditColor( nColor, oBrwColors ) CLASS HBDebugger
oBrwColors:RefreshCurrent()
oBrwColors:ForceStable()
IF __dbgInput( Row(), Col() + 15, oBrwColors:getColumn( 2 ):Width, ;
IF __dbgInput( Row(), oBrwColors:nLeft + oBrwColors:GetColumn( 1 ):width + 1, ;
oBrwColors:getColumn( 2 ):Width, ;
@cColor, __dbgExprValidBlock( "C" ), ;
SubStr( ::ClrModal(), 5 ) )
::aColors[ nColor ] := &cColor
@@ -1307,7 +1291,8 @@ METHOD PROCEDURE EditSet( nSet, oBrwSets ) CLASS HBDebugger
oBrwSets:RefreshCurrent()
oBrwSets:ForceStable()
IF __dbgInput( Row(), Col() + 13, oBrwSets:getColumn( 2 ):Width, ;
IF __dbgInput( Row(), oBrwSets:nLeft + oBrwSets:GetColumn( 1 ):width + 1, ;
oBrwSets:getColumn( 2 ):Width, ;
@cSet, __dbgExprValidBlock( cType ), ;
SubStr( ::ClrModal(), 5 ), 256 )
Set( nSet, &cSet )
@@ -1838,7 +1823,7 @@ METHOD PROCEDURE LoadCallStack() CLASS HBDebugger
FOR i := nDebugLevel TO nCurrLevel
nLevel := nCurrLevel - i + 1
IF ( nPos := AScan( ::aCallStack, {| a | a[ CSTACK_LEVEL ] == nLevel } ) ) > 0
IF ( nPos := AScan( ::aCallStack, {| a | a[ HB_DBG_CS_LEVEL ] == nLevel } ) ) > 0
// a procedure with debug info
::aProcStack[ i - nDebugLevel + 1 ] := ::aCallStack[ nPos ]
ELSE
@@ -1916,20 +1901,20 @@ METHOD PROCEDURE LoadVars() CLASS HBDebugger // updates monitored variables
ENDIF
ENDIF
IF ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_LINE ] != NIL
IF ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_LINE ] != NIL
IF ::lShowGlobals
cName := ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_MODULE ]
cName := ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_MODULE ]
FOR EACH n IN ::aModules
IF ! ::lShowAllGlobals
IF ! ::ModuleMatch( n[ MODULE_NAME ], cName )
IF ! ::ModuleMatch( n[ HB_DBG_MOD_NAME ], cName )
LOOP
ENDIF
ENDIF
FOR EACH m IN n[ MODULE_GLOBALS ]
FOR EACH m IN n[ HB_DBG_MOD_GLOBALS ]
AAdd( aBVars, m )
NEXT
IF ! ::lShowAllGlobals
FOR EACH m IN n[ MODULE_EXTERNGLOBALS ]
FOR EACH m IN n[ HB_DBG_MOD_EXTGLOBALS ]
AAdd( aBVars, m )
NEXT
ENDIF
@@ -1937,22 +1922,22 @@ METHOD PROCEDURE LoadVars() CLASS HBDebugger // updates monitored variables
ENDIF
IF ::lShowStatics
cName := ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_MODULE ]
IF ( n := AScan( ::aModules, {| a | ::ModuleMatch( a[ MODULE_NAME ], cName ) } ) ) > 0
FOR EACH m IN ::aModules[ n ][ MODULE_STATICS ]
cName := ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_MODULE ]
IF ( n := AScan( ::aModules, {| a | ::ModuleMatch( a[ HB_DBG_MOD_NAME ], cName ) } ) ) > 0
FOR EACH m IN ::aModules[ n ][ HB_DBG_MOD_STATICS ]
AAdd( aBVars, m )
NEXT
ENDIF
FOR EACH n IN ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_STATICS ]
FOR EACH n IN ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_STATICS ]
AAdd( aBVars, n )
NEXT
ENDIF
IF ::lShowLocals
FOR EACH n IN ::aProcStack[ ::oBrwStack:Cargo ][ CSTACK_LOCALS ]
cName := n[ VAR_NAME ]
FOR EACH n IN ::aProcStack[ ::oBrwStack:Cargo ][ HB_DBG_CS_LOCALS ]
cName := n[ HB_DBG_VAR_NAME ]
// Is there another var with this name ?
IF ( m := AScan( aBVars, {| aVar | aVar[ VAR_NAME ] == cName .AND. hb_LeftEq( aVar[ VAR_TYPE ], "S" ) } ) ) > 0
IF ( m := AScan( aBVars, {| aVar | aVar[ HB_DBG_VAR_NAME ] == cName .AND. aVar[ HB_DBG_VAR_TYPE ] == "S" } ) ) > 0
aBVars[ m ] := n
ELSE
AAdd( aBVars, n )
@@ -2513,8 +2498,8 @@ METHOD PROCEDURE SaveSettings( cFileName ) CLASS HBDebugger
ENDIF
FOR EACH aBreak IN __dbgGetBreakPoints( ::pInfo )
cInfo += "BP " + hb_ntos( aBreak[ 1 ] ) + " " + ;
AllTrim( aBreak[ 2 ] ) + hb_eol()
cInfo += "BP " + hb_ntos( aBreak[ HB_DBG_BP_LINE ] ) + " " + ;
aBreak[ HB_DBG_BP_MODULE ] + hb_eol()
NEXT
FOR EACH aWatch IN ::aWatch
@@ -2715,12 +2700,12 @@ METHOD PROCEDURE ShowCodeLine( nProc ) CLASS HBDebugger
::oBrwStack:RefreshAll()
ENDIF
nLine := ::aProcStack[ nProc ][ CSTACK_LINE ]
cPrgName := ::aProcStack[ nProc ][ CSTACK_MODULE ]
nLine := ::aProcStack[ nProc ][ HB_DBG_CS_LINE ]
cPrgName := ::aProcStack[ nProc ][ HB_DBG_CS_MODULE ]
IF nLine == NIL
::oBrwText := NIL
::oWndCode:Browser := NIL
::oWndCode:SetCaption( ::aProcStack[ nProc ][ CSTACK_FUNCTION ] + ;
::oWndCode:SetCaption( ::aProcStack[ nProc ][ HB_DBG_CS_FUNCTION ] + ;
": Code not available" )
::oWndCode:Refresh() // to force the window caption to update
RETURN
@@ -2744,7 +2729,7 @@ METHOD PROCEDURE ShowCodeLine( nProc ) CLASS HBDebugger
IF ! hb_FileExists( cPrgName )
::oBrwText := NIL
::oWndCode:Browser := NIL
::oWndCode:SetCaption( ::aProcStack[ nProc ][ CSTACK_MODULE ] + ;
::oWndCode:SetCaption( ::aProcStack[ nProc ][ HB_DBG_CS_MODULE ] + ;
" File not found" )
::oWndCode:Refresh()
RETURN
@@ -3051,8 +3036,10 @@ METHOD BreakPointList() CLASS HBDebugger
LOCAL aBreak, cType
FOR EACH aBreak IN __dbgGetBreakPoints( ::pInfo )
cType := iif( aBreak[ 3 ] != NIL, aBreak[ 3 ], ;
hb_ntos( aBreak[ 1 ] ) + " " + aBreak[ 2 ] )
cType := iif( aBreak[ HB_DBG_BP_FUNC ] != NIL, ;
aBreak[ HB_DBG_BP_FUNC ], ;
hb_ntos( aBreak[ HB_DBG_BP_LINE ] ) + " " + ;
aBreak[ HB_DBG_BP_MODULE ] )
::CommandWindowDisplay( hb_ntos( aBreak:__enumIndex() - 1 ) + ") " + ;
cType, .F. )
NEXT
@@ -3097,46 +3084,47 @@ METHOD VarGetInfo( aVar ) CLASS HBDebugger
LOCAL uValue := ::VarGetValue( aVar )
LOCAL cType
SWITCH Left( aVar[ VAR_TYPE ], 1 )
SWITCH aVar[ HB_DBG_VAR_TYPE ]
CASE "G" ; cType := "Global" ; EXIT
CASE "L" ; cType := "Local" ; EXIT
CASE "S" ; cType := "Static" ; EXIT
OTHERWISE ; cType := aVar[ VAR_TYPE ]
OTHERWISE ; cType := aVar[ HB_DBG_VAR_TYPE ]
ENDSWITCH
RETURN aVar[ VAR_NAME ] + " <" + cType + ", " + ValType( uValue ) + ">: " + __dbgValToStr( uValue )
RETURN aVar[ HB_DBG_VAR_NAME ] + " <" + cType + ", " + ValType( uValue ) + ">: " + __dbgValToStr( uValue )
METHOD VarGetValue( aVar ) CLASS HBDebugger
SWITCH Left( aVar[ VAR_TYPE ], 1 )
CASE "G" ; RETURN __dbgVMVarGGet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ] )
CASE "L" ; RETURN __dbgVMVarLGet( __dbgProcLevel() - aVar[ VAR_LEVEL ], aVar[ VAR_POS ] )
CASE "S" ; RETURN __dbgVMVarSGet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ] )
SWITCH aVar[ HB_DBG_VAR_TYPE ]
CASE "G" ; RETURN __dbgVMVarGGet( aVar[ HB_DBG_VAR_FRAME ], aVar[ HB_DBG_VAR_INDEX ] )
CASE "L" ; RETURN __dbgVMVarLGet( __dbgProcLevel() - aVar[ HB_DBG_VAR_FRAME ], aVar[ HB_DBG_VAR_INDEX ] )
CASE "S" ; RETURN __dbgVMVarSGet( aVar[ HB_DBG_VAR_FRAME ], aVar[ HB_DBG_VAR_INDEX ] )
ENDSWITCH
RETURN aVar[ VAR_POS ] // Public or Private
// Public or Private created in ::LoadVars(), value stored in HB_DBG_VAR_INDEX
RETURN aVar[ HB_DBG_VAR_MVALUE ]
METHOD VarSetValue( aVar, uValue ) CLASS HBDebugger
LOCAL nProcLevel
SWITCH Left( aVar[ VAR_TYPE ], 1 )
SWITCH aVar[ HB_DBG_VAR_TYPE ]
CASE "G"
__dbgVMVarGSet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ], uValue )
__dbgVMVarGSet( aVar[ HB_DBG_VAR_FRAME ], aVar[ HB_DBG_VAR_INDEX ], uValue )
EXIT
CASE "L"
nProcLevel := __dbgProcLevel() - aVar[ VAR_LEVEL ] // skip debugger stack
__dbgVMVarLSet( nProcLevel, aVar[ VAR_POS ], uValue )
nProcLevel := __dbgProcLevel() - aVar[ HB_DBG_VAR_FRAME ] // skip debugger stack
__dbgVMVarLSet( nProcLevel, aVar[ HB_DBG_VAR_INDEX ], uValue )
EXIT
CASE "S"
__dbgVMVarSSet( aVar[ VAR_LEVEL ], aVar[ VAR_POS ], uValue )
__dbgVMVarSSet( aVar[ HB_DBG_VAR_FRAME ], aVar[ HB_DBG_VAR_INDEX ], uValue )
EXIT
OTHERWISE
// Public or Private
aVar[ VAR_POS ] := uValue
&( aVar[ VAR_NAME ] ) := uValue
// Public or Private created in ::LoadVars(), value stored in HB_DBG_VAR_INDEX
aVar[ HB_DBG_VAR_MVALUE ] := uValue
&( aVar[ HB_DBG_VAR_NAME ] ) := uValue
ENDSWITCH
RETURN Self
@@ -3144,19 +3132,9 @@ METHOD VarSetValue( aVar, uValue ) CLASS HBDebugger
METHOD PROCEDURE ViewSets() CLASS HBDebugger
LOCAL oWndSets := HBDbWindow():New( 1, 8, ::nMaxRow - 2, ::nMaxCol - 8, ;
"System Settings[1..47]", ::ClrModal() )
LOCAL aSets := { ;
"Exact", "Fixed", "Decimals", "DateFormat", "Epoch", "Path", ;
"Default", "Exclusive", "SoftSeek", "Unique", "Deleted", ;
"Cancel", "Debug", "TypeAhead", "Color", "Cursor", "Console", ;
"Alternate", "AltFile", "Device", "Extra", "ExtraFile", ;
"Printer", "PrintFile", "Margin", "Bell", "Confirm", "Escape", ;
"Insert", "Exit", "Intensity", "ScoreBoard", "Delimeters", ;
"DelimChars", "Wrap", "Message", "MCenter", "ScrollBreak", ;
"EventMask", "VideoMode", "MBlockSize", "MFileExt", ;
"StrictRead", "Optimize", "Autopen", "Autorder", "AutoShare" }
LOCAL aSets := __dbgGetSETs()
LOCAL oWndSets := HBDbWindow():New( 1, 7, ::nMaxRow - 2, ::nMaxCol - 7, ;
"System Settings[1.." + hb_ntos( aTail( aSets )[ HB_DBG_SET_POS ] ) + "]", ::ClrModal() )
LOCAL oBrwSets := HBDbBrowser():new( oWndSets:nTop + 1, oWndSets:nLeft + 1, ;
oWndSets:nBottom - 1, oWndSets:nRight - 1 )
LOCAL nWidth := oWndSets:nRight - oWndSets:nLeft - 1
@@ -3169,17 +3147,18 @@ METHOD PROCEDURE ViewSets() CLASS HBDebugger
oBrwSets:goBottomBlock := {|| oBrwSets:cargo[ 1 ] := Len( oBrwSets:cargo[ 2 ][ 1 ] ) }
oBrwSets:skipBlock := {| nPos | ( nPos := ArrayBrowseSkip( nPos, oBrwSets ), oBrwSets:cargo[ 1 ] := ;
oBrwSets:cargo[ 1 ] + nPos, nPos ) }
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| PadR( aSets[ oBrwSets:cargo[ 1 ] ], 12 ) } ) )
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", {|| aSets[ oBrwSets:cargo[ 1 ] ][ HB_DBG_SET_NAME ] } ) )
AAdd( oBrwSets:Cargo[ 2 ], aSets )
ocol:defcolor := { 1, 2 }
oCol:Width := 14
oCol:defcolor := { 1, 2 }
oBrwSets:AddColumn( oCol := HBDbColumnNew( "", ;
{|| PadR( __dbgValToExp( Set( oBrwSets:cargo[ 1 ] ) ), nWidth - 13 ) } ) )
ocol:defcolor := { 1, 3 }
ocol:width := 40
{|| PadR( __dbgValToExp( Set( aSets[ oBrwSets:cargo[ 1 ] ][ HB_DBG_SET_POS ] ) ), nWidth - 13 ) } ) )
oCol:defcolor := { 1, 3 }
oCol:width := 40
oWndSets:bPainted := {|| oBrwSets:ForceStable(), RefreshVarsS( oBrwSets ) }
oWndSets:bKeyPressed := {| nKey | SetsKeyPressed( nKey, oBrwSets, Len( aSets ), ;
oWndSets, "System Settings", ;
{|| ::EditSet( oBrwSets:Cargo[ 1 ], oBrwSets ) } ) }
{|| ::EditSet( aSets[ oBrwSets:Cargo[ 1 ] ][ HB_DBG_SET_POS ], oBrwSets ) } ) }
oWndSets:ShowModal()

View File

@@ -492,92 +492,89 @@ static char * hb_set_PRINTFILE_default( void )
#endif
}
HB_FUNC( SET )
PHB_ITEM hb_setGetItem( HB_set_enum set_specifier, PHB_ITEM pResult,
PHB_ITEM pArg1, PHB_ITEM pArg2 )
{
HB_STACK_TLS_PRELOAD
PHB_SET_STRUCT pSet = hb_stackSetStruct();
int args = hb_pcount();
HB_set_enum set_specifier = ( args > 0 ) ? ( HB_set_enum ) hb_parni( 1 ) : HB_SET_INVALID_;
PHB_ITEM pArg2 = ( args > 1 ) ? hb_param( 2, HB_IT_ANY ) : NULL;
PHB_ITEM pArg3 = ( args > 2 ) ? hb_param( 3, HB_IT_ANY ) : NULL;
if( args > 1 )
if( pArg1 != NULL )
hb_setListenerNotify( set_specifier, HB_SET_LISTENER_BEFORE );
switch( set_specifier )
{
case HB_SET_ALTERNATE:
hb_retl( pSet->HB_SET_ALTERNATE );
if( args > 1 )
pSet->HB_SET_ALTERNATE = set_logical( pArg2, pSet->HB_SET_ALTERNATE );
pResult = hb_itemPutL( pResult, pSet->HB_SET_ALTERNATE );
if( pArg1 != NULL )
pSet->HB_SET_ALTERNATE = set_logical( pArg1, pSet->HB_SET_ALTERNATE );
break;
case HB_SET_ALTFILE:
hb_retc( pSet->HB_SET_ALTFILE );
if( pArg2 && HB_IS_STRING( pArg2 ) )
open_handle( pSet, hb_itemGetCPtr( pArg2 ), set_logical( pArg3, HB_FALSE ), HB_SET_ALTFILE );
pResult = hb_itemPutC( pResult, pSet->HB_SET_ALTFILE );
if( pArg1 && HB_IS_STRING( pArg1 ) )
open_handle( pSet, hb_itemGetCPtr( pArg1 ), set_logical( pArg2, HB_FALSE ), HB_SET_ALTFILE );
break;
case HB_SET_AUTOPEN:
hb_retl( pSet->HB_SET_AUTOPEN );
if( args > 1 )
pSet->HB_SET_AUTOPEN = set_logical( pArg2, pSet->HB_SET_AUTOPEN );
pResult = hb_itemPutL( pResult, pSet->HB_SET_AUTOPEN );
if( pArg1 != NULL )
pSet->HB_SET_AUTOPEN = set_logical( pArg1, pSet->HB_SET_AUTOPEN );
break;
case HB_SET_AUTORDER:
hb_retni( pSet->HB_SET_AUTORDER );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_AUTORDER );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_AUTORDER ) < 0 )
if( set_number( pArg1, pSet->HB_SET_AUTORDER ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_AUTORDER = set_number( pArg2, pSet->HB_SET_AUTORDER );
pSet->HB_SET_AUTORDER = set_number( pArg1, pSet->HB_SET_AUTORDER );
}
break;
case HB_SET_AUTOSHARE:
hb_retni( pSet->HB_SET_AUTOSHARE );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_AUTOSHARE );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_AUTOSHARE ) < 0 )
if( set_number( pArg1, pSet->HB_SET_AUTOSHARE ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_AUTOSHARE = set_number( pArg2, pSet->HB_SET_AUTOSHARE );
pSet->HB_SET_AUTOSHARE = set_number( pArg1, pSet->HB_SET_AUTOSHARE );
}
break;
case HB_SET_BELL:
hb_retl( pSet->HB_SET_BELL );
if( args > 1 )
pSet->HB_SET_BELL = set_logical( pArg2, pSet->HB_SET_BELL );
pResult = hb_itemPutL( pResult, pSet->HB_SET_BELL );
if( pArg1 != NULL )
pSet->HB_SET_BELL = set_logical( pArg1, pSet->HB_SET_BELL );
break;
case HB_SET_CANCEL:
hb_retl( pSet->HB_SET_CANCEL );
if( args > 1 )
pSet->HB_SET_CANCEL = set_logical( pArg2, pSet->HB_SET_CANCEL );
pResult = hb_itemPutL( pResult, pSet->HB_SET_CANCEL );
if( pArg1 != NULL )
pSet->HB_SET_CANCEL = set_logical( pArg1, pSet->HB_SET_CANCEL );
break;
case HB_SET_COLOR:
hb_retc( hb_conSetColor( args >= 2 && HB_IS_STRING( pArg2 ) ? hb_itemGetCPtr( pArg2 ) : NULL ) );
pResult = hb_itemPutC( pResult, hb_conSetColor( pArg1 != NULL && HB_IS_STRING( pArg1 ) ? hb_itemGetCPtr( pArg1 ) : NULL ) );
break;
case HB_SET_CONFIRM:
hb_retl( pSet->HB_SET_CONFIRM );
if( args > 1 )
pSet->HB_SET_CONFIRM = set_logical( pArg2, pSet->HB_SET_CONFIRM );
pResult = hb_itemPutL( pResult, pSet->HB_SET_CONFIRM );
if( pArg1 != NULL )
pSet->HB_SET_CONFIRM = set_logical( pArg1, pSet->HB_SET_CONFIRM );
break;
case HB_SET_CONSOLE:
hb_retl( pSet->HB_SET_CONSOLE );
if( args > 1 )
pSet->HB_SET_CONSOLE = set_logical( pArg2, pSet->HB_SET_CONSOLE );
pResult = hb_itemPutL( pResult, pSet->HB_SET_CONSOLE );
if( pArg1 != NULL )
pSet->HB_SET_CONSOLE = set_logical( pArg1, pSet->HB_SET_CONSOLE );
break;
case HB_SET_CURSOR:
if( args >= 2 && HB_IS_NUMERIC( pArg2 ) )
hb_retni( hb_conSetCursor( HB_TRUE, hb_itemGetNI( pArg2 ) ) );
if( pArg1 != NULL && HB_IS_NUMERIC( pArg1 ) )
pResult = hb_itemPutNI( pResult, hb_conSetCursor( HB_TRUE, hb_itemGetNI( pArg1 ) ) );
else
hb_retni( hb_conSetCursor( HB_FALSE, 0 ) );
pResult = hb_itemPutNI( pResult, hb_conSetCursor( HB_FALSE, 0 ) );
break;
case HB_SET_DATEFORMAT:
hb_retc( pSet->HB_SET_DATEFORMAT );
if( args > 1 )
pResult = hb_itemPutC( pResult, pSet->HB_SET_DATEFORMAT );
if( pArg1 != NULL )
{
char * value;
int year = 0;
value = pSet->HB_SET_DATEFORMAT = set_string( pArg2, pSet->HB_SET_DATEFORMAT );
value = pSet->HB_SET_DATEFORMAT = set_string( pArg1, pSet->HB_SET_DATEFORMAT );
while( *value )
{
if( *value == 'Y' || *value == 'y' )
@@ -592,232 +589,232 @@ HB_FUNC( SET )
}
break;
case HB_SET_TIMEFORMAT:
hb_retc( pSet->HB_SET_TIMEFORMAT );
if( args > 1 )
pSet->HB_SET_TIMEFORMAT = set_string( pArg2, pSet->HB_SET_TIMEFORMAT );
pResult = hb_itemPutC( pResult, pSet->HB_SET_TIMEFORMAT );
if( pArg1 != NULL )
pSet->HB_SET_TIMEFORMAT = set_string( pArg1, pSet->HB_SET_TIMEFORMAT );
break;
case HB_SET_DEBUG:
hb_retl( pSet->HB_SET_DEBUG );
if( args > 1 )
pSet->HB_SET_DEBUG = set_logical( pArg2, pSet->HB_SET_DEBUG );
pResult = hb_itemPutL( pResult, pSet->HB_SET_DEBUG );
if( pArg1 != NULL )
pSet->HB_SET_DEBUG = set_logical( pArg1, pSet->HB_SET_DEBUG );
break;
case HB_SET_DECIMALS:
hb_retni( pSet->HB_SET_DECIMALS );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_DECIMALS );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_DECIMALS ) < 0 )
if( set_number( pArg1, pSet->HB_SET_DECIMALS ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_DECIMALS = set_number( pArg2, pSet->HB_SET_DECIMALS );
pSet->HB_SET_DECIMALS = set_number( pArg1, pSet->HB_SET_DECIMALS );
}
break;
case HB_SET_DEFAULT:
hb_retc( pSet->HB_SET_DEFAULT );
if( args > 1 )
pSet->HB_SET_DEFAULT = set_string( pArg2, pSet->HB_SET_DEFAULT );
pResult = hb_itemPutC( pResult, pSet->HB_SET_DEFAULT );
if( pArg1 != NULL )
pSet->HB_SET_DEFAULT = set_string( pArg1, pSet->HB_SET_DEFAULT );
break;
case HB_SET_DELETED:
hb_retl( pSet->HB_SET_DELETED );
if( args > 1 )
pSet->HB_SET_DELETED = set_logical( pArg2, pSet->HB_SET_DELETED );
pResult = hb_itemPutL( pResult, pSet->HB_SET_DELETED );
if( pArg1 != NULL )
pSet->HB_SET_DELETED = set_logical( pArg1, pSet->HB_SET_DELETED );
break;
case HB_SET_DELIMCHARS:
hb_retc( pSet->HB_SET_DELIMCHARS );
if( args > 1 )
pSet->HB_SET_DELIMCHARS = set_string( pArg2, pSet->HB_SET_DELIMCHARS );
pResult = hb_itemPutC( pResult, pSet->HB_SET_DELIMCHARS );
if( pArg1 != NULL )
pSet->HB_SET_DELIMCHARS = set_string( pArg1, pSet->HB_SET_DELIMCHARS );
break;
case HB_SET_DELIMITERS:
hb_retl( pSet->HB_SET_DELIMITERS );
if( args > 1 )
pSet->HB_SET_DELIMITERS = set_logical( pArg2, pSet->HB_SET_DELIMITERS );
pResult = hb_itemPutL( pResult, pSet->HB_SET_DELIMITERS );
if( pArg1 != NULL )
pSet->HB_SET_DELIMITERS = set_logical( pArg1, pSet->HB_SET_DELIMITERS );
break;
case HB_SET_DEVICE:
hb_retc( pSet->HB_SET_DEVICE );
if( pArg2 && HB_IS_STRING( pArg2 ) )
pResult = hb_itemPutC( pResult, pSet->HB_SET_DEVICE );
if( pArg1 && HB_IS_STRING( pArg1 ) )
{
/* If the print file is not already open, open it in overwrite mode. */
pSet->HB_SET_DEVICE = set_string( pArg2, pSet->HB_SET_DEVICE );
pSet->HB_SET_DEVICE = set_string( pArg1, pSet->HB_SET_DEVICE );
pSet->hb_set_prndevice = strlen( pSet->HB_SET_DEVICE ) >= 4 &&
hb_strnicmp( pSet->HB_SET_DEVICE, "PRIN", 4 ) == 0;
}
break;
case HB_SET_EOF:
hb_retl( pSet->HB_SET_EOF );
if( args > 1 )
pSet->HB_SET_EOF = set_logical( pArg2, pSet->HB_SET_EOF );
pResult = hb_itemPutL( pResult, pSet->HB_SET_EOF );
if( pArg1 != NULL )
pSet->HB_SET_EOF = set_logical( pArg1, pSet->HB_SET_EOF );
break;
case HB_SET_EPOCH:
hb_retni( pSet->HB_SET_EPOCH );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_EPOCH );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_EPOCH ) < 0 )
if( set_number( pArg1, pSet->HB_SET_EPOCH ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_EPOCH = set_number( pArg2, pSet->HB_SET_EPOCH );
pSet->HB_SET_EPOCH = set_number( pArg1, pSet->HB_SET_EPOCH );
}
break;
case HB_SET_ESCAPE:
hb_retl( pSet->HB_SET_ESCAPE );
if( args > 1 )
pSet->HB_SET_ESCAPE = set_logical( pArg2, pSet->HB_SET_ESCAPE );
pResult = hb_itemPutL( pResult, pSet->HB_SET_ESCAPE );
if( pArg1 != NULL )
pSet->HB_SET_ESCAPE = set_logical( pArg1, pSet->HB_SET_ESCAPE );
break;
case HB_SET_EVENTMASK:
hb_retni( pSet->HB_SET_EVENTMASK );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_EVENTMASK );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_EVENTMASK ) < 0 )
if( set_number( pArg1, pSet->HB_SET_EVENTMASK ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_EVENTMASK = set_number( pArg2, pSet->HB_SET_EVENTMASK );
pSet->HB_SET_EVENTMASK = set_number( pArg1, pSet->HB_SET_EVENTMASK );
}
break;
case HB_SET_EXACT:
hb_retl( pSet->HB_SET_EXACT );
if( args > 1 )
pSet->HB_SET_EXACT = set_logical( pArg2, pSet->HB_SET_EXACT );
pResult = hb_itemPutL( pResult, pSet->HB_SET_EXACT );
if( pArg1 != NULL )
pSet->HB_SET_EXACT = set_logical( pArg1, pSet->HB_SET_EXACT );
break;
case HB_SET_EXCLUSIVE:
hb_retl( pSet->HB_SET_EXCLUSIVE );
if( args > 1 )
pSet->HB_SET_EXCLUSIVE = set_logical( pArg2, pSet->HB_SET_EXCLUSIVE );
pResult = hb_itemPutL( pResult, pSet->HB_SET_EXCLUSIVE );
if( pArg1 != NULL )
pSet->HB_SET_EXCLUSIVE = set_logical( pArg1, pSet->HB_SET_EXCLUSIVE );
break;
case HB_SET_EXIT:
hb_retl( pSet->HB_SET_EXIT );
pResult = hb_itemPutL( pResult, pSet->HB_SET_EXIT );
/* NOTE: Otherwise ReadExit() will always set the value. [vszakats] */
if( pArg2 != NULL && ! HB_IS_NIL( pArg2 ) )
pSet->HB_SET_EXIT = set_logical( pArg2, pSet->HB_SET_EXIT );
if( pArg1 != NULL && ! HB_IS_NIL( pArg1 ) )
pSet->HB_SET_EXIT = set_logical( pArg1, pSet->HB_SET_EXIT );
break;
case HB_SET_EXTRA:
hb_retl( pSet->HB_SET_EXTRA );
if( args > 1 )
pSet->HB_SET_EXTRA = set_logical( pArg2, pSet->HB_SET_EXTRA );
pResult = hb_itemPutL( pResult, pSet->HB_SET_EXTRA );
if( pArg1 != NULL )
pSet->HB_SET_EXTRA = set_logical( pArg1, pSet->HB_SET_EXTRA );
break;
case HB_SET_EXTRAFILE:
hb_retc( pSet->HB_SET_EXTRAFILE );
if( pArg2 && HB_IS_STRING( pArg2 ) )
open_handle( pSet, hb_itemGetCPtr( pArg2 ), set_logical( pArg3, HB_FALSE ), HB_SET_EXTRAFILE );
pResult = hb_itemPutC( pResult, pSet->HB_SET_EXTRAFILE );
if( pArg1 && HB_IS_STRING( pArg1 ) )
open_handle( pSet, hb_itemGetCPtr( pArg1 ), set_logical( pArg2, HB_FALSE ), HB_SET_EXTRAFILE );
break;
case HB_SET_FIXED:
hb_retl( pSet->HB_SET_FIXED );
if( args > 1 )
pSet->HB_SET_FIXED = set_logical( pArg2, pSet->HB_SET_FIXED );
pResult = hb_itemPutL( pResult, pSet->HB_SET_FIXED );
if( pArg1 != NULL )
pSet->HB_SET_FIXED = set_logical( pArg1, pSet->HB_SET_FIXED );
break;
case HB_SET_INSERT:
hb_retl( pSet->HB_SET_INSERT );
if( args > 1 )
pSet->HB_SET_INSERT = set_logical( pArg2, pSet->HB_SET_INSERT );
pResult = hb_itemPutL( pResult, pSet->HB_SET_INSERT );
if( pArg1 != NULL )
pSet->HB_SET_INSERT = set_logical( pArg1, pSet->HB_SET_INSERT );
break;
case HB_SET_INTENSITY:
hb_retl( pSet->HB_SET_INTENSITY );
if( args > 1 )
pSet->HB_SET_INTENSITY = set_logical( pArg2, pSet->HB_SET_INTENSITY );
pResult = hb_itemPutL( pResult, pSet->HB_SET_INTENSITY );
if( pArg1 != NULL )
pSet->HB_SET_INTENSITY = set_logical( pArg1, pSet->HB_SET_INTENSITY );
break;
case HB_SET_MARGIN:
hb_retni( pSet->HB_SET_MARGIN );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_MARGIN );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_MARGIN ) < 0 )
if( set_number( pArg1, pSet->HB_SET_MARGIN ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_MARGIN = set_number( pArg2, pSet->HB_SET_MARGIN );
pSet->HB_SET_MARGIN = set_number( pArg1, pSet->HB_SET_MARGIN );
}
break;
case HB_SET_MBLOCKSIZE:
hb_retni( pSet->HB_SET_MBLOCKSIZE );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_MBLOCKSIZE );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_MBLOCKSIZE ) < 0 )
if( set_number( pArg1, pSet->HB_SET_MBLOCKSIZE ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_MBLOCKSIZE = set_number( pArg2, pSet->HB_SET_MBLOCKSIZE );
pSet->HB_SET_MBLOCKSIZE = set_number( pArg1, pSet->HB_SET_MBLOCKSIZE );
}
break;
case HB_SET_MCENTER:
hb_retl( pSet->HB_SET_MCENTER );
if( args > 1 )
pSet->HB_SET_MCENTER = set_logical( pArg2, pSet->HB_SET_MCENTER );
pResult = hb_itemPutL( pResult, pSet->HB_SET_MCENTER );
if( pArg1 != NULL )
pSet->HB_SET_MCENTER = set_logical( pArg1, pSet->HB_SET_MCENTER );
break;
case HB_SET_MESSAGE:
hb_retni( pSet->HB_SET_MESSAGE );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_MESSAGE );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_MESSAGE ) < 0 )
if( set_number( pArg1, pSet->HB_SET_MESSAGE ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_MESSAGE = set_number( pArg2, pSet->HB_SET_MESSAGE );
pSet->HB_SET_MESSAGE = set_number( pArg1, pSet->HB_SET_MESSAGE );
}
break;
case HB_SET_MFILEEXT:
hb_retc( pSet->HB_SET_MFILEEXT );
if( args > 1 )
pSet->HB_SET_MFILEEXT = set_string( pArg2, pSet->HB_SET_MFILEEXT );
pResult = hb_itemPutC( pResult, pSet->HB_SET_MFILEEXT );
if( pArg1 != NULL )
pSet->HB_SET_MFILEEXT = set_string( pArg1, pSet->HB_SET_MFILEEXT );
break;
case HB_SET_OPTIMIZE:
hb_retl( pSet->HB_SET_OPTIMIZE );
if( args > 1 )
pSet->HB_SET_OPTIMIZE = set_logical( pArg2, pSet->HB_SET_OPTIMIZE );
pResult = hb_itemPutL( pResult, pSet->HB_SET_OPTIMIZE );
if( pArg1 != NULL )
pSet->HB_SET_OPTIMIZE = set_logical( pArg1, pSet->HB_SET_OPTIMIZE );
break;
case HB_SET_FORCEOPT:
hb_retl( pSet->HB_SET_FORCEOPT );
if( args > 1 )
pSet->HB_SET_FORCEOPT = set_logical( pArg2, pSet->HB_SET_FORCEOPT );
pResult = hb_itemPutL( pResult, pSet->HB_SET_FORCEOPT );
if( pArg1 != NULL )
pSet->HB_SET_FORCEOPT = set_logical( pArg1, pSet->HB_SET_FORCEOPT );
break;
case HB_SET_STRICTREAD:
hb_retl( pSet->HB_SET_STRICTREAD );
if( args > 1 )
pSet->HB_SET_STRICTREAD = set_logical( pArg2, pSet->HB_SET_STRICTREAD );
pResult = hb_itemPutL( pResult, pSet->HB_SET_STRICTREAD );
if( pArg1 != NULL )
pSet->HB_SET_STRICTREAD = set_logical( pArg1, pSet->HB_SET_STRICTREAD );
break;
case HB_SET_HARDCOMMIT:
hb_retl( pSet->HB_SET_HARDCOMMIT );
if( args > 1 )
pSet->HB_SET_HARDCOMMIT = set_logical( pArg2, pSet->HB_SET_HARDCOMMIT );
pResult = hb_itemPutL( pResult, pSet->HB_SET_HARDCOMMIT );
if( pArg1 != NULL )
pSet->HB_SET_HARDCOMMIT = set_logical( pArg1, pSet->HB_SET_HARDCOMMIT );
break;
case HB_SET_PATH:
hb_retc( pSet->HB_SET_PATH );
if( args > 1 )
pResult = hb_itemPutC( pResult, pSet->HB_SET_PATH );
if( pArg1 != NULL )
{
pSet->HB_SET_PATH = set_string( pArg2, pSet->HB_SET_PATH );
pSet->HB_SET_PATH = set_string( pArg1, pSet->HB_SET_PATH );
hb_fsFreeSearchPath( pSet->hb_set_path );
pSet->hb_set_path = NULL;
hb_fsAddSearchPath( pSet->HB_SET_PATH, &pSet->hb_set_path );
}
break;
case HB_SET_PRINTER:
hb_retl( pSet->HB_SET_PRINTER );
if( args > 1 )
pSet->HB_SET_PRINTER = set_logical( pArg2, pSet->HB_SET_PRINTER );
pResult = hb_itemPutL( pResult, pSet->HB_SET_PRINTER );
if( pArg1 != NULL )
pSet->HB_SET_PRINTER = set_logical( pArg1, pSet->HB_SET_PRINTER );
break;
case HB_SET_PRINTFILE:
hb_retc( pSet->HB_SET_PRINTFILE );
if( pArg2 && HB_IS_STRING( pArg2 ) )
pResult = hb_itemPutC( pResult, pSet->HB_SET_PRINTFILE );
if( pArg1 && HB_IS_STRING( pArg1 ) )
{
open_handle( pSet, hb_itemGetCPtr( pArg2 ), set_logical( pArg3, HB_FALSE ), HB_SET_PRINTFILE );
open_handle( pSet, hb_itemGetCPtr( pArg1 ), set_logical( pArg2, HB_FALSE ), HB_SET_PRINTFILE );
/* With SET PRINTER TO or Set( _SET_PRINTFILE, "" ) are expected to activate the default printer [jarabal] */
if( pSet->HB_SET_PRINTFILE == NULL )
pSet->HB_SET_PRINTFILE = hb_set_PRINTFILE_default();
}
break;
case HB_SET_SCOREBOARD:
hb_retl( pSet->HB_SET_SCOREBOARD );
if( args > 1 )
pSet->HB_SET_SCOREBOARD = set_logical( pArg2, pSet->HB_SET_SCOREBOARD );
pResult = hb_itemPutL( pResult, pSet->HB_SET_SCOREBOARD );
if( pArg1 != NULL )
pSet->HB_SET_SCOREBOARD = set_logical( pArg1, pSet->HB_SET_SCOREBOARD );
break;
case HB_SET_SCROLLBREAK:
hb_retl( pSet->HB_SET_SCROLLBREAK );
if( args > 1 )
pSet->HB_SET_SCROLLBREAK = set_logical( pArg2, pSet->HB_SET_SCROLLBREAK );
pResult = hb_itemPutL( pResult, pSet->HB_SET_SCROLLBREAK );
if( pArg1 != NULL )
pSet->HB_SET_SCROLLBREAK = set_logical( pArg1, pSet->HB_SET_SCROLLBREAK );
break;
case HB_SET_SOFTSEEK:
hb_retl( pSet->HB_SET_SOFTSEEK );
if( args > 1 )
pSet->HB_SET_SOFTSEEK = set_logical( pArg2, pSet->HB_SET_SOFTSEEK );
pResult = hb_itemPutL( pResult, pSet->HB_SET_SOFTSEEK );
if( pArg1 != NULL )
pSet->HB_SET_SOFTSEEK = set_logical( pArg1, pSet->HB_SET_SOFTSEEK );
break;
case HB_SET_TYPEAHEAD:
hb_retni( pSet->HB_SET_TYPEAHEAD );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_TYPEAHEAD );
if( pArg1 != NULL )
{
/* Set the value and limit the range */
pSet->HB_SET_TYPEAHEAD = set_number( pArg2, pSet->HB_SET_TYPEAHEAD );
pSet->HB_SET_TYPEAHEAD = set_number( pArg1, pSet->HB_SET_TYPEAHEAD );
if( pSet->HB_SET_TYPEAHEAD == 0 )
/* Do nothing */;
else if( pSet->HB_SET_TYPEAHEAD < 16 )
@@ -829,63 +826,63 @@ HB_FUNC( SET )
}
break;
case HB_SET_UNIQUE:
hb_retl( pSet->HB_SET_UNIQUE );
if( args > 1 )
pSet->HB_SET_UNIQUE = set_logical( pArg2, pSet->HB_SET_UNIQUE );
pResult = hb_itemPutL( pResult, pSet->HB_SET_UNIQUE );
if( pArg1 != NULL )
pSet->HB_SET_UNIQUE = set_logical( pArg1, pSet->HB_SET_UNIQUE );
break;
case HB_SET_VIDEOMODE:
hb_retni( pSet->HB_SET_VIDEOMODE );
if( args > 1 )
pSet->HB_SET_VIDEOMODE = set_number( pArg2, pSet->HB_SET_VIDEOMODE );
pResult = hb_itemPutNI( pResult, pSet->HB_SET_VIDEOMODE );
if( pArg1 != NULL )
pSet->HB_SET_VIDEOMODE = set_number( pArg1, pSet->HB_SET_VIDEOMODE );
break;
case HB_SET_WRAP:
hb_retl( pSet->HB_SET_WRAP );
if( args > 1 )
pSet->HB_SET_WRAP = set_logical( pArg2, pSet->HB_SET_WRAP );
pResult = hb_itemPutL( pResult, pSet->HB_SET_WRAP );
if( pArg1 != NULL )
pSet->HB_SET_WRAP = set_logical( pArg1, pSet->HB_SET_WRAP );
break;
case HB_SET_LANGUAGE:
hb_retc( hb_langID() );
if( args > 1 )
pResult = hb_itemPutC( pResult, hb_langID() );
if( pArg1 != NULL )
{
if( HB_IS_STRING( pArg2 ) )
hb_langSelectID( hb_itemGetCPtr( pArg2 ) );
if( HB_IS_STRING( pArg1 ) )
hb_langSelectID( hb_itemGetCPtr( pArg1 ) );
else
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
break;
case HB_SET_CODEPAGE:
hb_retc( hb_cdpID() );
if( args > 1 )
pResult = hb_itemPutC( pResult, hb_cdpID() );
if( pArg1 != NULL )
{
if( HB_IS_STRING( pArg2 ) )
hb_cdpSelectID( hb_itemGetCPtr( pArg2 ) );
if( HB_IS_STRING( pArg1 ) )
hb_cdpSelectID( hb_itemGetCPtr( pArg1 ) );
else
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
break;
case HB_SET_IDLEREPEAT:
hb_retl( pSet->HB_SET_IDLEREPEAT );
if( args > 1 )
pSet->HB_SET_IDLEREPEAT = set_logical( pArg2, pSet->HB_SET_IDLEREPEAT );
pResult = hb_itemPutL( pResult, pSet->HB_SET_IDLEREPEAT );
if( pArg1 != NULL )
pSet->HB_SET_IDLEREPEAT = set_logical( pArg1, pSet->HB_SET_IDLEREPEAT );
break;
case HB_SET_FILECASE:
hb_retni( pSet->HB_SET_FILECASE );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_FILECASE );
if( pArg1 != NULL )
{
if( HB_IS_STRING( pArg2 ) )
if( HB_IS_STRING( pArg1 ) )
{
if( ! hb_stricmp( hb_itemGetCPtr( pArg2 ), "LOWER" ) )
if( ! hb_stricmp( hb_itemGetCPtr( pArg1 ), "LOWER" ) )
pSet->HB_SET_FILECASE = HB_SET_CASE_LOWER;
else if( ! hb_stricmp( hb_itemGetCPtr( pArg2 ), "UPPER" ) )
else if( ! hb_stricmp( hb_itemGetCPtr( pArg1 ), "UPPER" ) )
pSet->HB_SET_FILECASE = HB_SET_CASE_UPPER;
else if( ! hb_stricmp( hb_itemGetCPtr( pArg2 ), "MIXED" ) )
else if( ! hb_stricmp( hb_itemGetCPtr( pArg1 ), "MIXED" ) )
pSet->HB_SET_FILECASE = HB_SET_CASE_MIXED;
else
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
else if( HB_IS_NUMERIC( pArg2 ) )
else if( HB_IS_NUMERIC( pArg1 ) )
{
int iValue = set_number( pArg2, pSet->HB_SET_FILECASE );
int iValue = set_number( pArg1, pSet->HB_SET_FILECASE );
if( iValue == HB_SET_CASE_LOWER ||
iValue == HB_SET_CASE_UPPER ||
iValue == HB_SET_CASE_MIXED )
@@ -898,23 +895,23 @@ HB_FUNC( SET )
}
break;
case HB_SET_DIRCASE:
hb_retni( pSet->HB_SET_DIRCASE );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_DIRCASE );
if( pArg1 != NULL )
{
if( HB_IS_STRING( pArg2 ) )
if( HB_IS_STRING( pArg1 ) )
{
if( ! hb_stricmp( hb_itemGetCPtr( pArg2 ), "LOWER" ) )
if( ! hb_stricmp( hb_itemGetCPtr( pArg1 ), "LOWER" ) )
pSet->HB_SET_DIRCASE = HB_SET_CASE_LOWER;
else if( ! hb_stricmp( hb_itemGetCPtr( pArg2 ), "UPPER" ) )
else if( ! hb_stricmp( hb_itemGetCPtr( pArg1 ), "UPPER" ) )
pSet->HB_SET_DIRCASE = HB_SET_CASE_UPPER;
else if( ! hb_stricmp( hb_itemGetCPtr( pArg2 ), "MIXED" ) )
else if( ! hb_stricmp( hb_itemGetCPtr( pArg1 ), "MIXED" ) )
pSet->HB_SET_DIRCASE = HB_SET_CASE_MIXED;
else
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
else if( HB_IS_NUMERIC( pArg2 ) )
else if( HB_IS_NUMERIC( pArg1 ) )
{
int iValue = set_number( pArg2, pSet->HB_SET_DIRCASE );
int iValue = set_number( pArg1, pSet->HB_SET_DIRCASE );
if( iValue == HB_SET_CASE_LOWER ||
iValue == HB_SET_CASE_UPPER ||
iValue == HB_SET_CASE_MIXED )
@@ -931,70 +928,72 @@ HB_FUNC( SET )
char szDirSep[ 2 ];
szDirSep[ 0 ] = ( char ) pSet->HB_SET_DIRSEPARATOR;
szDirSep[ 1 ] = '\0';
hb_retc( szDirSep );
if( args > 1 )
pSet->HB_SET_DIRSEPARATOR = set_char( pArg2, ( char ) pSet->HB_SET_DIRSEPARATOR );
pResult = hb_itemPutC( pResult, szDirSep );
if( pArg1 != NULL )
pSet->HB_SET_DIRSEPARATOR = set_char( pArg1, ( char ) pSet->HB_SET_DIRSEPARATOR );
break;
}
case HB_SET_DBFLOCKSCHEME:
hb_retni( pSet->HB_SET_DBFLOCKSCHEME );
if( args > 1 )
pResult = hb_itemPutNI( pResult, pSet->HB_SET_DBFLOCKSCHEME );
if( pArg1 != NULL )
{
if( set_number( pArg2, pSet->HB_SET_DBFLOCKSCHEME ) < 0 )
if( set_number( pArg1, pSet->HB_SET_DBFLOCKSCHEME ) < 0 )
hb_errRT_BASE( EG_ARG, 2020, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
else
pSet->HB_SET_DBFLOCKSCHEME = set_number( pArg2, pSet->HB_SET_DBFLOCKSCHEME );
pSet->HB_SET_DBFLOCKSCHEME = set_number( pArg1, pSet->HB_SET_DBFLOCKSCHEME );
}
break;
case HB_SET_DEFEXTENSIONS:
hb_retl( pSet->HB_SET_DEFEXTENSIONS );
if( args > 1 )
pSet->HB_SET_DEFEXTENSIONS = set_logical( pArg2, pSet->HB_SET_DEFEXTENSIONS );
pResult = hb_itemPutL( pResult, pSet->HB_SET_DEFEXTENSIONS );
if( pArg1 != NULL )
pSet->HB_SET_DEFEXTENSIONS = set_logical( pArg1, pSet->HB_SET_DEFEXTENSIONS );
break;
case HB_SET_EOL:
hb_retc( pSet->HB_SET_EOL );
if( args > 1 )
pSet->HB_SET_EOL = set_string( pArg2, pSet->HB_SET_EOL );
pResult = hb_itemPutC( pResult, pSet->HB_SET_EOL );
if( pArg1 != NULL )
pSet->HB_SET_EOL = set_string( pArg1, pSet->HB_SET_EOL );
break;
case HB_SET_TRIMFILENAME:
hb_retl( pSet->HB_SET_TRIMFILENAME );
if( args > 1 )
pSet->HB_SET_TRIMFILENAME = set_logical( pArg2, pSet->HB_SET_TRIMFILENAME );
pResult = hb_itemPutL( pResult, pSet->HB_SET_TRIMFILENAME );
if( pArg1 != NULL )
pSet->HB_SET_TRIMFILENAME = set_logical( pArg1, pSet->HB_SET_TRIMFILENAME );
break;
case HB_SET_HBOUTLOG:
hb_retc( pSet->HB_SET_HBOUTLOG );
if( args > 1 && ( HB_IS_STRING( pArg2 ) || HB_IS_NIL( pArg2 ) ) )
pResult = hb_itemPutC( pResult, pSet->HB_SET_HBOUTLOG );
if( pArg1 != NULL && ( HB_IS_STRING( pArg1 ) || HB_IS_NIL( pArg1 ) ) )
{
if( pSet->HB_SET_HBOUTLOG )
hb_xfree( pSet->HB_SET_HBOUTLOG );
if( HB_IS_NIL( pArg2 ) )
if( HB_IS_NIL( pArg1 ) )
pSet->HB_SET_HBOUTLOG = NULL;
else
/* Limit size of SET strings to 64K, truncating if source is longer */
pSet->HB_SET_HBOUTLOG = hb_strndup( hb_itemGetCPtr( pArg2 ), USHRT_MAX );
pSet->HB_SET_HBOUTLOG = hb_strndup( hb_itemGetCPtr( pArg1 ), USHRT_MAX );
hb_xsetfilename( pSet->HB_SET_HBOUTLOG );
}
break;
case HB_SET_HBOUTLOGINFO:
hb_retc( pSet->HB_SET_HBOUTLOGINFO );
if( args > 1 )
pResult = hb_itemPutC( pResult, pSet->HB_SET_HBOUTLOGINFO );
if( pArg1 != NULL )
{
pSet->HB_SET_HBOUTLOGINFO = set_string( pArg2, pSet->HB_SET_HBOUTLOGINFO );
pSet->HB_SET_HBOUTLOGINFO = set_string( pArg1, pSet->HB_SET_HBOUTLOGINFO );
hb_xsetinfo( pSet->HB_SET_HBOUTLOGINFO );
}
break;
case HB_SET_OSCODEPAGE:
if( pSet->hb_set_oscp )
hb_retc( ( ( PHB_CODEPAGE ) pSet->hb_set_oscp )->id );
pResult = hb_itemPutC( pResult, ( ( PHB_CODEPAGE ) pSet->hb_set_oscp )->id );
else if( pResult )
hb_itemClear( pResult );
else
hb_ret();
if( args > 1 )
pResult = hb_itemNew( NULL );
if( pArg1 != NULL )
{
if( HB_IS_NIL( pArg2 ) )
if( HB_IS_NIL( pArg1 ) )
pSet->hb_set_oscp = NULL;
else if( HB_IS_STRING( pArg2 ) )
else if( HB_IS_STRING( pArg1 ) )
{
PHB_CODEPAGE cdp = hb_cdpFindExt( hb_itemGetCPtr( pArg2 ) );
PHB_CODEPAGE cdp = hb_cdpFindExt( hb_itemGetCPtr( pArg1 ) );
if( cdp )
pSet->hb_set_oscp = ( void * ) cdp;
}
@@ -1004,16 +1003,18 @@ HB_FUNC( SET )
break;
case HB_SET_DBCODEPAGE:
if( pSet->hb_set_dbcp )
hb_retc( ( ( PHB_CODEPAGE ) pSet->hb_set_dbcp )->id );
pResult = hb_itemPutC( pResult, ( ( PHB_CODEPAGE ) pSet->hb_set_dbcp )->id );
else if( pResult )
hb_itemClear( pResult );
else
hb_ret();
if( args > 1 )
pResult = hb_itemNew( NULL );
if( pArg1 != NULL )
{
if( HB_IS_NIL( pArg2 ) )
if( HB_IS_NIL( pArg1 ) )
pSet->hb_set_dbcp = NULL;
else if( HB_IS_STRING( pArg2 ) )
else if( HB_IS_STRING( pArg1 ) )
{
PHB_CODEPAGE cdp = hb_cdpFindExt( hb_itemGetCPtr( pArg2 ) );
PHB_CODEPAGE cdp = hb_cdpFindExt( hb_itemGetCPtr( pArg1 ) );
if( cdp )
pSet->hb_set_dbcp = ( void * ) cdp;
}
@@ -1035,8 +1036,18 @@ HB_FUNC( SET )
break;
#endif
}
if( args > 1 )
if( pArg1 != NULL )
hb_setListenerNotify( set_specifier, HB_SET_LISTENER_AFTER );
return pResult;
}
HB_FUNC( SET )
{
HB_STACK_TLS_PRELOAD
hb_setGetItem( ( HB_set_enum ) hb_parnidef( 1, HB_SET_INVALID_ ),
hb_stackReturnItem(),
hb_param( 2, HB_IT_ANY ), hb_param( 3, HB_IT_ANY ) );
}
void hb_setInitialize( PHB_SET_STRUCT pSet )