bfileinformation.cpp

This is an example of file information use.

#include <stdio.h>
#include "btrieveCpp.h"
openFile(const char *btrieveFileName, BtrieveClient *btrieveClient, BtrieveFile *btrieveFile)
{
// If FileOpen() fails.
if ((status = btrieveClient->FileOpen(btrieveFile, btrieveFileName, NULL, Btrieve::OPEN_MODE_NORMAL)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileOpen():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
leave:
return status;
}
closeFile(BtrieveClient *btrieveClient, BtrieveFile *btrieveFile)
{
// If FileClose() fails.
if ((status = btrieveClient->FileClose(btrieveFile)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveClient::FileClose():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
leave:
return status;
}
printFileInformation(BtrieveFile *btrieveFile)
{
BtrieveFileInformation btrieveFileInformation;
Btrieve::ACSMode btrieveACSMode;
Btrieve::DataType btrieveDataType;
Btrieve::DuplicateMode btrieveDuplicateMode;
Btrieve::FileVersion btrieveFileVersion;
Btrieve::FreeSpaceThreshold btrieveFreeSpaceThreshold;
Btrieve::Index btrieveIndex;
Btrieve::LockMode btrieveLockMode;
Btrieve::NullKeyMode btrieveNullKeyMode;
Btrieve::OwnerMode btrieveOwnerMode;
Btrieve::PageLockType btrievePageLockType;
Btrieve::PageSize btrievePageSize;
Btrieve::RecordCompressionMode btrieveRecordCompressionMode;
Btrieve::SystemDataMode btrieveSystemDataMode;
Btrieve::VariableLengthRecordsMode btrieveVariableLengthRecordsMode;
BtrieveKeySegment btrieveKeySegment;
const char *c;
int i;
int indexCount;
int segmentCount;
long long cursorPosition;
long long recordCount;
long long uniqueValueCount;
// If GetInformation() fails.
if ((status = btrieveFile->GetInformation(&btrieveFileInformation)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFile::GetInformation():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
// If GetBalancedIndexes() fails.
if ((i = btrieveFileInformation.GetBalancedIndexes()) == Btrieve::INDEX_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetBalancedIndexes():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("BalancedIndexes = %s\n", i > 0 ? "Yes" : "No");
// If GetClientTransactions() fails.
if ((i = btrieveFileInformation.GetClientTransactions()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetClientTransactions():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ClientTransactions = %s\n", i > 0 ? "Yes" : "No");
// If GetDuplicateRecordConflictCursorPosition() fails.
if ((cursorPosition = btrieveFileInformation.GetDuplicateRecordConflictCursorPosition()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetDuplicateRecordConflictCursorPosition():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("DuplicateRecordConflictCursorPosition = %lld\n", cursorPosition);
// If GetDuplicateRecordConflictIndex() fails.
if ((btrieveIndex = btrieveFileInformation.GetDuplicateRecordConflictIndex()) == Btrieve::INDEX_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetDuplicateRecordConflictIndex():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("DuplicateRecordConflictIndex = %s\n", Btrieve::IndexToString(btrieveIndex));
// If GetContinuousOperation() fails.
if ((i = btrieveFileInformation.GetContinuousOperation()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetContinuousOperation():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ContinuousOperation = %s\n", i > 0 ? "Yes" : "No");
// If GetExplicitLocks() fails.
if ((i = btrieveFileInformation.GetExplicitLocks()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetExplicitLocks():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ExplicitLocks = %s\n", i > 0 ? "Yes" : "No");
// If GetFileVersion() fails.
if ((btrieveFileVersion = btrieveFileInformation.GetFileVersion()) == Btrieve::FILE_VERSION_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetFileVersion():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("FileVersion = %s\n", Btrieve::FileVersionToString(btrieveFileVersion));
// If GetFixedRecordLength() fails.
if ((i = btrieveFileInformation.GetFixedRecordLength()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetFixedRecordLength():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("FixedRecordLength = %d\n", i);
// If GetFreeSpaceThreshold() fails.
if ((btrieveFreeSpaceThreshold = btrieveFileInformation.GetFreeSpaceThreshold()) == Btrieve::FREE_SPACE_THRESHOLD_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetFreeSpaceThreshold():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("FreeSpaceThreshold = %s\n", Btrieve::FreeSpaceThresholdToString(btrieveFreeSpaceThreshold));
// If GetGatewayMajorVersion() fails.
if ((i = btrieveFileInformation.GetGatewayMajorVersion()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetGatewayMajorVersion():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("GatewayMajorVersion = %d\n", i);
// If GetGatewayMinorVersion() fails.
if ((i = btrieveFileInformation.GetGatewayMinorVersion()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetGatewayMinorVersion():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("GatewayMinorVersion = %d\n", i);
// If GetGatewayName() fails.
if ((c = btrieveFileInformation.GetGatewayName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetGatewayName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("GatewayName = %s\n", c);
// If GetGatewayPatchLevel() fails.
if ((i = btrieveFileInformation.GetGatewayPatchLevel()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetGatewayPatchLevel():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("GatewayPatchLevel = %d\n", i);
// If GetGatewayPlatform() fails.
if ((i = btrieveFileInformation.GetGatewayPlatform()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetGatewayPlatform():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("GatewayPlatform = %d\n", i);
// If GetHandleCount() fails.
if ((i = btrieveFileInformation.GetHandleCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetHandleCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("HandleCount = %d\n", i);
// If GetIdentifier() fails.
if ((i = btrieveFileInformation.GetIdentifier()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetIdentifier():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("Identifier = %d\n", i);
// If GetIndexCount() fails.
if ((indexCount = btrieveFileInformation.GetIndexCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetIndexCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("IndexCount = %d\n", indexCount);
// If GetKeyOnly() fails.
if ((i = btrieveFileInformation.GetKeyOnly()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetKeyOnly():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("KeyOnly = %s\n", i > 0 ? "Yes" : "No");
for (int keySegmentNumber = 1, indexNumber = 0; indexNumber < indexCount; keySegmentNumber++)
{
// If GetKeySegment() fails.
if ((status = btrieveFileInformation.GetKeySegment(&btrieveKeySegment, keySegmentNumber)) != Btrieve::STATUS_CODE_NO_ERROR)
{
printf("Error: BtrieveFileInformation::GetKeySegment():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("KeySegmentNumber = %d\n", keySegmentNumber);
// If GetACSMode() fails.
if ((btrieveACSMode = btrieveKeySegment.GetACSMode()) == Btrieve::ACS_MODE_UNKNOWN)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetACSMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tACSMode = %s\n", Btrieve::ACSModeToString(btrieveACSMode));
// If GetACSNumber() fails.
if ((i = btrieveKeySegment.GetACSNumber()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetACSNumber():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tACSNumber = %d\n", i);
// If GetDataType() fails.
if ((btrieveDataType = btrieveKeySegment.GetDataType()) == Btrieve::DATA_TYPE_UNKNOWN)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetDataType():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tDataType = %s\n", Btrieve::DataTypeToString(btrieveDataType));
// If GetDescendingSortOrder() fails.
if ((i = btrieveKeySegment.GetDescendingSortOrder()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetDescendingSortOrder():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tDescendingSortOrder = %s\n", i > 0 ? "Yes" : "No");
// If GetDuplicateMode() fails.
if ((btrieveDuplicateMode = btrieveKeySegment.GetDuplicateMode()) == Btrieve::DUPLICATE_MODE_UNKNOWN)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetDuplicateMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tDuplicateMode = %s\n", Btrieve::DuplicateModeToString(btrieveDuplicateMode));
// If GetIndex() fails.
if ((btrieveIndex = btrieveKeySegment.GetIndex()) == Btrieve::INDEX_UNKNOWN)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetIndex():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tIndex = %s\n", Btrieve::IndexToString(btrieveIndex));
// If GetKeyContinues() fails.
if ((i = btrieveKeySegment.GetKeyContinues()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetKeyContinues():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tKeyContinues = %s\n", i > 0 ? "Yes" : "No");
// If this key segment is the last key segment of the current index.
if (i == 0)
{
indexNumber++;
}
// If GetLength() fails.
if ((i = btrieveKeySegment.GetLength()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetLength():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tLength = %d\n", i);
// If GetModifiable() fails.
if ((i = btrieveKeySegment.GetModifiable()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetModifiable():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tModifiable = %s\n", i > 0 ? "Yes" : "No");
// If GetNullKeyMode() fails.
if ((btrieveNullKeyMode = btrieveKeySegment.GetNullKeyMode()) == Btrieve::NULL_KEY_MODE_UNKNOWN)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetNullKeyMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tNullKeyMode = %s\n", Btrieve::NullKeyModeToString(btrieveNullKeyMode));
// If GetNullValue() fails.
if ((i = btrieveKeySegment.GetNullValue()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetNullValue():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tNullValue = %d\n", i);
// If GetOffset() fails.
if ((i = btrieveKeySegment.GetOffset()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetOffset():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tOffset = %d\n", i);
// If GetUniqueValueCount() fails.
if ((uniqueValueCount = btrieveKeySegment.GetUniqueValueCount()) < 0)
{
status = btrieveKeySegment.GetLastStatusCode();
printf("Error: BtrieveKeySegment::GetUniqueValueCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("\tUniqueValueCount = %lld\n", uniqueValueCount);
}
// If GetLockOwnerClientIdentifier() fails.
if ((i = btrieveFileInformation.GetLockOwnerClientIdentifier()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerClientIdentifier():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerClientIdentifier = %d\n", i);
// If GetLockOwnerExplicitLockMode() fails.
if ((btrieveLockMode = btrieveFileInformation.GetLockOwnerExplicitLockMode()) == Btrieve::LOCK_MODE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerExplicitLockMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerExplicitLockMode = %s\n", Btrieve::LockModeToString(btrieveLockMode));
// If GetLockOwnerFileLock() fails.
if ((i = btrieveFileInformation.GetLockOwnerFileLock()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerFileLock():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerFileLock = %s\n", i > 0 ? "Yes" : "No");
// If GetLockOwnerImplicitLock() fails.
if ((i = btrieveFileInformation.GetLockOwnerImplicitLock()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerImplicitLock():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerImplicitLock = %s\n", i > 0 ? "Yes" : "No");
// If GetLockOwnerIndex() fails.
if ((btrieveIndex = btrieveFileInformation.GetLockOwnerIndex()) == Btrieve::INDEX_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerIndex():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerIndex = %s\n", Btrieve::IndexToString(btrieveIndex));
// If GetLockOwnerName() fails.
if ((c = btrieveFileInformation.GetLockOwnerName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerName = %s\n", c);
// If GetLockOwnerPageLockType() fails.
if ((btrievePageLockType = btrieveFileInformation.GetLockOwnerPageLockType()) == Btrieve::PAGE_LOCK_TYPE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerPageLockType():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerPageLockType = %s\n", Btrieve::PageLockTypeToString(btrievePageLockType));
// If GetLockOwnerRecordLock() fails.
if ((i = btrieveFileInformation.GetLockOwnerRecordLock()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerRecordLock():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerRecordLock = %s\n", i > 0 ? "Yes" : "No");
// If GetLockOwnerSameProcess() fails.
if ((i = btrieveFileInformation.GetLockOwnerSameProcess()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerSameProcess():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerSameProcess = %s\n", i > 0 ? "Yes" : "No");
// If GetLockOwnerServiceAgentIdentifier() fails.
if ((i = btrieveFileInformation.GetLockOwnerServiceAgentIdentifier()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerServiceAgentIdentifier():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerServiceAgentIdentifier = %d\n", i);
// If GetLockOwnerTimeInTransaction() fails.
if ((i = btrieveFileInformation.GetLockOwnerTimeInTransaction()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerTimeInTransaction():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerTimeInTransaction = %d\n", i);
// If GetLockOwnerTransactionLevel() fails.
if ((i = btrieveFileInformation.GetLockOwnerTransactionLevel()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerTransactionLevel():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerTransactionLevel = %d\n", i);
// If GetLockOwnerWriteHold() fails.
if ((i = btrieveFileInformation.GetLockOwnerWriteHold()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerWriteHold():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerWriteHold = %s\n", i > 0 ? "Yes" : "No");
// If GetLockOwnerWriteNoWait() fails.
if ((i = btrieveFileInformation.GetLockOwnerWriteNoWait()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLockOwnerWriteNoWait():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LockOwnerWriteNoWait = %s\n", i > 0 ? "Yes" : "No");
// If GetLoggable() fails.
if ((i = btrieveFileInformation.GetLoggable()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLoggable():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("Loggable = %s\n", i > 0 ? "Yes" : "No");
// If GetLogIndex() fails.
if ((btrieveIndex = btrieveFileInformation.GetLogIndex()) == Btrieve::INDEX_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetLogIndex():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("LogIndex = %s\n", Btrieve::IndexToString(btrieveIndex));
// If GetOpenTimestamp() fails.
if ((i = btrieveFileInformation.GetOpenTimestamp()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetOpenTimestamp():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("OpenTimestamp = %d\n", i);
// If GetOwnerMode() fails.
if ((btrieveOwnerMode = btrieveFileInformation.GetOwnerMode()) == Btrieve::OWNER_MODE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetOwnerMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("OwnerMode = %s\n", Btrieve::OwnerModeToString(btrieveOwnerMode));
// If GetPageCompression() fails.
if ((i = btrieveFileInformation.GetPageCompression()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetPageCompression():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("PageCompression = %s\n", i > 0 ? "Yes" : "No");
// If GetPagePreallocation() fails.
if ((i = btrieveFileInformation.GetPagePreallocation()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetPagePreallocation():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("PagePreallocation = %s\n", i > 0 ? "Yes" : "No");
// If GetPageSize() fails.
if ((btrievePageSize = btrieveFileInformation.GetPageSize()) == Btrieve::PAGE_SIZE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetPageSize():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("PageSize = %s\n", Btrieve::PageSizeToString(btrievePageSize));
// If GetReadOnly() fails.
if ((i = btrieveFileInformation.GetReadOnly()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetReadOnly():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ReadOnly = %s\n", i > 0 ? "Yes" : "No");
// If GetRecordCompressionMode() fails.
if ((btrieveRecordCompressionMode = btrieveFileInformation.GetRecordCompressionMode()) == Btrieve::RECORD_COMPRESSION_MODE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetRecordCompressionMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("RecordCompressionMode = %s\n", Btrieve::RecordCompressionModeToString(btrieveRecordCompressionMode));
// If GetRecordCount() fails.
if ((recordCount = btrieveFileInformation.GetRecordCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetRecordCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("RecordCount = %lld\n", recordCount);
// If GetReferentialIntegrityConstraints() fails.
if ((i = btrieveFileInformation.GetReferentialIntegrityConstraints()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetReferentialIntegrityConstraints():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ReferentialIntegrityConstraints = %s\n", i > 0 ? "Yes" : "No");
// If GetReferentialIntegrityCursorPosition() fails.
if ((cursorPosition = btrieveFileInformation.GetReferentialIntegrityCursorPosition()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetReferentialIntegrityCursorPosition():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ReferentialIntegrityCursorPosition = %lld\n", cursorPosition);
// If GetReferentialIntegrityFileName() fails.
if ((c = btrieveFileInformation.GetReferentialIntegrityFileName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetReferentialIntegrityFileName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ReferentialIntegrityFileName = %s\n", c);
// If GetReferentialIntegrityOperationCode() fails.
if ((i = btrieveFileInformation.GetReferentialIntegrityOperationCode()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetReferentialIntegrityOperationCode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("ReferentialIntegrityOperationCode = %d\n", i);
// If GetSecurityCurrentDatabaseAuthenticationByDatabase() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseAuthenticationByDatabase()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseAuthenticationByDatabase():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseAuthenticationByDatabase = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseAuthorizationByDatabase() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseAuthorizationByDatabase()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseAuthorizationByDatabase():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseAuthorizationByDatabase = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseBtpasswd() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseBtpasswd()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseBtpasswd():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseBtpasswd = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseExplicit() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseExplicit()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseExplicit():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseExplicit = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseImplicit() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseImplicit()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseImplicit():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseImplicit = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseName() fails.
if ((c = btrieveFileInformation.GetSecurityCurrentDatabaseName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseName = %s\n", c);
// If GetSecurityCurrentDatabasePAM() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabasePAM()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabasePAM():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabasePAM = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseRTSSComplete() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseRTSSComplete()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseRTSSComplete():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseRTSSComplete = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseRTSSDisabled() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseRTSSDisabled()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseRTSSDisabled():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseRTSSDisabled = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseRTSSPreauthorized() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseRTSSPreauthorized()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseRTSSPreauthorized():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseRTSSPreauthorized = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseTrusted() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseTrusted()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseTrusted():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseTrusted = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseWindowsNamedPipe() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseWindowsNamedPipe()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseWindowsNamedPipe():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseWindowsNamedPipe = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentDatabaseWorkgroup() fails.
if ((i = btrieveFileInformation.GetSecurityCurrentDatabaseWorkgroup()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentDatabaseWorkgroup():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentDatabaseWorkgroup = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityCurrentUserName() fails.
if ((c = btrieveFileInformation.GetSecurityCurrentUserName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityCurrentUserName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityCurrentUserName = %s\n", c);
// If GetSecurityHandleAuthenticationByDatabase() fails.
if ((i = btrieveFileInformation.GetSecurityHandleAuthenticationByDatabase()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleAuthenticationByDatabase():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleAuthenticationByDatabase = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleAuthorizationByDatabase() fails.
if ((i = btrieveFileInformation.GetSecurityHandleAuthorizationByDatabase()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleAuthorizationByDatabase():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleAuthorizationByDatabase = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleBtpasswd() fails.
if ((i = btrieveFileInformation.GetSecurityHandleBtpasswd()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleBtpasswd():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleBtpasswd = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleDatabaseName() fails.
if ((c = btrieveFileInformation.GetSecurityHandleDatabaseName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleDatabaseName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleDatabaseName = %s\n", c);
// If GetSecurityHandleExplicit() fails.
if ((i = btrieveFileInformation.GetSecurityHandleExplicit()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleExplicit():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleExplicit = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleImplicit() fails.
if ((i = btrieveFileInformation.GetSecurityHandleImplicit()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleImplicit():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleImplicit = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandlePAM() fails.
if ((i = btrieveFileInformation.GetSecurityHandlePAM()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandlePAM():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandlePAM = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleRTSSComplete() fails.
if ((i = btrieveFileInformation.GetSecurityHandleRTSSComplete()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleRTSSComplete():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleRTSSComplete = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleRTSSDisabled() fails.
if ((i = btrieveFileInformation.GetSecurityHandleRTSSDisabled()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleRTSSDisabled():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleRTSSDisabled = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleRTSSPreauthorized() fails.
if ((i = btrieveFileInformation.GetSecurityHandleRTSSPreauthorized()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleRTSSPreauthorized():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleRTSSPreauthorized = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleTableName() fails.
if ((c = btrieveFileInformation.GetSecurityHandleTableName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleTableName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleTableName = %s\n", c);
// If GetSecurityHandleTrusted() fails.
if ((i = btrieveFileInformation.GetSecurityHandleTrusted()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleTrusted():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleTrusted = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleUserName() fails.
if ((c = btrieveFileInformation.GetSecurityHandleUserName()) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleUserName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleUserName = %s\n", c);
// If GetSecurityHandleWindowsNamedPipe() fails.
if ((i = btrieveFileInformation.GetSecurityHandleWindowsNamedPipe()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleWindowsNamedPipe():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleWindowsNamedPipe = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityHandleWorkgroup() fails.
if ((i = btrieveFileInformation.GetSecurityHandleWorkgroup()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityHandleWorkgroup():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityHandleWorkgroup = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionAlter() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionAlter()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionAlter():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionAlter = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionCreateFile() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionCreateFile()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionCreateFile():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionCreateFile = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionCreateStoredProcedure() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionCreateStoredProcedure()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionCreateStoredProcedure():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionCreateStoredProcedure = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionCreateView() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionCreateView()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionCreateView():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionCreateView = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionDelete() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionDelete()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionDelete():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionDelete = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionExecute() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionExecute()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionExecute():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionExecute = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionCreateRecord() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionCreateRecord()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionCreateRecord():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionCreateRecord = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionNoRights() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionNoRights()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionNoRights():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionNoRights = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionOpen() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionOpen()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionOpen():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionOpen = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionRead() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionRead()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionRead():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionRead = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionRefer() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionRefer()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionRefer():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionRefer = %s\n", i > 0 ? "Yes" : "No");
// If GetSecurityPermissionUpdate() fails.
if ((i = btrieveFileInformation.GetSecurityPermissionUpdate()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSecurityPermissionUpdate():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SecurityPermissionUpdate = %s\n", i > 0 ? "Yes" : "No");
// If GetSegmented() fails.
if ((i = btrieveFileInformation.GetSegmented()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSegmented():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("Segmented = %s\n", i > 0 ? "Yes" : "No");
// If GetSegmentCount() fails.
if ((segmentCount = btrieveFileInformation.GetSegmentCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSegmentCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SegmentCount = %d\n", segmentCount);
for (i = 1; i <= segmentCount; i++)
{
// If GetSegmentFileName() fails.
if ((c = btrieveFileInformation.GetSegmentFileName(i)) == NULL)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSegmentFileName():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SegmentFileName = %s\n", c);
}
// If GetSystemDataMode() fails.
if ((btrieveSystemDataMode = btrieveFileInformation.GetSystemDataMode()) == Btrieve::SYSTEM_DATA_MODE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemDataMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SystemDataMode = %s\n", Btrieve::SystemDataModeToString(btrieveSystemDataMode));
// If GetSystemIndexPresent() fails.
if ((i = btrieveFileInformation.GetSystemIndexPresent()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemIndexPresent():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SystemIndexPresent = %s\n", i > 0 ? "Yes" : "No");
// If GetSystemIndexSize() fails.
if ((i = btrieveFileInformation.GetSystemIndexSize()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemIndexSize():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SystemIndexSize = %d\n", i);
// If GetSystemIndexUsed() fails.
if ((i = btrieveFileInformation.GetSystemIndexUsed()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemIndexUsed():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SystemIndexUsed = %s\n", i > 0 ? "Yes" : "No");
// If GetSystemIndexVersion() fails.
if ((i = btrieveFileInformation.GetSystemIndexVersion()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemIndexVersion():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("SystemIndexVersion = %d\n", i);
// If GetUnusedDuplicatePointerCount() fails.
if ((i = btrieveFileInformation.GetUnusedDuplicatePointerCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetUnusedDuplicatePointerCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("UnusedDuplicatePointerCount = %d\n", i);
// If GetUnusedPageCount() fails.
if ((i = btrieveFileInformation.GetUnusedPageCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetUnusedPageCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("UnusedPageCount = %d\n", i);
// If GetUsageCount() fails.
if ((i = btrieveFileInformation.GetUsageCount()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetUsageCount():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("UsageCount = %d\n", i);
// If GetVariableLengthRecordsMode() fails.
if ((btrieveVariableLengthRecordsMode = btrieveFileInformation.GetVariableLengthRecordsMode()) == Btrieve::VARIABLE_LENGTH_RECORDS_MODE_UNKNOWN)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetVariableLengthRecordsMode():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("VariableLengthRecordsMode = %s\n", Btrieve::VariableLengthRecordsModeToString(btrieveVariableLengthRecordsMode));
// If GetWrongOwner() fails.
if ((i = btrieveFileInformation.GetWrongOwner()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetWrongOwner():%d:%s.\n", status, Btrieve::StatusCodeToString(status));
goto leave;
}
printf("WrongOwner = %s\n", i > 0 ? "Yes" : "No");
leave:
return status;
}
int
main(int argc, char *argv[])
{
BtrieveClient btrieveClient(0x4232, 0);
BtrieveFile btrieveFile;
char *btrieveFileName;
// If the incorrect number of arguments were given.
if (argc != 2)
{
printf("Usage: %s btrieveFileName\n", argv[0]);
goto leave;
}
btrieveFileName = argv[1];
// If openFile() fails.
if ((status = openFile(btrieveFileName, &btrieveClient, &btrieveFile)) != Btrieve::STATUS_CODE_NO_ERROR)
{
goto leave;
}
// If printFileInformation() fails.
if ((status = printFileInformation(&btrieveFile)) != Btrieve::STATUS_CODE_NO_ERROR)
{
goto leave;
}
// If closeFile() fails.
if ((status = closeFile(&btrieveClient, &btrieveFile)) != Btrieve::STATUS_CODE_NO_ERROR)
{
goto leave;
}
leave:
// If there wasn't a failure.
return 0;
return 1;
}