tfs/rdmAllocTFS.c
RDM_RETCODE exampleTfs_rdmAllocTFS (const char *databaseName)
{
RDM_TFS tfs;
RDM_DB db;
/* Set the TFS type to 'embedded' */
rc = rdm_rdmAllocTFS (&tfs);
if (rc == sOKAY)
{
rc = rdm_tfsSetOptions (tfs, "tfstype=embed");
if (rc == sOKAY)
{
rc = rdm_tfsInitialize (tfs);
if (rc == sOKAY)
{
rc = rdm_tfsAllocDatabase (tfs, &db);
if (rc == sOKAY)
{
rc = rdm_dbOpen (db, databaseName, RDM_OPEN_SHARED);
if (rc == sOKAY)
{
printf ("Database (%s) is open!\n", databaseName);
rc = rdm_dbFree (db);
}
}
}
}
rc = rdm_tfsFree (tfs);
}
return rc;
}
RDM_RETCODE rdm_rdmAllocTFS(RDM_TFS *phTFS)
Allocate a TFS handle.
RDM_RETCODE rdm_dbFree(RDM_DB db)
Free a database handle.
RDM_RETCODE rdm_dbOpen(RDM_DB db, const char *dbNameSpec, RDM_OPEN_MODE mode)
Open an existing RDM database using the specified database handle.
@ sOKAY
Definition: rdmretcodetypes.h:97
RDM_RETCODE rdm_tfsAllocDatabase(RDM_TFS tfs, RDM_DB *pDb)
Allocate memory for a new RDM db.
@ RDM_OPEN_SHARED
Definition: rdmtypes.h:253
struct RDM_TFS_S * RDM_TFS
RDM TFS Handle.
Definition: rdmtfstypes.h:21
struct RDM_DB_S * RDM_DB
Definition: rdmtypes.h:305
RDM_RETCODE rdm_tfsFree(RDM_TFS hTFS)
Terminate a TFS service.
RDM_RETCODE rdm_tfsSetOptions(RDM_TFS tfs, const char *optString)
Set TFS options.
RDM_RETCODE
RDM status and error return codes.
Definition: rdmretcodetypes.h:43
RDM_RETCODE rdm_tfsInitialize(RDM_TFS tfs)
Initialize a RDM_TFS instance.