diff --git a/xflaim/src/fdbcnfig.cpp b/xflaim/src/fdbcnfig.cpp index 9a31770..f81e164 100644 --- a/xflaim/src/fdbcnfig.cpp +++ b/xflaim/src/fdbcnfig.cpp @@ -1161,9 +1161,9 @@ RCODE FLMAPI F_Db::getDiskSpaceUsage( // Open the file and get its size. - if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->openBlockFile( + if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->openFile( szTmpName, FLM_IO_RDWR | FLM_IO_SH_DENYNONE | FLM_IO_DIRECT, - 512, &pFileHdl))) + &pFileHdl))) { if (rc == NE_FLM_IO_PATH_NOT_FOUND || rc == NE_FLM_IO_INVALID_FILENAME) diff --git a/xflaim/src/frestore.cpp b/xflaim/src/frestore.cpp index 72c330f..d1b702b 100644 --- a/xflaim/src/frestore.cpp +++ b/xflaim/src/frestore.cpp @@ -161,8 +161,8 @@ RCODE F_FSRestore::openRflFile( // Open the file. - if( RC_BAD( rc = gv_XFlmSysData.pFileSystem->openBlockFile( szRflPath, - FLM_IO_RDWR | FLM_IO_SH_DENYNONE | FLM_IO_DIRECT, 512, &m_pFileHdl))) + if( RC_BAD( rc = gv_XFlmSysData.pFileSystem->openFile( szRflPath, + FLM_IO_RDWR | FLM_IO_SH_DENYNONE | FLM_IO_DIRECT, &m_pFileHdl))) { goto Exit; } diff --git a/xflaim/src/fsuperfl.cpp b/xflaim/src/fsuperfl.cpp index 73233db..4d30481 100644 --- a/xflaim/src/fsuperfl.cpp +++ b/xflaim/src/fsuperfl.cpp @@ -26,9 +26,6 @@ #include "flaimsys.h" -FSTATIC char base24ToDigit( - FLMUINT uiBaseValue); - /**************************************************************************** Desc: ****************************************************************************/ @@ -179,8 +176,6 @@ RCODE F_SuperFileHdl::createFile( goto Exit; } - pFileHdl->setBlockSize( m_uiBlockSize); - Exit: if( pFileHdl) @@ -845,8 +840,6 @@ RCODE F_SuperFileHdl::getFileHdl( { goto Exit; } - - pFileHdl->setBlockSize( m_uiBlockSize); } pCkoFileHdl->pFileHdl = pFileHdl; @@ -951,53 +944,8 @@ void bldSuperFileExtension( } *pszFileExtension++ = '.'; - *pszFileExtension++ = (char)(base24ToDigit( (uiFileNum & 511) / 24)); - *pszFileExtension++ = (char)(base24ToDigit( (uiFileNum & 511) % 24)); + *pszFileExtension++ = (char)(f_getBase24DigitChar( (uiFileNum & 511) / 24)); + *pszFileExtension++ = (char)(f_getBase24DigitChar( (uiFileNum & 511) % 24)); *pszFileExtension++ = ucLetter; *pszFileExtension = 0; } - -/**************************************************************************** -Desc: Turn a base 24 value into a native alphanumeric value. -Notes: This is a base 24 alphanumeric value where - {a, b, c, d, e, f, i, l, o, r, u, v } values are removed. -****************************************************************************/ -FSTATIC char base24ToDigit( - FLMUINT uiValue) -{ - flmAssert( uiValue <= 23); - - if( uiValue <= 9) - { - uiValue += (FLMUINT) NATIVE_ZERO; - } - else - { - uiValue = f_toascii(uiValue) - 10 + (FLMUINT)f_toascii('g'); - if( uiValue >= (FLMUINT)'i') - { - uiValue++; - if( uiValue >= (FLMUINT)'l') - { - uiValue++; - if( uiValue >= (FLMUINT)'o') - { - uiValue++; - if( uiValue >= (FLMUINT)'r') - { - uiValue++; - if( uiValue >= (FLMUINT)'u') - { - uiValue++; - if( uiValue >= (FLMUINT)'v') - { - uiValue++; - } - } - } - } - } - } - } - return (char)uiValue; -} diff --git a/xflaim/src/fsysdata.cpp b/xflaim/src/fsysdata.cpp index 797991c..d5b128b 100644 --- a/xflaim/src/fsysdata.cpp +++ b/xflaim/src/fsysdata.cpp @@ -29,7 +29,6 @@ #include "flaimsys.h" -#define HIGH_FLMUINT (~((FLMUINT)0)) #define FLM_MIN_FREE_BYTES (2 * 1024 * 1024) #ifdef FLM_32BIT @@ -188,9 +187,9 @@ FSTATIC RCODE flmGetCacheBytes( goto Exit; } - if( ui64TotalPhysMem > HIGH_FLMUINT) + if( ui64TotalPhysMem > FLM_MAX_UINT) { - ui64TotalPhysMem = HIGH_FLMUINT; + ui64TotalPhysMem = FLM_MAX_UINT; } if( ui64AvailPhysMem > ui64TotalPhysMem) @@ -207,9 +206,9 @@ FSTATIC RCODE flmGetCacheBytes( if (bCalcOnAvailMem) { - if (uiMem > HIGH_FLMUINT - uiBytesCurrentlyInUse) + if (uiMem > FLM_MAX_UINT - uiBytesCurrentlyInUse) { - uiMem = HIGH_FLMUINT; + uiMem = FLM_MAX_UINT; } else { @@ -237,7 +236,7 @@ FSTATIC RCODE flmGetCacheBytes( // Calculate memory as a percentage of memory. - uiMem = (FLMUINT)((uiMem > HIGH_FLMUINT / 100) + uiMem = (FLMUINT)((uiMem > FLM_MAX_UINT / 100) ? (FLMUINT)(uiMem / 100) * uiPercent : (FLMUINT)(uiMem * uiPercent) / 100); diff --git a/xflaim/src/ncache.cpp b/xflaim/src/ncache.cpp index 9b4e21e..84cc5b5 100644 --- a/xflaim/src/ncache.cpp +++ b/xflaim/src/ncache.cpp @@ -290,9 +290,9 @@ RCODE F_NodeCacheMgr::initCache( void) goto Exit; } - if (RC_BAD( rc = m_pNodeAllocator->setup( &m_nodeRelocator, - gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, - sizeof( F_CachedNode), &m_Usage.slabUsage))) + if (RC_BAD( rc = m_pNodeAllocator->setup( + gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, &m_nodeRelocator, + sizeof( F_CachedNode), &m_Usage.slabUsage, NULL))) { goto Exit; } @@ -305,7 +305,8 @@ RCODE F_NodeCacheMgr::initCache( void) } if (RC_BAD( rc = m_pBufAllocator->setup( - gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, &m_Usage.slabUsage))) + gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, + NULL, &m_Usage.slabUsage, NULL))) { goto Exit; } @@ -317,9 +318,9 @@ RCODE F_NodeCacheMgr::initCache( void) goto Exit; } - if( RC_BAD( rc = m_pAttrItemAllocator->setup( &m_attrItemRelocator, - gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, - sizeof( F_AttrItem), &m_Usage.slabUsage))) + if( RC_BAD( rc = m_pAttrItemAllocator->setup( + gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, &m_attrItemRelocator, + sizeof( F_AttrItem), &m_Usage.slabUsage, NULL))) { goto Exit; } diff --git a/xflaim/src/rfl.cpp b/xflaim/src/rfl.cpp index e6e3c5b..46b66ac 100644 --- a/xflaim/src/rfl.cpp +++ b/xflaim/src/rfl.cpp @@ -998,9 +998,9 @@ RCODE F_Rfl::openFile( // Open the file. - if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->openBlockFile( szRflFileName, + if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->openFile( szRflFileName, FLM_IO_RDWR | FLM_IO_SH_DENYNONE | FLM_IO_DIRECT, - 512, &m_pFileHdl))) + &m_pFileHdl))) { goto Exit; } @@ -1124,9 +1124,9 @@ RCODE F_Rfl::createFile( // Create the file - if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->createBlockFile( szRflFileName, - FLM_IO_RDWR | FLM_IO_EXCL | FLM_IO_SH_DENYNONE | FLM_IO_DIRECT, - 512, &m_pFileHdl))) + if (RC_BAD( rc = gv_XFlmSysData.pFileSystem->createFile( szRflFileName, + FLM_IO_RDWR | FLM_IO_EXCL | FLM_IO_SH_DENYNONE | FLM_IO_DIRECT, + &m_pFileHdl))) { goto Exit; } diff --git a/xflaim/src/scache.cpp b/xflaim/src/scache.cpp index 144d330..fbab714 100644 --- a/xflaim/src/scache.cpp +++ b/xflaim/src/scache.cpp @@ -6076,8 +6076,8 @@ RCODE F_BlockCacheMgr::initCache( void) } if (RC_BAD( rc = m_pBlockAllocator->setup( - gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, uiBlockSizes, - &m_Usage.slabUsage))) + gv_XFlmSysData.pGlobalCacheMgr->m_pSlabManager, NULL, uiBlockSizes, + &m_Usage.slabUsage, NULL))) { goto Exit; } diff --git a/xflaim/util/checkdb.cpp b/xflaim/util/checkdb.cpp index 81c5f87..f2cb4b1 100644 --- a/xflaim/util/checkdb.cpp +++ b/xflaim/util/checkdb.cpp @@ -194,11 +194,6 @@ FSTATIC FLMBOOL NumToName( FLMUINT uiType, char * pszBuf); -#ifdef FLM_NLM -FLMBOOL gv_bSynchronized = FALSE; -FSTATIC void chkCleanup( void); -#endif - FLMBOOL gv_bShutdown = FALSE; static IF_FileHdl * gv_pLogFile = NULL; static IF_DbInfo * gv_pDbInfo = NULL; @@ -257,20 +252,19 @@ extern "C" int main( if( RC_BAD( FlmAllocDbSystem( &gv_pDbSystem))) { - WpsStrOut( "\nCould not initialize FLAIM.\n"); + f_conStrOut( "\nCould not initialize FLAIM.\n"); goto Exit; } - WpsInit( 0xFFFF, 0xFFFF, "FLAIM Database Check"); - WpsOptimize(); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsDrawBorder(); - WpsScrClr( 0, 0); - WpsScrSize( NULL, &gv_uiMaxRow); + f_conInit( 0xFFFF, 0xFFFF, "FLAIM Database Check"); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conDrawBorder(); + f_conClearScreen( 0, 0); + f_conGetScreenSize( NULL, &gv_uiMaxRow); if (RC_BAD( logPool.poolAlloc( MAX_LOG_BUFF, (void **)&gv_pszLogBuffer))) { - WpsStrOut( "\nFailed to allocatae memory pool\n"); + f_conStrOut( "\nFailed to allocatae memory pool\n"); goto Exit; } @@ -286,25 +280,27 @@ extern "C" int main( if( (gv_bPauseBeforeExiting) && (!gv_bShutdown)) { - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrBackFor( FLM_RED, FLM_WHITE); + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_RED, FLM_WHITE); if( gv_szLastError[ 0] != '\0') { - WpsStrOut( gv_szLastError); + f_conStrOut( gv_szLastError); } - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); - WpsStrOut( "Press any character to exit CHECKDB: "); + + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conStrOut( "Press any character to exit CHECKDB: "); + for (;;) { if( gv_bShutdown) { break; } - if (WpkTestKB()) + if( f_conHaveKey()) { - (void)WpkIncar(); + f_conGetKey(); break; } } @@ -319,7 +315,7 @@ Exit: logPool.poolFree(); - WpsExit(); + f_conExit(); if( gv_pDbSystem) { @@ -369,7 +365,7 @@ FSTATIC FLMBOOL CheckDatabase( void) gv_ui64BytesDone = 0; gv_ui64FileSize = 0; gv_uiOldViewCount = 0; - WpsScrBackFor( FLM_BLUE, FLM_WHITE); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); if (gv_bLoggingEnabled) { @@ -634,8 +630,8 @@ FSTATIC FLMBOOL DoCheck( void) goto Exit; } - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, 0); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, 0); gv_bContinue = TRUE; gv_uiLineCount = 0; gv_bLoggingEnabled = FALSE; @@ -662,7 +658,7 @@ FSTATIC FLMBOOL DoCheck( void) } } - WpsCursorSetType( FLM_CURSOR_INVISIBLE); + f_conSetCursorType( FLM_CURSOR_INVISIBLE); for( ;;) { // Check the database... @@ -677,7 +673,7 @@ FSTATIC FLMBOOL DoCheck( void) break; } } - WpsCursorSetType( FLM_CURSOR_UNDERLINE); + f_conSetCursorType( FLM_CURSOR_UNDERLINE); if( gv_bLoggingEnabled) { @@ -703,61 +699,57 @@ FSTATIC void CheckShowHelp( FLMBOOL bShowFullUsage ) { - WpsStrOut( "\n"); + f_conStrOut( "\n"); if (bShowFullUsage) { - WpsStrOut( "Usage: checkdb [Options]\n"); + f_conStrOut( "Usage: checkdb [Options]\n"); } else { - WpsStrOut( "Parameters: [Options]\n\n"); + f_conStrOut( "Parameters: [Options]\n\n"); } - WpsStrOut( + f_conStrOut( " FileName = Name of database to check.\n"); - WpsStrOut( + f_conStrOut( " Options\n"); - WpsStrOut( + f_conStrOut( " -b = Run in Batch Mode.\n"); - WpsStrOut( + f_conStrOut( " -c = Repair logical corruptions.\n"); - WpsStrOut( + f_conStrOut( " -d = Display/log detailed statistics.\n"); - WpsStrOut( + f_conStrOut( " -dr = RFL directory.\n"); - WpsStrOut( + f_conStrOut( " -dd = Data directory.\n"); - WpsStrOut( + f_conStrOut( " -i = Perform a logical (index) check.\n"); - WpsStrOut( + f_conStrOut( " -l = Log detailed information to .\n"); - WpsStrOut( + f_conStrOut( " -m = Multiple passes (continuous check).\n"); - WpsStrOut( + f_conStrOut( " -o = Output binary log information to .\n"); - WpsStrOut( + f_conStrOut( " -p = Pause before exiting.\n"); - WpsStrOut( + f_conStrOut( " -s = Skip DOM link verification.\n"); - WpsStrOut( + f_conStrOut( " -t = Temporary directory.\n"); - WpsStrOut( + f_conStrOut( " -u = Run check in an update transaction.\n"); - WpsStrOut( + f_conStrOut( " -v = Verify binary log information in . NOTE:\n"); - WpsStrOut( + f_conStrOut( " The -v and -o options cannot both be specified.\n"); - WpsStrOut( + f_conStrOut( " -a = Database password.\n"); -#ifdef FLM_NLM - WpsStrOut( -" -w = Wait to end to synchronize\n"); -#endif - WpsStrOut( + f_conStrOut( " -? = A '?' anywhere in the command line will cause this\n"); - WpsStrOut( + f_conStrOut( " screen to be displayed.\n"); - WpsStrOut( + f_conStrOut( "Options may be specified anywhere in the command line.\n"); } @@ -775,9 +767,6 @@ FSTATIC FLMBOOL GetParams( char * pszTmp; char * ppszArgs[ MAX_ARGS]; char szCommandBuffer[ 300]; -#ifdef FLM_NLM - FLMBOOL bWaitToSync = FALSE; -#endif gv_szDbFileName [0] = '\0'; gv_szDataDir [0] = '\0'; @@ -796,10 +785,9 @@ FSTATIC FLMBOOL GetParams( { for( ;;) { - WpsStrOut( "CheckDB Params (enter ? for help): "); + f_conStrOut( "CheckDB Params (enter ? for help): "); szCommandBuffer[ 0] = '\0'; - WpsLineEd( szCommandBuffer, sizeof( szCommandBuffer) - 1, - &gv_bShutdown); + f_conLineEdit( szCommandBuffer, sizeof( szCommandBuffer) - 1); if( gv_bShutdown) { return( FALSE); @@ -923,22 +911,9 @@ FSTATIC FLMBOOL GetParams( { gv_bStartUpdate = TRUE; } -#ifdef FLM_NLM - else if (f_stricmp( pszTmp, "W") == 0) - { - bWaitToSync = TRUE; - } -#endif else if (f_stricmp( pszTmp, "?") == 0 || f_stricmp( pszTmp, "HELP") == 0) { -#ifdef FLM_NLM - if (!gv_bSynchronized) - { -// SynchronizeStart(); - gv_bSynchronized = TRUE; - } -#endif CheckShowHelp( TRUE); gv_bPauseBeforeExiting = TRUE; return( FALSE); @@ -955,13 +930,6 @@ FSTATIC FLMBOOL GetParams( else if( f_stricmp( pszTmp, "?") == 0) { Show_Help: -#ifdef FLM_NLM - if (!gv_bSynchronized) - { -// SynchronizeStart(); - gv_bSynchronized = TRUE; - } -#endif CheckShowHelp( TRUE); gv_bPauseBeforeExiting = TRUE; return( FALSE); @@ -972,13 +940,6 @@ Show_Help: } uiLoop++; } -#ifdef FLM_NLM - if (!bWaitToSync && !gv_bSynchronized) - { -// SynchronizeStart(); - gv_bSynchronized = TRUE; - } -#endif if( !gv_szDbFileName[ 0]) { @@ -1062,11 +1023,11 @@ FSTATIC void OutLine( { if( gv_uiLineCount == 20) { - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 1)); - WpsScrBackFor( FLM_RED, FLM_WHITE); - WpsStrOut( + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conSetBackFore( FLM_RED, FLM_WHITE); + f_conStrOut( "Press: ESC to quit, anything else to continue"); for( ;;) { @@ -1075,9 +1036,9 @@ FSTATIC void OutLine( uiChar = FKB_ESCAPE; break; } - else if( WpkTestKB()) + else if( f_conHaveKey()) { - uiChar = WpkIncar(); + uiChar = f_conGetKey(); break; } } @@ -1088,8 +1049,8 @@ FSTATIC void OutLine( } else { - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, 0); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, 0); } gv_uiLineCount = 0; @@ -1098,7 +1059,7 @@ FSTATIC void OutLine( if( gv_bContinue) { - WpsStrOutXY( pszBuf, 0, gv_uiLineCount); + f_conStrOutXY( pszBuf, 0, gv_uiLineCount); gv_uiLineCount++; } } @@ -1354,8 +1315,8 @@ FSTATIC void PrintInfo( FLMUINT uiNumErrors; const XFLM_DB_HDR * pDbHdr = pDbInfo->getDbHdr(); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, 0); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, 0); OutUINT( "Default Language", (FLMUINT)pDbHdr->ui8DefaultLanguage); @@ -1427,13 +1388,13 @@ FSTATIC FLMUINT CheckShowError( } else { - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrBackFor( FLM_RED, FLM_WHITE); - WpsStrOut( pszMessage); - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); - WpsStrOut( "Press ENTER to continue, ESC to quit"); + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_RED, FLM_WHITE); + f_conStrOut( pszMessage); + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conStrOut( "Press ENTER to continue, ESC to quit"); for( ;;) { if( gv_bShutdown) @@ -1441,9 +1402,9 @@ FSTATIC FLMUINT CheckShowError( uiResKey = FKB_ESCAPE; break; } - else if( WpkTestKB()) + else if( f_conHaveKey()) { - uiResKey = WpkIncar(); + uiResKey = f_conGetKey(); if( (uiResKey == FKB_ENTER) || (uiResKey == FKB_ESCAPE)) { break; @@ -1451,8 +1412,8 @@ FSTATIC FLMUINT CheckShowError( } } - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 2)); } return( uiResKey); @@ -1472,12 +1433,12 @@ FSTATIC void OutLabel( char szTmpBuf[ 100]; FLMUINT uiLoop; - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsStrOutXY( pszLabel, uiCol, uiRow); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conStrOutXY( pszLabel, uiCol, uiRow); - for( uiLoop = WpsCurrCol(); uiLoop < VALUE_COLUMN - 1; uiLoop++) + for( uiLoop = f_conGetCursorColumn(); uiLoop < VALUE_COLUMN - 1; uiLoop++) { - WpsStrOut( "."); + f_conStrOut( "."); } @@ -1514,9 +1475,9 @@ FSTATIC void DisplayValue( FLMUINT uiRow, const char * pszValue) { - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsStrOutXY( pszValue, VALUE_COLUMN, uiRow); - WpsLineClr( 255, 255); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conStrOutXY( pszValue, VALUE_COLUMN, uiRow); + f_conClearLine( 255, 255); } /******************************************************************** @@ -1542,12 +1503,12 @@ FSTATIC RCODE GetUserInput( { FLMUINT uiChar; - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 1)); - WpsScrBackFor( FLM_RED, FLM_WHITE); + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conSetBackFore( FLM_RED, FLM_WHITE); - WpsStrOut( "Q,ESC=Quit, Other=Continue"); + f_conStrOut( "Q,ESC=Quit, Other=Continue"); for( ;;) { if( gv_bShutdown) @@ -1555,15 +1516,15 @@ FSTATIC RCODE GetUserInput( uiChar = FKB_ESCAPE; break; } - else if( WpkTestKB()) + else if( f_conHaveKey()) { - uiChar = WpkIncar(); + uiChar = f_conGetKey(); break; } } - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 1)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 1)); switch( uiChar) { @@ -1693,19 +1654,19 @@ RCODE F_LocalCheckStatus::reportProgress( } szWhat[ 45] = '\0'; - WpsScrBackFor( FLM_BLUE, FLM_WHITE); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); DisplayValue( DOING_ROW, szWhat); } - else if( (WpkTestKB()) && (WpkIncar() == FKB_ESCAPE)) + else if( f_conHaveKey() && (f_conGetKey() == FKB_ESCAPE)) { - WpsScrBackFor( FLM_BLUE, FLM_WHITE); - WpsScrPos( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrBackFor( FLM_RED, FLM_WHITE); - WpsStrOut( "ESCAPE key pressed.\n"); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); + f_conSetCursorPos( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_RED, FLM_WHITE); + f_conStrOut( "ESCAPE key pressed.\n"); rc = GetUserInput(); - WpsScrClr( 0, (FLMUINT)(gv_uiMaxRow - 2)); - WpsScrBackFor( FLM_BLUE, FLM_WHITE); + f_conClearScreen( 0, (FLMUINT)(gv_uiMaxRow - 2)); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); goto Exit; } @@ -1732,7 +1693,7 @@ RCODE F_LocalCheckStatus::reportCheckErr( LogCorruptError( pCorruptInfo); } - WpsScrBackFor( FLM_BLUE, FLM_WHITE); + f_conSetBackFore( FLM_BLUE, FLM_WHITE); if( pCorruptInfo->iErrCode == FLM_OLD_VIEW) { gv_uiOldViewCount++; @@ -2148,17 +2109,3 @@ FSTATIC FLMBOOL NumToName( return( FALSE); } - -#ifdef FLM_NLM -/**************************************************************************** -Desc: This routine shuts down all threads in the NLM. -****************************************************************************/ -FSTATIC void chkCleanup( void) -{ - gv_bShutdown = TRUE; - while( gv_bRunning) - { - f_yieldCPU(); - } -} -#endif diff --git a/xflaim/util/domedit.cpp b/xflaim/util/domedit.cpp index d207684..dfcce85 100644 --- a/xflaim/util/domedit.cpp +++ b/xflaim/util/domedit.cpp @@ -199,7 +199,7 @@ void UIMain( void * pData) "DOMEdit for XFLAIM [DB=%s/BUILD=%s]", XFLM_CURRENT_VER_STR, __DATE__); - if( RC_BAD( FTXInit( szTitle, 80, 50, WPS_BLUE, WPS_WHITE, NULL, NULL))) + if( RC_BAD( FTXInit( szTitle, 80, 50, FLM_BLUE, FLM_WHITE, NULL, NULL))) { iResCode = 1; goto Exit; @@ -220,7 +220,7 @@ void UIMain( void * pData) goto Exit; } - if( FTXWinPaintBackground( pTitleWin, WPS_RED) != FTXRC_SUCCESS) + if( FTXWinPaintBackground( pTitleWin, FLM_RED) != FTXRC_SUCCESS) { iResCode = 1; goto Exit; @@ -232,7 +232,7 @@ void UIMain( void * pData) goto Exit; } - FTXWinSetCursorType( pTitleWin, WPS_CURSOR_INVISIBLE); + FTXWinSetCursorType( pTitleWin, FLM_CURSOR_INVISIBLE); if( FTXWinOpen( pTitleWin) != FTXRC_SUCCESS) { @@ -254,7 +254,7 @@ void UIMain( void * pData) if( RC_BAD( rc = domEditVerifyRun())) { - FTXDisplayMessage( pScreen, WPS_RED, WPS_WHITE, + FTXDisplayMessage( pScreen, FLM_RED, FLM_WHITE, "This Utility Has Expired", "NE_XFLM_ILLEGAL_OP", &uiDummy); f_sleep( 5000); @@ -275,7 +275,7 @@ void UIMain( void * pData) char szErr [20]; f_sprintf( szErr, "Error=0x%04X", (unsigned)rc); - FTXDisplayMessage( pScreen, WPS_RED, WPS_WHITE, + FTXDisplayMessage( pScreen, FLM_RED, FLM_WHITE, "Unable to open the database", szErr, &uiDummy); iResCode = 1; goto Exit; @@ -289,7 +289,7 @@ void UIMain( void * pData) char szErr [20]; f_sprintf( szErr, "Error=0x%04X", (unsigned)rc); - FTXDisplayMessage( pScreen, WPS_RED, WPS_WHITE, + FTXDisplayMessage( pScreen, FLM_RED, FLM_WHITE, "Unable to open the database", szErr, &uiDummy); iResCode = 1; goto Exit; diff --git a/xflaim/util/rebuild.cpp b/xflaim/util/rebuild.cpp index 1305863..132792f 100644 --- a/xflaim/util/rebuild.cpp +++ b/xflaim/util/rebuild.cpp @@ -28,8 +28,6 @@ #define UTIL_ID "REBUILD" -/* Columns/Rows where things go on the screen. */ - #define LABEL_COLUMN 5 #define VALUE_COLUMN 35 @@ -48,7 +46,7 @@ #define DICT_RECOV_ROW (RECOV_ROW + 1) #define DISCARD_ROW (DICT_RECOV_ROW + 1) -#define MAX_LOG_BUFF 2048 +#define MAX_LOG_BUFF 2048 // Local class definitions class F_LocalRebuildStatus : public IF_DbRebuildStatus @@ -175,12 +173,11 @@ extern "C" int main( goto Exit; } - WpsInit( 0xFFFF, 0xFFFF, "XFLAIM Database Rebuild"); - WpsOptimize(); + f_conInit( 0xFFFF, 0xFFFF, "XFLAIM Database Rebuild"); if (RC_BAD( logPool.poolAlloc( MAX_LOG_BUFF, (void **)&gv_pszLogBuffer))) { - WpsStrOut( + f_conStrOut( "\nCould not allocate log buffer\n"); goto Exit; } @@ -196,16 +193,16 @@ Exit: if (gv_bPauseBeforeExiting && !gv_bShutdown) { - WpsStrOut( "\nPress any character to exit REBUILD: "); + f_conStrOut( "\nPress any character to exit REBUILD: "); for (;;) { if (gv_bShutdown) { break; } - if (WpkTestKB()) + if (f_conHaveKey()) { - (void)WpkIncar(); + f_conGetKey(); break; } @@ -215,7 +212,7 @@ Exit: logPool.poolFree(); - WpsExit(); + f_conExit(); if( gv_pDbSystem) { @@ -250,8 +247,8 @@ FSTATIC FLMBOOL bldDoRebuild( void) gv_ui64TotalNodes = 0; gv_ui64NodesRecovered = 0; - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsScrClr( 0, 0); + f_conSetBackFore( FLM_BLACK, FLM_LIGHTGRAY); + f_conClearScreen( 0, 0); gv_bLoggingEnabled = FALSE; gv_uiLogBufferCount = 0; @@ -286,7 +283,7 @@ FSTATIC FLMBOOL bldDoRebuild( void) goto Exit; } - WpsScrBackFor( FLM_BLACK, FLM_WHITE); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); if( gv_bLoggingEnabled) { bldLogString( NULL); @@ -296,8 +293,8 @@ FSTATIC FLMBOOL bldDoRebuild( void) "=========================================================================="); bldLogString( "REBUILD PARAMETERS:"); } - WpsScrClr( 0, PARAM_ROW); - WpsStrOutXY( "REBUILD PARAMETERS:", LABEL_COLUMN, PARAM_ROW); + f_conClearScreen( 0, PARAM_ROW); + f_conStrOutXY( "REBUILD PARAMETERS:", LABEL_COLUMN, PARAM_ROW); bldOutLabel( LABEL_COLUMN + 2, SOURCE_ROW, "Source DB", gv_szSrcFileName, 0, TRUE); bldOutLabel( LABEL_COLUMN + 2, SOURCE_DATA_DIR_ROW, @@ -456,52 +453,48 @@ FSTATIC void bldShowHelp( void ) { - WpsStrOut( "\n"); - WpsStrOut( + f_conStrOut( "\n"); + f_conStrOut( "Parameters: [Options]\n\n"); - WpsStrOut( + f_conStrOut( "SourceName = Name of database which is to be recovered.\n"); - WpsStrOut( + f_conStrOut( "DestName = Name of destination database to recover data to. Recovered\n"); - WpsStrOut( + f_conStrOut( " records are put in this database.\n"); - WpsStrOut( + f_conStrOut( "Options = (may be specified anywhere on command line): \n"); - WpsStrOut( + f_conStrOut( " -c = Cache (kilobytes) to use.\n"); - WpsStrOut( + f_conStrOut( " -sd = Data directory for source DB.\n"); - WpsStrOut( + f_conStrOut( " -dc = Dictionary file to use to create destination DB.\n"); - WpsStrOut( + f_conStrOut( " -dd = Data directory for destination DB.\n"); - WpsStrOut( + f_conStrOut( " -dr = RFL directory for destination DB.\n"); - WpsStrOut( + f_conStrOut( " -l = Log detailed information to .\n"); - WpsStrOut( + f_conStrOut( " -w = Specifies a Security Password to be used.\n"); - WpsStrOut( + f_conStrOut( " -b = Run in Batch Mode.\n"); - WpsStrOut( + f_conStrOut( " -h = Fix file header information. HdrInfo is in the format\n"); - WpsStrOut( + f_conStrOut( " BlkSiz:MinRfl:MaxRfl:Lang:FlmVer\n"); - WpsStrOut( + f_conStrOut( " -q = Output binary log information to .\n"); - WpsStrOut( + f_conStrOut( " -v = Verify binary log information in . NOTE: The\n"); - WpsStrOut( + f_conStrOut( " -v and -q options cannot both be specified.\n"); - WpsStrOut( + f_conStrOut( " -p = Pause before exiting.\n"); -#ifdef FLM_NLM - WpsStrOut( -" -w = Wait to end to synchronize\n"); -#endif - WpsStrOut( + f_conStrOut( " -? = A '?' anywhere in the command line will cause this help\n"); - WpsStrOut( + f_conStrOut( " screen to be displayed, with or without the leading '-'.\n"); } @@ -545,10 +538,9 @@ FSTATIC FLMBOOL bldGetParams( { for (;;) { - WpsStrOut( "\nRebuild Params (enter ? for help): "); + f_conStrOut( "\nRebuild Params (enter ? for help): "); szCommandBuffer[ 0] = 0; - WpsLineEd( szCommandBuffer, sizeof( szCommandBuffer) - 1, - &gv_bShutdown); + f_conLineEdit( szCommandBuffer, sizeof( szCommandBuffer) - 1); if( gv_bShutdown) { return( FALSE); @@ -884,9 +876,9 @@ FSTATIC void bldOutLabel( f_memset( szMsg, '.', uiLen); szMsg[ uiLen] = 0; - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsStrOutXY( szMsg, uiCol, uiRow); - WpsStrOutXY( pszLabel, uiCol, uiRow); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conStrOutXY( szMsg, uiCol, uiRow); + f_conStrOutXY( pszLabel, uiCol, uiRow); if( pszValue != NULL) { @@ -921,8 +913,8 @@ FSTATIC void bldOutValue( FLMUINT uiRow, const char * pszValue) { - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsStrOutXY( pszValue, VALUE_COLUMN, uiRow); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conStrOutXY( pszValue, VALUE_COLUMN, uiRow); } /******************************************************************** @@ -949,7 +941,7 @@ FSTATIC RCODE bldGetUserInput( { FLMUINT uiChar; - WpsStrOutXY( "Q,ESC=Quit, Other=Continue: ", 0, 23); + f_conStrOutXY( "Q,ESC=Quit, Other=Continue: ", 0, 23); for (;;) { if( gv_bShutdown) @@ -957,9 +949,9 @@ FSTATIC RCODE bldGetUserInput( uiChar = FKB_ESCAPE; break; } - else if( WpkTestKB()) + else if( f_conHaveKey()) { - uiChar = WpkIncar(); + uiChar = f_conGetKey(); if( uiChar) { break; @@ -969,8 +961,8 @@ FSTATIC RCODE bldGetUserInput( f_yieldCPU(); } - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsScrClr( 0, 22); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conClearScreen( 0, 22); switch( uiChar) { case 'q': @@ -1128,12 +1120,12 @@ RCODE F_LocalRebuildStatus::reportRebuild( } // See if they pressed an ESC character - if ((WpkTestKB()) && (WpkIncar() == FKB_ESCAPE)) + if ((f_conHaveKey()) && (f_conGetKey() == FKB_ESCAPE)) { - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsScrClr( 0, 22); - WpsScrBackFor (FLM_RED, FLM_WHITE); - WpsStrOutXY( "ESCAPE key pressed", 0, 22); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conClearScreen( 0, 22); + f_conSetBackFore (FLM_RED, FLM_WHITE); + f_conStrOutXY( "ESCAPE key pressed", 0, 22); rc = bldGetUserInput(); goto Exit; } @@ -1154,12 +1146,12 @@ RCODE F_LocalRebuildStatus::reportRebuildErr( // See if they pressed an ESC character - if ((WpkTestKB()) && (WpkIncar() == FKB_ESCAPE)) + if ((f_conHaveKey()) && (f_conGetKey() == FKB_ESCAPE)) { - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsScrClr( 0, 22); - WpsScrBackFor (FLM_RED, FLM_WHITE); - WpsStrOutXY( "ESCAPE key pressed", 0, 22); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conClearScreen( 0, 22); + f_conSetBackFore (FLM_RED, FLM_WHITE); + f_conStrOutXY( "ESCAPE key pressed", 0, 22); rc = bldGetUserInput(); goto Exit; } @@ -1180,27 +1172,33 @@ FSTATIC void bldShowError( if( !gv_bBatchMode) { - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsScrClr( 0, 22); - WpsScrBackFor (FLM_RED, FLM_WHITE); - WpsStrOutXY( pszMessage, 0, 22); - WpsStrOutXY( "Press any character to continue, ESCAPE to quit: ", 0, 23); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conClearScreen( 0, 22); + f_conSetBackFore (FLM_RED, FLM_WHITE); + f_conStrOutXY( pszMessage, 0, 22); + f_conStrOutXY( "Press any character to continue, ESCAPE to quit: ", 0, 23); for (;;) { if (gv_bShutdown) - break; - else if (WpkTestKB()) { - if (WpkIncar() == FKB_ESCAPE) + break; + } + + else if (f_conHaveKey()) + { + if (f_conGetKey() == FKB_ESCAPE) + { gv_bShutdown = TRUE; + } + break; } f_yieldCPU(); } - WpsScrBackFor (FLM_BLACK, FLM_LIGHTGRAY); - WpsScrClr( 0, 22); + f_conSetBackFore (FLM_BLACK, FLM_LIGHTGRAY); + f_conClearScreen( 0, 22); } } diff --git a/xflaim/util/sharutil.cpp b/xflaim/util/sharutil.cpp index c803367..f4e0bb8 100644 --- a/xflaim/util/sharutil.cpp +++ b/xflaim/util/sharutil.cpp @@ -26,31 +26,6 @@ #include "flaimsys.h" #include "sharutil.h" -FSTATIC FTX_WINDOW * wpsGetThrdWin( void); - -FINLINE void wpsLock( - F_MUTEX * phMutex) -{ - f_mutexLock( *phMutex); -} - -FINLINE void wpsUnlock( - F_MUTEX * phMutex) -{ - f_mutexUnlock( *phMutex); -} - -static FLMBOOL gv_bShutdown = FALSE; -static FLMBOOL gv_bInitialized = FALSE; -static FLMBOOL gv_bOptimize = FALSE; -static WPSSCREEN * gv_pScreenList = NULL; -static F_MUTEX gv_hDispMutex = F_MUTEX_NULL; - -FSTATIC RCODE propertyExists( - char * pszProperty, - char * pszBuffer, - char ** ppszValue); - FSTATIC RCODE _flmWrapperFunc( IF_Thread * pThread); @@ -1108,975 +1083,3 @@ void utilShutdownWindow() { FTXExit(); } - -/**************************************************************************** -Desc: read the contents of the argument file into the ppszReturnString buffer -****************************************************************************/ -RCODE fileToString( - char * pszFile, - char ** ppszReturnString) -{ - RCODE rc = NE_XFLM_OK; - char * pszBuffer = NULL; - IF_FileHdl * pFileHdl = NULL; - FLMUINT64 ui64FileSize = 0; - FLMUINT uiBytesRead = 0; - IF_FileSystem * pFileSystem = NULL; - - if( RC_BAD( rc = FlmGetFileSystem( &pFileSystem))) - { - goto Exit; - } - - if (RC_BAD(rc = pFileSystem->openFile( pszFile, FLM_IO_RDONLY, &pFileHdl))) - { - goto Exit; - } - - if (RC_BAD( rc = pFileHdl->size( &ui64FileSize))) - { - goto Exit; - } - - if( ui64FileSize == 0) - { - goto Exit; - } - - if( RC_BAD( rc = f_alloc( (FLMUINT)(ui64FileSize + 1), &pszBuffer))) - { - goto Exit; - } - - if (RC_BAD( rc = pFileHdl->read( 0, (FLMUINT)ui64FileSize, - pszBuffer, &uiBytesRead))) - { - goto Exit; - } - - flmAssert( ui64FileSize == uiBytesRead); - pszBuffer[ ui64FileSize] = 0; - -Exit: - - if( pFileHdl) - { - pFileHdl->Release(); - } - - if( pFileSystem) - { - pFileSystem->Release(); - } - - if ( RC_BAD( rc) && pszBuffer) - { - f_free( &pszBuffer); - } - else if ( RC_OK( rc)) - { - *ppszReturnString = pszBuffer; - } - - return( rc); -} - -/**************************************************************************** -Desc: allocate a copy of the arg string and return it out -****************************************************************************/ -char * getStringClone( - char * pszSrcStr) -{ - char * pszReturnVal = NULL; - - if( RC_BAD( f_alloc( f_strlen( pszSrcStr) + 1, &pszReturnVal))) - { - goto Exit; - } - f_strcpy( pszReturnVal, pszSrcStr); - -Exit: - - return pszReturnVal; -} - -/**************************************************************************** -Desc: fill a buffer with the current (or given) time -****************************************************************************/ -FLMUINT utilGetTimeString( - char * pszOutString, - FLMUINT uiBufferSize, - FLMUINT uiInSeconds) //default param to use user-supplied time -{ - F_TMSTAMP timeStamp; - FLMUINT uiSeconds; - - if ( uiInSeconds != 0) - { - f_timeSecondsToDate( uiInSeconds, &timeStamp); - } - else - { - f_timeGetTimeStamp( &timeStamp); - } - f_timeDateToSeconds( &timeStamp, &uiSeconds); - char szTemp[ 256]; - f_sprintf( szTemp, - "%4u-%02u-%02u %02u:%02u:%02u", - (unsigned)timeStamp.year, - (unsigned)(timeStamp.month + 1), - (unsigned)timeStamp.day, - (unsigned)timeStamp.hour, - (unsigned)timeStamp.minute, - (unsigned)timeStamp.second); - f_strncpy( pszOutString, szTemp, uiBufferSize - 1); - pszOutString[ uiBufferSize-1] = 0; - return uiSeconds; -} - -#define UTIL_PROP_DELIMITER '!' -FSTATIC RCODE propertyExists( - char * pszProperty, - char * pszBuffer, - char ** ppszValue) -{ - flmAssert( pszProperty); - FlmStringAcc acc; - RCODE rc = NE_XFLM_OK; //returns only memory errors - - *ppszValue = NULL; - - if ( !pszBuffer) - { - goto Exit; - } - else - { - char * pszValue; - - acc.appendf( "%s%c", pszProperty, UTIL_PROP_DELIMITER); - if ( (pszValue = (char *)f_strstr( pszBuffer, pszProperty)) != NULL) - { - pszValue = (char *)(1 + f_strchr( pszValue, UTIL_PROP_DELIMITER)); - *ppszValue = getStringClone( pszValue); - if ( !*ppszValue) - { - rc = RC_SET( NE_XFLM_MEM); - goto Exit; - } - ((FLMBYTE*)(f_strchr( *ppszValue, '\n')))[ 0] = 0; - } - else - { - goto Exit; - } - } -Exit: - return rc; -} - -RCODE utilWriteProperty( - char * pszFile, - char * pszProp, - char * pszValue) -{ - RCODE rc = NE_XFLM_OK; - char * pszContents = NULL; - char * pszExistingProperty; - FlmStringAcc newContents; - IF_FileSystem * pFileSystem = NULL; - - if( RC_BAD( rc = FlmGetFileSystem( &pFileSystem))) - { - goto Exit; - } - - //can't have newlines in the props or values - flmAssert( !f_strchr( pszProp, '\n')); - flmAssert( !f_strchr( pszValue, '\n')); - - if ( RC_BAD( pFileSystem->doesFileExist( pszFile))) - { - //add trailing newline - TEST_RC( rc = f_filecpy( pszFile, "")); - } - if ( RC_BAD( fileToString( pszFile, &pszContents))) - { - goto Exit; - } - //propertyExists returns out a new - TEST_RC( rc = propertyExists( pszProp, pszContents, &pszExistingProperty)); - if ( !pszExistingProperty) - { - newContents.appendf( "%s%c%s\n", pszProp, UTIL_PROP_DELIMITER, pszValue); - newContents.appendTEXT( (FLMBYTE *)pszContents); - } - else - { - f_free( &pszExistingProperty); - pszExistingProperty = NULL; - FLMUINT uiProps = 0; - - //write out nulls in place of the "\n"'s throughout the contents - char * pszNuller = pszContents; - for( ;;) - { - pszNuller = (char *)f_strchr( pszNuller, '\n'); - if ( pszNuller) - { - pszNuller[ 0] = 0; - pszNuller++; - uiProps++; - } - else - { - break; - } - } - char * pszNextLine = pszContents; - char * pszNextProp; - char * pszNextVal; - char * pszBang; - - while ( uiProps--) - { - pszBang = (char *)f_strchr( pszNextLine, UTIL_PROP_DELIMITER); - flmAssert( pszBang); //better have a UTIL_PROP_DELIMITER in it - pszBang[ 0] = 0; - pszNextProp = pszNextLine; - pszNextVal = pszBang + 1; - if ( !(STREQ( pszNextProp, pszProp))) - { - pszBang[ 0] = UTIL_PROP_DELIMITER; - newContents.appendTEXT( (FLMBYTE *)pszNextLine); - newContents.appendCHAR( '\n'); - } - else - { - newContents.appendf( "%s%c%s\n", - pszNextProp, UTIL_PROP_DELIMITER, pszValue); - pszBang[ 0] = UTIL_PROP_DELIMITER; - } - - pszNextLine = pszNextLine + f_strlen( pszNextLine) + 1; - } - } - rc = f_filecpy( pszFile, newContents.getTEXT()); - -Exit: - - if( pFileSystem) - { - pFileSystem->Release(); - } - - if ( pszContents) - { - f_free( &pszContents); - } - return rc; -} - -RCODE utilReadProperty( - char * pszFile, - char * pszProp, - FlmStringAcc * pAcc) -{ - RCODE rc = NE_XFLM_OK; - char * pszContents = NULL; - char * pszValue = NULL; - IF_FileSystem * pFileSystem = NULL; - - if( RC_BAD( rc = FlmGetFileSystem( &pFileSystem))) - { - goto Exit; - } - - if ( RC_BAD( pFileSystem->doesFileExist( pszFile))) - { - //be nice here. simply don't append anything into FlmStringAcc - goto Exit; - } - if ( RC_BAD( fileToString( pszFile, &pszContents))) - { - goto Exit; - } - TEST_RC( rc = propertyExists( pszProp, pszContents, &pszValue)); - TEST_RC( rc = pAcc->appendTEXT( (FLMBYTE *)pszValue)); - -Exit: - - if( pFileSystem) - { - pFileSystem->Release(); - } - - if( pszValue) - { - f_free( &pszValue); - } - - if( pszContents) - { - f_free( &pszContents); - } - - return( rc); -} - -void scramble( - IF_RandomGenerator * pRandGen, - FLMUINT * puiArray, - FLMUINT uiNumElems) -{ - FLMUINT uiLoop; - FLMUINT uiTmp; - FLMUINT uiIndex; - - for( uiLoop = 0; uiLoop < uiNumElems; uiLoop++) - { - uiIndex = pRandGen->getUINT32( 0, (FLMUINT32)(uiNumElems - 1)); - f_swap( - puiArray[uiLoop], - puiArray[uiIndex], - uiTmp); - } -} - -/**************************************************************************** -Desc: Initialize and set the title -****************************************************************************/ -void WpsInit( - FLMUINT uiRows, // 0xFFFF means use current screen height. - FLMUINT uiCols, // 0xFFFF means use current screen width. - const char * pszScreenTitle) -{ - char szTitleAndVer[ 100]; - - if( gv_bInitialized) - { - return; - } - - // Setup utilities title which includes the software version. -#ifdef SECURE_UTIL - f_sprintf( (char *)szTitleAndVer, "%s - %s (%u)", - pszScreenTitle, SRC_VER_STR, (unsigned)UTIL_VER); -#else - f_sprintf( (char *)szTitleAndVer, "%s - %s (UNSECURE:%u)", - pszScreenTitle, SRC_VER_STR, (unsigned)UTIL_VER); -#endif - - FTXInit( szTitleAndVer, uiCols, uiRows, FLM_BLACK, FLM_LIGHTGRAY, - NULL, NULL); - - if( RC_BAD( f_mutexCreate( &gv_hDispMutex))) - { - flmAssert( 0); - } - - WpsThrdInit( szTitleAndVer); - gv_bInitialized = TRUE; -} - - -/**************************************************************************** -Desc: Initialize WPS using an existing FTX environment -****************************************************************************/ -void WpsInitFTX( void) -{ - if( gv_bInitialized) - { - return; - } - - if( RC_BAD( f_mutexCreate( &gv_hDispMutex))) - { - flmAssert( 0); - } - - gv_bInitialized = TRUE; -} - - -/**************************************************************************** -Desc: Restores the screen to an initial state -****************************************************************************/ -void WpsExit( void) -{ - if( !gv_bInitialized) - { - return; - } - - gv_bShutdown = TRUE; - WpsThrdExit(); - f_mutexDestroy( &gv_hDispMutex); - FTXExit(); - gv_bInitialized = FALSE; -} - -/**************************************************************************** -Desc: Initialize and set the title of a thread's screen -***************************************************************************/ -void WpsThrdInitUsingScreen( - FTX_SCREEN * pFtxScreen, - const char * pszScreenTitle) -{ - FLMUINT uiRows; - FLMUINT uiThrdId; - WPSSCREEN * pCurScreen = NULL; - - wpsLock( &gv_hDispMutex); - - uiThrdId = f_threadId(); - pCurScreen = gv_pScreenList; - while( pCurScreen != NULL) - { - if( pCurScreen->uiScreenId == uiThrdId) - { - break; - } - pCurScreen = pCurScreen->pNext; - } - - if( pCurScreen == NULL) - { - if( RC_BAD( f_calloc( sizeof( WPSSCREEN), &pCurScreen))) - { - flmAssert( 0); - } - pCurScreen->uiScreenId = uiThrdId; - pCurScreen->pNext = gv_pScreenList; - gv_pScreenList = pCurScreen; - - if( pFtxScreen != NULL) - { - pCurScreen->pScreen = pFtxScreen; - pCurScreen->bPrivate = FALSE; - } - else - { - if( RC_BAD( FTXScreenInit( pszScreenTitle, - &(pCurScreen->pScreen)))) - { - flmAssert( 0); - } - pCurScreen->bPrivate = TRUE; - } - - if( RC_BAD( FTXScreenGetSize( pCurScreen->pScreen, NULL, &uiRows))) - { - flmAssert( 0); - } - - if( RC_BAD( FTXWinInit( pCurScreen->pScreen, 0, - (FLMBYTE)(uiRows - 1), &(pCurScreen->pWin)))) - { - flmAssert( 0); - } - - FTXWinMove( pCurScreen->pWin, 0, 1); - - if( RC_BAD( FTXWinInit( pCurScreen->pScreen, 0, - 1, &(pCurScreen->pTitleWin)))) - { - flmAssert( 0); - } - - FTXWinPaintBackground( pCurScreen->pTitleWin, FLM_RED); - FTXWinPrintStr( pCurScreen->pTitleWin, pszScreenTitle); - FTXWinOpen( pCurScreen->pTitleWin); - FTXWinOpen( pCurScreen->pWin); - } - - wpsUnlock( &gv_hDispMutex); -} - - -/**************************************************************************** -Desc: Frees all screen resources allocated to a thread -Ret: -****************************************************************************/ -void WpsThrdExit( void) -{ - FLMUINT uiThrdId; - WPSSCREEN * pPrevScreen = NULL; - WPSSCREEN * pCurScreen = NULL; - - - wpsLock( &gv_hDispMutex); - - uiThrdId = f_threadId(); - pCurScreen = gv_pScreenList; - while( pCurScreen != NULL) - { - if( pCurScreen->uiScreenId == uiThrdId) - { - break; - } - pPrevScreen = pCurScreen; - pCurScreen = pCurScreen->pNext; - } - - if( pCurScreen != NULL) - { - if( pCurScreen == gv_pScreenList) - { - gv_pScreenList = pCurScreen->pNext; - } - - if( pPrevScreen != NULL) - { - pPrevScreen->pNext = pCurScreen->pNext; - } - - if( pCurScreen->bPrivate == TRUE) - { - FTXScreenFree( &(pCurScreen->pScreen)); - } - else - { - FTXWinFree( &(pCurScreen->pTitleWin)); - FTXWinFree( &(pCurScreen->pWin)); - } - - f_free( &pCurScreen); - } - - wpsUnlock( &gv_hDispMutex); -} - - -/**************************************************************************** -Desc: Returns the size of the screen in columns and rows. -****************************************************************************/ -void WpsScrSize( - FLMUINT * puiNumColsRV, - FLMUINT * puiNumRowsRV - ) -{ - FTXWinGetCanvasSize( wpsGetThrdWin(), puiNumColsRV, puiNumRowsRV); -} - - -/**************************************************************************** -Desc: Output a string at present cursor location. -****************************************************************************/ -void WpsStrOut( - const char * pszString) -{ - FTXWinPrintStr( wpsGetThrdWin(), pszString); - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - -/**************************************************************************** -Desc: Output a formatted string at present cursor location. -****************************************************************************/ -void WpsPrintf( - const char * pszFormat, ...) -{ - char szBuffer[ 512]; - f_va_list args; - - f_va_start( args, pszFormat); - f_vsprintf( szBuffer, pszFormat, &args); - f_va_end( args); - FTXWinPrintStr( wpsGetThrdWin(), szBuffer); - - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - - -/**************************************************************************** -Desc: Output a formatted string at present cursor location with color -****************************************************************************/ -void WpsCPrintf( - eColorType uiBack, - eColorType uiFore, - const char * pszFormat, ...) -{ - char szBuffer[ 512]; - f_va_list args; - eColorType uiOldBack; - eColorType uiOldFore; - - f_va_start( args, pszFormat); - f_vsprintf( szBuffer, pszFormat, &args); - f_va_end( args); - - FTXWinGetBackFore( wpsGetThrdWin(), &uiOldBack, &uiOldFore); - FTXWinSetBackFore( wpsGetThrdWin(), uiBack, uiFore); - FTXWinPrintStr( wpsGetThrdWin(), szBuffer); - FTXWinSetBackFore( wpsGetThrdWin(), uiOldBack, uiOldFore); - - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - - -/**************************************************************************** -Desc: Output a character to the screen at the current location. If char is - a LineFeed then a CarriageReturn will be inserted before the LineFeed. -Notes:On NLM becomes a blocking function if the char is the newline character. -****************************************************************************/ -void WpsChrOut( - char chr - ) -{ - FTXWinPrintChar( wpsGetThrdWin(), (FLMUINT)chr); - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - - -/**************************************************************************** -Desc: Clear the screen from the col/row down -Notes: If col==row==0 then clear entire screen -****************************************************************************/ -void WpsScrClr( - FLMUINT uiCol, - FLMUINT uiRow - ) -{ - FTX_WINDOW * pThrdWin; - FLMUINT uiCurrCol; - FLMUINT uiCurrRow; - - - pThrdWin = wpsGetThrdWin(); - FTXWinGetCursorPos( pThrdWin, &uiCurrCol, &uiCurrRow); - - if( uiCol == 255) - { - uiCol = uiCurrCol; - } - - if( uiRow == 255) - { - uiRow = uiCurrRow; - } - - FTXWinClearXY( pThrdWin, uiCol, uiRow); - FTXWinSetCursorPos( pThrdWin, uiCol, uiRow); - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - -/**************************************************************************** -Desc: Position to the column and row specified. -Notes: The NLM could call GetPositionOfOutputCursor(&r,&c); -****************************************************************************/ -void WpsScrPos( - FLMUINT uiCol, - FLMUINT uiRow - ) -{ - FTX_WINDOW * pThrdWin; - FLMUINT uiCurrCol; - FLMUINT uiCurrRow; - - - pThrdWin = wpsGetThrdWin(); - FTXWinGetCursorPos( pThrdWin, &uiCurrCol, &uiCurrRow); - - if( uiCol == 255) - { - uiCol = uiCurrCol; - } - - if( uiRow == 255) - { - uiRow = uiCurrRow; - } - - FTXWinSetCursorPos( pThrdWin, uiCol, uiRow); -} - - -/**************************************************************************** -Desc: Clear from input cursor to end of line -****************************************************************************/ -void WpsLineClr( - FLMUINT uiCol, - FLMUINT uiRow - ) -{ - FTX_WINDOW * pThrdWin; - FLMUINT uiCurrCol; - FLMUINT uiCurrRow; - - - pThrdWin = wpsGetThrdWin(); - FTXWinGetCursorPos( pThrdWin, &uiCurrCol, &uiCurrRow); - - if( uiCol == 255) - { - uiCol = uiCurrCol; - } - - if( uiRow == 255) - { - uiRow = uiCurrRow; - } - - FTXWinClearLine( pThrdWin, uiCol, uiRow); - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - -/**************************************************************************** -Desc: Edit a line of data like gets(s). Newline replaced by NULL character. -Ret: WPK Character -Notes: Does not support WP extended character input - but could easily! -****************************************************************************/ -FLMUINT WpsLineEd( - char * pszString, - FLMUINT uiMaxLen, - FLMBOOL * pbShutdown - ) -{ - FLMUINT uiCharCount; - FLMUINT uiCursorType; - - - uiCursorType = FTXWinGetCursorType( wpsGetThrdWin()); - FTXWinSetCursorType( wpsGetThrdWin(), FLM_CURSOR_UNDERLINE); - FTXSetShutdownFlag( pbShutdown); - uiCharCount = FTXLineEd( wpsGetThrdWin(), pszString, uiMaxLen); - FTXSetShutdownFlag( NULL); - FTXWinSetCursorType( wpsGetThrdWin(), uiCursorType); - - return( uiCharCount); -} - - -/**************************************************************************** -Desc: Sets the FTX shutdown flag pointer -Ret: -****************************************************************************/ -void WpsSetShutdown( - FLMBOOL * pbShutdown - ) -{ - FTXSetShutdownFlag( pbShutdown); -} - - -/**************************************************************************** -Desc: Edit a line of data with advanced features. -Ret: Number of characters input. -****************************************************************************/ -FLMUINT WpsLineEditExt( - char * pszBuffer, - FLMUINT uiBufSize, - FLMUINT uiMaxWidth, - FLMBOOL * pbShutdown, - FLMUINT * puiTermChar - ) -{ - FLMUINT uiCharCount = 0; - FLMUINT uiCursorType; - - - uiCursorType = FTXWinGetCursorType( wpsGetThrdWin()); - FTXWinSetCursorType( wpsGetThrdWin(), FLM_CURSOR_UNDERLINE); - FTXSetShutdownFlag( pbShutdown); - FTXLineEdit( wpsGetThrdWin(), pszBuffer, uiBufSize, uiMaxWidth, - &uiCharCount, puiTermChar); - FTXSetShutdownFlag( NULL); - FTXWinSetCursorType( wpsGetThrdWin(), uiCursorType); - - return( (FLMINT)uiCharCount); -} - - -/**************************************************************************** -Desc: Get the current X coordinate of the cursor -****************************************************************************/ -FLMUINT WpsCurrCol( void) -{ - FLMUINT uiCol; - - FTXWinGetCursorPos( wpsGetThrdWin(), &uiCol, NULL); - return( uiCol); -} - - -/**************************************************************************** -Desc: Get the current Y coordinate of the cursor -****************************************************************************/ -FLMUINT WpsCurrRow( void) -{ - FLMUINT uiRow; - - FTXWinGetCursorPos( wpsGetThrdWin(), NULL, &uiRow); - return( uiRow); -} - -/**************************************************************************** -Desc: Set the background and foreground colors -Ret: None -****************************************************************************/ -void WpsScrBackFor( - eColorType backColor, - eColorType foreColor) -{ - FTXWinSetBackFore( wpsGetThrdWin(), backColor, foreColor); -} - - -/**************************************************************************** -Desc : Sets the cursor attributes. -****************************************************************************/ -void WpsCursorSetType( - FLMUINT uiType) -{ - FTXWinSetCursorType( wpsGetThrdWin(), uiType); - FTXRefresh(); -} - -/**************************************************************************** -Desc: Specifies that display performance (throughput) should be - optimal. -****************************************************************************/ -void WpsOptimize( void) -{ - gv_bOptimize = TRUE; -} - - -/**************************************************************************** -Desc: Draws a border around the current thread's screen -Ret: none -****************************************************************************/ -void WpsDrawBorder( void) -{ - FTXWinDrawBorder( wpsGetThrdWin()); - if( !gv_bOptimize) - { - FTXRefresh(); - } -} - - -/**************************************************************************** -Desc: Convert keyboard sequences/scan codes to WPK key strokes. -Notes: Does not support WP extended character input - but could easily! -****************************************************************************/ -FLMUINT WpkIncar( void) -{ - FLMUINT uiChar; - - FTXWinInputChar( wpsGetThrdWin(), &uiChar); - return( uiChar); -} - - -/**************************************************************************** -Desc: Convert keyboard sequences/scan codes to WPK key strokes. This - routine accepts a pointer to a shutdown flag. -****************************************************************************/ -FLMUINT WpkGetChar( - FLMBOOL * pbShutdown - ) -{ - FLMUINT uiChar; - - FTXSetShutdownFlag( pbShutdown); - FTXWinInputChar( wpsGetThrdWin(), &uiChar); - FTXSetShutdownFlag( NULL); - - return( uiChar); -} - - -/**************************************************************************** -Desc: Tests the keyboard for a pending character -Ret: 1 if key available, 0 if no key available -****************************************************************************/ -FLMUINT WpkTestKB( void) -{ - FLMUINT uiCharAvail; - - uiCharAvail = (FLMUINT)(FTXWinTestKB( wpsGetThrdWin()) == - NE_FLM_OK ? 1 : 0); - return( uiCharAvail); -} - - -/**************************************************************************** -Desc: Returns a pointer to a thread's screen -****************************************************************************/ -FTX_SCREEN * WpsGetThrdScreen( void) -{ - FLMUINT uiThrdId; - WPSSCREEN * pCurScreen = NULL; - - wpsLock( &gv_hDispMutex); - - uiThrdId = f_threadId(); - - pCurScreen = gv_pScreenList; - while( pCurScreen != NULL) - { - if( pCurScreen->uiScreenId == uiThrdId) - { - break; - } - pCurScreen = pCurScreen->pNext; - } - - if( pCurScreen == NULL) - { - flmAssert( 0); - } - - wpsUnlock( &gv_hDispMutex); - return( pCurScreen->pScreen); -} - -/**************************************************************************** -Desc: Returns a pointer to a thread's screen -****************************************************************************/ -FSTATIC FTX_WINDOW * wpsGetThrdWin( void) -{ - FLMUINT uiThrdId; - WPSSCREEN * pCurScreen = NULL; - - - wpsLock( &gv_hDispMutex); - - uiThrdId = f_threadId(); - pCurScreen = gv_pScreenList; - while( pCurScreen != NULL) - { - if( pCurScreen->uiScreenId == uiThrdId) - { - break; - } - pCurScreen = pCurScreen->pNext; - } - - if( pCurScreen == NULL) - { - flmAssert( 0); - } - - wpsUnlock( &gv_hDispMutex); - return( pCurScreen->pWin); -} diff --git a/xflaim/util/sharutil.h b/xflaim/util/sharutil.h index 40c87b4..b7f4d77 100644 --- a/xflaim/util/sharutil.h +++ b/xflaim/util/sharutil.h @@ -414,153 +414,5 @@ RCODE utilInitWindow( void utilShutdownWindow(); -RCODE fileToString( - char * pszFile, - char ** ppszReturnString); - -char * getStringClone( - char * pszSrcStr); - -//current milliseconds is returned -FLMUINT utilGetTimeString( - char * pszOutString, - FLMUINT uiBufferSize, - FLMUINT uiInSeconds = 0); //default param - -//two functions to read and write from a file. -//the file will look like: -// ,----[ ! separates props/values, 1 per line, with trailing newline ] -// |prop1!value1 -// |prop2!value2 -// | -// `---- -RCODE utilWriteProperty( - char * pszFile, - char * pszProp, - char * pszValue); - -RCODE utilReadProperty( - char * pszFile, - char * pszProp, - FlmStringAcc * pAcc); - -void scramble( - IF_RandomGenerator * pRandGen, - FLMUINT * puiArray, - FLMUINT uiNumElems); - -typedef struct wps_screen -{ - FLMBOOL bPrivate; - FLMUINT uiScreenId; - FTX_SCREEN * pScreen; - FTX_WINDOW * pTitleWin; - FTX_WINDOW * pWin; - struct wps_screen * pNext; - void * hThis; -} WPSSCREEN, * WPSSCREEN_p; - -void WpsInit( - FLMUINT rows, - FLMUINT cols, - const char * title); - -void WpsExit( void); - -void WpsThrdInitUsingScreen( - FTX_SCREEN * pScreen, - const char * screenTitle); - -#define WpsThrdInit(a) \ - WpsThrdInitUsingScreen( NULL, (a)) - -void WpsThrdExit( void); - -void WpsWPOut( - FLMINT WPChr); - -void WpsStrOut( - const char * string); - -void WpsPrintf( - const char * pucFormat, ...); - -void WpsCPrintf( - eColorType background, - eColorType foreground, - const char * pucFormat, ...); - -void WpsOptimize( void); - -void WpsScrReset( void); - -#define WpsScrReset() \ - (WpsScrClr(0,0)) - -void WpsScrClr( - FLMUINT col, - FLMUINT row); - -void WpsScrPos( - FLMUINT col, - FLMUINT row); - -void WpsScrBackFor( - eColorType background, - eColorType forground); - -void WpsLineClr( - FLMUINT col, - FLMUINT row); - -FLMUINT WpsLineEd( - char * string, - FLMUINT maxLen, - FLMBOOL * pbShutdown); - -FLMUINT WpsLineEditExt( - char * pbyBuffer, - FLMUINT wBufSize, - FLMUINT wMaxWidth, - FLMBOOL * pbShutdown, - FLMUINT * pwTermChar); - -void WpsStrOutXY( - const char * string, - FLMUINT col, - FLMUINT row); - -#define WpsStrOutXY( string, col, row) \ - (WpsScrPos( col, row), WpsStrOut( string)) - -void WpsDrawBorder( void); - -void WpsCursorSetType( - FLMUINT uiType); - -void WpsCurOff( void); - -void WpsCurOn( void); - -void WpsScrSize( - FLMUINT * puiNumColsRV, - FLMUINT * puiNumRowsRV); - -FLMUINT WpsCurrRow( void); - -FLMUINT WpsCurrCol( void); - -FLMUINT WpkIncar( void); - -FLMUINT WpkGetChar( - FLMBOOL * pbShutdown); - -FLMUINT WpkTestKB( void); - -FTX_SCREEN * WpsGetThrdScreen( void); - -void WpsSetShutdown( - FLMBOOL * pbShutdown); - #endif // SHARUTIL_H diff --git a/xflaim/util/view.cpp b/xflaim/util/view.cpp index ce410fb..023480a 100644 --- a/xflaim/util/view.cpp +++ b/xflaim/util/view.cpp @@ -105,10 +105,9 @@ int main( gv_bRunning = TRUE; gv_pSFileHdl = NULL; - WpsInit( 0xFFFF, 0xFFFF, "FLAIM Database Viewer"); - WpsOptimize(); - - WpsScrSize( NULL, &gv_uiBottomLine); + f_conInit( 0xFFFF, 0xFFFF, "FLAIM Database Viewer"); + f_conGetScreenSize( NULL, &gv_uiBottomLine); + gv_uiTopLine = 2; gv_uiBottomLine -= 3; @@ -119,10 +118,9 @@ int main( { for (;;) { - WpsStrOut( "\nView Params (enter ? for help): "); + f_conStrOut( "\nView Params (enter ? for help): "); szCommandBuffer [0] = 0; - WpsLineEd( szCommandBuffer, - sizeof( szCommandBuffer) - 1, &gv_bShutdown); + f_conLineEdit( szCommandBuffer, sizeof( szCommandBuffer) - 1); if (f_stricmp( szCommandBuffer, "?") == 0) { ViewShowHelp( FALSE); @@ -241,8 +239,8 @@ int main( gv_pViewPool->poolInit(2048); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, 0); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, 0); // Open the file @@ -277,16 +275,16 @@ Exit: if ((bPauseBeforeExiting) && (!gv_bShutdown)) { - WpsStrOut( "\nPress any character to exit VIEW: "); + f_conStrOut( "\nPress any character to exit VIEW: "); for (;;) { if (gv_bShutdown) { break; } - if (WpkTestKB()) + if (f_conHaveKey()) { - (void)WpkIncar(); + f_conGetKey(); break; } viewGiveUpCPU(); @@ -298,7 +296,7 @@ Exit: gv_pViewPool->Release(); } - WpsExit(); + f_conExit(); if( gv_pDbSystem) { @@ -316,50 +314,50 @@ FSTATIC void ViewShowHelp( FLMBOOL bShowFullUsage ) { - WpsStrOut( "\n"); + f_conStrOut( "\n"); if (bShowFullUsage) { - WpsStrOut( "Usage: view [Options]\n"); + f_conStrOut( "Usage: view [Options]\n"); } else { - WpsStrOut( "Parameters: [Options]\n\n"); + f_conStrOut( "Parameters: [Options]\n\n"); } - WpsStrOut( + f_conStrOut( " DbName = Name of database to view.\n"); - WpsStrOut( + f_conStrOut( " Options =\n"); - WpsStrOut( + f_conStrOut( " -dr = RFL directory.\n"); - WpsStrOut( + f_conStrOut( " -dd = Data directory.\n"); - WpsStrOut( + f_conStrOut( " -x = Open database in exclusive mode.\n"); - WpsStrOut( + f_conStrOut( " -f = Fix database header. If the options below are not set,\n"); - WpsStrOut( + f_conStrOut( " defaults will be used.\n"); - WpsStrOut( + f_conStrOut( " -b = Set block size to Size (only used if -f is specified).\n"); - WpsStrOut( + f_conStrOut( " -m = Set minimum RFL file size to Size (only used if -f\n"); - WpsStrOut( + f_conStrOut( " option is used).\n"); - WpsStrOut( + f_conStrOut( " -l = Set maximum RFL file size to Size (only used if -f\n"); - WpsStrOut( + f_conStrOut( " option is used).\n"); - WpsStrOut( + f_conStrOut( " used).\n"); - WpsStrOut( + f_conStrOut( " -p = Pause before exiting.\n"); - WpsStrOut( + f_conStrOut( " -pw = Database password.\n"); - WpsStrOut( + f_conStrOut( " -? = A '?' anywhere in the command line will cause this\n"); - WpsStrOut( + f_conStrOut( " screen to be displayed, with or without the leading '-'.\n"); - WpsStrOut( + f_conStrOut( "Options may be specified anywhere in the command line.\n"); } @@ -375,15 +373,18 @@ FSTATIC FLMUINT ViewGetChar( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); - WpsScrBackFor( FLM_RED, FLM_WHITE); + f_conGetScreenSize( &uiNumCols, &uiNumRows); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); + f_conSetBackFore( FLM_RED, FLM_WHITE); + if (pszMessage1) { - WpsStrOutXY( pszMessage1, 0, uiNumRows - 2); + f_conStrOutXY( pszMessage1, 0, uiNumRows - 2); } - WpsStrOutXY( pszMessage2, 0, 23); + + f_conStrOutXY( pszMessage2, 0, 23); + for (;;) { if (gv_bShutdown) @@ -391,15 +392,15 @@ FSTATIC FLMUINT ViewGetChar( uiChar = FKB_ESCAPE; break; } - else if (WpkTestKB()) + else if (f_conHaveKey()) { - uiChar = (FLMUINT)WpkIncar(); + uiChar = f_conGetKey(); break; } viewGiveUpCPU(); } - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); if (uiChar == FKB_ENTER) { uiChar = uiDefaultChar; @@ -434,7 +435,7 @@ void ViewReadHdr( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); + f_conGetScreenSize( &uiNumCols, &uiNumRows); gv_bViewHdrRead = TRUE; if (RC_OK( rc = ViewReadAndVerifyHdrInfo( pui32CalcCRC))) @@ -464,13 +465,13 @@ void ViewAskInput( { char szTempBuf [80]; - WpsStrOut( pszPrompt); + f_conStrOut( pszPrompt); if (uiBufLen > sizeof( szTempBuf)) { uiBufLen = sizeof( szTempBuf); } szTempBuf [0] = 0; - WpsLineEd( szTempBuf, uiBufLen, &gv_bShutdown); + f_conLineEdit( szTempBuf, uiBufLen); f_strcpy( (char *)pszBuffer, szTempBuf); } @@ -484,17 +485,17 @@ FSTATIC FLMBOOL ViewGetFileName( { const char * pszPrompt = "Enter database file name: "; - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( uiCol, uiRow); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( uiCol, uiRow); if (bDispOnly) { - WpsStrOutXY( pszPrompt, uiCol, uiRow); - WpsStrOutXY( gv_szViewFileName, + f_conStrOutXY( pszPrompt, uiCol, uiRow); + f_conStrOutXY( gv_szViewFileName, uiCol + f_strlen( pszPrompt), uiRow); } else { - WpsScrPos( uiCol, uiRow); + f_conSetCursorPos( uiCol, uiRow); ViewAskInput( pszPrompt, gv_szViewFileName, 40); if (!gv_szViewFileName [0] || f_strcmp( gv_szViewFileName, "\\") == 0) @@ -536,7 +537,7 @@ Get_File_Name: // Prompt for file name if necessary - WpsScrClr( 0, 1); + f_conClearScreen( 0, 1); if (!gv_szViewFileName [0]) { if (!ViewGetFileName( 5, 5, FALSE)) diff --git a/xflaim/util/viewblk.cpp b/xflaim/util/viewblk.cpp index 2bfc85f..b233877 100644 --- a/xflaim/util/viewblk.cpp +++ b/xflaim/util/viewblk.cpp @@ -3337,15 +3337,15 @@ FLMBOOL GetBlockAddrType( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); + f_conGetScreenSize( &uiNumCols, &uiNumRows); // Get the block address for (;;) { bBadDigit = FALSE; - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); ViewAskInput( "Enter Block Address (in hex): ", szTempBuf, sizeof( szTempBuf)); @@ -3394,7 +3394,7 @@ FLMBOOL GetBlockAddrType( } } - WpsScrClr( 0, uiNumRows - 2); + f_conClearScreen( 0, uiNumRows - 2); ViewEscPrompt(); return( bGotAddress); } diff --git a/xflaim/util/viewdisp.cpp b/xflaim/util/viewdisp.cpp index e7f8b40..1c03e70 100644 --- a/xflaim/util/viewdisp.cpp +++ b/xflaim/util/viewdisp.cpp @@ -36,22 +36,22 @@ void ViewShowError( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); - WpsScrBackFor( FLM_RED, FLM_WHITE); - WpsStrOutXY( pszMessage, 0, uiNumRows - 2); - WpsStrOutXY( "Press ENTER to continue: ", 0, uiNumRows - 1); + f_conGetScreenSize( &uiNumCols, &uiNumRows); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); + f_conSetBackFore( FLM_RED, FLM_WHITE); + f_conStrOutXY( pszMessage, 0, uiNumRows - 2); + f_conStrOutXY( "Press ENTER to continue: ", 0, uiNumRows - 1); for (;;) { - uiChar = (FLMUINT)WpkIncar(); + uiChar = f_conGetKey(); if (uiChar == FKB_ENTER || uiChar == FKB_ESCAPE) { break; } } - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); ViewEscPrompt(); } diff --git a/xflaim/util/viewedit.cpp b/xflaim/util/viewedit.cpp index 5fb1e2b..7c43a82 100644 --- a/xflaim/util/viewedit.cpp +++ b/xflaim/util/viewedit.cpp @@ -47,7 +47,7 @@ FLMBOOL ViewGetNum( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); + f_conGetScreenSize( &uiNumCols, &uiNumRows); if (bEnterHexFlag) { @@ -67,11 +67,11 @@ FLMBOOL ViewGetNum( for (;;) { bGetOK = TRUE; - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); ViewAskInput( pszPrompt, szTempBuf, sizeof( szTempBuf)); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); if (f_stricmp( szTempBuf, "\\") == 0) { *pbValEntered = FALSE; @@ -219,12 +219,12 @@ FLMBOOL ViewEditText( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conGetScreenSize( &uiNumCols, &uiNumRows); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); ViewAskInput( pszPrompt, szTempBuf, sizeof( szTempBuf) - 1); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); if (f_stricmp( szTempBuf, "\\") == 0) { @@ -311,7 +311,7 @@ FLMBOOL ViewEditBinary( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); + f_conGetScreenSize( &uiNumCols, &uiNumRows); if (!pszPrompt) { @@ -319,11 +319,11 @@ FLMBOOL ViewEditBinary( } for (;;) { - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); ViewAskInput( pszPrompt, szTempBuf, sizeof( szTempBuf)); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 2); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 2); if( f_stricmp( szTempBuf, "\\") == 0) { *pbValEntered = FALSE; diff --git a/xflaim/util/viewmenu.cpp b/xflaim/util/viewmenu.cpp index 70e1251..03aad45 100644 --- a/xflaim/util/viewmenu.cpp +++ b/xflaim/util/viewmenu.cpp @@ -106,14 +106,14 @@ void ViewMenuInit( // Clear the screen and display the menu title - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, 0); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, 0); // Display the title in the middle of the top line of the screen uiCol = (80 - f_strlen( pszTitle)) / 2; - WpsStrOutXY( pszTitle, uiCol, 0); + f_conStrOutXY( pszTitle, uiCol, 0); ViewUpdateDate( TRUE, &gv_ViewLastTime); // Deallocate any old memory, if any @@ -198,8 +198,8 @@ FSTATIC void ViewDispMenuItem( f_sprintf( (char *)szTempBuf, "%03u:%08X", (unsigned)pMenuItem->uiModFileNumber, (unsigned)pMenuItem->uiModFileOffset); - WpsScrBackFor( FLM_WHITE, FLM_GREEN); - WpsStrOutXY( szTempBuf, 0, uiRow); + f_conSetBackFore( FLM_WHITE, FLM_GREEN); + f_conStrOutXY( szTempBuf, 0, uiRow); } // If the item is the current item, display it using the @@ -213,18 +213,18 @@ FSTATIC void ViewDispMenuItem( } if (pMenuItem->uiOption) { - WpsScrBackFor( pMenuItem->uiSelectBackColor, + f_conSetBackFore( pMenuItem->uiSelectBackColor, pMenuItem->uiSelectForeColor); } else { - WpsScrBackFor( pMenuItem->uiUnselectForeColor, + f_conSetBackFore( pMenuItem->uiUnselectForeColor, pMenuItem->uiUnselectBackColor); } } else { - WpsScrBackFor( pMenuItem->uiUnselectBackColor, + f_conSetBackFore( pMenuItem->uiUnselectBackColor, pMenuItem->uiUnselectForeColor); } @@ -253,27 +253,27 @@ FSTATIC void ViewDispMenuItem( { if (pMenuItem->uiItemNum == gv_uiViewMenuCurrItemNum) { - WpsStrOutXY( "*>", (uiCol - 2), uiRow); + f_conStrOutXY( "*>", (uiCol - 2), uiRow); } else { - WpsStrOutXY( "* ", (uiCol - 2), uiRow); + f_conStrOutXY( "* ", (uiCol - 2), uiRow); } } else { if (pMenuItem->uiItemNum == gv_uiViewMenuCurrItemNum) { - WpsStrOutXY( " >", (uiCol - 2), uiRow); + f_conStrOutXY( " >", (uiCol - 2), uiRow); } else { - WpsStrOutXY( " ", (uiCol - 2), uiRow); + f_conStrOutXY( " ", (uiCol - 2), uiRow); } } if (szTempBuf[ 0]) { - WpsStrOutXY( szTempBuf, uiCol, uiRow); + f_conStrOutXY( szTempBuf, uiCol, uiRow); } // Now output the value @@ -282,18 +282,18 @@ FSTATIC void ViewDispMenuItem( switch (pMenuItem->uiValueType & 0x0F) { case VAL_IS_LABEL_INDEX: - WpsStrOutXY( (Labels[ pMenuItem->ui64Value]), + f_conStrOutXY( (Labels[ pMenuItem->ui64Value]), uiCol, uiRow); break; case VAL_IS_ERR_INDEX: { FLMUINT ValIndex = (FLMUINT)pMenuItem->ui64Value; - WpsStrOutXY( dbSystem.checkErrorToStr( ValIndex), + f_conStrOutXY( dbSystem.checkErrorToStr( ValIndex), uiCol, uiRow); break; } case VAL_IS_TEXT_PTR: - WpsStrOutXY( ((char *)(FLMUINT)pMenuItem->ui64Value), uiCol, uiRow); + f_conStrOutXY( ((char *)(FLMUINT)pMenuItem->ui64Value), uiCol, uiRow); break; case VAL_IS_BINARY_HEX: case VAL_IS_BINARY_PTR: @@ -342,7 +342,7 @@ FSTATIC void ViewDispMenuItem( // Output the line - WpsStrOutXY( szTempBuf, uiCol, uiRow); + f_conStrOutXY( szTempBuf, uiCol, uiRow); if (pMenuItem->uiItemNum == gv_uiViewMenuCurrItemNum) { UpdateHorizCursor( TRUE); @@ -393,7 +393,7 @@ FSTATIC void ViewDispMenuItem( } break; } - WpsStrOutXY( szTempBuf, uiCol, uiRow); + f_conStrOutXY( szTempBuf, uiCol, uiRow); break; case VAL_IS_EMPTY: default: @@ -511,14 +511,14 @@ void ViewEscPrompt( void) FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, uiNumRows - 1); - WpsScrBackFor( FLM_RED, FLM_WHITE); - WpsStrOutXY( "ESC=Exit, ?=Help", 0, uiNumRows - 1); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsStrOutXY( "File: ", 20, uiNumRows - 1); - WpsStrOutXY( gv_szViewFileName, 26, uiNumRows - 1); + f_conGetScreenSize( &uiNumCols, &uiNumRows); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, uiNumRows - 1); + f_conSetBackFore( FLM_RED, FLM_WHITE); + f_conStrOutXY( "ESC=Exit, ?=Help", 0, uiNumRows - 1); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conStrOutXY( "File: ", 20, uiNumRows - 1); + f_conStrOutXY( gv_szViewFileName, 26, uiNumRows - 1); gv_uiViewLastFileOffset = VIEW_INVALID_FILE_OFFSET; } @@ -544,8 +544,8 @@ FSTATIC void ViewRefreshMenu( // Refresh the entire screen - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, 1); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, 1); pMenuItem = gv_pViewMenuFirstItem; while( pMenuItem) @@ -585,18 +585,18 @@ FSTATIC void UpdateHorizCursor( szTempBuf[ 2] = 0; if (bOnFlag) { - WpsScrBackFor( FLM_RED, FLM_WHITE); + f_conSetBackFore( FLM_RED, FLM_WHITE); } else { - WpsScrBackFor( gv_pViewMenuCurrItem->uiUnselectForeColor, + f_conSetBackFore( gv_pViewMenuCurrItem->uiUnselectForeColor, gv_pViewMenuCurrItem->uiUnselectBackColor); } // Calculate row and column where the item is to be displayed uiRow = gv_uiTopLine + (gv_pViewMenuCurrItem->uiRow - gv_uiViewTopRow); - WpsStrOutXY( (char *)szTempBuf, (uiCol + uiLoop * 3), uiRow); + f_conStrOutXY( (char *)szTempBuf, (uiCol + uiLoop * 3), uiRow); if (((szTempBuf[ 0] = pucVal[ uiLoop]) < ' ') || (szTempBuf[ 0] > 127)) { @@ -609,17 +609,17 @@ FSTATIC void UpdateHorizCursor( } #endif szTempBuf[ 1] = 0; - WpsStrOutXY( (char *)szTempBuf, + f_conStrOutXY( (char *)szTempBuf, (uiCol + MAX_HORIZ_SIZE( uiCol) * 3 + 5 + uiLoop), uiRow); - WpsScrBackFor( gv_pViewMenuCurrItem->uiUnselectForeColor, + f_conSetBackFore( gv_pViewMenuCurrItem->uiUnselectForeColor, gv_pViewMenuCurrItem->uiUnselectBackColor); if (bOnFlag) { - WpsStrOutXY( ">", (uiCol + uiLoop * 3 - 1), uiRow); + f_conStrOutXY( ">", (uiCol + uiLoop * 3 - 1), uiRow); } else { - WpsStrOutXY( " ", (uiCol + uiLoop * 3 - 1), uiRow); + f_conStrOutXY( " ", (uiCol + uiLoop * 3 - 1), uiRow); } } @@ -867,29 +867,29 @@ FSTATIC void ViewHelpScreen( void) // Clear the screen and display the menu title - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsScrClr( 0, 1); - WpsScrPos( 0, 3); - WpsStrOut( " RECOGNIZED KEYBOARD CHARACTERS\n"); - WpsStrOut( "\n"); - WpsStrOut( " ESCAPE - Exit Screen\n"); - WpsStrOut( " U,u,8 - Up Arrow\n"); - WpsStrOut( " D,d,2 - Down Arrow\n"); - WpsStrOut( " +,3 - Page Down\n"); - WpsStrOut( " R,r,6 - Right Arrow\n"); - WpsStrOut( " L,l,5 - Left Arrow\n"); - WpsStrOut( " -,9 - Page Up\n"); - WpsStrOut( " H,h,7 - Home\n"); - WpsStrOut( " Z,z,1 - End\n"); - WpsStrOut( " E,e - Edit Data\n"); - WpsStrOut( " A,a - Edit Data in RAW Mode (no checksum)\n"); - WpsStrOut( " G,g - Goto Block\n"); - WpsStrOut( " X,x - Display Hex\n"); - WpsStrOut( " Y,y - Display Decrypted\n"); - WpsStrOut( " S,s - Search\n"); - WpsStrOut( " ? - Show this help screen\n"); - WpsStrOut( "\n"); - WpsStrOut( " PRESS ANY CHARACTER TO EXIT HELP SCREEN\n"); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conClearScreen( 0, 1); + f_conSetCursorPos( 0, 3); + f_conStrOut( " RECOGNIZED KEYBOARD CHARACTERS\n"); + f_conStrOut( "\n"); + f_conStrOut( " ESCAPE - Exit Screen\n"); + f_conStrOut( " U,u,8 - Up Arrow\n"); + f_conStrOut( " D,d,2 - Down Arrow\n"); + f_conStrOut( " +,3 - Page Down\n"); + f_conStrOut( " R,r,6 - Right Arrow\n"); + f_conStrOut( " L,l,5 - Left Arrow\n"); + f_conStrOut( " -,9 - Page Up\n"); + f_conStrOut( " H,h,7 - Home\n"); + f_conStrOut( " Z,z,1 - End\n"); + f_conStrOut( " E,e - Edit Data\n"); + f_conStrOut( " A,a - Edit Data in RAW Mode (no checksum)\n"); + f_conStrOut( " G,g - Goto Block\n"); + f_conStrOut( " X,x - Display Hex\n"); + f_conStrOut( " Y,y - Display Decrypted\n"); + f_conStrOut( " S,s - Search\n"); + f_conStrOut( " ? - Show this help screen\n"); + f_conStrOut( "\n"); + f_conStrOut( " PRESS ANY CHARACTER TO EXIT HELP SCREEN\n"); for (;;) { @@ -900,7 +900,7 @@ FSTATIC void ViewHelpScreen( void) // See what character was pressed - uiChar = (!WpkTestKB()) ? 0 : (WpkIncar()); + uiChar = (!f_conHaveKey()) ? 0 : (f_conGetKey()); if (gv_bShutdown) { return; @@ -966,9 +966,9 @@ FLMUINT ViewGetMenuOption( void) // See what character was pressed viewGiveUpCPU(); - uiChar = (FLMUINT)(!WpkTestKB() + uiChar = (FLMUINT)(!f_conHaveKey() ? (FLMUINT)0 - : (FLMUINT)WpkIncar()); + : (FLMUINT)f_conGetKey()); if (gv_bShutdown) { return( ESCAPE_OPTION); @@ -1071,7 +1071,7 @@ void ViewUpdateDate( FLMUINT uiNumCols; FLMUINT uiNumRows; - WpsScrSize( &uiNumCols, &uiNumRows); + f_conGetScreenSize( &uiNumCols, &uiNumRows); f_timeGetTimeStamp( &CurrTime); // Update the date, if it has changed or the bUpdateFlag is set @@ -1085,8 +1085,8 @@ void ViewUpdateDate( Months [CurrTime.month], (unsigned)CurrTime.day, (unsigned)CurrTime.year); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsStrOutXY( szTempBuf, 0, 0); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conStrOutXY( szTempBuf, 0, 0); } // Update the time, if it has changed or the bUpdateFlag is set @@ -1120,8 +1120,8 @@ void ViewUpdateDate( (unsigned)uiHour, (unsigned)CurrTime.minute, (unsigned)CurrTime.second, szAmPm); - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsStrOutXY( szTempBuf, 66, 0); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conStrOutXY( szTempBuf, 66, 0); } if (bUpdateFlag || @@ -1154,8 +1154,8 @@ void ViewUpdateDate( (unsigned)gv_uiViewLastFileNumber, (unsigned)gv_uiViewLastFileOffset); } - WpsScrBackFor( FLM_BLACK, FLM_WHITE); - WpsStrOutXY( szTempBuf, 47, uiNumRows - 1); + f_conSetBackFore( FLM_BLACK, FLM_WHITE); + f_conStrOutXY( szTempBuf, 47, uiNumRows - 1); } // Save the date and time