ajindex.c


Function ajBtreeFieldGetLenC

Returns the default indexed name length for a named field

Prototype

ajuint ajBtreeFieldGetLenC (
      const char* nametxt
);

TypeNameRead/WriteDescription
const char*nametxtInputField name
ajuint RETURNField name length

From EMBOSS 6.4.0


Function ajBtreeFieldGetLenS

Returns the default indexed name length for a named field

Prototype

ajuint ajBtreeFieldGetLenS (
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrnameInputField name
ajuint RETURNField name length

From EMBOSS 6.4.0


Function ajBtreeFieldGetExtensionC

Returns the default index file extension for a named field

Prototype

const AjPStr ajBtreeFieldGetExtensionC (
      const char* nametxt
);

TypeNameRead/WriteDescription
const char*nametxtInputField name
const AjPStr RETURNFilename extension

From EMBOSS 6.4.0


Function ajBtreeFieldGetExtensionS

Returns the default index file extension for a named field

Prototype

const AjPStr ajBtreeFieldGetExtensionS (
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrnameInputField name
const AjPStr RETURNFilename extension

From EMBOSS 6.4.0


Function ajBtreeFieldGetSecondaryC

Returns whether a named field uses a secondary index

Prototype

AjBool ajBtreeFieldGetSecondaryC (
      const char* nametxt
);

TypeNameRead/WriteDescription
const char*nametxtInputField name
AjBool RETURNTrue for a secondary index where indexed terms treturn IDs False for an ID index where terms return file positions.

From EMBOSS 6.4.0


Function ajBtreeFieldGetSecondaryS

Returns whether a named field uses a secondary index

Prototype

AjBool ajBtreeFieldGetSecondaryS (
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrnameInputField name
AjBool RETURNTrue for a secondary index where indexed terms treturn IDs False for an ID index where terms return file positions.

From EMBOSS 6.4.0


Function ajBtreeCacheNewC

Open a b+tree index file and initialise a cache object

Prototype

AjPBtcache ajBtreeCacheNewC (
      const char* filetxt,
      const char* exttxt,
      const char* idirtxt,
      const char* mode,
      AjBool compressed,
      ajuint kwlimit,
      ajuint pagesize,
      ajuint cachesize,
      ajulong pagecount,
      ajuint order,
      ajuint fill,
      ajuint level,
      ajuint sorder,
      ajuint sfill,
      ajulong count,
      ajulong countall
);

TypeNameRead/WriteDescription
const char*filetxtInputname of file
const char*exttxtInputextension of file
const char*idirtxtInputindex file directory
const char*modeInputopening mode
AjBoolcompressedInputCompressed index flag
ajuintkwlimitInputMax key size
ajuintpagesizeInputpagesize
ajuintcachesizeInputsize of cache
ajulongpagecountInputpage count
ajuintorderInputTree order
ajuintfillInputNumber of entries per bucket
ajuintlevelInputlevel of tree
ajuintsorderInputorder of secondary tree
ajuintsfillInputNumber of entries per secondary bucket
ajulongcountInputNumber of entries in the index
ajulongcountallInputNumber of total entries in the index
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 3.0.0


Function ajBtreeCacheNewS

Open a b+tree index file and initialise a cache object

Prototype

AjPBtcache ajBtreeCacheNewS (
      const AjPStr file,
      const AjPStr ext,
      const AjPStr idir,
      const char* mode,
      AjBool compressed,
      ajuint kwlimit,
      ajuint pagesize,
      ajuint cachesize,
      ajulong pagecount,
      ajuint order,
      ajuint fill,
      ajuint level,
      ajuint sorder,
      ajuint sfill,
      ajulong count,
      ajulong countall
);

TypeNameRead/WriteDescription
const AjPStrfileInputname of file
const AjPStrextInputextension of file
const AjPStridirInputindex file directory
const char*modeInputopening mode
AjBoolcompressedInputCompressed index flag
ajuintkwlimitInputMax key size
ajuintpagesizeInputpagesize
ajuintcachesizeInputsize of cache
ajulongpagecountInputpage count
ajuintorderInputTree order
ajuintfillInputNumber of entries per bucket
ajuintlevelInputlevel of tree
ajuintsorderInputorder of secondary tree
ajuintsfillInputNumber of entries per secondary bucket
ajulongcountInputNumber of entries in the index
ajulongcountallInputNumber of total entries in the index
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 6.4.0


Function ajBtreeCacheNewReadC

Open an existing b+tree index file and initialise a cache object

Prototype

AjPBtcache ajBtreeCacheNewReadC (
      const char* filetxt,
      const char* exttxt,
      const char* idirtxt
);

TypeNameRead/WriteDescription
const char*filetxtInputname of file
const char*exttxtInputextension of file
const char*idirtxtInputindex file directory
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 6.4.0


Function ajBtreeCacheNewReadS

Open an existing b+tree index file and initialise a cache object

Prototype

AjPBtcache ajBtreeCacheNewReadS (
      const AjPStr file,
      const AjPStr ext,
      const AjPStr idir
);

TypeNameRead/WriteDescription
const AjPStrfileInputname of file
const AjPStrextInputextension of file
const AjPStridirInputindex file directory
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 6.4.0


Function ajBtreeCacheNewUpdateC

Open an existing b+tree index file for update and initialise a cache object

Prototype

AjPBtcache ajBtreeCacheNewUpdateC (
      const char* filetxt,
      const char* exttxt,
      const char* idirtxt
);

TypeNameRead/WriteDescription
const char*filetxtInputname of file
const char*exttxtInputextension of file
const char*idirtxtInputindex file directory
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 6.4.0


Function ajBtreeCacheNewUpdateS

Open an existing b+tree index file for update and initialise a cache object

Prototype

AjPBtcache ajBtreeCacheNewUpdateS (
      const AjPStr file,
      const AjPStr ext,
      const AjPStr idir
);

TypeNameRead/WriteDescription
const AjPStrfileInputname of file
const AjPStrextInputextension of file
const AjPStridirInputindex file directory
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 6.4.0


Function ajBtreeCacheDel

Close a b+tree cache

Prototype

ajulong ajBtreeCacheDel (
      AjPBtcache* Pthis
);

TypeNameRead/WriteDescription
AjPBtcache*PthisOutputCache object
ajulong RETURNIndex file size

From EMBOSS 3.0.0


Function ajBtreeCacheIsSecondary

Test whether a cache is a secondary index

Prototype

AjBool ajBtreeCacheIsSecondary (
      const AjPBtcache thys
);

TypeNameRead/WriteDescription
const AjPBtcachethysInputCache object
AjBool RETURNTrue if cache is secondary

From EMBOSS 6.4.0


Function ajBtreeCacheStatsOut

Cache statistics for writing a new index

Prototype

void ajBtreeCacheStatsOut (
      AjPFile outf,
      const AjPBtcache cache,
      ajulong* Pcache,
      ajulong* Preads,
      ajulong* Pwrites,
      ajulong* Psize
);

TypeNameRead/WriteDescription
AjPFileoutfModifyoutput file file
const AjPBtcachecacheInputcache object
ajulong*PcacheModifyNumber of cache reads to date
ajulong*PreadsModifyNumber of disk reads to date
ajulong*PwritesModifyNumber of disk writes to date
ajulong*PsizeModifyNumber of cache pages to date
void RETURN

From EMBOSS 6.4.0


Function ajBtreeCacheRead

Get a pointer to a disc cache page

Prototype

AjPBtpage ajBtreeCacheRead (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 3.0.0


Function ajBtreeCacheSync

Sync all dirty cache pages

Prototype

void ajBtreeCacheSync (
      AjPBtcache cache,
      ajulong rootpage
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajulongrootpageInputroot page
void RETURN

From EMBOSS 3.0.0


Function ajBtreeCacheRootSync

Reset locked pages to dirty and relock the specified secondary root page.

Prototype

void ajBtreeCacheRootSync (
      AjPBtcache cache,
      ajulong rootpage
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajulongrootpageInputsecondary (locked) root page
void RETURN

From EMBOSS 6.4.0


Function ajBtreeCacheWrite

Get a pointer to a disc cache page for writing

Prototype

AjPBtpage ajBtreeCacheWrite (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 3.0.0


Function ajBtreeCacheWriteBucket

Get a pointer to a disc cache page for writing

Prototype

AjPBtpage ajBtreeCacheWriteBucket (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 6.4.0


Function ajBtreeCacheWriteNode

Get a pointer to a disc cache page for writing a node

Prototype

AjPBtpage ajBtreeCacheWriteNode (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 6.4.0


Function ajBtreeCacheWriteBucketnew

Get a pointer to a new disc cache page for writing a bucket.

Prototype

AjPBtpage ajBtreeCacheWriteBucketnew (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 6.4.0


Function ajBtreeCacheWriteNodenew

Get a pointer to a new disc cache page for writing a node

Prototype

AjPBtpage ajBtreeCacheWriteNodenew (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 6.4.0


Function ajBtreeCacheWriteOverflownew

Get a pointer to a new disc cache page for writing an overflow node

Prototype

AjPBtpage ajBtreeCacheWriteOverflownew (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
AjPBtpage RETURNdisc cache page pointer

From EMBOSS 6.4.0


Function ajBtreeCreateRootNode

Create and write an empty root node. Set it as root, write it to disc and then lock the page in the disc cache. The root node is at block 0L

Prototype

void ajBtreeCreateRootNode (
      AjPBtcache cache,
      ajulong rootpage
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongrootpageInputroot block
void RETURN

From EMBOSS 3.0.0


Function ajBtreeFindInsert

Find the node that should contain a new key for insertion

Prototype

AjPBtpage ajBtreeFindInsert (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey to search for
AjPBtpage RETURNleaf node where item should be inserted

From EMBOSS 3.0.0


Function ajBtreeIdNew

Constructor for index bucket ID information

Prototype

AjPBtId ajBtreeIdNew (
      void
);

TypeNameRead/WriteDescription
AjPBtId RETURNIndex ID object

From EMBOSS 3.0.0


Function ajBtreeIdDel

Destructor for index bucket ID information

Prototype

void ajBtreeIdDel (
      AjPBtId* thys
);

TypeNameRead/WriteDescription
AjPBtId*thysOutputindex ID object
void RETURN

From EMBOSS 3.0.0


Function ajBtreeIdDelVoid

Destructor for index bucket ID information

Prototype

void ajBtreeIdDelVoid (
      void** voidarg
);

TypeNameRead/WriteDescription
void**voidargOutputIndex ID object, passed as void for use by list and table destructors.
void RETURN

From EMBOSS 6.4.0


Function ajBtreeDumpKeywords

Read the leaves of a secondary keywords tree

Prototype

void ajBtreeDumpKeywords (
      AjPBtcache cache,
      ajuint dmin,
      ajuint dmax,
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajuintdminInputminimum number of times the key should appear
ajuintdmaxInputmaximum number of times the key should appear
AjPFileoutfModifyoutput file
void RETURN

From EMBOSS 6.4.0


Function ajBtreeInsertId

Insert an ID structure into the tree

Prototype

void ajBtreeInsertId (
      AjPBtcache cache,
      const AjPBtId id
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPBtIdidInputId object
void RETURNpointer to a page

From EMBOSS 3.0.0


Function ajBtreeIdFromKey

Get an ID structure from a leaf node given a key

Prototype

AjPBtId ajBtreeIdFromKey (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey
AjPBtId RETURNpointer to an ID structure or NULL if not found

From EMBOSS 3.0.0


Function ajBtreeWriteParamsC

Write B+ tree parameters to file

Prototype

void ajBtreeWriteParamsC (
      const AjPBtcache cache,
      const char* fntxt,
      const char* exttxt,
      const char* idirtxt
);

TypeNameRead/WriteDescription
const AjPBtcachecacheInputcache
const char*fntxtInputfile name
const char*exttxtInputindex file extension name
const char*idirtxtInputindex file directory
void RETURN

From EMBOSS 6.4.0


Function ajBtreeWriteParamsS

Write B+ tree parameters to file

Prototype

void ajBtreeWriteParamsS (
      const AjPBtcache cache,
      const AjPStr fn,
      const AjPStr ext,
      const AjPStr idir
);

TypeNameRead/WriteDescription
const AjPBtcachecacheInputcache
const AjPStrfnInputfile name
const AjPStrextInputindex file extension name
const AjPStridirInputindex file directory
void RETURN

From EMBOSS 6.4.0


Function ajBtreeReadParamsC

Read B+ tree parameters from file

Prototype

AjBool ajBtreeReadParamsC (
      const char* filetxt,
      const char* exttxt,
      const char* idirtxt,
      AjBool* secondary,
      AjBool* compressed,
      ajuint* kwlimit,
      ajuint* pagesize,
      ajuint* cachesize,
      ajulong* pagecount,
      ajuint* order,
      ajuint* nperbucket,
      ajuint* level,
      ajuint* sorder,
      ajuint* snperbucket,
      ajulong* count,
      ajulong* countall
);

TypeNameRead/WriteDescription
const char*filetxtInputfile
const char*exttxtInputfile extension
const char*idirtxtInputindex directory
AjBool*secondaryOutputtrue for a secondary index
AjBool*compressedOutputtrue for a compressed index
ajuint*kwlimitOutputmaximum length of a keyword
ajuint*pagesizeOutputsize of pages
ajuint*cachesizeOutputcachesize
ajulong*pagecountOutputpage count
ajuint*orderOutputtree order
ajuint*nperbucketOutputbucket fill
ajuint*levelOutputdepth of tree (0 = root leaf)
ajuint*sorderOutputsecondary tree order
ajuint*snperbucketOutputsecondary bucket fill
ajulong*countOutputnumber of primary keywords in the index
ajulong*countallOutputnumber of total keywords in the index
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeReadParamsS

Read B+ tree parameters from file

Prototype

AjBool ajBtreeReadParamsS (
      const AjPStr file,
      const AjPStr ext,
      const AjPStr idir,
      AjBool* secondary,
      AjBool* compressed,
      ajuint* kwlimit,
      ajuint* pagesize,
      ajuint* cachesize,
      ajulong* pagecount,
      ajuint* order,
      ajuint* nperbucket,
      ajuint* level,
      ajuint* sorder,
      ajuint* snperbucket,
      ajulong* count,
      ajulong* countall
);

TypeNameRead/WriteDescription
const AjPStrfileInputfile
const AjPStrextInputfile extension
const AjPStridirInputindex directory
AjBool*secondaryOutputtrue for a secondary index
AjBool*compressedOutputtrue for a compressed index
ajuint*kwlimitOutputmaximum length of a keyword
ajuint*pagesizeOutputsize of pages
ajuint*cachesizeOutputcachesize
ajulong*pagecountOutputpage count
ajuint*orderOutputtree order
ajuint*nperbucketOutputbucket fill
ajuint*levelOutputdepth of tree (0 = root leaf)
ajuint*sorderOutputsecondary tree order
ajuint*snperbucketOutputsecondary bucket fill
ajulong*countOutputnumber of primary keywords in the index
ajulong*countallOutputnumber of total keywords in the index
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeWildNew

Construct a wildcard search object

Prototype

AjPBtWild ajBtreeWildNew (
      AjPBtcache cache,
      const AjPStr wild
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrwildInputwildcard id prefix (without asterisk)
AjPBtWild RETURNb+ tree wildcard object

From EMBOSS 3.0.0


Function ajBtreeWildDel

Destroy a wildcard search object

Prototype

void ajBtreeWildDel (
      AjPBtWild* Pthis
);

TypeNameRead/WriteDescription
AjPBtWild*PthisModifyb+ tree wildcard structure
void RETURN

From EMBOSS 3.0.0


Function ajBtreeKeyWildNew

Construct a wildcard keyword search object

Prototype

AjPBtKeyWild ajBtreeKeyWildNew (
      AjPBtcache cache,
      const AjPStr wild
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrwildInputwildcard keyword prefix (without asterisk)
AjPBtKeyWild RETURNb+ tree wildcard object

From EMBOSS 3.0.0


Function ajBtreeKeyWildDel

Destroy a wildcard keyword search object

Prototype

void ajBtreeKeyWildDel (
      AjPBtKeyWild* Pthis
);

TypeNameRead/WriteDescription
AjPBtKeyWild*PthisModifyb+ tree wildcard keyword structure
void RETURN

From EMBOSS 3.0.0


Function ajBtreeFindInsertW

Find the node that should contain a key (wild)

Prototype

AjPBtpage ajBtreeFindInsertW (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey to search for
AjPBtpage RETURNleaf node where item should be inserted

From EMBOSS 3.0.0


Function ajBtreeIdFromKeyW

Wildcard retrieval of entries

Prototype

AjPBtId ajBtreeIdFromKeyW (
      AjPBtcache cache,
      AjPBtWild wild
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtWildwildModifyWildcard
AjPBtId RETURNnext matching Id or NULL

From EMBOSS 3.0.0


Function ajBtreeListFromKeyW

Wildcard retrieval of entries

Prototype

void ajBtreeListFromKeyW (
      AjPBtcache cache,
      const AjPStr key,
      AjPList idlist
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputWildcard key
AjPListidlistModifylist of matching AjPBtIds
void RETURN

From EMBOSS 3.0.0


Function ajBtreeReplaceId

Replace an ID structure in a leaf node given a key

Prototype

AjBool ajBtreeReplaceId (
      AjPBtcache cache,
      const AjPBtId rid
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPBtIdridInputreplacement id object
AjBool RETURNtrue if success

From EMBOSS 3.0.0


Function ajBtreeReadEntries

Read B+ tree entries from file

Prototype

ajuint ajBtreeReadEntries (
      const char* filename,
      const char* indexdir,
      const char* directory,
      AjPStr** seqfiles,
      AjPStr** reffiles
);

TypeNameRead/WriteDescription
const char*filenameInputfile name
const char*indexdirInputindex file directory
const char*directoryInputfile directory
AjPStr**seqfilesOutputsequence file names
AjPStr**reffilesOutputreference file names (if any)
ajuint RETURNnumber of entries

From EMBOSS 3.0.0


Function ajBtreeReadEntriesS

Read B+ tree entries from file

Prototype

ajuint ajBtreeReadEntriesS (
      const AjPStr filename,
      const AjPStr indexdir,
      const AjPStr directory,
      AjPStr** seqfiles,
      AjPStr** reffiles
);

TypeNameRead/WriteDescription
const AjPStrfilenameInputfile name
const AjPStrindexdirInputindex file directory
const AjPStrdirectoryInputfile directory
AjPStr**seqfilesOutputsequence file names
AjPStr**reffilesOutputreference file names (if any)
ajuint RETURNnumber of entries

From EMBOSS 6.4.0


Function ajBtreeInsertDupId

Get an ID structure from a leaf node given a key

Prototype

void ajBtreeInsertDupId (
      AjPBtcache cache,
      AjPBtId id
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtIdidModifypotentially duplicate id
void RETURN

From EMBOSS 3.0.0


Function ajBtreeDupFromKey

Write B+ tree parameters to file

Prototype

AjPList ajBtreeDupFromKey (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey
AjPList RETURNlist of matching AjPBtIds or NULL

From EMBOSS 3.0.0


Function ajBtreePriNew

Constructor for index bucket keyword information

Prototype

AjPBtPri ajBtreePriNew (
      void
);

TypeNameRead/WriteDescription
AjPBtPri RETURNIndex ID object

From EMBOSS 3.0.0


Function ajBtreePriDel

Destructor for keyword index primary bucket information

Prototype

void ajBtreePriDel (
      AjPBtPri* thys
);

TypeNameRead/WriteDescription
AjPBtPri*thysOutputindex keyword primary object
void RETURN

From EMBOSS 3.0.0


Function ajBtreeInsertKeyword

Insert a keyword structure into the tree

Prototype

AjBool ajBtreeInsertKeyword (
      AjPBtcache cache,
      AjPBtPri pri
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtPripriModifyId object
AjBool RETURNTrue if keyword and ID combination was inserted False if keyword exists alraedy for ID

From EMBOSS 3.0.0


Function ajBtreePriFindKeyword

Get Pri structure matching a keyword

Prototype

AjBool ajBtreePriFindKeyword (
      AjPBtcache cache,
      const AjPStr key,
      ajulong* treeblock
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey
ajulong*treeblockOutputTree block number for id
AjBool RETURNajTrue if found

From EMBOSS 6.4.0


Function ajBtreePriFindKeywordLen

Get Pri structure matching a keyword truncated to maximum indexed length

Prototype

AjBool ajBtreePriFindKeywordLen (
      AjPBtcache cache,
      const AjPStr key,
      ajulong* treeblock
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey
ajulong*treeblockOutputTree block number for id
AjBool RETURNajTrue if found

From EMBOSS 6.4.0


Function ajBtreeSecCacheNewC

Open a b+tree index file and initialise a cache object for keyword index

Prototype

AjPBtcache ajBtreeSecCacheNewC (
      const char* filetxt,
      const char* exttxt,
      const char* idirtxt,
      const char* mode,
      AjBool compressed,
      ajuint kwlimit,
      ajuint pagesize,
      ajuint cachesize,
      ajulong pagecount,
      ajuint order,
      ajuint fill,
      ajuint level,
      ajuint sorder,
      ajuint sfill,
      ajulong count,
      ajulong countall
);

TypeNameRead/WriteDescription
const char*filetxtInputname of file
const char*exttxtInputextension of file
const char*idirtxtInputindex file directory
const char*modeInputopening mode
AjBoolcompressedInputCompressed index flag
ajuintkwlimitInputMax key size
ajuintpagesizeInputpagesize
ajuintcachesizeInputsize of cache
ajulongpagecountInputpage count
ajuintorderInputTree order
ajuintfillInputNumber of entries per bucket
ajuintlevelInputlevel of tree
ajuintsorderInputorder of secondary tree
ajuintsfillInputNumber of entries per secondary bucket
ajulongcountInputNumber of entries in the index
ajulongcountallInputNumber of total entries in the index
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 3.0.0


Function ajBtreeSecCacheNewS

Open a b+tree index file and initialise a cache object for keyword index

Prototype

AjPBtcache ajBtreeSecCacheNewS (
      const AjPStr file,
      const AjPStr ext,
      const AjPStr idir,
      const char* mode,
      AjBool compressed,
      ajuint kwlimit,
      ajuint pagesize,
      ajuint cachesize,
      ajulong pagecount,
      ajuint order,
      ajuint fill,
      ajuint level,
      ajuint sorder,
      ajuint sfill,
      ajulong count,
      ajulong countall
);

TypeNameRead/WriteDescription
const AjPStrfileInputname of file
const AjPStrextInputextension of file
const AjPStridirInputindex file directory
const char*modeInputopening mode
AjBoolcompressedInputCompressed index flag
ajuintkwlimitInputMax key size
ajuintpagesizeInputpagesize
ajuintcachesizeInputsize of cache
ajulongpagecountInputpage count
ajuintorderInputTree order
ajuintfillInputNumber of entries per bucket
ajuintlevelInputlevel of tree
ajuintsorderInputorder of secondary tree
ajuintsfillInputNumber of entries per secondary bucket
ajulongcountInputNumber of entries in the index
ajulongcountallInputNumber of total entries in the index
AjPBtcache RETURNinitialised disc block cache structure

From EMBOSS 6.4.0


Function ajBtreeSecInsertId

Insert a secondary ID into the tree

Prototype

AjBool ajBtreeSecInsertId (
      AjPBtcache cache,
      const AjPStr id
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStridInputId
AjBool RETURNTrue if ID was inserted False if ID already exists

From EMBOSS 6.4.0


Function ajBtreeSecFindId

See whether ID already exists in the tree

Prototype

AjBool ajBtreeSecFindId (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey
AjBool RETURNtrue if ID already added

From EMBOSS 6.4.0


Function ajBtreeSecFindInsert

Find the node that should contain a new key for insertion

Prototype

AjPBtpage ajBtreeSecFindInsert (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey to search for
AjPBtpage RETURNleaf node where item should be inserted

From EMBOSS 3.0.0


Function ajBtreeLockTest

Test function: show if a primary tree root block is unlocked

Prototype

void ajBtreeLockTest (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
void RETURN

From EMBOSS 3.0.0


Function ajBtreeSecLeafList

Read the leaves of a secondary tree

Prototype

AjPList ajBtreeSecLeafList (
      AjPBtcache cache,
      ajulong rootblock
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajulongrootblockInputroot page of secondary tree
AjPList RETURNList of IDs matching a keyword

From EMBOSS 3.0.0


Function ajBtreeVerifyId

Test routine: test for ID within a secondary tree

Prototype

AjBool ajBtreeVerifyId (
      AjPBtcache cache,
      ajulong rootblock,
      const AjPStr id
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajulongrootblockInputroot page of secondary tree
const AjPStridInputtest ID
AjBool RETURNtrue if ID found

From EMBOSS 3.0.0


Function ajBtreeIdFromKeywordW

Wildcard retrieval of keyword index entries

Prototype

AjPBtId ajBtreeIdFromKeywordW (
      AjPBtcache cache,
      AjPBtKeyWild wild,
      AjPBtcache idcache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtKeyWildwildModifyWildcard
AjPBtcacheidcacheModifyid cache
AjPBtId RETURNnext matching Id or NULL

From EMBOSS 3.0.0


Function ajBtreeListFromKeywordW

Wildcard retrieval of keyword index entries

Prototype

void ajBtreeListFromKeywordW (
      AjPBtcache cache,
      const AjPStr key,
      AjPBtcache idcache,
      AjPList btidlist
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey
AjPBtcacheidcacheModifyid cache
AjPListbtidlistModifyList of matching AjPBtId entries
void RETURN

From EMBOSS 3.0.0


Function ajBtreeHybNew

Constructor for index bucket ID information

Prototype

AjPBtHybrid ajBtreeHybNew (
      void
);

TypeNameRead/WriteDescription
AjPBtHybrid RETURNIndex ID object

From EMBOSS 4.0.0


Function ajBtreeHybDel

Destructor for index bucket ID information

Prototype

void ajBtreeHybDel (
      AjPBtHybrid* Pthis
);

TypeNameRead/WriteDescription
AjPBtHybrid*PthisOutputindex ID object
void RETURN

From EMBOSS 4.0.0


Function ajBtreeHybFindInsert

Find the node that should contain a new key for insertion

Prototype

AjPBtpage ajBtreeHybFindInsert (
      AjPBtcache cache,
      const AjPStr key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPStrkeyInputkey to search for
AjPBtpage RETURNleaf node where item should be inserted

From EMBOSS 4.0.0


Function ajBtreeHybInsertId

Insert an ID structure into the tree

Prototype

void ajBtreeHybInsertId (
      AjPBtcache cache,
      AjPBtHybrid hyb
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtHybridhybModifyId object
void RETURNpointer to a page

From EMBOSS 4.0.0


Function ajBtreeNumFindInsert

Find the node that should contain a new key for insertion

Prototype

AjPBtpage ajBtreeNumFindInsert (
      AjPBtcache cache,
      const ajulong key
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const ajulongkeyInputkey to search for
AjPBtpage RETURNleaf node where item should be inserted

From EMBOSS 4.0.0


Function ajBtreeInsertNum

Insert a file offset key into a secondary tree

Prototype

void ajBtreeInsertNum (
      AjPBtcache cache,
      const AjPBtNumId num,
      AjPBtpage page
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPBtNumIdnumInputId object
AjPBtpagepageOutputcache page
void RETURNpointer to a page

From EMBOSS 4.0.0


Function ajBtreeFreePriArray

Free karray and parray arrays for a primary key

Prototype

void ajBtreeFreePriArray (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
void RETURN

From EMBOSS 4.0.0


Function ajBtreeFreeSecArray

Free karray and parray arrays for a secondary key

Prototype

void ajBtreeFreeSecArray (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
void RETURN

From EMBOSS 4.0.0


Function ajBtreeHybLeafList

Read the leaves of a secondary hybrid tree

Prototype

void ajBtreeHybLeafList (
      AjPBtcache cache,
      ajulong rootblock,
      const AjPStr idname,
      AjPList list
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajulongrootblockInputroot page of secondary tree
const AjPStridnameInputid name
AjPListlistModifylist to add BtIDs to
void RETURN

From EMBOSS 4.0.0


Function ajBtreeDumpHybKeys

Read the leaves of a primary hybrid tree (requested by EBI services)

Prototype

void ajBtreeDumpHybKeys (
      AjPBtcache cache,
      ajuint dmin,
      ajuint dmax,
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajuintdminInputminimum number of times the key should appear
ajuintdmaxInputmaximum number of times the key should appear
AjPFileoutfModifyoutput file
void RETURN

From EMBOSS 5.0.0


Function ajBtreeDeleteHybId

Entry point for hybrid ID deletion.

Prototype

AjBool ajBtreeDeleteHybId (
      AjPBtcache cache,
      const AjPBtHybrid hyb
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPBtHybridhybInputhybrid object
AjBool RETURNTrue if found and deleted

From EMBOSS 6.1.0


Function ajBtreeDeletePriId

Entry point for keyword tree ID deletion.

Prototype

AjBool ajBtreeDeletePriId (
      AjPBtcache cache,
      const AjPBtPri pri
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
const AjPBtPripriInputkeyword object
AjBool RETURNTrue if found and deleted

From EMBOSS 6.1.0


Function ajBtreeGetPagecount

Returns the number of pages in a tree index

Prototype

ajulong ajBtreeGetPagecount (
      const AjPBtcache cache
);

TypeNameRead/WriteDescription
const AjPBtcachecacheInputcache
ajulong RETURNnumber of pages in a tree index

From EMBOSS 6.4.0


Function ajBtreeGetPagesize

Returns the page size a tree index

Prototype

ajuint ajBtreeGetPagesize (
      const AjPBtcache cache
);

TypeNameRead/WriteDescription
const AjPBtcachecacheInputcache
ajuint RETURNPage size of a tree index

From EMBOSS 6.4.0


Function ajBtreeGetTotsize

Returns the number of bytes in a tree index

Prototype

ajulong ajBtreeGetTotsize (
      const AjPBtcache cache
);

TypeNameRead/WriteDescription
const AjPBtcachecacheInputcache
ajulong RETURNnumber of bytes in a tree index

From EMBOSS 6.4.0


Function ajBtreePageGetTypename

Returns the node type name of a tree index page

Prototype

const char* ajBtreePageGetTypename (
      const AjPBtpage page
);

TypeNameRead/WriteDescription
const AjPBtpagepageInputPage
const char* RETURNName of page type

From EMBOSS 6.4.0


Function ajBtreeStatNode

Returns number of keys, overflow pages visited and free space unused for a b+ tree node page

Prototype

AjBool ajBtreeStatNode (
      AjPBtcache cache,
      const AjPBtpage page,
      AjBool full,
      ajuint* nkeys,
      ajuint* overflows,
      ajuint* freespace,
      ajulong* refs,
      const AjPTable newpostable
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
const AjPBtpagepageInputPage
AjBoolfullInputIf true, write detailed debug report
ajuint*nkeysOutputNumber of keys
ajuint*overflowsOutputNumber of overflow pages
ajuint*freespaceOutputUnused space in this page
ajulong*refsModifyReferences to pages
const AjPTablenewpostableInputPage numbers for page offsets
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeStatNumnode

Returns number of keys, overflow pages visited and free space unused for a b+ tree numeric node page

Prototype

AjBool ajBtreeStatNumnode (
      AjPBtcache cache,
      const AjPBtpage page,
      AjBool full,
      ajuint* nkeys,
      ajuint* overflows,
      ajuint* freespace,
      ajulong* refs,
      const AjPTable newpostable
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
const AjPBtpagepageInputPage
AjBoolfullInputIf true, write detailed debug report
ajuint*nkeysOutputNumber of keys
ajuint*overflowsOutputNumber of overflow pages
ajuint*freespaceOutputUnused space in this page
ajulong*refsModifyReferences to pages
const AjPTablenewpostableInputPage numbers for page offsets
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeStatBucket

Returns number of keys, overflow pages visited and free space unused for a b+ tree bucket page

Prototype

AjBool ajBtreeStatBucket (
      AjPBtcache cache,
      const AjPBtpage page,
      AjBool full,
      ajuint* nentries,
      ajuint* ndups,
      ajuint* nextra,
      ajuint* overflows,
      ajuint* freespace,
      ajulong* refs,
      const AjPTable newpostable
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
const AjPBtpagepageInputPage
AjBoolfullInputIf true, write detailed debug report
ajuint*nentriesOutputNumber of entries
ajuint*ndupsOutputNumber of entries with duplicates
ajuint*nextraOutputNumber of extra entries as duplicates
ajuint*overflowsOutputNumber of overflow pages
ajuint*freespaceOutputUnused space in this page
ajulong*refsModifyReferences to pages
const AjPTablenewpostableInputPage numbers for page offsets
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeStatNumbucket

Returns number of keys, overflow pages visited and free space unused for a b+ tree secondary bucket page

Prototype

AjBool ajBtreeStatNumbucket (
      AjPBtcache cache,
      const AjPBtpage page,
      AjBool full,
      ajuint* nentries,
      ajuint* overflows,
      ajuint* freespace
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
const AjPBtpagepageInputPage
AjBoolfullInputIf true, write detailed debug report
ajuint*nentriesOutputNumber of entries
ajuint*overflowsOutputNumber of overflow pages
ajuint*freespaceOutputUnused space in this page
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeStatPribucket

Returns number of keys, overflow pages visited and free space unused for a b+ tree primary bucket page

Prototype

AjBool ajBtreeStatPribucket (
      AjPBtcache cache,
      const AjPBtpage page,
      AjBool full,
      ajuint* nentries,
      ajuint* overflows,
      ajuint* freespace,
      ajulong* refs,
      const AjPTable newpostable
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
const AjPBtpagepageInputPage
AjBoolfullInputIf true, write detailed debug report
ajuint*nentriesOutputNumber of entries
ajuint*overflowsOutputNumber of overflow pages
ajuint*freespaceOutputUnused space in this page
ajulong*refsModifyReferences to pages
const AjPTablenewpostableInputPage numbers for page offsets
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreeStatSecbucket

Returns number of keys, overflow pages visited and free space unused for a b+ tree numeric bucket page

Prototype

AjBool ajBtreeStatSecbucket (
      AjPBtcache cache,
      const AjPBtpage page,
      AjBool full,
      ajuint* nentries,
      ajuint* overflows,
      ajuint* freespace
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
const AjPBtpagepageInputPage
AjBoolfullInputIf true, write detailed debug report
ajuint*nentriesOutputNumber of entries
ajuint*overflowsOutputNumber of overflow pages
ajuint*freespaceOutputUnused space in this page
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajBtreePageGetSize

Return the used size of a cache page

Prototype

ajuint ajBtreePageGetSize (
      const AjPBtpage page
);

TypeNameRead/WriteDescription
const AjPBtpagepageInputPage
ajuint RETURNUsed page size

From EMBOSS 6.4.0


Function ajBtreeExit

Cleans up B+tree indexing internal memory

Prototype

void ajBtreeExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 6.4.0


Function ajBtreeIdCmp

Comparison function for sorting B+tree ID objects by database file number and offset.

Prototype

ajint ajBtreeIdCmp (
      const void* x,
      const void* y
);

TypeNameRead/WriteDescription
const void*xInputStandard argument. Item value.
const void*yInputStandard argument. Comparison item value.
ajint RETURNComparison result. Zero if equal, non-zero if different.

From EMBOSS 6.4.0


Function ajBtreeIdHash

Hash function for a table with a B+tree primary key

Prototype

ajuint ajBtreeIdHash (
      const void* key,
      ajuint hashsize
);

TypeNameRead/WriteDescription
const void*keyInputStandard argument. Table key.
ajuinthashsizeInputStandard argument. Estimated Hash size.
ajuint RETURNHash value in range 0 to hashsize-1

From EMBOSS 6.4.0