Added FTK console I/O routines to support FLAIM utilities. Misc. changes to the slab allocator.

git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@505 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
ahodgkinson
2006-06-05 19:13:55 +00:00
parent 5fa1801ce9
commit f672e7590f
10 changed files with 424 additions and 355 deletions

View File

@@ -96,12 +96,6 @@ public:
FLMUINT uiIoFlags,
IF_FileHdl ** ppFile);
RCODE FLMAPI createBlockFile(
const char * pszFileName,
FLMUINT uiIoFlags,
FLMUINT uiBlockSize,
IF_FileHdl ** ppFile);
RCODE FLMAPI createUniqueFile(
char * pszPath,
const char * pszFileExtension,
@@ -117,12 +111,6 @@ public:
FLMUINT uiIoFlags,
IF_FileHdl ** ppFile);
RCODE FLMAPI openBlockFile(
const char * pszFileName,
FLMUINT uiIoFlags,
FLMUINT uiBlockSize,
IF_FileHdl ** ppFile);
RCODE FLMAPI openDir(
const char * pszDirName,
const char * pszPattern,
@@ -413,12 +401,30 @@ Desc:
RCODE f_allocFileSystem(
IF_FileSystem ** ppFileSystem)
{
if( (*ppFileSystem = f_new F_FileSystem) == NULL)
RCODE rc = NE_FLM_OK;
F_FileSystem * pFileSystem = NULL;
if( (pFileSystem = f_new F_FileSystem) == NULL)
{
return( RC_SET( NE_FLM_MEM));
}
if( RC_BAD( rc = pFileSystem->setup()))
{
goto Exit;
}
*ppFileSystem = pFileSystem;
pFileSystem = NULL;
Exit:
if( pFileSystem)
{
pFileSystem->Release();
}
return( NE_FLM_OK);
return( rc);
}
/****************************************************************************
@@ -509,43 +515,6 @@ Exit:
return( rc);
}
/****************************************************************************
Desc: Create a block-oriented file, return a file handle to created file.
****************************************************************************/
RCODE FLMAPI F_FileSystem::createBlockFile(
const char * pszFileName,
FLMUINT uiIoFlags,
FLMUINT uiBlockSize,
IF_FileHdl ** ppFileHdl)
{
RCODE rc = NE_FLM_OK;
F_FileHdl * pFileHdl = NULL;
if( RC_BAD( rc = f_allocFileHdl( &pFileHdl)))
{
goto Exit;
}
pFileHdl->setBlockSize( uiBlockSize);
if (RC_BAD( rc = pFileHdl->create( pszFileName, uiIoFlags)))
{
goto Exit;
}
*ppFileHdl = pFileHdl;
pFileHdl = NULL;
Exit:
if( pFileHdl)
{
pFileHdl->Release();
}
return( rc);
}
/****************************************************************************
Desc: Create a unique file, return a file handle to created file.
****************************************************************************/
@@ -616,43 +585,6 @@ Exit:
return( rc);
}
/****************************************************************************
Desc: Open a block-oriented file, return a file handle to opened file.
****************************************************************************/
RCODE FLMAPI F_FileSystem::openBlockFile(
const char * pszFileName,
FLMUINT uiIoFlags,
FLMUINT uiBlockSize,
IF_FileHdl ** ppFileHdl)
{
RCODE rc = NE_FLM_OK;
F_FileHdl * pFileHdl = NULL;
if( RC_BAD( rc = f_allocFileHdl( &pFileHdl)))
{
goto Exit;
}
pFileHdl->setBlockSize( uiBlockSize);
if (RC_BAD( rc = pFileHdl->open( pszFileName, uiIoFlags)))
{
goto Exit;
}
*ppFileHdl = pFileHdl;
pFileHdl = NULL;
Exit:
if( pFileHdl)
{
pFileHdl->Release();
}
return( rc);
}
/****************************************************************************
Desc: Open a directory, return a file handle to opened directory.
****************************************************************************/
@@ -2482,3 +2414,25 @@ Exit:
return( rc);
}
/****************************************************************************
Desc:
****************************************************************************/
RCODE FLMAPI f_pathReduce(
const char * pszSourcePath,
char * pszDestPath,
char * pszString)
{
return( f_getFileSysPtr()->pathReduce(
pszSourcePath, pszDestPath, pszString));
}
/****************************************************************************
Desc:
****************************************************************************/
RCODE FLMAPI f_pathAppend(
char * pszPath,
const char * pszPathComponent)
{
return( f_getFileSysPtr()->pathAppend( pszPath, pszPathComponent));
}