本文整理汇总了C++中RC_BAD函数的典型用法代码示例。如果您正苦于以下问题:C++ RC_BAD函数的具体用法?C++ RC_BAD怎么用?C++ RC_BAD使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了RC_BAD函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: f_memset
/****************************************************************************
Desc:
****************************************************************************/
RCODE TestBase::openTestState(
const char * pszDibName)
{
RCODE rc = FERR_OK;
CREATE_OPTS createOpts;
if( RC_BAD( rc = gv_FlmSysData.pFileSystem->doesFileExist( pszDibName)))
{
// Create the database
f_memset( &createOpts, 0, sizeof( CREATE_OPTS));
if( RC_BAD( rc = FlmDbCreate( pszDibName,
NULL, NULL, NULL, NULL, &createOpts, &m_hDb)))
{
goto Exit;
}
}
else
{
// Open the existing database
if( RC_BAD( rc = FlmDbOpen( pszDibName, NULL, NULL,
0, NULL, &m_hDb)))
{
goto Exit;
}
}
Exit:
return( rc);
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:36,代码来源:flmunittest.cpp
示例2: reset
/****************************************************************************
Desc:
****************************************************************************/
void FlagSet::init(
FLMBYTE ** ppucElemArray,
FLMUINT uiNumElems)
{
reset();
if( RC_BAD( f_alloc( sizeof( FLMBYTE *) * uiNumElems,
&m_ppucElemArray)))
{
flmAssert( 0);
}
if( RC_BAD( f_alloc( sizeof( FLMBOOL) * uiNumElems,
&m_pbFlagArray)))
{
flmAssert( 0);
}
f_memset( m_pbFlagArray, 0, sizeof( FLMBOOL) * uiNumElems);
for( FLMUINT uiLoop = 0; uiLoop < uiNumElems; uiLoop++)
{
if( RC_BAD( f_alloc( f_strlen( (char *)ppucElemArray[ uiLoop]) + 1,
&m_ppucElemArray[ uiLoop])))
{
flmAssert( 0);
}
f_strcpy( (char *)m_ppucElemArray[uiLoop], (char *)ppucElemArray[uiLoop]);
}
m_uiNumElems = uiNumElems;
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:36,代码来源:flmunittest.cpp
示例3: expandArgs
/****************************************************************************
Desc:
****************************************************************************/
RCODE ArgList::expandArgs(
char ** ppszArgs,
FLMUINT uiNumArgs)
{
RCODE rc = FERR_OK;
FLMUINT uiLoop;
for( uiLoop = 0; uiLoop < uiNumArgs; uiLoop++)
{
if( ppszArgs[uiLoop][0] == '@')
{
if( RC_BAD( rc = expandFileArgs( &ppszArgs[uiLoop][ 1])))
{
goto Exit;
}
}
else
{
if( RC_BAD( rc = addArg( ppszArgs[ uiLoop])))
{
goto Exit;
}
}
}
Exit:
return( rc);
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:32,代码来源:flmunittest.cpp
示例4: flmAssert
/****************************************************************************
Desc:
****************************************************************************/
FlagSet::FlagSet(
const FlagSet& fs)
{
if( RC_BAD( f_alloc( sizeof( FLMBYTE *) * fs.m_uiNumElems,
&m_ppucElemArray)))
{
flmAssert( 0);
}
if( RC_BAD( f_alloc( sizeof( FLMBOOL) * fs.m_uiNumElems,
&m_pbFlagArray)))
{
flmAssert( 0);
}
f_memset( m_pbFlagArray, 0, sizeof( FLMBOOL) * fs.m_uiNumElems);
for( FLMUINT uiLoop = 0; uiLoop < fs.m_uiNumElems; uiLoop++)
{
if( RC_BAD( f_alloc( f_strlen( (char *)fs.m_ppucElemArray[uiLoop]) + 1,
&m_ppucElemArray[ uiLoop])))
{
flmAssert( 0);
}
f_strcpy( (char *)m_ppucElemArray[uiLoop],
(char *)fs.m_ppucElemArray[uiLoop]);
}
m_uiNumElems = fs.m_uiNumElems;
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:34,代码来源:flmunittest.cpp
示例5: addArg
/****************************************************************************
Desc:
****************************************************************************/
RCODE ArgList::addArg(
const char * pszArg)
{
RCODE rc = FERR_OK;
if( m_uiNumEntries >= m_uiCapacity)
{
if( RC_BAD( rc = resize()))
{
goto Exit;
}
}
if( RC_BAD( rc = f_alloc( f_strlen( pszArg) + 1,
&m_ppszArgs[ m_uiNumEntries])))
{
goto Exit;
}
f_strcpy( m_ppszArgs[ m_uiNumEntries++], pszArg);
Exit:
return( rc);
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:28,代码来源:flmunittest.cpp
示例6: f_sprintf
/****************************************************************************
Desc:
****************************************************************************/
RCODE IFlmTestLogger::appendString(
const char * pszString)
{
RCODE rc = FERR_OK;
char * pszTemp = NULL;
if ( RC_BAD( rc = f_alloc( f_strlen( pszString) + 3, &pszTemp)))
{
goto Exit;
}
f_sprintf( pszTemp, "%s\n", pszString);
if( RC_BAD( rc = f_filecat( m_szFilename, pszString)))
{
goto Exit;
}
Exit:
if ( pszTemp)
{
f_free( &pszTemp);
}
return rc;
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:30,代码来源:flmunittest.cpp
示例7: resize
/****************************************************************************
Desc:
****************************************************************************/
RCODE ArgList::resize( void)
{
RCODE rc = FERR_OK;
FLMUINT uiLoop;
char ** ppszTemp = NULL;
if( RC_BAD( rc = f_alloc( m_uiCapacity * GROW_FACTOR * sizeof(char*),
&ppszTemp)))
{
goto Exit;
}
m_uiCapacity *= GROW_FACTOR;
for( uiLoop = 0; uiLoop < m_uiNumEntries; uiLoop++)
{
if( RC_BAD( rc = f_alloc( f_strlen( m_ppszArgs[ uiLoop]) + 1,
&ppszTemp[ uiLoop])))
{
f_free( &ppszTemp);
goto Exit;
}
f_strcpy( ppszTemp[uiLoop], m_ppszArgs[uiLoop]);
}
f_free( &m_ppszArgs);
m_ppszArgs = ppszTemp;
Exit:
return( rc);
}
开发者ID:ajumi2,项目名称:libflaim,代码行数:36,代码来源:flmunittest.cpp
示例8: processDupKeys
/****************************************************************************
Desc: Checks if the current database has any UNIQUE indexes that need
to checked. Also does duplicate processing for the record.
****************************************************************************/
RCODE F_Db::processDupKeys(
F_INDEX * pIndex)
{
RCODE rc = NE_SFLM_OK;
// Sort and remove duplicates
if (m_uiKrefCount > 1)
{
if (RC_BAD( rc = krefQuickSort( this, pIndex, m_pKrefTbl,
0, m_uiKrefCount - 1)))
{
goto Exit;
}
if (RC_BAD( rc = krefKillDups( this, pIndex,
m_pKrefTbl, &m_uiKrefCount)))
{
goto Exit;
}
}
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:29,代码来源:kyqsort.cpp
示例9: f_yieldCPU
/***************************************************************************
Desc: This routine verifies the LFH blocks.
*****************************************************************************/
RCODE F_DbCheck::verifyLFHBlocks(
FLMBOOL * pbStartOverRV)
{
RCODE rc = NE_XFLM_OK;
m_Progress.ui32LfNumber = 0;
m_Progress.ui32LfType = 0;
m_Progress.i32CheckPhase = XFLM_CHECK_LFH_BLOCKS;
m_Progress.bStartFlag = TRUE;
if (RC_BAD( rc = chkCallProgFunc()))
{
goto Exit;
}
m_Progress.bStartFlag = FALSE;
f_yieldCPU();
// Go through the LFH blocks.
if (RC_BAD( rc = verifyBlkChain(
&m_pDbInfo->m_LFHBlocks, XFLM_LOCALE_LFH_LIST,
(FLMUINT)m_pDb->m_pDatabase->m_lastCommittedDbHdr.ui32FirstLFBlkAddr,
BT_LFH_BLK, pbStartOverRV)) ||
*pbStartOverRV)
{
goto Exit;
}
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:35,代码来源:flchkdb.cpp
示例10: outputKey
/****************************************************************************
Desc: Compose a key buffer from the vector's components.
****************************************************************************/
RCODE XFLAPI F_DataVector::outputKey(
IF_Db * ifpDb,
FLMUINT uiIndexNum,
FLMUINT, // uiMatchFlags, //VISIT: Need to remove this from the interface.
FLMBYTE * pucKeyBuf,
FLMUINT uiKeyBufSize,
FLMUINT * puiKeyLen)
{
RCODE rc = NE_XFLM_OK;
IXD * pIxd;
if (RC_BAD( rc = ((F_Db *)ifpDb)->m_pDict->getIndex( uiIndexNum, NULL, &pIxd, TRUE)))
{
goto Exit;
}
if (RC_BAD( rc = outputKey( pIxd, XFLM_MATCH_IDS | XFLM_MATCH_DOC_ID, pucKeyBuf,
uiKeyBufSize, puiKeyLen, 0)))
{
goto Exit;
}
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:29,代码来源:fvector.cpp
示例11: sizeof
/****************************************************************************
Desc: Set a FLMUINT64 value for a vector element.
****************************************************************************/
RCODE XFLAPI F_DataVector::setUINT64(
FLMUINT uiElementNumber,
FLMUINT64 ui64Num)
{
RCODE rc = NE_XFLM_OK;
FLMBYTE ucStorageBuf [FLM_MAX_NUM_BUF_SIZE];
FLMUINT uiStorageLen;
uiStorageLen = sizeof( ucStorageBuf);
if (RC_BAD( rc = flmNumber64ToStorage( ui64Num,
&uiStorageLen, ucStorageBuf, FALSE, FALSE)))
{
goto Exit;
}
if (RC_BAD( rc = storeValue( uiElementNumber,
XFLM_NUMBER_TYPE, ucStorageBuf, uiStorageLen)))
{
goto Exit;
}
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:28,代码来源:fvector.cpp
示例12: entryCount
/****************************************************************************
Desc: Reinsert all entries given a new root block.
Caller will release 'this'. Used ONLY for building the first
ROOT and two leaves of the tree.
****************************************************************************/
RCODE F_BtreeLeaf::split(
F_BtreeRoot * pNewRoot) // New Non-leaf root
{
RCODE rc = NE_FLM_OK;
FLMBYTE * pucEntry;
FLMUINT uiPos;
FLMUINT uiEntryCount = entryCount();
FLMUINT uiMid = (uiEntryCount + 1) >> 1;
if (RC_BAD( rc = pNewRoot->setupTree( ENTRY_POS(uiMid),
ACCESS_BTREE_LEAF, NULL, NULL)))
{
goto Exit;
}
for (uiPos = 0; uiPos < uiEntryCount; uiPos++)
{
pucEntry = ENTRY_POS( uiPos);
if ((rc = pNewRoot->search( pucEntry)) != NE_FLM_NOT_FOUND)
{
rc = RC_SET_AND_ASSERT( NE_FLM_FAILURE);
goto Exit;
}
if (RC_BAD( rc = pNewRoot->insert( pucEntry)))
{
goto Exit;
}
}
Exit:
return( rc);
}
开发者ID:jlodom,项目名称:FLAIM-Database-For-OS-X,代码行数:39,代码来源:ftkdynbtree.cpp
示例13: f_rwlockCreate
/****************************************************************************
Desc:
****************************************************************************/
RCODE FLMAPI f_rwlockCreate(
F_RWLOCK * phReadWriteLock)
{
RCODE rc = NE_FLM_OK;
F_RWLOCK_IMP * pReadWriteLock = NULL;
if( RC_BAD( rc = f_calloc( sizeof( F_RWLOCK_IMP), &pReadWriteLock)))
{
goto Exit;
}
pReadWriteLock->hMutex = F_MUTEX_NULL;
if( RC_BAD( rc = f_mutexCreate( &pReadWriteLock->hMutex)))
{
goto Exit;
}
*phReadWriteLock = (F_RWLOCK)pReadWriteLock;
pReadWriteLock = NULL;
Exit:
if( pReadWriteLock)
{
f_rwlockDestroy( (F_RWLOCK *)&pReadWriteLock);
}
return( rc);
}
开发者ID:jlodom,项目名称:FLAIM-Database-For-OS-X,代码行数:33,代码来源:ftksem.cpp
示例14: flmAssert
/****************************************************************************
Desc:
****************************************************************************/
RCODE F_FSRestore::openBackupSet( void)
{
RCODE rc = NE_SFLM_OK;
flmAssert( m_bSetupCalled);
flmAssert( !m_pMultiFileHdl);
if( RC_BAD( rc = FlmAllocMultiFileHdl( &m_pMultiFileHdl)))
{
goto Exit;
}
if( RC_BAD( rc = m_pMultiFileHdl->openFile( m_szBackupSetPath)))
{
m_pMultiFileHdl->Release();
m_pMultiFileHdl = NULL;
goto Exit;
}
m_ui64Offset = 0;
m_bOpen = TRUE;
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:29,代码来源:frestore.cpp
示例15: flmGetHdrInfo
/***************************************************************************
Desc: This routine reads the header information in a FLAIM database,
verifies the password, and returns the file header and log
header information.
*****************************************************************************/
RCODE flmGetHdrInfo(
F_SuperFileHdl * pSFileHdl,
XFLM_DB_HDR * pDbHdr,
FLMUINT32 * pui32CalcCRC)
{
RCODE rc = NE_XFLM_OK;
IF_FileHdl * pCFileHdl = NULL;
if( RC_BAD( rc = pSFileHdl->getFileHdl( 0, FALSE, &pCFileHdl)))
{
goto Exit;
}
if( RC_BAD( rc = flmReadAndVerifyHdrInfo( NULL, pCFileHdl,
pDbHdr, pui32CalcCRC)))
{
goto Exit;
}
Exit:
if( pCFileHdl)
{
pCFileHdl->Release();
}
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:33,代码来源:ffilehdr.cpp
示例16: RC_SET
/****************************************************************************
Desc: This routine allocates a new F_Database object and links it
into its hash buckets.
NOTE: This routine assumes that the global mutex has already
been locked. It may unlock it temporarily if there is an error,
but will always relock it before exiting.
****************************************************************************/
RCODE F_DbSystem::allocDatabase(
const char * pszDbPath,
const char * pszDataDir,
FLMBOOL bTempDb,
F_Database ** ppDatabase)
{
RCODE rc = NE_XFLM_OK;
F_Database * pDatabase = NULL;
if ((pDatabase = f_new F_Database( bTempDb)) == NULL)
{
rc = RC_SET( NE_XFLM_MEM);
goto Exit;
}
if (RC_BAD( rc = pDatabase->setupDatabase( pszDbPath, pszDataDir)))
{
goto Exit;
}
*ppDatabase = pDatabase;
Exit:
if (RC_BAD( rc))
{
if (pDatabase)
{
pDatabase->freeDatabase();
}
}
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:40,代码来源:flopen.cpp
示例17: RC_SET
/****************************************************************************
Desc: See if any F_INDEX structures need indexing in the background.
****************************************************************************/
RCODE F_Db::startBackgroundIndexing( void)
{
RCODE rc = NE_SFLM_OK;
FLMBOOL bStartedTrans = FALSE;
FLMUINT uiIndexNum;
F_INDEX * pIndex;
if (RC_BAD( rc = checkState( __FILE__, __LINE__)))
{
goto Exit;
}
if (m_eTransType != SFLM_NO_TRANS)
{
if (!okToCommitTrans())
{
rc = RC_SET( NE_SFLM_ABORT_TRANS);
goto Exit;
}
}
else
{
// Need to have at least a read transaction going.
if (RC_BAD( rc = beginTrans( SFLM_READ_TRANS)))
{
goto Exit;
}
bStartedTrans = TRUE;
}
for (uiIndexNum = 1, pIndex = m_pDict->m_pIndexTbl;
uiIndexNum <= m_pDict->m_uiHighestIndexNum;
uiIndexNum++, pIndex++)
{
// Restart any indexes that are off-line but not suspended
if ((pIndex->uiFlags & (IXD_OFFLINE | IXD_SUSPENDED)) == IXD_OFFLINE)
{
flmAssert( flmBackgroundIndexGet( m_pDatabase,
uiIndexNum, FALSE) == NULL);
if (RC_BAD( rc = startIndexBuild( uiIndexNum)))
{
goto Exit;
}
}
}
Exit:
if (bStartedTrans)
{
(void)abortTrans();
}
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:63,代码来源:fslfileu.cpp
示例18: f_assert
/****************************************************************************
Desc:
****************************************************************************/
RCODE F_IOBufferMgr::setupBufferMgr(
FLMUINT uiMaxBuffers,
FLMUINT uiMaxBytes,
FLMBOOL bReuseBuffers)
{
RCODE rc = NE_FLM_OK;
f_assert( uiMaxBuffers);
f_assert( uiMaxBytes);
if( RC_BAD( rc = f_mutexCreate( &m_hMutex)))
{
goto Exit;
}
#if !defined( FLM_UNIX) && !defined( FLM_NLM)
if( RC_BAD( rc = f_semCreate( &m_hAvailSem)))
{
goto Exit;
}
#endif
m_uiMaxBuffers = uiMaxBuffers;
m_uiMaxBufferBytes = uiMaxBytes;
m_bReuseBuffers = bReuseBuffers;
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:33,代码来源:ftkiobuf.cpp
示例19: name
/****************************************************************************
Desc: Stores a new value for the specified name (or creates a new name/value
pair) in the list of INI_STRUCTs
****************************************************************************/
RCODE FTKAPI F_IniFile::setParam(
const char * pszParamName,
const char * pszParamVal)
{
RCODE rc = NE_FLM_OK;
INI_LINE * pLine;
f_assert( m_bReady);
// If the parameter exists in the list, just store the new value.
// Othewise, create a new INI_LINE and add it to the list
pLine = findParam( pszParamName);
if( !pLine)
{
if( RC_BAD( rc = setParamCommon( &pLine, pszParamName)))
{
goto Exit;
}
}
if( RC_BAD( rc = toAscii( &pLine->pszParamValue, pszParamVal)))
{
goto Exit;
}
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:34,代码来源:ftkini.cpp
示例20: f_memcpy
/****************************************************************************
Desc: Recover a database on startup.
****************************************************************************/
RCODE F_Database::doRecover(
F_Db * pDb,
IF_RestoreClient * pRestoreObj,
IF_RestoreStatus * pRestoreStatus)
{
RCODE rc = NE_XFLM_OK;
XFLM_DB_HDR * pLastCommittedDbHdr;
// At this point, m_lastCommittedDbHdr contains the header
// that was read from disk, which will be the state of the
// header as of the last completed checkpoint. Therefore,
// we copy it into m_checkpointDbHdr.
pLastCommittedDbHdr = &m_lastCommittedDbHdr;
f_memcpy( &m_checkpointDbHdr, pLastCommittedDbHdr, sizeof( XFLM_DB_HDR));
// Do a physical rollback on the database to restore the last
// checkpoint.
if (RC_BAD( rc = pDb->physRollback(
(FLMUINT)pLastCommittedDbHdr->ui32RblEOF,
(FLMUINT)pLastCommittedDbHdr->ui32RblFirstCPBlkAddr,
TRUE,
pLastCommittedDbHdr->ui64RflLastCPTransID)))
{
goto Exit;
}
pLastCommittedDbHdr->ui32RblFirstCPBlkAddr = 0;
pLastCommittedDbHdr->ui32RblEOF = (FLMUINT32)m_uiBlockSize;
if (RC_BAD( rc = writeDbHdr( pDb->m_pDbStats, pDb->m_pSFileHdl,
pLastCommittedDbHdr,
&m_checkpointDbHdr, TRUE)))
{
goto Exit;
}
// Set uiFirstLogCPBlkAddress to zero to indicate that no
// physical blocks have been logged for the current checkpoint.
// The above call to flmPhysRollback will have set the log header
// to the same thing.
m_uiFirstLogCPBlkAddress = 0;
// Set the checkpointDbHdr to be the same as the log header
f_memcpy( &m_checkpointDbHdr, pLastCommittedDbHdr, sizeof( XFLM_DB_HDR));
// Open roll forward log and redo the transactions that
// occurred since the last checkpoint, if any.
if( RC_BAD( rc = m_pRfl->recover( pDb, pRestoreObj, pRestoreStatus)))
{
goto Exit;
}
Exit:
return( rc);
}
开发者ID:Tyrion-Lannister-274AL,项目名称:flaim,代码行数:62,代码来源:flopen.cpp
注:本文中的RC_BAD函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论