ajindex.c


Function ajBtreeFieldGetLenC

Returns the default indexed name length for a named field

Synopsis

Prototype
ajuint ajBtreeFieldGetLenC (
      const char* nametxt
);

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

Input
nametxt:(Input)Field name
Returns
ajuint:Field name length

Description

Returns the default indexed name length for a named field

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFieldGetLenS

Returns the default indexed name length for a named field

Synopsis

Prototype
ajuint ajBtreeFieldGetLenS (
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrnameInputField name
ajuint RETURNField name length

Input
name:(Input)Field name
Returns
ajuint:Field name length

Description

Returns the default indexed name length for a named field

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFieldGetExtensionC

Returns the default index file extension for a named field

Synopsis

Prototype
const AjPStr ajBtreeFieldGetExtensionC (
      const char* nametxt
);

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

Input
nametxt:(Input)Field name
Returns
const AjPStr:Filename extension

Description

Returns the default index file extension for a named field

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFieldGetExtensionS

Returns the default index file extension for a named field

Synopsis

Prototype
const AjPStr ajBtreeFieldGetExtensionS (
      const AjPStr name
);

TypeNameRead/WriteDescription
const AjPStrnameInputField name
const AjPStr RETURNFilename extension

Input
name:(Input)Field name
Returns
const AjPStr:Filename extension

Description

Returns the default index file extension for a named field

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFieldGetSecondaryC

Returns whether a named field uses a secondary index

Synopsis

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.

Input
nametxt:(Input)Field name
Returns
AjBool:True for a secondary index where indexed terms treturn IDs False for an ID index where terms return file positions.

Description

Returns whether a named field uses a secondary index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFieldGetSecondaryS

Returns whether a named field uses a secondary index

Synopsis

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.

Input
name:(Input)Field name
Returns
AjBool:True for a secondary index where indexed terms treturn IDs False for an ID index where terms return file positions.

Description

Returns whether a named field uses a secondary index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheNewC

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

Synopsis

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

Input
filetxt:(Input)name of file
exttxt:(Input)extension of file
idirtxt:(Input)index file directory
mode:(Input)opening mode
compressed:(Input)Compressed index flag
kwlimit:(Input)Max key size
pagesize:(Input)pagesize
cachesize:(Input)size of cache
pagecount:(Input)page count
order:(Input)Tree order
fill:(Input)Number of entries per bucket
level:(Input)level of tree
sorder:(Input)order of secondary tree
sfill:(Input)Number of entries per secondary bucket
count:(Input)Number of entries in the index
countall:(Input)Number of total entries in the index
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheNewS

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

Synopsis

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

Input
file:(Input)name of file
ext:(Input)extension of file
idir:(Input)index file directory
mode:(Input)opening mode
compressed:(Input)Compressed index flag
kwlimit:(Input)Max key size
pagesize:(Input)pagesize
cachesize:(Input)size of cache
pagecount:(Input)page count
order:(Input)Tree order
fill:(Input)Number of entries per bucket
level:(Input)level of tree
sorder:(Input)order of secondary tree
sfill:(Input)Number of entries per secondary bucket
count:(Input)Number of entries in the index
countall:(Input)Number of total entries in the index
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheNewReadC

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

Synopsis

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

Input
filetxt:(Input)name of file
exttxt:(Input)extension of file
idirtxt:(Input)index file directory
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheNewReadS

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

Synopsis

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

Input
file:(Input)name of file
ext:(Input)extension of file
idir:(Input)index file directory
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheNewUpdateC

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

Synopsis

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

Input
filetxt:(Input)name of file
exttxt:(Input)extension of file
idirtxt:(Input)index file directory
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheNewUpdateS

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

Synopsis

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

Input
file:(Input)name of file
ext:(Input)extension of file
idir:(Input)index file directory
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheDel

Close a b+tree cache

Synopsis

Prototype
ajulong ajBtreeCacheDel (
      AjPBtcache* Pthis
);

TypeNameRead/WriteDescription
AjPBtcache*PthisOutputCache object
ajulong RETURNIndex file size

Output
Pthis:(Output)Cache object
Returns
ajulong:Index file size

Description

Close a b+tree cache

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheIsSecondary

Test whether a cache is a secondary index

Synopsis

Prototype
AjBool ajBtreeCacheIsSecondary (
      const AjPBtcache thys
);

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

Input
thys:(Input)Cache object
Returns
AjBool:True if cache is secondary

Description

Test whether a cache is a secondary index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheStatsOut

Cache statistics for writing a new index

Synopsis

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

Input
cache:(Input)cache object
Input & Output
outf:(Modify)output file file
Pcache:(Modify)Number of cache reads to date
Preads:(Modify)Number of disk reads to date
Pwrites:(Modify)Number of disk writes to date
Psize:(Modify)Number of cache pages to date
Returns
void:No return value

Description

Cache statistics for writing a new index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheRead

Get a pointer to a disc cache page

Synopsis

Prototype
AjPBtpage ajBtreeCacheRead (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

Input
pagepos:(Input)page number
Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

Get a pointer to a disc cache page

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheSync

Sync all dirty cache pages

Synopsis

Prototype
void ajBtreeCacheSync (
      AjPBtcache cache,
      ajulong rootpage
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
ajulongrootpageInputroot page
void RETURN

Input
rootpage:(Input)root page
Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

Sync all dirty cache pages

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheRootSync

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

Pages will be written only when they are removed from the cache.

This function clears all locks. The caller must relock the root page (zero) if needed.

Synopsis

Prototype
void ajBtreeCacheRootSync (
      AjPBtcache cache,
      ajulong rootpage
);

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

Input
rootpage:(Input)secondary (locked) root page
Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

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

Pages will be written only when they are removed from the cache.

This function clears all locks. The caller must relock the root page (zero) if needed.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheWrite

Get a pointer to a disc cache page for writing

Synopsis

Prototype
AjPBtpage ajBtreeCacheWrite (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

Input
pagepos:(Input)page number
Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

Get a pointer to a disc cache page for writing

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheWriteBucket

Get a pointer to a disc cache page for writing

Synopsis

Prototype
AjPBtpage ajBtreeCacheWriteBucket (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

Input
pagepos:(Input)page number
Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

Get a pointer to a disc cache page for writing

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheWriteNode

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

Synopsis

Prototype
AjPBtpage ajBtreeCacheWriteNode (
      AjPBtcache cache,
      ajulong pagepos
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongpageposInputpage number
AjPBtpage RETURNdisc cache page pointer

Input
pagepos:(Input)page number
Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheWriteBucketnew

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

Clears the page.

Synopsis

Prototype
AjPBtpage ajBtreeCacheWriteBucketnew (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
AjPBtpage RETURNdisc cache page pointer

Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

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

Clears the page.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheWriteNodenew

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

Clears the page and sets the block number.

Synopsis

Prototype
AjPBtpage ajBtreeCacheWriteNodenew (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
AjPBtpage RETURNdisc cache page pointer

Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

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

Clears the page and sets the block number.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeCacheWriteOverflownew

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

Clears the page and sets the block number and nodetype

Synopsis

Prototype
AjPBtpage ajBtreeCacheWriteOverflownew (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
AjPBtpage RETURNdisc cache page pointer

Output
cache:(Output)cache
Returns
AjPBtpage:disc cache page pointer

Description

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

Clears the page and sets the block number and nodetype

See Also

See other functions in this section

Availability

In release 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

Synopsis

Prototype
void ajBtreeCreateRootNode (
      AjPBtcache cache,
      ajulong rootpage
);

TypeNameRead/WriteDescription
AjPBtcachecacheOutputcache
ajulongrootpageInputroot block
void RETURN

Input
rootpage:(Input)root block
Output
cache:(Output)cache
Returns
void:No return value

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFindInsert

Find the node that should contain a new key for insertion

Synopsis

Prototype
AjPBtpage ajBtreeFindInsert (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key to search for
Input & Output
cache:(Modify)cache
Returns
AjPBtpage:leaf node where item should be inserted

Description

Find the node that should contain a new key for insertion

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdNew

Constructor for index bucket ID information

Synopsis

Prototype
AjPBtId ajBtreeIdNew (
      void
);

TypeNameRead/WriteDescription
AjPBtId RETURNIndex ID object

Returns
AjPBtId:Index ID object

Description

Constructor for index bucket ID information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdDel

Destructor for index bucket ID information

Synopsis

Prototype
void ajBtreeIdDel (
      AjPBtId* thys
);

TypeNameRead/WriteDescription
AjPBtId*thysOutputindex ID object
void RETURN

Output
thys:(Output)index ID object
Returns
void:No return value

Description

Destructor for index bucket ID information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdDelVoid

Destructor for index bucket ID information

Synopsis

Prototype
void ajBtreeIdDelVoid (
      void** voidarg
);

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

Output
voidarg:(Output)Index ID object, passed as void for use by list and table destructors.
Returns
void:No return value

Description

Destructor for index bucket ID information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeDumpKeywords

Read the leaves of a secondary keywords tree

Synopsis

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

Input
dmin:(Input)minimum number of times the key should appear
dmax:(Input)maximum number of times the key should appear
Input & Output
cache:(Modify)cache
outf:(Modify)output file
Returns
void:No return value

Description

Read the leaves of a secondary keywords tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeInsertId

Insert an ID structure into the tree

Synopsis

Prototype
void ajBtreeInsertId (
      AjPBtcache cache,
      const AjPBtId id
);

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

Input
id:(Input)Id object
Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

Insert an ID structure into the tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdFromKey

Get an ID structure from a leaf node given a key

Synopsis

Prototype
AjPBtId ajBtreeIdFromKey (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key
Input & Output
cache:(Modify)cache
Returns
AjPBtId:pointer to an ID structure or NULL if not found

Description

Get an ID structure from a leaf node given a key

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeWriteParamsC

Write B+ tree parameters to file

Synopsis

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

Input
cache:(Input)cache
fntxt:(Input)file name
exttxt:(Input)index file extension name
idirtxt:(Input)index file directory
Returns
void:No return value

Description

Write B+ tree parameters to file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeWriteParamsS

Write B+ tree parameters to file

Synopsis

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

Input
cache:(Input)cache
fn:(Input)file name
ext:(Input)index file extension name
idir:(Input)index file directory
Returns
void:No return value

Description

Write B+ tree parameters to file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeReadParamsC

Read B+ tree parameters from file

Synopsis

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

Input
filetxt:(Input)file
exttxt:(Input)file extension
idirtxt:(Input)index directory
Output
secondary:(Output)true for a secondary index
compressed:(Output)true for a compressed index
kwlimit:(Output)maximum length of a keyword
pagesize:(Output)size of pages
cachesize:(Output)cachesize
pagecount:(Output)page count
order:(Output)tree order
nperbucket:(Output)bucket fill
level:(Output)depth of tree (0 = root leaf)
sorder:(Output)secondary tree order
snperbucket:(Output)secondary bucket fill
count:(Output)number of primary keywords in the index
countall:(Output)number of total keywords in the index
Returns
AjBool:True on success

Description

Read B+ tree parameters from file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeReadParamsS

Read B+ tree parameters from file

Synopsis

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

Input
file:(Input)file
ext:(Input)file extension
idir:(Input)index directory
Output
secondary:(Output)true for a secondary index
compressed:(Output)true for a compressed index
kwlimit:(Output)maximum length of a keyword
pagesize:(Output)size of pages
cachesize:(Output)cachesize
pagecount:(Output)page count
order:(Output)tree order
nperbucket:(Output)bucket fill
level:(Output)depth of tree (0 = root leaf)
sorder:(Output)secondary tree order
snperbucket:(Output)secondary bucket fill
count:(Output)number of primary keywords in the index
countall:(Output)number of total keywords in the index
Returns
AjBool:True on success

Description

Read B+ tree parameters from file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeWildNew

Construct a wildcard search object

Synopsis

Prototype
AjPBtWild ajBtreeWildNew (
      AjPBtcache cache,
      const AjPStr wild
);

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

Input
wild:(Input)wildcard id prefix (without asterisk)
Input & Output
cache:(Modify)cache
Returns
AjPBtWild:b+ tree wildcard object

Description

Construct a wildcard search object

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeWildDel

Destroy a wildcard search object

Synopsis

Prototype
void ajBtreeWildDel (
      AjPBtWild* Pthis
);

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

Input & Output
Pthis:(Modify)b+ tree wildcard structure
Returns
void:No return value

Description

Destroy a wildcard search object

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeKeyWildNew

Construct a wildcard keyword search object

Synopsis

Prototype
AjPBtKeyWild ajBtreeKeyWildNew (
      AjPBtcache cache,
      const AjPStr wild
);

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

Input
wild:(Input)wildcard keyword prefix (without asterisk)
Input & Output
cache:(Modify)cache
Returns
AjPBtKeyWild:b+ tree wildcard object

Description

Construct a wildcard keyword search object

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeKeyWildDel

Destroy a wildcard keyword search object

Synopsis

Prototype
void ajBtreeKeyWildDel (
      AjPBtKeyWild* Pthis
);

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

Input & Output
Pthis:(Modify)b+ tree wildcard keyword structure
Returns
void:No return value

Description

Destroy a wildcard keyword search object

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFindInsertW

Find the node that should contain a key (wild)

Synopsis

Prototype
AjPBtpage ajBtreeFindInsertW (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key to search for
Input & Output
cache:(Modify)cache
Returns
AjPBtpage:leaf node where item should be inserted

Description

Find the node that should contain a key (wild)

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdFromKeyW

Wildcard retrieval of entries

Synopsis

Prototype
AjPBtId ajBtreeIdFromKeyW (
      AjPBtcache cache,
      AjPBtWild wild
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtWildwildModifyWildcard
AjPBtId RETURNnext matching Id or NULL

Input & Output
cache:(Modify)cache
wild:(Modify)Wildcard
Returns
AjPBtId:next matching Id or NULL

Description

Wildcard retrieval of entries

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeListFromKeyW

Wildcard retrieval of entries

Synopsis

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

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

Input
key:(Input)Wildcard key
Input & Output
cache:(Modify)cache
idlist:(Modify)list of matching AjPBtIds
Returns
void:No return value

Description

Wildcard retrieval of entries

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeReplaceId

Replace an ID structure in a leaf node given a key

Synopsis

Prototype
AjBool ajBtreeReplaceId (
      AjPBtcache cache,
      const AjPBtId rid
);

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

Input
rid:(Input)replacement id object
Input & Output
cache:(Modify)cache
Returns
AjBool:true if success

Description

Replace an ID structure in a leaf node given a key

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeReadEntries

Read B+ tree entries from file

Synopsis

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

Input
filename:(Input)file name
indexdir:(Input)index file directory
directory:(Input)file directory
Output
seqfiles:(Output)sequence file names
reffiles:(Output)reference file names (if any)
Returns
ajuint:number of entries

Description

Read B+ tree entries from file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeReadEntriesS

Read B+ tree entries from file

Synopsis

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

Input
filename:(Input)file name
indexdir:(Input)index file directory
directory:(Input)file directory
Output
seqfiles:(Output)sequence file names
reffiles:(Output)reference file names (if any)
Returns
ajuint:number of entries

Description

Read B+ tree entries from file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeInsertDupId

Get an ID structure from a leaf node given a key

Synopsis

Prototype
void ajBtreeInsertDupId (
      AjPBtcache cache,
      AjPBtId id
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtIdidModifypotentially duplicate id
void RETURN

Input & Output
cache:(Modify)cache
id:(Modify)potentially duplicate id
Returns
void:No return value

Description

Get an ID structure from a leaf node given a key

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeDupFromKey

Write B+ tree parameters to file

Synopsis

Prototype
AjPList ajBtreeDupFromKey (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key
Input & Output
cache:(Modify)cache
Returns
AjPList:list of matching AjPBtIds or NULL

Description

Write B+ tree parameters to file

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreePriNew

Constructor for index bucket keyword information

Synopsis

Prototype
AjPBtPri ajBtreePriNew (
      void
);

TypeNameRead/WriteDescription
AjPBtPri RETURNIndex ID object

Returns
AjPBtPri:Index ID object

Description

Constructor for index bucket keyword information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreePriDel

Destructor for keyword index primary bucket information

Synopsis

Prototype
void ajBtreePriDel (
      AjPBtPri* thys
);

TypeNameRead/WriteDescription
AjPBtPri*thysOutputindex keyword primary object
void RETURN

Output
thys:(Output)index keyword primary object
Returns
void:No return value

Description

Destructor for keyword index primary bucket information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeInsertKeyword

Insert a keyword structure into the tree

Synopsis

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

Input & Output
cache:(Modify)cache
pri:(Modify)Id object
Returns
AjBool:True if keyword and ID combination was inserted False if keyword exists alraedy for ID

Description

Insert a keyword structure into the tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreePriFindKeyword

Get Pri structure matching a keyword

Synopsis

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

Input
key:(Input)key
Output
treeblock:(Output)Tree block number for id
Input & Output
cache:(Modify)cache
Returns
AjBool:ajTrue if found

Description

Get Pri structure matching a keyword

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreePriFindKeywordLen

Get Pri structure matching a keyword truncated to maximum indexed length

Synopsis

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

Input
key:(Input)key
Output
treeblock:(Output)Tree block number for id
Input & Output
cache:(Modify)cache
Returns
AjBool:ajTrue if found

Description

Get Pri structure matching a keyword truncated to maximum indexed length

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeSecCacheNewC

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

Synopsis

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

Input
filetxt:(Input)name of file
exttxt:(Input)extension of file
idirtxt:(Input)index file directory
mode:(Input)opening mode
compressed:(Input)Compressed index flag
kwlimit:(Input)Max key size
pagesize:(Input)pagesize
cachesize:(Input)size of cache
pagecount:(Input)page count
order:(Input)Tree order
fill:(Input)Number of entries per bucket
level:(Input)level of tree
sorder:(Input)order of secondary tree
sfill:(Input)Number of entries per secondary bucket
count:(Input)Number of entries in the index
countall:(Input)Number of total entries in the index
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeSecCacheNewS

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

Synopsis

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

Input
file:(Input)name of file
ext:(Input)extension of file
idir:(Input)index file directory
mode:(Input)opening mode
compressed:(Input)Compressed index flag
kwlimit:(Input)Max key size
pagesize:(Input)pagesize
cachesize:(Input)size of cache
pagecount:(Input)page count
order:(Input)Tree order
fill:(Input)Number of entries per bucket
level:(Input)level of tree
sorder:(Input)order of secondary tree
sfill:(Input)Number of entries per secondary bucket
count:(Input)Number of entries in the index
countall:(Input)Number of total entries in the index
Returns
AjPBtcache:initialised disc block cache structure

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeSecInsertId

Insert a secondary ID into the tree

Synopsis

Prototype
AjBool ajBtreeSecInsertId (
      AjPBtcache cache,
      const AjPStr id
);

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

Input
id:(Input)Id
Input & Output
cache:(Modify)cache
Returns
AjBool:True if ID was inserted False if ID already exists

Description

Insert a secondary ID into the tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeSecFindId

See whether ID already exists in the tree

Synopsis

Prototype
AjBool ajBtreeSecFindId (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key
Input & Output
cache:(Modify)cache
Returns
AjBool:true if ID already added

Description

See whether ID already exists in the tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeSecFindInsert

Find the node that should contain a new key for insertion

Synopsis

Prototype
AjPBtpage ajBtreeSecFindInsert (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key to search for
Input & Output
cache:(Modify)cache
Returns
AjPBtpage:leaf node where item should be inserted

Description

Find the node that should contain a new key for insertion

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeLockTest

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

Synopsis

Prototype
void ajBtreeLockTest (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
void RETURN

Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeSecLeafList

Read the leaves of a secondary tree

Synopsis

Prototype
AjPList ajBtreeSecLeafList (
      AjPBtcache cache,
      ajulong rootblock
);

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

Input
rootblock:(Input)root page of secondary tree
Input & Output
cache:(Modify)cache
Returns
AjPList:List of IDs matching a keyword

Description

Read the leaves of a secondary tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeVerifyId

Test routine: test for ID within a secondary tree

Synopsis

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

Input
rootblock:(Input)root page of secondary tree
id:(Input)test ID
Input & Output
cache:(Modify)cache
Returns
AjBool:true if ID found

Description

Test routine: test for ID within a secondary tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdFromKeywordW

Wildcard retrieval of keyword index entries

Synopsis

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

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

Input & Output
cache:(Modify)cache
wild:(Modify)Wildcard
idcache:(Modify)id cache
Returns
AjPBtId:next matching Id or NULL

Description

Wildcard retrieval of keyword index entries

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeListFromKeywordW

Wildcard retrieval of keyword index entries

Synopsis

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

Input
key:(Input)key
Input & Output
cache:(Modify)cache
idcache:(Modify)id cache
btidlist:(Modify)List of matching AjPBtId entries
Returns
void:No return value

Description

Wildcard retrieval of keyword index entries

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeHybNew

Constructor for index bucket ID information

Synopsis

Prototype
AjPBtHybrid ajBtreeHybNew (
      void
);

TypeNameRead/WriteDescription
AjPBtHybrid RETURNIndex ID object

Returns
AjPBtHybrid:Index ID object

Description

Constructor for index bucket ID information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeHybDel

Destructor for index bucket ID information

Synopsis

Prototype
void ajBtreeHybDel (
      AjPBtHybrid* Pthis
);

TypeNameRead/WriteDescription
AjPBtHybrid*PthisOutputindex ID object
void RETURN

Output
Pthis:(Output)index ID object
Returns
void:No return value

Description

Destructor for index bucket ID information

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeHybFindInsert

Find the node that should contain a new key for insertion

Synopsis

Prototype
AjPBtpage ajBtreeHybFindInsert (
      AjPBtcache cache,
      const AjPStr key
);

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

Input
key:(Input)key to search for
Input & Output
cache:(Modify)cache
Returns
AjPBtpage:leaf node where item should be inserted

Description

Find the node that should contain a new key for insertion

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeHybInsertId

Insert an ID structure into the tree

Synopsis

Prototype
void ajBtreeHybInsertId (
      AjPBtcache cache,
      AjPBtHybrid hyb
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
AjPBtHybridhybModifyId object
void RETURNpointer to a page

Input & Output
cache:(Modify)cache
hyb:(Modify)Id object
Returns
void:No return value

Description

Insert an ID structure into the tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeNumFindInsert

Find the node that should contain a new key for insertion

Synopsis

Prototype
AjPBtpage ajBtreeNumFindInsert (
      AjPBtcache cache,
      const ajulong key
);

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

Input
key:(Input)key to search for
Input & Output
cache:(Modify)cache
Returns
AjPBtpage:leaf node where item should be inserted

Description

Find the node that should contain a new key for insertion

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeInsertNum

Insert a file offset key into a secondary tree

Synopsis

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

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

Input
num:(Input)Id object
Output
page:(Output)cache page
Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

Insert a file offset key into a secondary tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFreePriArray

Free karray and parray arrays for a primary key

Synopsis

Prototype
void ajBtreeFreePriArray (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
void RETURN

Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

Free karray and parray arrays for a primary key

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeFreeSecArray

Free karray and parray arrays for a secondary key

Synopsis

Prototype
void ajBtreeFreeSecArray (
      AjPBtcache cache
);

TypeNameRead/WriteDescription
AjPBtcachecacheModifycache
void RETURN

Input & Output
cache:(Modify)cache
Returns
void:No return value

Description

Free karray and parray arrays for a secondary key

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeHybLeafList

Read the leaves of a secondary hybrid tree

Synopsis

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

Input
rootblock:(Input)root page of secondary tree
idname:(Input)id name
Input & Output
cache:(Modify)cache
list:(Modify)list to add BtIDs to
Returns
void:No return value

Description

Read the leaves of a secondary hybrid tree

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeDumpHybKeys

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

Synopsis

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

Input
dmin:(Input)minimum number of times the key should appear
dmax:(Input)maximum number of times the key should appear
Input & Output
cache:(Modify)cache
outf:(Modify)output file
Returns
void:No return value

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeDeleteHybId

Entry point for hybrid ID deletion.

Deletion software

Synopsis

Prototype
AjBool ajBtreeDeleteHybId (
      AjPBtcache cache,
      const AjPBtHybrid hyb
);

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

Input
hyb:(Input)hybrid object
Input & Output
cache:(Modify)cache
Returns
AjBool:True if found and deleted

Description

Entry point for hybrid ID deletion.

Deletion software

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeDeletePriId

Entry point for keyword tree ID deletion.

Deletion software

Synopsis

Prototype
AjBool ajBtreeDeletePriId (
      AjPBtcache cache,
      const AjPBtPri pri
);

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

Input
pri:(Input)keyword object
Input & Output
cache:(Modify)cache
Returns
AjBool:True if found and deleted

Description

Entry point for keyword tree ID deletion.

Deletion software

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeGetPagecount

Returns the number of pages in a tree index

Synopsis

Prototype
ajulong ajBtreeGetPagecount (
      const AjPBtcache cache
);

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

Input
cache:(Input)cache
Returns
ajulong:number of pages in a tree index

Description

Returns the number of pages in a tree index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeGetPagesize

Returns the page size a tree index

Synopsis

Prototype
ajuint ajBtreeGetPagesize (
      const AjPBtcache cache
);

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

Input
cache:(Input)cache
Returns
ajuint:Page size of a tree index

Description

Returns the page size a tree index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeGetTotsize

Returns the number of bytes in a tree index

Synopsis

Prototype
ajulong ajBtreeGetTotsize (
      const AjPBtcache cache
);

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

Input
cache:(Input)cache
Returns
ajulong:number of bytes in a tree index

Description

Returns the number of bytes in a tree index

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreePageGetTypename

Returns the node type name of a tree index page

Synopsis

Prototype
const char* ajBtreePageGetTypename (
      const AjPBtpage page
);

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

Input
page:(Input)Page
Returns
const char*:Name of page type

Description

Returns the node type name of a tree index page

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeStatNode

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

Synopsis

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

Input
page:(Input)Page
full:(Input)If true, write detailed debug report
newpostable:(Input)Page numbers for page offsets
Output
cache:(Output)cache
nkeys:(Output)Number of keys
overflows:(Output)Number of overflow pages
freespace:(Output)Unused space in this page
Input & Output
refs:(Modify)References to pages
Returns
AjBool:True on success

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeStatNumnode

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

Synopsis

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

Input
page:(Input)Page
full:(Input)If true, write detailed debug report
newpostable:(Input)Page numbers for page offsets
Output
cache:(Output)cache
nkeys:(Output)Number of keys
overflows:(Output)Number of overflow pages
freespace:(Output)Unused space in this page
Input & Output
refs:(Modify)References to pages
Returns
AjBool:True on success

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeStatBucket

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

Synopsis

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

Input
page:(Input)Page
full:(Input)If true, write detailed debug report
newpostable:(Input)Page numbers for page offsets
Output
cache:(Output)cache
nentries:(Output)Number of entries
ndups:(Output)Number of entries with duplicates
nextra:(Output)Number of extra entries as duplicates
overflows:(Output)Number of overflow pages
freespace:(Output)Unused space in this page
Input & Output
refs:(Modify)References to pages
Returns
AjBool:True on success

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeStatNumbucket

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

Synopsis

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

Input
page:(Input)Page
full:(Input)If true, write detailed debug report
Output
cache:(Output)cache
nentries:(Output)Number of entries
overflows:(Output)Number of overflow pages
freespace:(Output)Unused space in this page
Returns
AjBool:True on success

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeStatPribucket

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

Synopsis

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

Input
page:(Input)Page
full:(Input)If true, write detailed debug report
newpostable:(Input)Page numbers for page offsets
Output
cache:(Output)cache
nentries:(Output)Number of entries
overflows:(Output)Number of overflow pages
freespace:(Output)Unused space in this page
Input & Output
refs:(Modify)References to pages
Returns
AjBool:True on success

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeStatSecbucket

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

Synopsis

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

Input
page:(Input)Page
full:(Input)If true, write detailed debug report
Output
cache:(Output)cache
nentries:(Output)Number of entries
overflows:(Output)Number of overflow pages
freespace:(Output)Unused space in this page
Returns
AjBool:True on success

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreePageGetSize

Return the used size of a cache page

Synopsis

Prototype
ajuint ajBtreePageGetSize (
      const AjPBtpage page
);

TypeNameRead/WriteDescription
const AjPBtpagepageInputPage
ajuint RETURNUsed page size

Input
page:(Input)Page
Returns
ajuint:Used page size

Description

Return the used size of a cache page

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeExit

Cleans up B+tree indexing internal memory

Synopsis

Prototype
void ajBtreeExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Cleans up B+tree indexing internal memory

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdCmp

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

Using the file and position allows unique identifiers to be compared with other primary keys such bas accession number.

Synopsis

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.

Input
x:(Input)Standard argument. Item value.
y:(Input)Standard argument. Comparison item value.
Returns
ajint:Comparison result. Zero if equal, non-zero if different.

Description

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

Using the file and position allows unique identifiers to be compared with other primary keys such bas accession number.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajBtreeIdHash

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

Synopsis

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

Input
key:(Input)Standard argument. Table key.
hashsize:(Input)Standard argument. Estimated Hash size.
Returns
ajuint:Hash value in range 0 to hashsize-1

Description

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

See Also

See other functions in this section

Availability

In release 6.4.0