Each FairCom DB function has two names: the full name and the abbreviated name. Full names are used throughout this manual, and describe the action the function performs. The abbreviated name is generally shorter and more cryptic. You will see it if you examine the FairCom DB source code. Prior versions of the c‑tree File Handler used the abbreviated names. If you have a program that worked with older versions of c‑tree, you will not have to change the function calls to the full names. Also included in the table is the function’s API group and a table of API groups.
| In This Chapter |
| Full Names |
| Abbreviated (short) Names |
| Function API Listing |
Full Names
This table lists the functions alphabetically by the Full Name.
| Full Name | Abbreviated Name | Function Type |
|---|---|---|
| Abort | TRANABT | Transaction Processing API |
| AbortXtd | TRANABTX | Transaction Processing API |
| AddCtResource | ADDRES | Utility API |
| AddKey | ADDKEY | Low-Level Data Manipulation API |
| AddRecord | ADDREC | ISAM Data Manipulation API |
| AddVRecord | ADDVREC | ISAM Data Manipulation API |
| AllocateBatch | ALCBAT | ISAM Data Manipulation - Batch API |
| AllocateSet | ALCSET | ISAM Data Manipulation - Sets API |
| AvailableFileNbr | AVLFILNUM | Utility API |
| Begin | TRANBEG | Transaction Processing API |
| BuildKey | frmkey | Low-Level Data Manipulation API |
| ChangeBatch | CHGBAT | ISAM Data Manipulation - Batch API |
| ChangeHistory | CHGHST | Transaction Processing API |
| ChangeISAMContext | CHGICON | ISAM Data Manipulation - Context API |
| ChangeSet | CHGSET | ISAM Data Manipulation - Sets API |
| CleanIndexXtd | CLNIDXX | Utility API |
| ClearSavePoint | SAVPCLR | Transaction Processing API |
| ClearTranError | TRANCLR | Transaction Processing API |
| CloseCtFile | CLSFIL | Low-Level Data Manipulation API |
| CloseIFile | CLIFIL | Initialization API - ISAM |
| CloseISAM | CLISAM | Initialization API - ISAM |
| CloseISAMContext | CLSICON | ISAM Data Manipulation - Context API |
| CloseRFile | CLRFIL | Initialization API - ISAM |
| Commit | TRANEND | Transaction Processing API |
| CompactIFile | CMPIFIL | Utility API |
| CompactIFileXtd | CMPIFILX | Utility API |
| cpybuf | cpybuf | Miscellaneous Functions |
| CreateDataFile | CREDAT | Low-Level Data Definition API |
| CreateDataFileXtd | CREDATX | Low-Level Data Definition API |
| CreateDataFileXtd8 | CREDATX8 | Low-Level Data Definition API |
| CreateIFile | CREIFIL | ISAM Data Definition API |
| CreateIFileXtd | CREIFILX | ISAM Data Definition API |
| CreateIFileXtd8 | CREIFILX8 | ISAM Data Definition API |
| CreateIndexFile | CREIDX | Low-Level Data Definition API |
| CreateIndexFileXtd | CREIDXX | Low-Level Data Definition API |
| CreateIndexFileXtd8 | CREIDXX8 | Low-Level Data Definition API |
| CreateIndexMember | CREMEM | Low-Level Data Definition API |
| CreateISAM | CREISAM | ISAM Data Definition API |
| CreateISAMXtd | CREISAMX | ISAM Data Definition API |
| ctFILELIST | ctFILELIST | Utility API |
| ctGETHGH | ctGETHGH | Low-Level Data Manipulation API |
| ctMBprefix | ctMBprefix | Utility API |
| CtreeAsynchronous | CTASYNC | Utility API |
| CtreeCheckPoint | CTCHKPNT | Transaction Processing API |
| CtreeFlushFile | CTFLUSH | Utility API |
| CtreeFlushFileXtd | CTFLUSHX | Utility API |
| ctSETHGH | ctSETHGH | Low-level Data Manipulation API |
| ctStatusLogWrite | ctStatusLogWrite | Server DLL (server side) |
| ctThrdAttach | ctThrdAttach | Initialization API - ctThrd API |
| ctThrdBlockCls | ctThrdBlockCls | Initialization API - ctThrd API |
| ctThrdBlockGet | ctThrdBlockGet | Initialization API - ctThrd API |
| ctThrdBlockInit | ctThrdBlockInit | Initialization API - ctThrd API |
| ctThrdBlockRel | ctThrdBlockRel | Initialization API - ctThrd API |
| ctThrdBlockWait | ctThrdBlockWait | Initialization API - ctThrd API |
| ctThrdCreate | ctThrdCreate | Initialization API - ctThrd API |
| ctThrdData | ctThrdData | Initialization API - ctThrd API |
| ctThrdDataSet | ctThrdDataSet | Initialization API - ctThrd API |
| ctThrdDetach | ctThrdDetach | Initialization API - ctThrd API |
| ctThrdExit | ctThrdExit | Initialization API - ctThrd API |
| ctThrdHandle | ctThrdHandle | Initialization API - ctThrd API |
| ctThrdInit | ctThrdInit | Initialization API - ctThrd API |
| ctThrdLIFOWrite | ctThrdLIFOWrite | Initialization API - ctThrd API |
| ctThrdMutexCls | ctThrdMutexCls | Initialization API - ctThrd API |
| ctThrdMutexGet | ctThrdMutexGet | Initialization API - ctThrd API |
| ctThrdMutexInit | ctThrdMutexInit | Initialization API - ctThrd API |
| ctThrdMutexRel | ctThrdMutexRel | Initialization API - ctThrd API |
| ctThrdMutexTry | ctThrdMutexTry | Initialization API - ctThrd API |
| ctThrdQueueClose | ctThrdQueueClose | Initialization API - ctThrd API |
| ctThrdQueueCount | ctThrdQueueCount | Initialization API - ctThrd API |
| ctThrdQueueMlen | ctThrdQueueMlen | Initialization API - ctThrd API |
| ctThrdQueueOpen | ctThrdQueueOpen | Initialization API - ctThrd API |
| ctThrdQueueRead | ctThrdQueueRead | Initialization API - ctThrd API |
| ctThrdQueueReadDirect | ctThrdQueueReadDirect | Initialization API - ctThrd API |
| ctThrdQueueWrite | ctThrdQueueWrite | Initialization API - ctThrd API |
| ctThrdQueueWriteDirect | ctThrdQueueWriteDirect | Initialization API - ctThrd API |
| ctThrdSemapCls | ctThrdSemapCls | Initialization API - ctThrd API |
| ctThrdSemapGet | ctThrdSemapGet | Initialization API - ctThrd API |
| ctThrdSemapInit | ctThrdSemapInit | Initialization API - ctThrd API |
| ctThrdSemapRel | ctThrdSemapRel | Initialization API - ctThrd API |
| ctThrdSemapTry | ctThrdSemapTry | Initialization API - ctThrd API |
| ctThrdSleep | ctThrdSleep | Initialization API - ctThrd API |
| ctThrdTerm | ctThrdTerm | Initialization API - ctThrd API |
| ctu16tou8 | ctu16tou8 | Utility API |
| ctu8tou16 | ctu8tou16 | Utility API |
| ctVerifyFile | ctVerifyFile | Verifies integrity of a file |
| ctVERIFYidx | ctVERIFYidx | Verifies integrity of a file |
| CurrentFileOffset | GETCURP | ISAM Data Manipulation API |
| CurrentISAMKey | GETCURK | ISAM Data Manipulation API |
| CurrentLowLevelKey | GETCURKL | Low-Level Data Manipulation API |
| DeleteCtFile | DELFIL | Low-Level Data Definition API |
| DeleteCtResource | DELRES | Utility API |
| DeleteIFile | DELIFIL | ISAM Data Definition API |
| DeleteKey | DELCHK | Low-Level Data Manipulation API |
| DeleteKeyBlind | DELBLD | Low-Level Data Manipulation API |
| DeleteRecord | DELREC | ISAM Data Manipulation API |
| DeleteRFile | DELRFIL | ISAM Data Definition API |
| DeleteVRecord | DELVREC | ISAM Data Manipulation API |
| DoBatch | BATSET | ISAM Data Manipulation - Batch API |
| DropIndex | ctDROPIDX | ISAM Data Definition API |
| EnableCtResource | ENARES | Utility API |
| EstimateKeySpan | ESTKEY | Low-Level Data Manipulation API |
| FirstInSet | FRSSET | ISAM Data Manipulation - Sets API |
| FirstInVSet | FRSVSET | ISAM Data Manipulation - Sets API |
| FirstKey | FRSKEY | Low-Level Data Manipulation API |
| FirstRecord | FRSREC | ISAM Data Manipulation API |
| FirstVRecord | FRSVREC | ISAM Data Manipulation API |
| FreeBatch | FREBAT | ISAM Data Manipulation - Batch API |
| FreeBatchNbr | FREBATN | ISAM Data Manipulation - Batch API |
| FreeHistory | FREHST | Transaction Processing API |
| FreeHistoryNbr | FREHSTN | Transaction Processing API |
| FreeSet | FRESET | ISAM Data Manipulation - Sets API |
| FreeSetNbr | FRESETN | ISAM Data Manipulation - Sets API |
| GetAltSequence | GETALTSEQ | Low-Level Data Definition API |
| GetConditionalIndex | GETCIDX | ISAM Data Definition API |
| GetCtFileInfo | GETFIL | Low-Level Data Definition API |
| GetCtResource | GETRES | Initialization API - Instance Control |
| GetCtreePointer | GETCTREE | Utility API |
| GetCtTempFileName | TMPNAME | Utility API |
| GetDODA | GETDODA | ISAM Data Definition API |
| GetGTEKey | GTEKEY | Low-Level Data Manipulation API |
| GetGTERecord | GTEREC | ISAM Data Manipulation API |
| GetGTEVRecord | GTEVREC | ISAM Data Manipulation API |
| GetGTKey | GTKEY | Low-level Data Manipulation API |
| GetGTRecord | GTREC | ISAM Data Manipulation API |
| GetGTVRecord | GTVREC | ISAM Data Manipulation API |
| GetIFile | GETIFIL | ISAM Data Definition API |
| GetKey | EQLKEY | Low-Level Data Manipulation API |
| GetLTEKey | LTEKEY | Low-Level Data Manipulation API |
| GetLTERecord | LTEREC | ISAM Data Manipulation API |
| GetLTEVRecord | LTEVREC | ISAM Data Manipulation API |
| GetLTKey | LTKEY | Low-Level Data Manipulation API |
| GetLTRecord | LTREC | ISAM Data Manipulation API |
| GetLTVRecord | LTVREC | ISAM Data Manipulation API |
| GetORDKey | ORDKEY | Low-Level Data Manipulation API |
| GetRecord | EQLREC | ISAM Data Manipulation API |
| GetSerialNbr | SERIALNUM | Utility API |
| GetServerInfo | GetServerInfo | Low-Level Data Definition API |
| GetServerInfoXtd | GetServerInfoXtd | Low-Level Data Definition API |
| GetSuperFileNames | GETMNAME | Low-Level Data Definition API |
| GetSymbolicNames | GETNAM | Low-Level Data Definition API |
| GetVRecord | EQLVREC | ISAM Data Manipulation API |
| GetXtdCreateBlock | GETXCREBLK | Utility API |
| GetXtdKeySegmentDef | GETKSEGDEF | ISAM Data Definition API |
| InitCTree | INTREE | Initialization API - Low-level |
| InitCTreeXtd | INTREEX | Initialization API - Low-level |
| InitISAM | INTISAM | Initialization API - ISAM |
| InitISAMXtd | INTISAMX | Initialization API - ISAM |
| IOPERFORMANCE | IOPERFORMANCE | Server Administration API |
| IOPERFORMANCEX | IOPERFORMANCEX | Server Administration API |
| KeyAtPercentile | FRCKEY | Low-Level Data Manipulation API |
| LastInSet | LSTSET | ISAM Data Manipulation - Sets API |
| LastInVSet | LSTVSET | ISAM Data Manipulation - Sets API |
| LastKey | LSTKEY | Low-Level Data Manipulation API |
| LastRecord | LSTREC | ISAM Data Manipulation API |
| LastVRecord | LSTVREC | ISAM Data Manipulation API |
| LoadKey | LOADKEY | Low-Level Data Manipulation API |
| LockCtData | LOKREC | Low-Level Data Manipulation API |
| LockDump | ctLOKDMP | Server Administration API |
| LockISAM | LKISAM | ISAM Data Manipulation API |
| NbrOfKeyEntries | IDXENT | Low-Level Data Manipulation API |
| NbrOfKeysInRange | RNGENT | Low-Level Data Manipulation API |
| NbrOfRecords | DATENT | ISAM Data Manipulation API |
| NewData | NEWREC | Low-Level Data Manipulation API |
| NewVData | NEWVREC | Low-Level Data Manipulation API |
| NextCtree | NXTCTREE | Initialization API - Instance Control |
| NextInSet | NXTSET | ISAM Data Manipulation - Sets API |
| NextInVSet | NXTVSET | ISAM Data Manipulation - Sets API |
| NextKey | NXTKEY | Low-Level Data Manipulation API |
| NextRecord | NXTREC | ISAM Data Manipulation API |
| NextVRecord | NXTVREC | ISAM Data Manipulation API |
| OpenCtFile | OPNFIL | Initialization API - ISAM |
| OpenCtFileXtd | OPNFILX | Initialization API - ISAM |
| OpenFileWithResource | OPNRFIL | Initialization API - ISAM |
| OpenFileWithResourceXtd | OPNRFILX | Initialization API - ISAM |
| OpenIFile | OPNIFIL | Initialization API - ISAM |
| OpenIFileXtd | OPNIFILX | Initialization API - ISAM |
| OpenISAM | OPNISAM | Initialization API - ISAM |
| OpenISAMContext | OPNICON | Initialization API - ISAM |
| OpenISAMXtd | OPNISAMX | Initialization API - ISAM |
| PartitionAdmin | PTADMIN | Utility API |
| Perform | PERFORM | Server Administration API |
| PermIIndex | PRMIIDX | ISAM Data Definition API |
| PermIIndex8 | PRMIIDX8 | ISAM Data Definition API |
| PositionSet | MIDSET | ISAM Data Manipulation - Sets API |
| PositionVSet | MIDVSET | ISAM Data Manipulation - Sets API |
| PreviousInSet | PRVSET | ISAM Data Manipulation API |
| PreviousInVSet | PRVVSET | ISAM Data Manipulation API |
| PreviousKey | PRVKEY | Low-level Data Manipulation API |
| PreviousRecord | PRVREC | ISAM Data Manipulation API |
| PreviousVRecord | PRVVREC | ISAM Data Manipulation API |
| PutDODA | PUTDODA | ISAM Data Definition API |
| PutIFile | PUTIFIL | ISAM Data Definition API |
| PutIFileXtd | PUTIFILX | ISAM Data Definition API |
| PutIFileXtd8 | PUTIFILX8 | ISAM Data Definition API |
| PutXtdKeySegmentDef | PUTKSEGDEF | ISAM Data Definition |
| ReadData | REDREC | Low-level Data Manipulation API |
| ReadIsamData | REDIREC | ISAM Data Manipulation API |
| ReadIsamVData | REDIVREC | ISAM Data Manipulation API |
| ReadVData | RDVREC | Low-Level Data Manipulation API |
| RebuildIFile | RBLIFIL | ISAM Data Definition API |
| RebuildIFileXtd | RBLIFILX | ISAM Data Definition API |
| RebuildIFileXtd8 | RBLIFILX8 | ISAM Data Definition API |
| RebuildIIndex | RBLIIDX | ISAM Data Definition API |
| RegisterCtree | REGCTREE | Initialization API - Instance Control |
| ReleaseData | RETREC | Low-Level Data Manipulation API |
| ReleaseVData | RETVREC | Low-Level Data Manipulation API |
| RenameFile | ctRENFIL | Low-Level Data Definition API |
| RenameIFile | RENIFIL | ISAM Data Definition API |
| RenameIFileXtd | RENIFILX | ISAM Data Definition API |
| ReReadRecord | RRDREC | ISAM Data Manipulation API |
| ReReadVRecord | REDVREC | ISAM Data Manipulation API |
| ResetRecord | UPDCURI | ISAM Data Manipulation API |
| RestoreSavePoint | TRANRST | Transaction Processing API |
| ReWriteRecord | RWTREC | ISAM Data Manipulation API |
| ReWriteVRecord | RWTVREC | ISAM Data Manipulation API |
| SA_FILES | SA_FILES | Server Administration API |
| SA_GROUP | SA_GROUP | Server Administration API |
| SA_LOGOF | SA_LOGOF | Server Administration API |
| SA_LOGON | SA_LOGON | Server Administration API |
| SA_USERS | SA_USERS | Server Administration API |
| Security | SECURITY | Server Administration API |
| SetAlternateSequence | SETALTSEQ | Low-Level Data Definition API |
| SetCallbackOnRebuild | SETCBRBL | Utility API |
| SetDataFilter | SETFLTR | Low-Level Data Manipulation API |
| SetEncryption | ctSETENCRYPT | Utility API |
| SetFileSegments | ctSETSEG | Low-Level Data Definition API |
| SETLOGPATH | SETLOGPATH | Transaction Processing API |
| SetNodeName | SETNODE | Server Administration API |
| SetOperationState | SETOPS | Utility API |
| SetRecord | SETCURI | ISAM Data Manipulation API |
| SetSavePoint | TRANSAV | Transaction Processing API |
| SetVariableBytes | SETVARBYTS | Low-Level Data Definition API |
| StopServer | STPSRV | Server Administration API |
| StopServerXtd | STPSRVX | Server Administration API |
| StopUser | STPUSR | Server Administration API |
| StopUserAsync | STPUSRA | Server Administration API |
| SuperfilePrepassXtd | CTSBLDX | Utility API |
| SwitchCtree | SWTCTREE | Initialization API - Instance Control |
| SystemConfiguration | SYSCFG | Utility API |
| SystemLog | SYSLOG | Server Administration API |
| SystemMonitor | SYSMON | Utility API |
| TempIIndexXtd | TMPIIDXX | ISAM Data Definition API |
| TempIIndexXtd8 | TMPIIDXX8 | ISAM Data Definition API |
| TestFileNbr | TSTFILNUM | Utility API |
| TestHugeFile | TESTHUGE | Utility API |
| TransformKey | TFRMKEY | Low-Level Data Manipulation API |
| TranformSegment | cttseg | Transaction Processing API |
| TranformXtdSegment | XFMKSEGDEF | ISAM Data Definition API |
| TransactionHistory | CTHIST | ISAM Data Manipulation API |
| UnRegisterCtree | UNRCTREE | Initialization API - Instance Control |
| UpdateConditionalIndex | UPDCIDX | ISAM Data Definition API |
| UpdateCtResource | UPDRES | Utility API |
| UpdateFileMode | PUTFIL | Low-Level Data Definition API |
| UpdateHeader | PUTHDR | Low-Level Data Definition API |
| VDataLength | GTVLEN | Low-Level Data Manipulation API |
| VRecordLength | GETVLEN | ISAM Data Manipulation API |
| vtclose | vtclose | Utility API |
| WhichCtree | WCHCTREE | Initialization API - Instance Control |
| WriteData | WRTREC | Low-Level Data Manipulation API |
| WriteVData | WRTVREC | Low-Level Data Manipulation API |
Abbreviated (short) Names
This table lists the functions alphabetically by the Abbreviated Name.
| Abbreviated Name | Full Name | Function Type |
|---|---|---|
| ADDKEY | AddKey | Low-Level Data Manipulation API |
| ADDREC | AddRecord | ISAM Data Manipulation API |
| ADDRES | AddCtResource | Utility API |
| ADDVREC | AddVRecord | ISAM Data Manipulation API |
| ALCBAT | AllocateBatch | ISAM Data Manipulation - Batch API |
| ALCSET | AllocateSet | ISAM Data Manipulation - Sets API |
| AVLFILNUM | AvailableFileNbr | Utility API |
| BATSET | DoBatch | ISAM Data Manipulation - Batch API |
| CHGBAT | ChangeBatch | ISAM Data Manipulation - Batch API |
| CHGHST | ChangeHistory | Transaction Processing API |
| CHGICON | ChangeISAMContext | ISAM Data Manipulation - Context API |
| CHGSET | ChangeSet | ISAM Data Manipulation - Sets API |
| CLIFIL | CloseIFile | Initialization API - ISAM |
| CLISAM | CloseISAM | Initialization API - ISAM |
| CLNIDXX | CleanIndexXtd | Utility API |
| CLRFIL | CloseRFile | Initialization API - ISAM |
| CLSFIL | CloseCtFile | Initialization API - Low-level |
| CLSICON | CloseISAMContext | ISAM Data Manipulation - Context API |
| CMPIFIL | CompactIFile | ISAM Data Definition API |
| CMPIFILX | CompactIFileXtd | ISAM Data Definition API |
| cpybuf | cpybuf | Utility API |
| CREDAT | CreateDataFile | Low-Level Data Definition API |
| CREDATX | CreateDataFileXtd | Low-Level Data Definition API |
| CREDATX8 | CreateDataFileXtd8 | Low-Level Data Definition API |
| CREIDX | CreateIndexFile | Low-Level Data Definition API |
| CREIDXX | CreateIndexFileXtd | Low-Level Data Definition API |
| CREIDXX8 | CreateIndexFileXtd8 | Low-Level Data Definition API |
| CREIFIL | CreateIFile | ISAM Data Definition API |
| CREIFILX | CreateIFileXtd | ISAM Data Definition API |
| CREIFILX8 | CreateIFileXtd8 | ISAM Data Definition API |
| CREISAM | CreateISAM | ISAM Data Definition API |
| CREISAMX | CreateISAMXtd | ISAM Data Definition API |
| CREMEM | CreateIndexMember | Low-Level Data Definition API |
| CTASYNC | CtreeAsynchronous | Utility API |
| CTCHKPNT | CtreeCheckPoint | Transaction Processing API |
| ctDROPIDX | DropIndex | ISAM Data Definition API |
| ctFILELIST | ctFILELIST | Utility API |
| CTFLUSH | CtreeFlushFile | Utility API |
| CTFLUSHX | CtreeFlushFileXtd | Utility API |
| ctGETHGH | ctGETHGH | Low-Level Data Manipulation API |
| CTHIST | TransactionHistory | Transaction Processing API |
| ctLOKDMP | LockDump | Server Administration API |
| ctMBprefix | ctMBprefix | Utility API |
| ctRENFIL | RenameFile | Low-Level Data Definition API |
| CTSBLDX | SuperfilePrePassXtd | Utility API |
| ctSETENCRYPT | SetEncryption | Utility API |
| ctSETHGH | ctSETHGH | Low-Level Data Manipulation API |
| ctSETSEG | SetFileSegments | Low-Level Data Definition API |
| ctStatusLogWrite | ctStatusLogWrite | Server DLL (server side) |
| ctThrdAttach | ctThrdAttach | Initialization API - ctThrd API |
| ctThrdBlockCls | ctThrdBlockCls | Initialization API - ctThrd API |
| ctThrdBlockGet | ctThrdBlockGet | Initialization API - ctThrd API |
| ctThrdBlockInit | ctThrdBlockInit | Initialization API - ctThrd API |
| ctThrdBlockRel | ctThrdBlockRel | Initialization API - ctThrd API |
| ctThrdBlockWait | ctThrdBlockWait | Initialization API - ctThrd API |
| ctThrdCreate | ctThrdCreate | Initialization API - ctThrd API |
| ctThrdData | ctThrdData | Initialization API - ctThrd API |
| ctThrdDataSet | ctThrdDataSet | Initialization API - ctThrd API |
| ctThrdDetach | ctThrdDetach | Initialization API - ctThrd API |
| ctThrdExit | ctThrdExit | Initialization API - ctThrd API |
| ctThrdHandle | ctThrdHandle | Initialization API - ctThrd API |
| ctThrdInit | ctThrdInit | Initialization API - ctThrd API |
| ctThrdLIFOWrite | ctThrdLIFOWrite | Initialization API - ctThrd API |
| ctThrdMutexCls | ctThrdMutexCls | Initialization API - ctThrd API |
| ctThrdMutexGet | ctThrdMutexGet | Initialization API - ctThrd API |
| ctThrdMutexInit | ctThrdMutexInit | Initialization API - ctThrd API |
| ctThrdMutexRel | ctThrdMutexRel | Initialization API - ctThrd API |
| ctThrdMutexTry | ctThrdMutexTry | Initialization API - ctThrd API |
| ctThrdQueueClose | ctThrdQueueClose | Initialization API - ctThrd API |
| ctThrdQueueCount | ctThrdQueueCount | Initialization API - ctThrd API |
| ctThrdQueueMlen | ctThrdQueueMlen | Initialization API - ctThrd API |
| ctThrdQueueOpen | ctThrdQueueOpen | Initialization API - ctThrd API |
| ctThrdQueueRead | ctThrdQueueRead | Initialization API - ctThrd API |
| ctThrdQueueReadDirect | ctThrdQueueReadDirect | Initialization API - ctThrd API |
| ctThrdQueueWrite | ctThrdQueueWrite | Initialization API - ctThrd API |
| ctThrdQueueWriteDirect | ctThrdQueueWriteDirect | Initialization API - ctThrd API |
| ctThrdSemapCls | ctThrdSemapCls | Initialization API - ctThrd API |
| ctThrdSemapGet | ctThrdSemapGet | Initialization API - ctThrd API |
| ctThrdSemapInit | ctThrdSemapInit | Initialization API - ctThrd API |
| ctThrdSemapRel | ctThrdSemapRel | Initialization API - ctThrd API |
| ctThrdSemapTry | ctThrdSemapTry | Initialization API - ctThrd API |
| ctThrdSleep | ctThrdSleep | Initialization API - ctThrd API |
| ctThrdTerm | ctThrdTerm | Initialization API - ctThrd API |
| cttseg | TransformSegment | Low-Level Data Manipulation API |
| ctu16tou8 | ctu16tou8 | Utility API |
| ctu8tou16 | ctu8tou16 | Utility API |
| ctVerifyFile | ctVerifyFile | Verifies integrity of a file |
| ctVERIFYidx | ctVERIFYidx | Verifies integrity of a file |
| DATENT | NbrOfRecords | ISAM Data Manipulation API |
| DELBLD | DeleteKeyBlind | Low-Level Data Manipulation API |
| DELCHK | DeleteKey | Low-Level Data Manipulation API |
| DELFIL | DeleteCtFile | Low-Level Data Definition API |
| DELIFIL | DeleteIFile | ISAM Data Definition API |
| DELREC | DeleteRecord | ISAM Data Manipulation API |
| DELRES | DeleteCtResource | Utility API |
| DELRFIL | DeleteRFile | ISAM Data Definition API |
| DELVREC | DeleteVRecord | ISAM Data Manipulation API |
| ENARES | EnableCtResource | Utility API |
| EQLKEY | GetKey | Low-Level Data Manipulation API |
| EQLREC | GetRecord | ISAM Data Manipulation API |
| EQLVREC | GetVRecord | Low-Level Data Manipulation API |
| ESTKEY | EstimateKeySpan | Low-Level Data Manipulation API |
| FRCKEY | KeyAtPercentile | Low-Level Data Manipulation API |
| FREBAT | FreeBatch | ISAM Data Manipulation - Batch API |
| FREBATN | FreeBatchNbr | ISAM Data Manipulation - Batch API |
| FREHST | FreeHistory | Transaction Processing API |
| FREHSTN | FreeHistoryNbr | Transaction Processing API |
| FRESET | FreeSet | ISAM Data Manipulation - Sets API |
| FRESETN | FreeSetNbr | ISAM Data Manipulation - Sets API |
| frmkey | BuildKey | Low-Level Data Manipulation API |
| FRSKEY | FirstKey | Low-Level Data Manipulation API |
| FRSREC | FirstRecord | ISAM Data Manipulation API |
| FRSSET | FirstInSet | ISAM Data Manipulation - Sets API |
| FRSVREC | FirstVRecord | ISAM Data Manipulation API |
| FRSVSET | FirstInVSet | ISAM Data Manipulation - Sets API |
| GETALTSEQ | GetAlternateSequence | Low-Level Data Definition API |
| GETCIDX | GetConditionalIndex | ISAM Data Definition API |
| GETCTREE | GetCtreePointer | Initialization API - Instance Control |
| GETCURK | CurrentISAMKey | ISAM Data Manipulation API |
| GETCURKL | CurrentLowLevelKey | Low-Level Data Manipulation API |
| GETCURP | CurrentFileOffset | ISAM Data Manipulation API |
| GETDODA | GetDODA | ISAM Data Definition API |
| GETFIL | GetCtFileInfo | Low-level Data Definition API |
| GETIFIL | GetIFile | ISAM Data Definition API |
| GETKSEGDEF | GetXtdKeySegmentDef | ISAM Data Definition API |
| GETMNAME | GetSuperFileNames | Low-Level Data Definition API |
| GETNAM | GetSymbolicNames | ISAM Data Manipulation API |
| GETRES | GetCtResource | Utility API |
| GetServerInfo | GetServerInfo | Low-Level Data Definition API |
| GetServerInfoXtd | GetServerInfoXtd | Low-Level Data Definition API |
| GETVLEN | VRecordLength | ISAM Data Manipulation API |
| GETXCREBLK | GetXtdCreateBlock | Utility API |
| GTEKEY | GetGTEKey | Low-Level Data Manipulation API |
| GTEREC | GetGTERecord | ISAM Data Manipulation API |
| GTEVREC | GetGTEVRecord | ISAM Data Manipulation API |
| GTKEY | GetGTKey | Low-Level Data Manipulation API |
| GTREC | GetGTRecord | ISAM Data Manipulation API |
| GTVLEN | VDataLength | Low-Level Data Manipulation API |
| GTVREC | GetGTVRecord | ISAM Data Manipulation API |
| IDXENT | NbrOfKeyEntries | Low-Level Data Manipulation API |
| INTISAM | InitISAM | Initialization API - ISAM |
| INTISAMX | InitISAMXtd | Initialization API - ISAM |
| INTREE | InitCTree | Initialization API - Low-level |
| INTREEX | InitCTreeXtd | Initialization API - Low-level |
| IOPERFORMANCE | IOPERFORMANCE | Server Administration API |
| IOPERFORMANCEX | IOPERFORMANCEX | Server Administration API |
| LKISAM | LockISAM | ISAM Data Manipulation API |
| LOADKEY | LoadKey | Low-Level Data Manipulation API |
| LOKREC | LockCtData | Low-Level Data Manipulation API |
| LSTKEY | LastKey | Low-Level Data Manipulation API |
| LSTREC | LastRecord | ISAM Data Manipulation API |
| LSTSET | LastInSet | ISAM Data Manipulation - Sets API |
| LSTVREC | LastVRecord | ISAM Data Manipulation API |
| LSTVSET | LastInVSet | ISAM Data Manipulation - Sets API |
| LTEKEY | GetLTEKey | Low-Level Data Manipulation API |
| LTEREC | GetLTERecord | ISAM Data Manipulation API |
| LTEVREC | GetLTEVRecord | ISAM Data Manipulation API |
| LTKEY | GetLTKey | Low-Level Data Manipulation API |
| LTREC | GetLTRecord | ISAM Data Manipulation API |
| LTVREC | GetLTVRecord | ISAM Data Manipulation API |
| MIDSET | PositionSet | ISAM Data Manipulation - Sets API |
| MIDVSET | PositionVSet | ISAM Data Manipulation - Sets API |
| NEWREC | NewData | Low-Level Data Manipulation API |
| NEWVREC | NewVData | Low-Level Data Manipulation API |
| NXTCTREE | NextCtree | Initialization API - Instance Control |
| NXTKEY | NextKey | Low-Level Data Manipulation API |
| NXTREC | NextRecord | ISAM Data Manipulation API |
| NXTSET | NextInSet | ISAM Data Manipulation - Sets API |
| NXTVREC | NextVRecord | ISAM Data Manipulation API |
| NXTVSET | NextInVSet | ISAM Data Manipulation - Sets API |
| OPNFIL | OpenCtFile | Initialization API - Low-Level |
| OPNFILX | OpenCtFileXtd | Initialization API - Low-Level |
| OPNICON | OpenISAMContext | ISAM Data Manipulation - Context API |
| OPNIFIL | OpenIFile | Initialization API - ISAM |
| OPNIFILX | OpenIFileXtd | Initialization API - ISAM |
| OPNISAM | OpenISAM | Initialization API - ISAM |
| OPNISAMX | OpenISAMXtd | Initialization API - ISAM |
| OPNRFIL | OpenFileWithResource | Initialization API - ISAM |
| OPNRFILX | OpenFileWithResourceXtd | Initialization API - ISAM |
| ORDKEY | GetORDKey | Low-Level Data Manipulation API |
| PERFORM | Perform | Server Administration API |
| PRMIIDX | PermIIndex | ISAM Data Definition API |
| PRMIIDX8 | PermIIndex8 | ISAM Data Definition API |
| PRVKEY | PreviousKey | Low-Level Data Manipulation API |
| PRVREC | PreviousRecord | ISAM Data Manipulation API |
| PRVSET | PreviousInSet | ISAM Data Manipulation - Sets API |
| PRVVREC | PreviousVRecord | ISAM Data Manipulation API |
| PRVVSET | PreviousInVSet | ISAM Data Manipulation - Sets API |
| PTADMIN | PartitionAdmin | Utility API |
| PUTDODA | PutDoda | ISAM Data Definition API |
| PUTFIL | UpdateFileMode | Low-Level Data Definition API |
| PUTHDR | UpdateHeader | Low-Level Data Definition API |
| PUTIFIL | PutIFile | ISAM Data Definition API |
| PUTIFILX | PutIFileXtd | ISAM Data Definition API |
| PUTIFILX8 | PutIFileXtd8 | ISAM Data Definition API |
| PUTKSEGDEF | PutXtdKeySegmentDef | ISAM Data Definition |
| RBLIFIL | RebuildIFile | ISAM Data Definition API |
| RBLIFILX | RebuildIFileXtd | ISAM Data Definition API |
| RBLIFILX8 | RebuildIFileXtd8 | ISAM Data Definition API |
| RBLIIDX | RebuildIIndex | ISAM Data Definition API |
| RDVREC | ReadVData | Low-Level Data Manipulation API |
| REDIREC | ReadIsamData | ISAM Data Manipulation API |
| REDIVREC | ReadIsamVData | ISAM Data Manipulation API |
| REDREC | ReadData | Low-Level Data Manipulation API |
| REDVREC | ReReadVRecord | ISAM Data Manipulation API |
| REGCTREE | RegisterCtree | Initialization API - Instance Control |
| RENIFIL | RenameIFile | ISAM Data Definition API |
| RENIFILX | RenameIFileXtd | ISAM Data Definition API |
| RETREC | ReleaseData | Low-Level Data Manipulation API |
| RETVREC | ReleaseVData | Low-Level Data Manipulation API |
| RNGENT | NbrOfKeysInRange | Low-Level Data Manipulation API |
| RRDREC | ReReadRecord | ISAM Data Manipulation API |
| RWTREC | ReWriteRecord | ISAM Data Manipulation API |
| RWTVREC | ReWriteVRecord | ISAM Data Manipulation API |
| SA_FILES | SA_FILES | Server Administration API |
| SA_GROUP | SA_GROUP | Server Administration API |
| SA_LOGOF | SA_LOGOF | Server Administration API |
| SA_LOGON | SA_LOGON | Server Administration API |
| SA_USERS | SA_USERS | Server Administration API |
| SAVPCLR | ClearSavePoint | Transaction Processing API |
| SECURITY | Security | Server Administration API |
| SERIALNUM | GetSerialNbr | Utility API |
| SETALTSEQ | SetAlternateSequence | Low-Level Data Definition API |
| SETCBRBL | SetCallbackOnRebuild | Utility API |
| SETCURI | SetRecord | ISAM Data Manipulation API |
| SETFLTR | SetDataFilter | Low-Level Data Manipulation API |
| SETLOGPATH | SETLOGPATH | Transaction Processing API |
| SETNODE | SetNodeName | Server Administration API |
| SETOPS | SetOperationState | Utility API |
| SETVARBYTS | SetVariableBytes | Low-Level Data Definition API |
| STPSRV | StopServer | Server Administration API |
| STPSRVX | StopServerXtd | Server Administration API |
| STPUSR | StopUser | Initialization API - ISAM |
| STPUSRA | StopUserAsync | Initialization API - ISAM |
| SWTCTREE | SwitchCtree | Initialization API - Instance Control |
| SYSCFG | SystemConfiguration | Utility API |
| SYSLOG | SystemLog | Server Administration API |
| SYSMON | SystemMonitor | Utility API |
| TESTHUGE | TestHugeFile | Utility API |
| TFRMKEY | TransformKey | ISAM Data Manipulation API |
| TMPIIDXX | TempIIndexXtd | ISAM Data Definition API |
| TMPIIDXX8 | TempIIndexXtd8 | ISAM Data Definition API |
| TMPNAME | GetCtTempFileName | Utility API |
| TRANABT | Abort | Transaction Processing API |
| TRANABTX | AbortXtd | Transaction Processing API |
| TRANBEG | Begin | Transaction Processing API |
| TRANCLR | ClearTranError | Transaction Processing API |
| TRANEND | Commit | Transaction Processing API |
| TRANRST | RestoreSavePoint | Transaction Processing API |
| TRANSAV | SetSavePoint | Transaction Processing API |
| TSTFILNUM | TestFileNbr | Utility API |
| UNRCTREE | UnRegisterCtree | Initialization API - Instance Control |
| UPDCIDX | UpdateConditionalIndex | ISAM Data Definition API |
| UPDCURI | ResetRecord | ISAM Data Manipulation API |
| UPDRES | UpdateCtResource | Utility API |
| vtclose | vtclose | Utility API |
| WCHCTREE | WhichCtree | Initialization API - Instance Control |
| WRTREC | WriteData | Low-Level Data Manipulation API |
| WRTVREC | WriteVData | Low-Level Data Manipulation API |
| XFMKSEGDEF | TranformXtdSegment | ISAM Data Definition API |
Function API Listing
This section lists the FairCom DB Function API broken into functional groupings: Initialization, Definition, Manipulation, and Utility. Each of these groupings has sub-groups as described in the topics that follow.
| In This Section |
| Initialization API |
| Data Definition API |
| Data Manipulation API |
| Utility Functions |
Initialization API
The initialization API prepares the environment for FairCom DB operation. Included are the ctThrd, Instance Control, ISAM Initialization, and Low-Level Initialization APIs.
| In This Section |
| ctThrd API |
| Instance Control API |
| ISAM Initialization API |
| Low-Level Initialization API |
ctThrd API
The FairCom DB ctThrd API is a very thin overlay over the native threading API for each operating systems. Only systems without native threading use a FairCom DB proprietary threading API.
| ctThrdAttach | ctThrdInit | ctThrdQueueRead |
| ctThrdBlockCls | ctThrdLIFOWrite | ctThrdQueueReadDirect |
| ctThrdBlockGet | ctThrdMutexCls | ctThrdQueueWrite |
| ctThrdBlockInit | ctThrdMutexGet | ctThrdQueueWriteDirect |
| ctThrdBlockRel | ctThrdMutexInit | ctThrdSemapCls |
| ctThrdBlockWait | ctThrdMutexRel | ctThrdSemapGet |
| ctThrdCreate | ctThrdMutexTry | ctThrdSemapInit |
| ctThrdData | ctThrdQueueClose | ctThrdSemapRel |
| ctThrdDataSet | ctThrdQueueCount | ctThrdSemapTry |
| ctThrdDetach | ctThrdQueueMlen | ctThrdSleep |
| ctThrdExit | ctThrdQueueOpen | ctThrdTerm |
| ctThrdHandle |
Instance Control API
Similar to the thread API but used only with single-thread models, Instance Control allows and controls multiple FairCom DB instances within a single application.
| GetCtreePointer | RegisterCtree | UnRegisterCtree |
| NextCtree | SwitchCtree | WhichCtree |
ISAM Initialization API
Used to initialize the ISAM level operation of FairCom DB.
| CloseIFile | InitISAMXtd | OpenIFileXtd |
| CloseISAM | OpenFileWithResource | OpenISAM |
| CloseRFile | OpenFileWithResourceXtd | OpenISAMXtd |
| InitISAM | OpenIFile |
Low-Level Initialization API
Used to initialize the Low-Level FairCom DB environment.
| CloseCtFile | InitCTreeXtd | OpenCtFileXtd |
| InitCTree | OpenCtFile |
Data Definition API
Used to create and define tables and indexes. Divided into ISAM and Low-Level APIs.
| In This Section |
| ISAM Data Definition API |
| Low-Level Data Definition API |
ISAM Data Definition API
Used to create and define files for ISAM level use.
| CompactIFile | GetDODA | RebuildIFile |
| CompactIFileXtd | GetIFile | RebuildIFileXtd |
| CreateIFile | GetXtdKeySegmentDef | RebuildIFileXtd8 |
| CreateIFileXtd | PermIIndex | RebuildIIndex |
| CreateIFileXtd8 | PermIIndex8 | RenameIFile |
| CreateISAM | PutDODA | RenameIFileXtd |
| CreateISAMXtd | PutIFile | TempIIndexXtd |
| DeleteIFile | PutIFileXtd | TempIIndexXtd8 |
| DeleteRFile | PutIFileXtd8 | TranformXtdSegment |
| DropIndex | PutXtdKeySegmentDef | UpdateConditionalIndex |
| GetConditionalIndex |
Low-Level Data Definition API
Used to create and define files for Low-Level use.
| CreateDataFile | DeleteCtFile | RenameFile |
| CreateDataFileXtd | GetAlternateSequence | SetAlternateSequence |
| CreateDataFileXtd8 | GetCtFileInfo | SetFileSegments |
| CreateIndexFile | GetServerInfo | SetVariableBytes |
| CreateIndexFileXtd | GetServerInfoXtd | UpdateFileMode |
| CreateIndexFileXtd8 | GetSuperFileNames | UpdateHeader |
| CreateIndexMember |
Data Manipulation API
Data manipulation functions are used to alter the contents of data and index files. This sections is divided into ISAM and Low-Level functions.
| In This Section |
| ISAM Data Manipulation API |
| Low-Level Data Manipulation API |
ISAM Data Manipulation API
ISAM Manipulation functions are divided into general, Batch, Context, and Set APIs.
| AddRecord | GetLTEVRecord | PreviousVRecord |
| AddVRecord | GetLTRecord | ReadIsamData |
| CurrentFileOffset | GetLTVRecord | ReadIsamVData |
| CurrentISAMKey | GetRecord | ReReadRecord |
| DeleteRecord | GetSymbolicNames | ReReadVRecord |
| DeleteVRecord | LastRecord | ResetRecord |
| FirstRecord | LastVRecord | ReWriteRecord |
| FirstVRecord | LockISAM | ReWriteVRecord |
| GetGTERecord | NbrOfRecords | SetDataFilter |
| GetGTEVRecord | NextRecord | SetRecord |
| GetGTRecord | NextVRecord | TransformKey |
| GetGTVRecord | PreviousRecord | VRecordLength |
| GetLTERecord |
| In This Section |
| Batch API |
| Context API |
| Sets API |
Batch API
Manipulate batches of records in a single call.
| AllocateBatch | DoBatch | FreeBatchNbr |
| ChangeBatch | FreeBatch |
Context API
Maintain separate positions in a file.
| ChangeISAMContext | CloseISAMContext | OpenISAMContext |
Sets API
Work with a specified subset of a table’s records.
| AllocateSet | FreeSetNbr | PositionSet |
| ChangeSet | LastInSet | PositionVSet |
| FirstInSet | LastInVSet | PreviousInSet |
| FirstInVSet | NextInSet | PreviousInVSet |
| FreeSet | NextInVSet |
Low-Level Data Manipulation API
Manipulate data and index files at the low level.
| AddKey | GetKey | NewData |
| BuildKey | GetLTEKey | NextKey |
| ctGETHGH | GetLTKey | PreviousKey |
| ctSETHGH | GetORDKey | ReadData |
| CurrentLowLevelKey | GetVRecord | ReadVData |
| DeleteKey | KeyAtPercentile | ReleaseData |
| DeleteKeyBlind | LastKey | ReleaseVData |
| EstimateKeySpan | LoadKey | TransformSegment |
| FirstKey | LockCtData | VDataLength |
| GetGTEKey | NbrOfKeyEntries | WriteData |
| GetGTKey | NbrOfKeysInRange | WriteVData |
Utility Functions
The following functions provide capabilities that do not fit into the categories above. In addition to general utility functions, Server administration and Transaction Processing control functions are included here.
| AddCtResource | ctu16tou8 | SetEncryption |
| AvailableFileNbr | ctu8tou16 | SetOperationState |
| CleanIndexXtd | DeleteCtResource | SuperfilePrePassXtd |
| cpybuf | EnableCtResource | SystemConfiguration |
| ctFILELIST | GetCtResource | SystemMonitor |
| ctMBprefix | GetCtTempFileName | TestFileNbr |
| CtreeAsynchronous | GetSerialNbr | TestHugeFile |
| CtreeFlushFile | GetXtdCreateBlock | UpdateCtResource |
| CtreeFlushFileXtd | PartitionAdmin | vtclose |
| CtreeUserOperation | SetCallbackOnRebuild |
| In This Section |
| Server Administration API |
| Transaction Processing API |
Server Administration API
The following utility functions are specific to Client/Server operation.
| IOPERFORMANCE | SA_LOGOF | StopServer |
| IOPERFORMANCEX | SA_LOGON | StopServerXtd |
| LockDump | SA_USERS | StopUser |
| Perform | SA_WILDCARD | StopUserAsync |
| SA_FILES | Security | SystemLog |
| SA_GROUP | SetNodeName |
Transaction Processing API
The following utility functions control transaction processing.
| Abort | ClearTranError | RestoreSavePoint |
| AbortXtd | Commit | SETLOGPATH |
| Begin | CtreeCheckPoint | SetSavePoint |
| ChangeHistory | FreeHistory | TransactionHistory |
| ClearSavePoint | FreeHistoryNbr |
Common Entry Point Functions
FairCom DB offers two calling methods for each function: the traditional FairCom DB call by function name in which each operation is called by a separate function, and the common entry point in which all functions are accessed through the ctree function. For example, AddKey() can be called in either of these two ways:
AddKey(keyno,target,recbyt,typadd);
ctree(FN_ADDKEY,keyno,target,&recbyt,NULL,NULL,typadd);Either approach produces the same results, but some developers find the common entry point approach better suits their approach to programming.
If you are using FairCom DB, the client side of FairCom DB uses the common entry point approach to send the function calls to FairCom DB. The traditional functions are remapped to common entry point functions. If you use the common entry point function in your application, without any traditional functions, your program will not have to link in the remapping code, saving program memory.
Note: If the local library support is to be used in conjunction with common entry point, call ctree_loc() instead of ctree().
Note: When using common entry point with ctNOGLOBALS defined in ctoptn.h, call RegisterCtree() before initializing FairCom DB, (InitISAM(), etc.), because the global structure must be allocated before FairCom DB can be initialized. If this is not done, the application will hang or core dump on the initialization call.
| In This Chapter |
| Forced Single Entry Point Capability |
| Extended Feature Parameter Blocks |
| Function Calls |
Forced Single Entry Point Capability
The ctFRCSNG define forces single entry point calls using the regular API. Enabling this define causes the standard FairCom DB API (i.e., GetRecord(), AddRecord(), . . .) to be routed through the FairCom DB single entry function ctree(). Forcing the single-entry point is used when developing an interface wrapper from another database. This forced single entry point feature is enabled by adding #define ctFRCSNG to ctoptn.h (see the Quick Start and Product Overview Guide for information on modifying ctoptn.h) and requires no modification on the part of the programmer.
Extended Feature Parameter Blocks
Most of the extended features, such as file security, are passed to ctree as part of a set of parameter blocks defined in ctparm.h. Any application using the single entry point function, ctree(), must include ctparm.h. ctparm.h also contains the function numbers (FN_ADDKEY, etc.) used in the ctree()fn parameter.
The definitions of the parameter blocks are below. They are referenced as parameters in the function definitions listed at the end of this appendix. Please note the values assigned to the various character array sizes for the parameter block definitions:
| Value | Symbolic Constant | Use (including null terminator) |
|---|---|---|
| 8 | EXZ | Incremental IFIL data and index file name extensions. |
| 10 | FILEPWZ | File password. |
| 16 | IDZ | User and Group ID’s. |
| 64 | DSZ | Symbolic Field and Index Names. |
| 255 | FNZ | File and Server Names. |
| 1025 | PWZX | User password. |
| In This Section |
| Logon Block |
| ISAM Block |
| IFIL Block |
| Create File Block |
| Open File Block |
| Key Estimate Block |
Logon Block
typedef struct logblk {
COUNT files; /* number of files & indexes */ COUNT userprof; /* user profile mask */
COUNT ibuffers; /* # of index buffers */
COUNT dbuffers; /* # of data buffers */
COUNT nsectors; /* # of sectors per buffer */
COUNT reservd1; /* reserved */
VRLEN reservd2; /* reserved */
TEXT userid[IDZ]; /* user id */
TEXT userword[PWZX]; /* user password */
TEXT servname[FNZ]; /* optional server name */
} LOGBLK;The ibuffers, dbuffers, and nsectors members are ignored when connecting to a FairCom DB. The userid and userword members are ignored in non-server operation. The userprof member controls performance of automatic TransformKey() on targets sent to ISAM level search routines. Set userprof to USERPRF_NTKEY to disable the automatic TransformKey(). The servname member supports multiple FairCom DB environments.
ISAM Block
typedef struct isamblk {
LOGBLK isamlog; /* login block */
LONG permmask; /* CreateISAM permission mask */
TEXT groupid[IDZ]; /* CreateISAM Group id */
TEXT fileword[FILEPWZ]; /* file password */
TEXT parmname[FNZ]; /* parameter file name */
} ISAMBLK;The isamlog member is simply a logon block interpreted as above. The optional permmask and groupid members are only used by CreateISAM() to set the file permission masks and passwords. The fileword member is used by CreateISAM() to set the password and by OpenISAM() to access the file. The parmname member holds the parameter file name.
IFIL Block
typedef struct ifilblk {
LONG permmask; /* CreateIFile permission mask */
TEXT groupid[IDZ]; /* CreateIFile Group id */
TEXT fileword[FILEPWZ]; /* file password */
TEXT dataextn[EXZ]; /* data extension */
TEXT indxextn[EXZ]; /* indx extension */
pIFIL ptr_ifil; /* IFIL pointer */
} IFILBLK;permmask and groupid hold the optional security information assigned at file creation. fileword holds the optional password assigned at creation or used by a file open. dataextn and indxextn hold optional file name extensions for the data and index files, respectively. If a file name extension member begins with a NULL byte, the default extension is used, .dat for data files and .idx for index files. To signify that no extension should be added, pass the member containing only blanks and a null terminator. Both file name extension members cannot be blank since the data file and index must have unique names. ptr_ifil points to a traditional IFIL structure.
Create File Block
typedef struct creblk {
UCOUNT length; /* record / key length */
UCOUNT extdsize; /* file extent size */
COUNT filemode; /* file mode */
COUNT keytyp; /* index key type */
COUNT keydup; /* index duplicate flag */
COUNT member; /* index member # */
LONG permmask; /* permission mask */
TEXT groupid[IDZ]; /* group id */
TEXT fileword[FILEPWZ]; /* file password */
TEXT filename[FNZ]; /* file name */
} CREBLK;length specifies the record length for data files or the key length for index files. extdsize contains the file size extension parameter, and filemode contains the file mode. keytyp, keydup, and member are ignored for data files and represent the key type, key duplicate, and index member number, respectively, for index files. permmask, groupid, and fileword hold the optional file security information. Finally, filename contains the file name to be used at create.
Open File Block
typedef struct openblk { COUNT filemode; /* file mode */ TEXT fileword[FILEPWZ]; /* file password */
TEXT filename[FNZ]; /* file name */
} OPENBLK;Key Estimate Block
typedef struct estmblk {
TEXT key1[MAXLEN]; /* 1st key */
TEXT key2[MAXLEN]; /* 2nd key */
} ESTMBLK;The Key Estimate Block is used with the FN_ESTKEY() function, which estimates the number of key values occurring between key1 and key2.
Function Calls
The single entry point calling sequence is based on the following function prototype:
COUNT ctree(COUNT fn, COUNT filno, pVOID ptr1, pLONG plong,
pVOID ptr2, pVRLEN psize, COUNT mode);fn is the function number, filno is usually a file number, ptr1 and ptr2 point to various types of data or parameter blocks, plong points to a long integer, psize points to a long integer used to convey or return the size of an object, and mode is a short integer for various specifications.
Because of the manner in which C functions pass parameters, it is not necessary to supply all seven parameters all of the time. Generally, you need only supply enough parameters to satisfy the particular function, BUT you cannot skip parameters.
Note: ctree() always returns an error code. If the traditional function does not return an error code, a return value is passed back as one of the parameters to ctree().
For example, GetKey() returns a long value corresponding to the record position containing the target key value. In the traditional FairCom DB approach, call:
recpos = GetKey(keyno,target);With the ctree() form, call:
errcod = ctree(FN_EQLKEY,keyno,target,&recpos);recpos is passed back as an output parameter of ctree(). In the following listing, retval denotes the parameter that contains the return value of the function. FairCom DB functions which return an error code do not use a retval parameter.
Several FairCom DB functions are listed below with their traditional call by name form and the ctree(FN_...) form. The extended functions, those that have a suffix of Xtd, use the same single entry point call as the equivalent standard function. The function numbers are based on the short function name listed in Upgrade Previous Editions.
COUNT Abort()
ctree(FN_TRANABT)
COUNT AddKey(keyno,target,recbyt,typadd)
ctree(FN_ADDKEY,keyno,target,&recbyt,NULL,NULL,typadd)
COUNT AddRecord(datno,recptr)
ctree(FN_ADDREC,datno,recptr)
COUNT AddCtResource(datno,resptr,varlen)
ctree(FN_ADDRES,datno,resptr,NULL,NULL,&varlen)
COUNT AddVRecord(datno,recptr,varlen)
ctree(FN_ADDVREC,datno,recptr,NULL,NULL,&varlen)
COUNT AllocateSet(numset)
ctree(FN_ALCSET,numset)
COUNT AvailableFileNbr(numfils)
ctree(FN_AVLFILNUM,numfils,retval)
LONG Begin(mode)
ctree(FN_TRANBEG,mode,NULL,&retval)
COUNT ChangeSet(setnum)
ctree(FN_CHGSET,setnum)
COUNT ClearTranError()
ctree(FN_TRANCLR)
COUNT CloseFile(filno,filmod)
ctree(FN_CLSFIL,filno)
COUNT CloseIFile(ifilptr)
ctree(FN_CLIFIL,0,&ifilblk)
COUNT CloseISAM()
ctree(FN_CLISAM)
COUNT CloseRFile(datno)
ctree(FN_CLRFIL,datno)
COUNT Commit(mode)
ctree(FN_TRANEND,mode)
COUNT CreateDataFile(datno,filnam,datlen,xtdsiz,filmod)
COUNT CreateDataFileXtd(datno,filnam,datlen,xtdsiz,filmod,
permmask,groupid,fileword)
ctree(FN_CREDAT,datno,&createblk)
COUNT CreateIFile(ifilptr)
COUNT CreateIFileXtd(ifilptr,dataextn,indxextn,permmask,groupid,fileword)
ctree(FN_CREIFIL,0,&ifilblk)
COUNT CreateIndexFile(keyno,filnam,keylen,keytyp,keydup,
nomemb,xtdsiz,filmod)
COUNT CreateIndexFileXtd(keyno,filnam,keylen,keytyp,keydup,
nomemb,xtdsiz,filmod,permmask,groupid,fileword)
ctree(FN_CREIDX,keyno,&createblk)
COUNT CreateIndexMember(keyno,keylen,keytyp,keydup,membno)
ctree(FN_CREMEM,keyno,&createblk)
COUNT CreateISAM(filnam)
COUNT CreateISAMXtd(filnam,userprof,userid,userword,servname,
permmask,groupid,fileword)
ctree(FN_CREISAM,0,&isamblk)
pTEXT CurrentISAMKey(keyno,idxval,plen)
ctree(FN_GETCURK,keyno,idxval,NULL,plen)
LONG CurrentFileOffset(datno)
ctree(FN_GETCURP,datno,NULL,&retval)
COUNT DeleteCtFile(filno)
ctree(FN_DELFIL,filno)
COUNT DeleteKey(keyno,target,recbyt)
ctree(FN_DELCHK,keyno,target,&recbyt)
LONG DeleteKeyBlind(keyno,target)
ctree(FN_DELBLD,keyno,target,&retval)
COUNT DeleteRecord(datno)
ctree(FN_DELREC,datno)
COUNT DeleteCtResource(datno,resptr)
ctree(FN_DELRES,datno,resptr)
COUNT DeleteVRecord(datno)
ctree(FN_DELVREC,datno)
COUNT DoBatch(filno,request,bufptr,bufsiz,mode)
ctree(FN_BATSET,filno,request,NULL,bufptr,&bufsiz,mode)
COUNT EnableCtResource(datno)
ctree(FN_ENARES,datno)
LONG EstimateKeySpan(keyno,idxval1,idxval2)
ctree(FN_ESTKEY,keyno,&estm,&retval)
COUNT FirstInSet(keyno,target,recptr,siglen)
ctree(FN_FRSSET,keyno,target,NULL,recptr,NULL,siglen)
LONG FirstKey(keyno,idxval)
ctree(FN_FRSKEY,keyno,idxval,&retval)
COUNT FirstRecord(filno,recptr)
ctree(FN_FRSREC,filno,recptr)
COUNT FreeSet()
ctree(FN_FRESET)
COUNT GetAlternateSequence(keyno,altseq)
ctree(FN_GETALTSEQ,keyno,altseq)
VRLEN GetDODA(datno,bufsiz,bufptr,mode)
ctree(FN_GETDODA,datno,bufptr,&bufsiz,NULL,&retval,mode)
LONG GetFileInfo(filno,mode)
ctree(FN_GETFIL,filno,NULL,&retval,NULL,NULL,mode)
LONG GetGTEKey(keyno,target,idxval)
ctree(FN_GTEKEY,keyno,target,&retval,idxval)
COUNT GetGTERecord(keyno,target,recptr)
ctree(FN_GTEREC,keyno,target,NULL,recptr)
LONG GetGTKey(keyno,target,idxval)
ctree(FN_GTKEY,keyno,target,&retval,idxval)
VRLEN GetIFile(datno,bufsiz,bufptr)
ctree(FN_GETIFIL,datno,bufptr,&bufsiz,NULL,&retval)
LONG GetKey(keyno,target)
ctree(FN_EQLKEY,keyno,target,&retval)
LONG GetLTEKey(keyno,target,idxval)
ctree(FN_LTEKEY,keyno,target,&retval,idxval)
COUNT GetLTERecord(keyno,target,recptr)
ctree(FN_LTEREC,keyno,target,NULL,recptr)
LONG GetLTKey(keyno,target,idxval)
ctree(FN_LTKEY,keyno,target,&retval,idxval)
COUNT GetRecord(keyno,target,recptr)
ctree(FN_EQLREC,keyno,target,NULL,recptr)
LONG GetCtResource(datno,resptr,bufptr,bufsiz,resmode)
ctree(FN_GETRES,datno,resptr,&retval,bufptr,&bufsiz,resmode)
LONG GetSerialNbr(datno)
ctree(FN_SERIALNUM,datno,NULL,&retval)
COUNT GetSymbolicNames(filno,nambuf,buflen,mode)
ctree(FN_GETNAM,filno,nambuf,NULL,NULL,&buflen,mode)
COUNT GetTempCtFileName(bufptr,bufsiz)
ctree(FN_TMPNAME,0,bufptr,NULL,NULL,&bufsiz)
COUNT InitISAM(bufs,fils,sect)
COUNT InitISAMXtd(bufs,fils,sect,dbufs,userprof,userid,userword,servname)
ctree(FN_INTISAM,0,&logonblk)
COUNT InitCTree(bufs,fils,sect)
COUNT InitCTreeXtd(bufs,fils,sect,dbufs,userprof,userid,userword,servname)
ctree(FN_INTREE,0,&logonblk)logonblk is defined above under the discussion of the Logon Block found in CTPARM.H.
LONG KeyAtPercentile(keyno,idxval,fractal)
ctree(FN_FRCKEY,keyno,idxval,&retval,NULL,NULL,fractal)
COUNT LastInSet(keyno,target,recptr,siglen)
ctree(FN_LSTSET,keyno,target,NULL,recptr,NULL,siglen)
LONG LastKey(keyno,idxval)
ctree(FN_LSTKEY,keyno,idxval,&retval)
COUNT LastRecord(filno,recptr)
ctree(FN_LSTREC,filno,recptr)
COUNT LoadKey(keyno,target,recbyt,typadd)
ctree(FN_LOADKEY,keyno,target,&recbyt,NULL,NULL,typadd)
COUNT LockISAM(lokmod)
ctree(FN_LKISAM,lokmod)
COUNT LockCtData(datno,lokmod,recbyt)
ctree(FN_LOKREC,datno,NULL,&recbyt,NULL,NULL,lokmod)
LONG NbrOfKeyEntries(keyno)
ctree(FN_IDXENT,keyno,NULL,&retval)
LONG NbrOfRecords(datno)
ctree(FN_DATENT,datno,NULL,&retval)
LONG NewData(datno)
ctree(FN_NEWREC,datno,NULL,&retval)
LONG NewVData(datno,varlen)
ctree(FN_NEWVREC,datno,NULL,&retval,NULL,&varlen)
COUNT NextInSet(keyno,recptr)
ctree(FN_NXTSET,keyno,recptr)
LONG NextKey(keyno,idxval)
ctree(FN_NXTKEY,keyno,idxval,&retval)
COUNT NextRecord(filno,recptr)
ctree(FN_NXTREC,filno,recptr)
COUNT OpenCtFile(filno,filnam,filmod)
COUNT OpenCtFileXtd(filno,filnam,filmod,fileword)
ctree(FN_OPNFIL,filno,&openblk)
COUNT OpenFileWithResource(filno,filnam,filmod)
COUNT OpenFileWithResourceXtd(filno,filnam,filmod,fileword)
ctree(FN_OPNRFIL,filno,&openblk,&retval)openblk is defined above under the discussion of the Open Block found in CTPARM.H.
COUNT OpenIFile(ifilptr)
COUNT OpenIFileXtd(ifilptr,dataextn,indxextn,fileword)
ctree(FN_OPNIFIL,0,&ifilblk)
COUNT OpenISAM(filnam)
COUNT OpenISAMXtd(filnam,userprof,userid,userword,servname,
fileword)
ctree(FN_OPNISAM,0,&isamblk)
COUNT PermIIndex(ifilptr)
ctree(FN_PRMIIDX,0,&ifilblk)
COUNT PositionSet(keyno,recptr,siglen)
ctree(FN_MIDSET,keyno,recptr,NULL,NULL,NULL,siglen)
LONG PreviousKey(keyno,idxval)
ctree(FN_PRVKEY,keyno,idxval,&retval)
COUNT PreviousInSet(keyno,recptr)
ctree(FN_PRVSET,keyno,recptr)
COUNT PreviousRecord(filno,recptr)
ctree(FN_PRVREC,filno,recptr)
COUNT PutDODA(datno,doda,numfld)
ctree(FN_PUTDODA,datno,doda,NULL,NULL,NULL,numfld)
COUNT ReadData(datno,recbyt,recptr)
ctree(FN_REDREC,datno,recptr,&recbyt)
COUNT ReadVData(datno,recbyt,recptr,bufsiz)
ctree(FN_RDVREC,datno,recptr,&recbyt,NULL,&bufsiz)
COUNT RebuildIFile(ifilptr)
COUNT RebuildIFileXtd(ifilptr)
ctree(FN_RBLIFIL,0,&ifilblk)
COUNT ReleaseData(datno,recbyt)
ctree(FN_RETREC,datno,NULL,&recbyt)
COUNT ReleaseVData(datno,recbyt)
ctree(FN_RETVREC,datno,NULL,&recbyt)
COUNT ReReadRecord(datno,recptr)
ctree(FN_RRDREC,datno,recptr)
COUNT ReReadVRecord(datno,recptr,bufsiz)
ctree(FN_REDVREC,datno,recptr,NULL,NULL,&bufsiz)
COUNT ResetRecord(datno,mode)
ctree(FN_UPDCURI,datno,NULL,NULL,NULL,NULL,mode)
COUNT RestoreSavePoingTRANRST(savpnt)
ctree(FN_TRANRST,savpnt)
COUNT ReWriteRecord(datno,recptr)
ctree(FN_RWTREC,datno,recptr)
COUNT ReWriteVRecord(datno,recptr,varlen)
ctree(FN_RWTVREC,datno,recptr,NULL,NULL,&varlen)
COUNT SetAlternateSequence(keyno,altseq)
ctree(FN_SETALTSEQ,keyno,altseq)
COUNT SetRecord(datno,recbyt,recptr,datlen)
ctree(FN_SETCURI,datno,recptr,&recbyt,NULL,&datlen)
COUNT SetSavePoint()
ctree(FN_TRANSAV,0,&retval2)retval2 is a short integer in which the save point number is returned.
COUNT SetVariableBytes(filno,pvbyte)
ctree(FN_SETVARBYTS,filno,pvbyte)
COUNT StopUser()
ctree(FN_STPUSR)
COUNT TempIIndex(ifilptr)
ctree(FN_TMPIIDX,0,&ifilblk)
pTEXT TransformKey(keyno,tarptr)
ctree(FN_TFRMKEY,keyno,tarptr)
COUNT UpdateFileMode(filno,filmod)
ctree(FN_PUTFIL,filno,NULL,NULL,NULL,NULL,filmod)
COUNT UpdateCtResource(datno,resptr,varlen)
ctree(FN_UPDRES,datno,resptr,NULL,NULL,&varlen)
VRLEN VDataLength(datno,recbyt)
ctree(FN_GTVLEN,datno,NULL,&recbyt,NULL,&retval)
VRLEN VRecordLength(datno)
ctree(FN_GETVLEN,datno,NULL,NULL,NULL,&retval)
COUNT WriteData(datno,recbyt,recptr)
ctree(FN_WRTREC,datno,recptr,&recbyt)
COUNT WriteVData(datno,recbyt,recptr,varlen)
ctree(FN_WRTVREC,datno,recptr,&recbyt,NULL,&varlen)