Btrieve 2
Loading...
Searching...
No Matches
bfileinformation.cpp

This is an example of file information use written in C++.

#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()) < 0)
{
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 GetSystemData() fails.
if ((i = btrieveFileInformation.GetSystemData()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemData():%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 GetSystemIndex() fails.
if ((i = btrieveFileInformation.GetSystemIndex()) < 0)
{
status = btrieveFileInformation.GetLastStatusCode();
printf("Error: BtrieveFileInformation::GetSystemIndex():%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[])
{
static const char *usage = "Usage: %s btrieveFileName\n";
BtrieveClient btrieveClient;
BtrieveFile btrieveFile;
char *btrieveFileName;
// If the incorrect number of arguments were given.
if (argc != 2)
{
printf(usage, 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;
}
The Btrieve client class.
Definition btrieveCpp.h:1388
Btrieve::StatusCode FileClose(BtrieveFile *btrieveFile)
Close a file.
Btrieve::StatusCode FileOpen(BtrieveFile *btrieveFile, const char *fileName, const char *ownerName, Btrieve::OpenMode openMode, Btrieve::LocationMode locationMode=Btrieve::LOCATION_MODE_NO_PREFERENCE)
Open a file.
The Btrieve file information class.
Definition btrieveCpp.h:2576
int GetUnusedPageCount()
Get the unused page count.
Btrieve::Index GetLockOwnerIndex()
Get the lock owner index.
Btrieve::RecordCompressionMode GetRecordCompressionMode()
Get the record compression mode.
int GetWrongOwner()
Get wrong owner.
int GetSystemIndex()
Get system index.
int GetSystemIndexSize()
Get the system index size.
int GetSecurityCurrentDatabaseRTSSDisabled()
Get security current database RTSS (Runtime Server Support) disabled.
Btrieve::Index GetDuplicateRecordConflictIndex()
Get the duplicate record conflict index.
int GetSecurityCurrentDatabaseImplicit()
Get security current database implicit.
int GetBalancedIndexes()
Get balanced indexes.
int GetLockOwnerServiceAgentIdentifier()
Get the lock owner service agent identifier.
int GetSecurityPermissionCreateView()
Get security permission create view.
const char * GetSecurityHandleTableName()
Get the security handle table name.
int GetExplicitLocks()
Get explicit locks.
int GetSecurityCurrentDatabasePAM()
Get security current database PAM (Pluggable Authentication Module).
int GetSecurityHandleWorkgroup()
Get security handle workgroup.
int GetLoggable()
Get loggable.
const char * GetReferentialIntegrityFileName()
Get the referential integrity file name.
long long GetDuplicateRecordConflictCursorPosition()
Get the duplicate record conflict cursor position.
Btrieve::SystemDataMode GetSystemDataMode()
Get the system data mode.
int GetSecurityHandleImplicit()
Get security handle implicit.
int GetClientTransactions()
Get client transactions.
const char * GetGatewayName()
Get the gateway name.
const char * GetSecurityCurrentUserName()
Get the security current user name.
const char * GetSecurityHandleDatabaseName()
Get the security handle database name.
Btrieve::FileVersion GetFileVersion()
Get the file version.
int GetSecurityPermissionOpen()
Get security permission open.
int GetSecurityHandlePAM()
Get security handle PAM (Pluggable Authentication Module).
int GetHandleCount()
Get the handle count.
int GetLockOwnerSameProcess()
Get lock owner same process.
int GetGatewayPlatform()
Get the gateway platform.
int GetSecurityCurrentDatabaseExplicit()
Get security current database explicit.
int GetSystemData()
Get system data.
int GetIndexCount()
Get the index count.
const char * GetSegmentFileName(int segmentFileNumber)
Get the segment file name.
Btrieve::PageLockType GetLockOwnerPageLockType()
Get the lock owner page lock type.
int GetUnusedDuplicatePointerCount()
Get the unused duplicate pointer count.
int GetGatewayPatchLevel()
Get the gateway patch level.
const char * GetLockOwnerName()
Get the lock owner name.
Btrieve::StatusCode GetLastStatusCode()
Get the last status code.
int GetSecurityHandleExplicit()
Get security handle explicit.
Btrieve::LockMode GetLockOwnerExplicitLockMode()
Get the lock owner explcit lock mode.
int GetSecurityCurrentDatabaseAuthenticationByDatabase()
Get security current database authentication by database.
long long GetReferentialIntegrityCursorPosition()
Get the referential integrity cursor position.
Btrieve::OwnerMode GetOwnerMode()
Get the owner mode.
int GetReferentialIntegrityConstraints()
Get referential integrity constraints.
int GetSecurityHandleAuthorizationByDatabase()
Get security handle authorization by database.
int GetSystemIndexVersion()
Get the system index version.
int GetPageCompression()
Get page compression.
int GetSecurityHandleBtpasswd()
Get security handle Btpasswd.
int GetLockOwnerWriteHold()
Get lock owner write hold.
int GetIdentifier()
Get the identifier.
int GetSecurityCurrentDatabaseTrusted()
Get security current database trusted.
int GetSegmented()
Get segmented.
int GetLockOwnerWriteNoWait()
Get lock owner write no wait.
int GetSecurityHandleAuthenticationByDatabase()
Get security handle authentication by database.
int GetSecurityPermissionAlter()
Get security permission alter.
int GetLockOwnerTimeInTransaction()
Get the lock owner time in transaction.
int GetPagePreallocation()
Get page preallocation.
long long GetRecordCount()
Get the record count.
int GetSecurityHandleRTSSComplete()
Get security handle RTSS (Runtime Server Support) complete.
int GetGatewayMajorVersion()
Get the gateway major version.
int GetSecurityCurrentDatabaseBtpasswd()
Get security current database Btpasswd.
Btrieve::Index GetLogIndex()
Get the log index.
int GetUsageCount()
Get the usage count.
int GetSecurityHandleRTSSPreauthorized()
Get security handle RTSS (Runtime Server Support) preautorized.
Btrieve::PageSize GetPageSize()
Get the page size.
int GetSecurityCurrentDatabaseAuthorizationByDatabase()
Get security current database authorization by database.
int GetSecurityHandleTrusted()
Get security handle trusted.
Btrieve::VariableLengthRecordsMode GetVariableLengthRecordsMode()
Get the variable length records mode.
const char * GetSecurityHandleUserName()
Get the security handle user name.
const char * GetSecurityCurrentDatabaseName()
Get the security current database name.
int GetReadOnly()
Get read only.
Btrieve::StatusCode GetKeySegment(BtrieveKeySegment *btrieveKeySegment, int keySegmentNumber)
Get a key segment.
int GetSecurityHandleRTSSDisabled()
Get security handle RTSS (Runtime Server Support) disabled.
int GetLockOwnerRecordLock()
Get lock owner record lock.
int GetKeyOnly()
Get key only.
int GetSecurityPermissionRefer()
Get security permission refer.
int GetLockOwnerTransactionLevel()
Get the lock owner transaction level.
int GetContinuousOperation()
Get continuous operation.
int GetLockOwnerImplicitLock()
Get lock owner implicit lock.
int GetSecurityPermissionCreateRecord()
Get security permission record create.
int GetSecurityPermissionCreateFile()
Get security permission file create.
int GetSecurityPermissionRead()
Get security permission read.
int GetSecurityCurrentDatabaseWindowsNamedPipe()
Get security current database Windows named pipe.
int GetSecurityPermissionCreateStoredProcedure()
Get security permission create stored procedure.
int GetGatewayMinorVersion()
Get the gateway minor version.
int GetLockOwnerClientIdentifier()
Get the lock owner client identifier.
int GetSegmentCount()
Get the segment count.
int GetSecurityPermissionUpdate()
Get security permission update.
int GetSecurityPermissionDelete()
Get security permission delete.
int GetSecurityPermissionNoRights()
Get security permission no rights.
int GetFixedRecordLength()
Get the fixed record length.
int GetSecurityHandleWindowsNamedPipe()
Get security handle Windows named pipe.
int GetSecurityCurrentDatabaseRTSSComplete()
Get security current database RTSS (Runtime Server Support) complete.
Btrieve::FreeSpaceThreshold GetFreeSpaceThreshold()
Get the free space threshold.
int GetSecurityCurrentDatabaseWorkgroup()
Get security current database workgroup.
int GetOpenTimestamp()
Get the open timestamp.
int GetSecurityCurrentDatabaseRTSSPreauthorized()
Get security current database RTSS (Runtime Server Support) preauthorized.
int GetSecurityPermissionExecute()
Get security permission execute.
int GetReferentialIntegrityOperationCode()
Get the referential integrity operation code.
int GetLockOwnerFileLock()
Get lock owner file lock.
The Btrieve file class.
Definition btrieveCpp.h:1729
Btrieve::StatusCode GetInformation(BtrieveFileInformation *btrieveFileInformation)
Get the file information.
The Btrieve key segment class.
Definition btrieveCpp.h:3874
Btrieve::DuplicateMode GetDuplicateMode()
Get the duplicate mode.
int GetLength()
Get the length.
int GetOffset()
Get the offset.
long long GetUniqueValueCount()
Get the unique value count.
Btrieve::StatusCode GetLastStatusCode()
Get the last status code.
Btrieve::DataType GetDataType()
Get the data type.
int GetACSNumber()
Get the alternate collation sequence number.
Btrieve::NullKeyMode GetNullKeyMode()
Get the null key mode.
int GetKeyContinues()
Get key continues.
Btrieve::Index GetIndex()
Get the index.
int GetModifiable()
Get modifiable.
int GetNullValue()
Get the null value.
int GetDescendingSortOrder()
Get descending sort order.
Btrieve::ACSMode GetACSMode()
Get the alternate collation sequence mode.
VariableLengthRecordsMode
The Btrieve variable length records modes.
Definition btrieveCpp.h:1239
@ VARIABLE_LENGTH_RECORDS_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:1247
static const char * PageSizeToString(PageSize pageSize)
Return a page size as a string.
static const char * FreeSpaceThresholdToString(FreeSpaceThreshold freeSpaceThreshold)
Return a free space threshold as a string.
static const char * VariableLengthRecordsModeToString(VariableLengthRecordsMode variableLengthRecordsMode)
Return a variable length records mode as a string.
static const char * RecordCompressionModeToString(RecordCompressionMode recordCompressionMode)
Return an record compression mode as a string.
SystemDataMode
The Btrieve system data modes.
Definition btrieveCpp.h:1200
@ SYSTEM_DATA_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:1210
FileVersion
The Btrieve file versions.
Definition btrieveCpp.h:267
@ FILE_VERSION_UNKNOWN
Unknown.
Definition btrieveCpp.h:287
static const char * ACSModeToString(ACSMode ACSMode)
Return an alternate collation sequence mode as a string.
static const char * StatusCodeToString(StatusCode statusCode)
Return a status code as a string.
static const char * NullKeyModeToString(NullKeyMode nullKeyMode)
Return a null key mode as a string.
PageLockType
The Btrieve page lock type.
Definition btrieveCpp.h:655
@ PAGE_LOCK_TYPE_UNKNOWN
Unknown.
Definition btrieveCpp.h:665
LockMode
The Btrieve lock modes.
Definition btrieveCpp.h:573
@ LOCK_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:585
static const char * OwnerModeToString(OwnerMode ownerMode)
Return an owner mode as a string.
PageSize
The Btrieve page sizes.
Definition btrieveCpp.h:671
@ PAGE_SIZE_UNKNOWN
Unknown.
Definition btrieveCpp.h:693
StatusCode
The Btrieve status codes.
Definition btrieveCpp.h:713
@ STATUS_CODE_UNKNOWN
-7 - Unknown.
Definition btrieveCpp.h:1194
@ STATUS_CODE_NO_ERROR
0 - No error.
Definition btrieveCpp.h:715
static const char * SystemDataModeToString(SystemDataMode systemDataMode)
Return a system data mode as a string.
static const char * DuplicateModeToString(DuplicateMode duplicateMode)
Return a duplicate mode as a string.
DuplicateMode
The Btrieve duplicate modes.
Definition btrieveCpp.h:183
@ DUPLICATE_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:191
FreeSpaceThreshold
The Btrieve free space thresholds.
Definition btrieveCpp.h:293
@ FREE_SPACE_THRESHOLD_UNKNOWN
Unknown.
Definition btrieveCpp.h:303
NullKeyMode
The Btrieve null key modes.
Definition btrieveCpp.h:591
@ NULL_KEY_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:599
@ OPEN_MODE_NORMAL
Normal.
Definition btrieveCpp.h:606
static const char * PageLockTypeToString(PageLockType pageLockType)
Return a page lock type as a string.
ACSMode
The Btrieve alternate collation sequence modes.
Definition btrieveCpp.h:53
@ ACS_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:65
OwnerMode
The Btrieve file owner modes.
Definition btrieveCpp.h:621
@ OWNER_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:633
static const char * LockModeToString(LockMode lockMode)
Return a lock mode as a string.
RecordCompressionMode
The Btrieve record compression modes.
Definition btrieveCpp.h:699
@ RECORD_COMPRESSION_MODE_UNKNOWN
Unknown.
Definition btrieveCpp.h:707
static const char * FileVersionToString(FileVersion fileVersion)
Return a file version as a string.
static const char * IndexToString(Index index)
Return an index as a string.
DataType
The Btrieve data types.
Definition btrieveCpp.h:197
@ DATA_TYPE_UNKNOWN
Unknown.
Definition btrieveCpp.h:261
static const char * DataTypeToString(DataType dataType)
Return a data type as a string.
Index
The Btrieve indexes.
Definition btrieveCpp.h:309
@ INDEX_UNKNOWN
Unknown.
Definition btrieveCpp.h:555