c-treeDB C API Function DescriptionsThis document lists the c-treeDB C API Functions with a brief explanation of each function.ctdbAbort Abort a transaction.ctdbAddDatabase Add an existing database to a session.ctdbAddField Add a new field to a table.ctdbAddIndex Add a new indext to a table.ctdbAddSegment Add a new index segment.ctdbAddSegmentByName Add a new index segment, given the field name.ctdbAddSegmentByNbr Add a new index segment, given the field and index num- bers.ctdbAddSegmentEx Add a new extended index segment.ctdbAddTable Add an existing table to a database.ctdbAllocDatabase Allocate and initiate a new database handle.ctdbAllocRecord Allocate a new c-treeDB C API record handle.ctdbAllocSession Allocate a new session handle and set the default attributes.ctdbAllocTable Allocate a new table handle.ctdbAlterTable Rebuild existing table based on field, index and segment changes.ctdbBegin Start a transaction.ctdbBigIntToCurrency Convert a big integer value to a CTCURRENCY value.ctdbBigIntToFloat Convert a big integer value to a float.ctdbBigIntToLong Convert a big integer value to a LONG.ctdbBigIntToNumber Convert a big integer to a CTNUMBER value.ctdbBigIntToString Convert a big integer value to a string.ctdbBlobAlloc Allocate a new blob type.ctdbBlobClear Clear a blob variable by releasing memory associated with data.ctdbBlobCmp Compare two blobs.ctdbBlobFree Release all resources associated with a blob.ctdbBlobGetData Return a pointer to the blob data.ctdbBlobGetSize Return the allocated size of a blob.ctdbBlobSet Set the blob data.ctdbBuildTargetKey Build a target key based on data in record buffer.ctdbClearError Clear the error code.ctdbClearField Clear the field data.ctdbClearRecord Clear the record buffer.ctdbCloseAll Close all open tables associated with a given database.ctdbCloseTable Close an open table.ctdbCommit Commit a transaction.ctdbConnect Connect to a database.ctdbCreateDatabase Create a new database.ctdbCreateSession Create a new session table.ctdbCreateTable Create a new table.ctdbCurrencyAbs Return the absolute value of a CTCURRENCY type value.ctdbCurrencyAdd Add two currency values. pResult = left + rightctdbCurrencyCmp Compare two CTCURRENCY type values.ctdbCurrencyDiv Divide a currency value by another currency value. pResult = left / rightctdbCurrencyMul Multiply two CTCURRENCY values.ctdbCurrencyRound Round a currency value to a given number of decimal places.ctdbCurrencySub Subtract two currency values. pResult = left - rightctdbCurrencyToBigInt Convert a CTCURRENCY value to a big integer value.ctdbCurrencyToFloat Convert a CTCURRENCY value to a float value.ctdbCurrencyToLong Convert a CTCURRENCY value to a LONG value.ctdbCurrencyToMoney Convert a CTCURRENCY value to a CTMONEY value.ctdbCurrencyToNumber Convert a CTCURRENCY value to a CTNUMBER value.ctdbCurrencyToString Convert a CTCURRENCY value to a string value.ctdbCurrentDate Retrieve the current system date.ctdbCurrentDateTime Retrieve the current system date and time.ctdbCurrentTime Retrieve the current system time.ctdbDateCheck Check if a given date is valid.ctdbDatePack Pack a date in the form day, month and year into a CTDATE form.ctdbDateTimeGetDate Retrieve a CTDATE type value from a CTDATETIME type valuectdbDateTimeGetTime Retrieve a CTTIME type value from a CTDATETIME type value.ctdbDateTimePack Pack a date and time in the form day, month, year, hour, minute, second into a CTDATETIME form.ctdbDateTimeSetDate Set a CTDATETIME type value with a CTDATE type value.ctdbDateTimeSetTime Set a CTDATETIME type value with a CTTIME type value.ctdbDateTimeToString Convert a packed CTDATETIME into a string.ctdbDateTimeUnpack Unpack a date and time CTDATETIME value into the form day, month, year, hour, minute, second.ctdbDateToString Convert a packed CTDATE into a string.ctdbDateUnpack Unpack a CTDATE date into the form day, month and year.ctdbDayOfWeek Retrieve the day of the week from a packed CTDATE.ctdbDeleteDatabase Drop the database from session and delete database file and index.ctdbDeleteRecord Delete an existing record.ctdbDeleteTable Drop a table from a database and delete table from disk.ctdbDelField Delete the field indicated by the field number Index.ctdbDelFieldByName Delete the field indicated by the field name.ctdbDelIndex Delete an index from a table.ctdbDelSegment Delete segment indicated by SegNumber.ctdbDelSegmentEx Delete extended segment.ctdbDisconnect Disconnect a database.ctdbDisconnectAll Disconnect all databases.ctdbDropDatabase Drop a database from a session dictionary. The data and index files are not deleted from disk.ctdbDropTable Drop the table from the database, but does not delete the table from disk.ctdbDuplicateRecord Return a duplicate copy of a record.ctdbFilterRecord Set the filtering logic for the table.ctdbFindActiveDatabase Locate an active database by name and returns its Han- dle.ctdbFindActiveDatabaseByUID Locate an active database by its unique identifier and returns its Handle.ctdbFindActiveTable Locate an active table by name and returns its Handle.ctdbFindActiveTableByUID Locate an active table by its unique identifier and locate its Handle.ctdbFindDatabase Locate a database by name.ctdbFindDatabaseByUID Locate a database by its unique identifier.ctdbFindRecord Find a record using the FindMode as the find strategy.ctdbFindRowid Find a record based on its rowid.ctdbFindTable Find a table in a database dictionary.ctdbFindTableByUID Locate a table in a database dictionary by its unique identifier.ctdbFindTarget Find a record using a target key.ctdbFirstDatabase Get the first database that belongs to this session.ctdbFirstRecord Get the first record on a table.ctdbFirstTable Get the first table in a database dictionary.ctdbFloatToBigInt Convert a float to a big integer value.ctdbFloatToCurrency Convert a float value to a CTCURRENCY value.ctdbFloatToMoney Converts a floating point value to a CTMONEY type.ctdbFloatToNumber Convert a float to a CTNUMBER value.ctdbFreeDatabase Release all resources associated with a database handle.ctdbFreeRecord Release resources allocated for the table handle.ctdbFreeSession Release all resources associated with a session.ctdbFreeTable Release resources allocated for the table handle.ctdbGetActiveDatabaseUID Retrieve the database UID.ctdbGetActiveTableByUID Retrieve the active table handle given its UID.ctdbGetActiveTableUID Retrieve the table UID.ctdbGetCndxIndex Retrieve the conditional index expression string, given the index number.ctdbGetCndxIndexByName Retrieve the conditional index expression string, given the index name.ctdbGetCndxIndexLength Retrieve the length in bytes of the conditional expres- sion string, given the index number.ctdbGetCndxIndexLengthByName Retrieve the length in bytes of the conditional expression string, given the index name.ctdbGetDatabaseCount Retrieve the number of databases in the session dictio- nary.ctdbGetDatabaseHandle Return the database handle.ctdbGetDatabaseName Return the database name.ctdbGetDatabasePath Return the database path.ctdbGetDatabaseUID Return the database handle.ctdbGetDay Retrieve the day of the month from a packed CTDATE.ctdbGetDefaultIndex Return the current default index.ctdbGetDefaultIndexName Return the default index name.ctdbGetDefDateType Retrieve the default date type.ctdbGetDefFloatFormat Retrieve the default floating point format string.ctdbGetDefTimeType Retrieve the default time type.ctdbGetError Return the last error logged by any function in the c-treeDB C API.ctdbGetField Retrieve a field handle from a table, based on the field number.ctdbGetFieldAddress Retrieve the field address in record buffer.ctdbGetFieldAsBigint Retrieve field as big integer value.ctdbGetFieldAsBinary Retrieve field as binary value.ctdbGetFieldAsBlob Retrieve field as blob value.ctdbGetFieldAsBool Retrieve field as boolean value.ctdbGetFieldAsCurrency Retrieve field as a currency value.ctdbGetFieldAsDate Retrieve field as CTDATE value.ctdbGetFieldAsDateTime Retrieve field as CTDATETIME value.ctdbGetFieldAsFloat Retrieve field as CTFLOAT value.ctdbGetFieldAsMoney Retrieve field as CTMONEY value.ctdbGetFieldAsNumber Retrieve field as a number value.ctdbGetFieldAsSigned Retrieve field as signed value.ctdbGetFieldAsString Retrieve field as CTSTRING value.ctdbGetFieldAsTime Retrieve field as CTTIME value.ctdbGetFieldAsUnsigned Retrieve field as unsigned value.ctdbGetFieldByName Retrieve a field handle from a table, based on the field name.ctdbGetFieldDataLength Retrieve the field data actual length.ctdbGetFieldHandle Retrieve a Field Handle.ctdbGetFieldLength Retrieve the field length.ctdbGetFieldName Retrieve the field name.ctdbGetFieldNbr Retrieve the field number in the table fields list.ctdbGetFieldNullFlag Retrieve the field null flag.ctdbGetFieldNumber Given the field Name and the table handle, returns the field number.ctdbGetFieldNumberByName Return the field number, based on the field name and record handle.ctdbGetFieldOffset Retrieve the field offset in record buffer.ctdbGetFieldPrecision Retrieve the field precision.ctdbGetFieldProperties Retrieve field properties such as name, type and length, given a field handle.ctdbGetFieldScale Retrieve the field scale.ctdbGetFieldSize Retrieve the defined field size.ctdbGetFieldType Retrieve the field type.ctdbGetFilter Retrieve the filter from the table.ctdbGetFirstActiveDatabase Retrieve the handle of the first active database in the session.ctdbGetFirstActiveTable Retrieve the handle of the first active table in the data- base.ctdbGetHour Get the hour from a packed CTTIME.ctdbGetIndex Retrieve the handle for index identified by IndexNumber.ctdbGetIndexByName Retrieve the index handle given the index name.ctdbGetIndexByUID Retrieve the index handle given the index UID.ctdbGetIndexDuplicateFlag Retrieve the "Allow Duplicate Key" flag for this index.ctdbGetIndexEmptyChar Retrieve the empty char property for this index.ctdbGetIndexExtension Retrieve the table index file name extension.ctdbGetIndexHandle Retrieve the index handle.ctdbGetIndexKeyLength Retrieve the key length for this index.ctdbGetIndexKeyType Retrieve the key type for this index.ctdbGetIndexName Retrieve the index name.ctdbGetIndexNbr Retrieve the index number in the table list.ctdbGetIndexNbrByName Retrieve the index number given the index name.ctdbGetIndexNullFlag Retrieve the null key flag for this index.ctdbGetIndexSegmentCount Retrieve the number of segments associated with this index.ctdbGetIndexTemporaryFlag Retrieve the flag that indicates this index as tempo- rary.ctdbGetIndexUID Retrieve the index UID number.ctdbGetLockMode Retrieve the current session-wide lock mode.ctdbGetLogonOnly Retrieve the session logon only flag.ctdbGetMinute Get the minute from a packed CTTIME.ctdbGetMonth Retrieve the month of the year from a packed CTDATE.ctdbGetNextActiveDatabase Retrieve the handle of the next active database in the session.ctdbGetNextActiveTable Retrieve the handle of the next active table in the data- base.ctdbGetPadChar Retrieve the table pad and field delimiter characters.ctdbGetRecord Retrieve the record handle from the table's active record list.ctdbGetRecordBuffer Return a pointer to the current record buffer.ctdbGetRecordCount Retrieve the number of records in Table.ctdbGetRecordHandle Retrieve the record handle.ctdbGetRecordLength Return the current record length.ctdbGetRecordLock Return the record lock status.ctdbGetRecordNbr Retrieve the record index number in the table's active record list.ctdbGetRecordPos Retrieve the current record offset position.ctdbGetRecordSize Return the allocated record buffer size in bytes.ctdbGetRowid Retrieve the record rowid.ctdbGetSecond Get the second from a packed CTTIME.ctdbGetSegment Retrieve the segment handle of the segment indicated by Seg- Number.ctdbGetSegmentField Retrieve the field handle of the segment.ctdbGetSegmentFieldName Get the field name of the index segment.ctdbGetSegmentHandle Retrieve a segment handle.ctdbGetSegmentMode Retrieve the segment mode.ctdbGetSegmentNbr Retrieve the segment number in the segment list on the Seg- ment Handle.ctdbGetServerName Return the server name associated with the session.ctdbGetSessionHandle Return the Session Handle from the opaque handle.ctdbGetSessionParams Return the session parameter based on the parameter type.ctdbGetSessionPath Return the default session path.ctdbGetSessionType Retrieve the current session type.ctdbGetTable Return the table handle, given its position in the database active table list.ctdbGetTableCount Retrieve the number of tables in the database dictionary.ctdbGetTableCreateMode Retrieve the table create mode.ctdbGetTableDefaultDataExtentSize Retrieve the table default data extent size.ctdbGetTableDefaultIndexExtentSize Retrieve the table default index extent size.ctdbGetTableExtension Retrieve the table filename extension.ctdbGetTableFieldCount Retrieve the number of fields associated with the table.ctdbGetTableGroupid Retrieve the table group ID.ctdbGetTableHandle Return a table handle.ctdbGetTableIndexCount Retrieve the number of indices associated with the table.ctdbGetTableName Retrieve the table name.ctdbGetTableNbr Return the table index number in the database's active table list.ctdbGetTableOpenMode Retrieve the table open mode.ctdbGetTablePassword Retrieve the table password.ctdbGetTablePath Retrieve the table drive/directory path.ctdbGetTablePermission Retrieve the table permission.ctdbGetTableUID Return the table Unique Identifier.ctdbGetUserLogonName Return the user name associated with the session.ctdbGetUserPassword Return the user password associated with the session.ctdbGetUserTag Retrieve the user tag.ctdbGetYear Retrieve the year from a packed CTDATE.ctdbHasNullFieldSupport Indicate if a table has Null field support.ctdbHasRecbyt Indicate if the table has support for recbyt index.ctdbHasRowid Indicate if the table has support for rowid index.ctdbInsField Insert a field before the field number given by Index.ctdbInsFieldByName Insert a field before the field given by FieldIndex parameter.ctdbInsSegment Insert a segment before the segment indicated by SegNumber segment.