embdbi.c


Function embDbiFieldNew

Constructor for field token structures.

Synopsis

Prototype
EmbPField embDbiFieldNew (
      void
);

TypeNameRead/WriteDescription
EmbPField RETURNField token structure.

Returns
EmbPField:Field token structure.

Description

Constructor for field token structures.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFieldDel

Destructor for field token structures.

Synopsis

Prototype
void embDbiFieldDel (
      EmbPField* pthys
);

TypeNameRead/WriteDescription
EmbPField*pthysDeleteField token structure.
void RETURN

Output
pthys:(Delete)Field token structure.
Returns
void:No return value

Description

Destructor for field token structures.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFieldDelMap

Destructor for field token structures to be mapped to lists or tables.

Synopsis

Prototype
void embDbiFieldDelMap (
      void** pthys,
      void* cl
);

TypeNameRead/WriteDescription
void**pthysDeleteField token structure.
void*clModifyUnused
void RETURN

Output
pthys:(Delete)Field token structure.
Input & Output
cl:(Modify)Unused
Returns
void:No return value

Description

Destructor for field token structures to be mapped to lists or tables.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiCmpId

Comparison function for two entries.

Synopsis

Prototype
ajint embDbiCmpId (
      const void* a,
      const void* b
);

TypeNameRead/WriteDescription
const void*aInputFirst id (EmbPEntry*)
const void*bInputSecond id (EmbPEntry*)
ajint RETURNComparison value, -1, 0 or +1.

Input
a:(Input)First id (EmbPEntry*)
b:(Input)Second id (EmbPEntry*)
Returns
ajint:Comparison value, -1, 0 or +1.

Description

Comparison function for two entries.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiCmpFieldId

Comparison function for the entrynames in two field structures.

Synopsis

Prototype
ajint embDbiCmpFieldId (
      const void* a,
      const void* b
);

TypeNameRead/WriteDescription
const void*aInputFirst id (EmbPField*)
const void*bInputSecond id (EmbPField*)
ajint RETURNComparison value, -1, 0 or +1.

Input
a:(Input)First id (EmbPField*)
b:(Input)Second id (EmbPField*)
Returns
ajint:Comparison value, -1, 0 or +1.

Description

Comparison function for the entrynames in two field structures.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiCmpFieldField

Comparison function for two field token values

Synopsis

Prototype
ajint embDbiCmpFieldField (
      const void* a,
      const void* b
);

TypeNameRead/WriteDescription
const void*aInputFirst id (EmbPField*)
const void*bInputSecond id (EmbPField*)
ajint RETURNComparison value, -1, 0 or +1.

Input
a:(Input)First id (EmbPField*)
b:(Input)Second id (EmbPField*)
Returns
ajint:Comparison value, -1, 0 or +1.

Description

Comparison function for two field token values

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiEntryNew

Constructor for entry structures.

Synopsis

Prototype
EmbPEntry embDbiEntryNew (
      ajuint nfields
);

TypeNameRead/WriteDescription
ajuintnfieldsInputNumber of data fields to be included
EmbPEntry RETURNEntry structure.

Input
nfields:(Input)Number of data fields to be included
Returns
EmbPEntry:Entry structure.

Description

Constructor for entry structures.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiEntryDel

Destructor for entry structures.

Synopsis

Prototype
void embDbiEntryDel (
      EmbPEntry* Pentry
);

TypeNameRead/WriteDescription
EmbPEntry*PentryDeleteEntry structure
void RETURN

Output
Pentry:(Delete)Entry structure
Returns
void:No return value

Description

Destructor for entry structures.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiEntryDelMap

Destructor for entry structures to be mapped to lists or tables.

Synopsis

Prototype
void embDbiEntryDelMap (
      void** pthys,
      void* cl
);

TypeNameRead/WriteDescription
void**pthysDeleteField token structure.
void*clModifyUnused
void RETURN

Output
pthys:(Delete)Field token structure.
Input & Output
cl:(Modify)Unused
Returns
void:No return value

Description

Destructor for entry structures to be mapped to lists or tables.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFileList

Makes a list of all files in a directory matching a wildcard file name.

Synopsis

Prototype
AjPList embDbiFileList (
      const AjPStr dir,
      const AjPStr wildfile,
      AjBool trim
);

TypeNameRead/WriteDescription
const AjPStrdirInputDirectory
const AjPStrwildfileInputWildcard file name
AjBooltrimInputExpand to search, trim results
AjPList RETURNNew list of all files with full paths

Input
dir:(Input)Directory
wildfile:(Input)Wildcard file name
trim:(Input)Expand to search, trim results
Returns
AjPList:New list of all files with full paths

Description

Makes a list of all files in a directory matching a wildcard file name.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFileListExc

Makes a list of all files in a directory matching a wildcard file name.

Synopsis

Prototype
AjPList embDbiFileListExc (
      const AjPStr dir,
      const AjPStr wildfile,
      const AjPStr exclude
);

TypeNameRead/WriteDescription
const AjPStrdirInputDirectory
const AjPStrwildfileInputWildcard file list
const AjPStrexcludeInputWildcard file list (NULL if none to exclude)
AjPList RETURNNew list of all files with full paths

Input
dir:(Input)Directory
wildfile:(Input)Wildcard file list
exclude:(Input)Wildcard file list (NULL if none to exclude)
Returns
AjPList:New list of all files with full paths

Description

Makes a list of all files in a directory matching a wildcard file name.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFlatOpenlib

Open a flat file library

Synopsis

Prototype
AjBool embDbiFlatOpenlib (
      const AjPStr lname,
      AjPFile* libr
);

TypeNameRead/WriteDescription
const AjPStrlnameInputSource file basename
AjPFile*librModifyDatabase file
AjBool RETURNajTrue on success

Input
lname:(Input)Source file basename
Input & Output
libr:(Modify)Database file
Returns
AjBool:ajTrue on success

Description

Open a flat file library

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiRmFile

Remove a file or a set of numbered files

Synopsis

Prototype
void embDbiRmFile (
      const AjPStr dbname,
      const char* ext,
      ajuint nfiles,
      AjBool cleanup
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
const char*extInputBase file extension
ajuintnfilesInputNumber of files, or zero for unnumbered.
AjBoolcleanupInputIf ajTrue, clean up temporary files after
void RETURN

Input
dbname:(Input)Database name
ext:(Input)Base file extension
nfiles:(Input)Number of files, or zero for unnumbered.
cleanup:(Input)If ajTrue, clean up temporary files after
Returns
void:No return value

Description

Remove a file or a set of numbered files

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiRmFileI

Remove a numbered file

Synopsis

Prototype
void embDbiRmFileI (
      const AjPStr dbname,
      const char* ext,
      ajuint ifile,
      AjBool cleanup
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
const char*extInputBase file extension
ajuintifileInputFile number.
AjBoolcleanupInputIf ajTrue, clean up temporary files after
void RETURN

Input
dbname:(Input)Database name
ext:(Input)Base file extension
ifile:(Input)File number.
cleanup:(Input)If ajTrue, clean up temporary files after
Returns
void:No return value

Description

Remove a numbered file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiRmEntryFile

Remove the sorted entryname file (kept until end of processing as it is the sorted list of all entries, used to count entries for field indexing.

Synopsis

Prototype
void embDbiRmEntryFile (
      const AjPStr dbname,
      AjBool cleanup
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
AjBoolcleanupInputIf ajTrue, clean up temporary files after
void RETURN

Input
dbname:(Input)Database name
cleanup:(Input)If ajTrue, clean up temporary files after
Returns
void:No return value

Description

Remove the sorted entryname file (kept until end of processing as it is the sorted list of all entries, used to count entries for field indexing.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiSortFile

Sort a file, or a set of numbered files, individually

Synopsis

Prototype
void embDbiSortFile (
      const AjPStr dbname,
      const char* ext1,
      const char* ext2,
      ajuint nfiles,
      AjBool cleanup,
      const AjPStr sortopt
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
const char*ext1InputInput file extension
const char*ext2InputOutput file extension
ajuintnfilesInputNumber of files to sort (zero if unnumbered)
AjBoolcleanupInputIf ajTrue, clean up temporary files after
const AjPStrsortoptInputExtra options for the system sort
void RETURN

Input
dbname:(Input)Database name
ext1:(Input)Input file extension
ext2:(Input)Output file extension
nfiles:(Input)Number of files to sort (zero if unnumbered)
cleanup:(Input)If ajTrue, clean up temporary files after
sortopt:(Input)Extra options for the system sort
Returns
void:No return value

Description

Sort a file, or a set of numbered files, individually

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiHeaderSize

Updates the file header for an index file to include the correct file size.

Synopsis

Prototype
void embDbiHeaderSize (
      AjPFile file,
      ajuint filesize,
      ajuint recordcnt
);

TypeNameRead/WriteDescription
AjPFilefileModifyOutput file
ajuintfilesizeInputFile size (if known, can be rewritten)
ajuintrecordcntInputNumber of records
void RETURN

Input
filesize:(Input)File size (if known, can be rewritten)
recordcnt:(Input)Number of records
Input & Output
file:(Modify)Output file
Returns
void:No return value

Description

Updates the file header for an index file to include the correct file size.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiHeader

Writes the header for an index file. Resets the file pointer to beginning of file, and leaves the file pointer at the start of the first record.

Synopsis

Prototype
void embDbiHeader (
      AjPFile file,
      ajuint filesize,
      ajuint recordcnt,
      short recordlen,
      const AjPStr dbname,
      const AjPStr release,
      const char[4] date
);

TypeNameRead/WriteDescription
AjPFilefileModifyOutput file
ajuintfilesizeInputFile size (if known, can be rewritten)
ajuintrecordcntInputNumber of records
shortrecordlenInputRecord length (bytes)
const AjPStrdbnameInputDatabase name (up to 20 characters used)
const AjPStrreleaseInputRelease as a string (up to 10 characters used)
const char[4]dateInputDate dd,mm,yy,00
void RETURN

Input
filesize:(Input)File size (if known, can be rewritten)
recordcnt:(Input)Number of records
recordlen:(Input)Record length (bytes)
dbname:(Input)Database name (up to 20 characters used)
release:(Input)Release as a string (up to 10 characters used)
date:(Input)Date dd,mm,yy,00
Input & Output
file:(Modify)Output file
Returns
void:No return value

Description

Writes the header for an index file. Resets the file pointer to beginning of file, and leaves the file pointer at the start of the first record.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFileSingle

Builds a filename for a single temporary file to save IDs or some other index field, for example EMBL01.list

Synopsis

Prototype
AjPFile embDbiFileSingle (
      const AjPStr dbname,
      const char* extension,
      ajuint num
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
const char*extensionInputFilename extension.
ajuintnumInputNumber for this file (start at 1)
AjPFile RETURNOpened output file

Input
dbname:(Input)Database name
extension:(Input)Filename extension.
num:(Input)Number for this file (start at 1)
Returns
AjPFile:Opened output file

Description

Builds a filename for a single temporary file to save IDs or some other index field, for example EMBL01.list

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFileIn

Builds a filename for a summary file to read IDs or some other index field, for example EMBL.acnum_sort

Synopsis

Prototype
AjPFile embDbiFileIn (
      const AjPStr dbname,
      const char* extension
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
const char*extensionInputFilename extension.
AjPFile RETURNOpened output file

Input
dbname:(Input)Database name
extension:(Input)Filename extension.
Returns
AjPFile:Opened output file

Description

Builds a filename for a summary file to read IDs or some other index field, for example EMBL.acnum_sort

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFileOut

Builds a filename for a summary file to save IDs or some other index field, for example EMBL.acnum_srt2

Synopsis

Prototype
AjPFile embDbiFileOut (
      const AjPStr dbname,
      const char* extension
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name
const char*extensionInputFilename extension.
AjPFile RETURNOpened output file

Input
dbname:(Input)Database name
extension:(Input)Filename extension.
Returns
AjPFile:Opened output file

Description

Builds a filename for a summary file to save IDs or some other index field, for example EMBL.acnum_srt2

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiFileIndex

Builds a filename for a summary file to save IDs or some other index field, for example EMBL.acsrt2

Synopsis

Prototype
AjPFile embDbiFileIndex (
      const AjPStr indexdir,
      const AjPStr field,
      const char* extension
);

TypeNameRead/WriteDescription
const AjPStrindexdirInputIndex directory
const AjPStrfieldInputField name
const char*extensionInputFilename extension.
AjPFile RETURNOpened output file

Input
indexdir:(Input)Index directory
field:(Input)Field name
extension:(Input)Filename extension.
Returns
AjPFile:Opened output file

Description

Builds a filename for a summary file to save IDs or some other index field, for example EMBL.acsrt2

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiWriteDivision

Writes the division index file

Synopsis

Prototype
void embDbiWriteDivision (
      const AjPStr indexdir,
      const AjPStr dbname,
      const AjPStr release,
      const char[4] date,
      ajuint maxfilelen,
      ajuint nfiles,
      AjPStr const* divfiles,
      AjPStr const* seqfiles
);

TypeNameRead/WriteDescription
const AjPStrindexdirInputIndex directory
const AjPStrdbnameInputDatabase name
const AjPStrreleaseInputRelease number as a string
const char[4]dateInputDate
ajuintmaxfilelenInputMax file name length
ajuintnfilesInputNumber of files indexes
AjPStr const*divfilesInputDivision filenames
AjPStr const*seqfilesInputSequence filenames (or NULL if none)
void RETURN

Input
indexdir:(Input)Index directory
dbname:(Input)Database name
release:(Input)Release number as a string
date:(Input)Date
maxfilelen:(Input)Max file name length
nfiles:(Input)Number of files indexes
divfiles:(Input)Division filenames
seqfiles:(Input)Sequence filenames (or NULL if none)
Returns
void:No return value

Description

Writes the division index file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiWriteDivisionRecord

Writes a record to the division lookup file

Synopsis

Prototype
void embDbiWriteDivisionRecord (
      AjPFile file,
      ajuint maxnamlen,
      short recnum,
      const AjPStr datfile,
      const AjPStr seqfile
);

TypeNameRead/WriteDescription
AjPFilefileModifyIndex file
ajuintmaxnamlenInputMaximum file name length
shortrecnumInputRecord number
const AjPStrdatfileInputData file name
const AjPStrseqfileInputSequence file name (or NULL if none)
void RETURN

Input
maxnamlen:(Input)Maximum file name length
recnum:(Input)Record number
datfile:(Input)Data file name
seqfile:(Input)Sequence file name (or NULL if none)
Input & Output
file:(Modify)Index file
Returns
void:No return value

Description

Writes a record to the division lookup file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiWriteEntryRecord

Writes a record to the entryname index file

Synopsis

Prototype
void embDbiWriteEntryRecord (
      AjPFile file,
      ajuint maxidlen,
      const AjPStr id,
      ajuint rpos,
      ajuint spos,
      ajushort filenum
);

TypeNameRead/WriteDescription
AjPFilefileModifyhit file
ajuintmaxidlenInputMaximum length for an id string
const AjPStridInputThe id string for this entry
ajuintrposInputData file offset
ajuintsposInputsequence file offset
ajushortfilenumInputfile number in division file
void RETURN

Input
maxidlen:(Input)Maximum length for an id string
id:(Input)The id string for this entry
rpos:(Input)Data file offset
spos:(Input)sequence file offset
filenum:(Input)file number in division file
Input & Output
file:(Modify)hit file
Returns
void:No return value

Description

Writes a record to the entryname index file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiWriteHit

Writes a record to the field hit (.hit) index file

Synopsis

Prototype
void embDbiWriteHit (
      AjPFile file,
      ajuint idnum
);

TypeNameRead/WriteDescription
AjPFilefileModifyhit file
ajuintidnumInputEntry number (1 for the first) in the entryname file
void RETURN

Input
idnum:(Input)Entry number (1 for the first) in the entryname file
Input & Output
file:(Modify)hit file
Returns
void:No return value

Description

Writes a record to the field hit (.hit) index file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiWriteTrg

Writes a record to the field target (.trg) index file

Synopsis

Prototype
void embDbiWriteTrg (
      AjPFile file,
      ajuint maxfieldlen,
      ajuint idnum,
      ajuint idcnt,
      const AjPStr hitstr
);

TypeNameRead/WriteDescription
AjPFilefileModifyhit file
ajuintmaxfieldlenInputMaximum field token length
ajuintidnumInputFirst record number (1 for the first) in the field hit index file
ajuintidcntInputNumber of entries for this field value in the field hit index file
const AjPStrhitstrInputField token string
void RETURN

Input
maxfieldlen:(Input)Maximum field token length
idnum:(Input)First record number (1 for the first) in the field hit index file
idcnt:(Input)Number of entries for this field value in the field hit index file
hitstr:(Input)Field token string
Input & Output
file:(Modify)hit file
Returns
void:No return value

Description

Writes a record to the field target (.trg) index file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiSortOpen

Open sort files for entries and all fields

Synopsis

Prototype
AjPFile embDbiSortOpen (
      AjPFile* alistfile,
      ajuint ifile,
      const AjPStr dbname,
      AjPStr const* fields,
      ajuint nfields
);

TypeNameRead/WriteDescription
AjPFile*alistfileOutputSort files for each field.
ajuintifileInputInput file number (used for temporary file names)
const AjPStrdbnameInputDatabase name (used for temporary file names)
AjPStr const*fieldsInputField names (used for temporary file names)
ajuintnfieldsInputNumber of fields
AjPFile RETURNSort file for entries

Input
ifile:(Input)Input file number (used for temporary file names)
dbname:(Input)Database name (used for temporary file names)
fields:(Input)Field names (used for temporary file names)
nfields:(Input)Number of fields
Output
alistfile:(Output)Sort files for each field.
Returns
AjPFile:Sort file for entries

Description

Open sort files for entries and all fields

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiSortClose

Close the sort files for entries and all fields

Synopsis

Prototype
void embDbiSortClose (
      AjPFile* elistfile,
      AjPFile* alistfile,
      ajuint nfields
);

TypeNameRead/WriteDescription
AjPFile*elistfileModifySort file for entries
AjPFile*alistfileModifySort files for each field.
ajuintnfieldsInputNumber of fields
void RETURN

Input
nfields:(Input)Number of fields
Input & Output
elistfile:(Modify)Sort file for entries
alistfile:(Modify)Sort files for each field.
Returns
void:No return value

Description

Close the sort files for entries and all fields

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiMemEntry

Stores data for current entry in memory by appending to lists

Synopsis

Prototype
void embDbiMemEntry (
      AjPList idlist,
      AjPList* fieldList,
      ajuint nfields,
      EmbPEntry entry,
      ajuint ifile
);

TypeNameRead/WriteDescription
AjPListidlistModifyList of entry IDs
AjPList*fieldListModifyList of field tokens for each field
ajuintnfieldsInputNumber of fields
EmbPEntryentryModifyCurrent entry
ajuintifileInputCurrent input file number
void RETURN

Input
nfields:(Input)Number of fields
ifile:(Input)Current input file number
Input & Output
idlist:(Modify)List of entry IDs
fieldList:(Modify)List of field tokens for each field
entry:(Modify)Current entry
Returns
void:No return value

Description

Stores data for current entry in memory by appending to lists

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiSortWriteEntry

Write the entryname index file using data from the entry sort file.

Synopsis

Prototype
ajuint embDbiSortWriteEntry (
      AjPFile entFile,
      ajuint maxidlen,
      const AjPStr dbname,
      ajuint nfiles,
      AjBool cleanup,
      const AjPStr sortopt
);

TypeNameRead/WriteDescription
AjPFileentFileModifyEntry file
ajuintmaxidlenInputMaximum id length
const AjPStrdbnameInputDatabase name (used in temp file names)
ajuintnfilesInputNumber of files
AjBoolcleanupInputCleanup temp files if true
const AjPStrsortoptInputSort commandline options
ajuint RETURNNumber of entries

Input
maxidlen:(Input)Maximum id length
dbname:(Input)Database name (used in temp file names)
nfiles:(Input)Number of files
cleanup:(Input)Cleanup temp files if true
sortopt:(Input)Sort commandline options
Input & Output
entFile:(Modify)Entry file
Returns
ajuint:Number of entries

Description

Write the entryname index file using data from the entry sort file.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiMemWriteEntry

Write entryname index for in-memory processing

Synopsis

Prototype
ajuint embDbiMemWriteEntry (
      AjPFile entFile,
      ajuint maxidlen,
      const AjPList idlist,
      void*** ids
);

TypeNameRead/WriteDescription
AjPFileentFileModifyentryname index file
ajuintmaxidlenInputMaximum entry id length
const AjPListidlistInputList of entry IDs to be written
void***idsOutputAjPStr* array of IDs from list
ajuint RETURNNumber of entries written (excluding duplicates)

Input
maxidlen:(Input)Maximum entry id length
idlist:(Input)List of entry IDs to be written
Output
ids:(Output)AjPStr* array of IDs from list
Input & Output
entFile:(Modify)entryname index file
Returns
ajuint:Number of entries written (excluding duplicates)

Description

Write entryname index for in-memory processing

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiSortWriteFields

Write the indices for a field.

Synopsis

Prototype
ajuint embDbiSortWriteFields (
      const AjPStr dbname,
      const AjPStr release,
      const char[4] date,
      const AjPStr indexdir,
      const AjPStr fieldname,
      ajuint maxFieldLen,
      ajuint nfiles,
      ajuint nentries,
      AjBool cleanup,
      const AjPStr sortopt
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name (used for temp file names)
const AjPStrreleaseInputRelease number as a string
const char[4]dateInputDate
const AjPStrindexdirInputIndex directory
const AjPStrfieldnameInputField name (used for temp file names)
ajuintmaxFieldLenInputMaximum field token length
ajuintnfilesInputNumber of data files
ajuintnentriesInputNumber of entries
AjBoolcleanupInputCleanup temp files if true
const AjPStrsortoptInputSort command line options
ajuint RETURNNumber of unique field targets written

Input
dbname:(Input)Database name (used for temp file names)
release:(Input)Release number as a string
date:(Input)Date
indexdir:(Input)Index directory
fieldname:(Input)Field name (used for temp file names)
maxFieldLen:(Input)Maximum field token length
nfiles:(Input)Number of data files
nentries:(Input)Number of entries
cleanup:(Input)Cleanup temp files if true
sortopt:(Input)Sort command line options
Returns
ajuint:Number of unique field targets written

Description

Write the indices for a field.

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiMemWriteFields

Write the fields indices

Synopsis

Prototype
ajuint embDbiMemWriteFields (
      const AjPStr dbname,
      const AjPStr release,
      const char[4] date,
      const AjPStr indexdir,
      const AjPStr fieldname,
      ajuint maxFieldLen,
      const AjPList fieldList,
      void** ids
);

TypeNameRead/WriteDescription
const AjPStrdbnameInputDatabase name (used for temp file names)
const AjPStrreleaseInputRelease number as a string
const char[4]dateInputDate
const AjPStrindexdirInputIndex directory
const AjPStrfieldnameInputField name (used for file names)
ajuintmaxFieldLenInputMaximum field token length
const AjPListfieldListInputList of field tokens to be written
void**idsInputAjPStr* array offield token s from list
ajuint RETURNNumber of unique field targets written

Input
dbname:(Input)Database name (used for temp file names)
release:(Input)Release number as a string
date:(Input)Date
indexdir:(Input)Index directory
fieldname:(Input)Field name (used for file names)
maxFieldLen:(Input)Maximum field token length
fieldList:(Input)List of field tokens to be written
ids:(Input)AjPStr* array offield token s from list
Returns
ajuint:Number of unique field targets written

Description

Write the fields indices

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiDateSet

Sets the date as an integer array from a formatted string. The integer array is the internal format in database index headers

Synopsis

Prototype
void embDbiDateSet (
      const AjPStr datestr,
      char[4] date
);

TypeNameRead/WriteDescription
const AjPStrdatestrInputDate as a string
char[4]dateOutputData char (1 byte int) array
void RETURN

Input
datestr:(Input)Date as a string
Output
date:(Output)Data char (1 byte int) array
Returns
void:No return value

Description

Sets the date as an integer array from a formatted string. The integer array is the internal format in database index headers

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiMaxlen

Compares a string to a maximum string length.

A negative maximum length limits the string to that absolute length.

A non-negative length is updated if the string is longer

Synopsis

Prototype
void embDbiMaxlen (
      AjPStr* token,
      ajint* maxlen
);

TypeNameRead/WriteDescription
AjPStr*tokenModifyToken string
ajint*maxlenModifyMaximum string length
void RETURN

Input & Output
token:(Modify)Token string
maxlen:(Modify)Maximum string length
Returns
void:No return value

Description

Compares a string to a maximum string length.

A negative maximum length limits the string to that absolute length.

A non-negative length is updated if the string is longer

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiLogHeader

Writes the header to a database indexing logfile

Synopsis

Prototype
void embDbiLogHeader (
      AjPFile logfile,
      const AjPStr dbname,
      const AjPStr release,
      const AjPStr datestr,
      const AjPStr indexdir,
      ajuint maxindex
);

TypeNameRead/WriteDescription
AjPFilelogfileModifyLog file
const AjPStrdbnameInputDatabase name
const AjPStrreleaseInputRelease number, name or code
const AjPStrdatestrInputIndexing date as a string dd/mm/yy
const AjPStrindexdirInputIndex directory relative path
ajuintmaxindexInputMaximum index token length (usually zero)
void RETURN

Input
dbname:(Input)Database name
release:(Input)Release number, name or code
datestr:(Input)Indexing date as a string dd/mm/yy
indexdir:(Input)Index directory relative path
maxindex:(Input)Maximum index token length (usually zero)
Input & Output
logfile:(Modify)Log file
Returns
void:No return value

Description

Writes the header to a database indexing logfile

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiLogFields

Writes database indexing logfile report of fields selected for indexing

Synopsis

Prototype
void embDbiLogFields (
      AjPFile logfile,
      AjPStr const* fields,
      ajuint nfields
);

TypeNameRead/WriteDescription
AjPFilelogfileModifyLog file
AjPStr const*fieldsInputField names
ajuintnfieldsInputNumber of fields
void RETURN

Input
fields:(Input)Field names
nfields:(Input)Number of fields
Input & Output
logfile:(Modify)Log file
Returns
void:No return value

Description

Writes database indexing logfile report of fields selected for indexing

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiLogSource

Writes database indexing logfile report of source data selected for indexing

Synopsis

Prototype
void embDbiLogSource (
      AjPFile logfile,
      const AjPStr directory,
      const AjPStr filename,
      const AjPStr exclude,
      AjPStr const* inputFiles,
      ajuint nfiles
);

TypeNameRead/WriteDescription
AjPFilelogfileModifyLog file
const AjPStrdirectoryInputData directory relative path
const AjPStrfilenameInputSelected filenames wildcard
const AjPStrexcludeInputExcluded filenames wildcard
AjPStr const*inputFilesInputFile names
ajuintnfilesInputNumber of files
void RETURN

Input
directory:(Input)Data directory relative path
filename:(Input)Selected filenames wildcard
exclude:(Input)Excluded filenames wildcard
inputFiles:(Input)File names
nfiles:(Input)Number of files
Input & Output
logfile:(Modify)Log file
Returns
void:No return value

Description

Writes database indexing logfile report of source data selected for indexing

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiLogCmdline

Writes database indexing logfile report of commandline used

Synopsis

Prototype
void embDbiLogCmdline (
      AjPFile logfile
);

TypeNameRead/WriteDescription
AjPFilelogfileModifyLog file
void RETURN

Input & Output
logfile:(Modify)Log file
Returns
void:No return value

Description

Writes database indexing logfile report of commandline used

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiLogFile

Writes database indexing logfile report of a single source file

Synopsis

Prototype
void embDbiLogFile (
      AjPFile logfile,
      const AjPStr curfilename,
      ajuint idCountFile,
      AjPStr const* fields,
      const ajuint* countField,
      ajuint nfields
);

TypeNameRead/WriteDescription
AjPFilelogfileModifyLog file
const AjPStrcurfilenameInputSource filename
ajuintidCountFileInputNumber of IDs in file
AjPStr const*fieldsInputField names
const ajuint*countFieldInputNumber of field tokens in this file
ajuintnfieldsInputNumber of fields
void RETURN

Input
curfilename:(Input)Source filename
idCountFile:(Input)Number of IDs in file
fields:(Input)Field names
countField:(Input)Number of field tokens in this file
nfields:(Input)Number of fields
Input & Output
logfile:(Modify)Log file
Returns
void:No return value

Description

Writes database indexing logfile report of a single source file

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiLogFinal

Writes database indexing logfile report of final totals

Synopsis

Prototype
void embDbiLogFinal (
      AjPFile logfile,
      ajuint maxindex,
      const ajint* maxFieldLen,
      AjPStr const* fields,
      const ajuint* fieldTot,
      ajuint nfields,
      ajuint nfiles,
      ajuint idDone,
      ajuint idCount
);

TypeNameRead/WriteDescription
AjPFilelogfileModifyLog file
ajuintmaxindexInputUser defined maximum index token length (usually zero)
const ajint*maxFieldLenInputMaximum index token length for each field. Negative values were upper limits. Positive values are the maximum in the data
AjPStr const*fieldsInputField names
const ajuint*fieldTotInputNumber of unique field tokens
ajuintnfieldsInputNumber of fields
ajuintnfilesInputNumber of input files
ajuintidDoneInputNumber of unique IDs indexed
ajuintidCountInputTotal number of IDs indexed
void RETURN

Input
maxindex:(Input)User defined maximum index token length (usually zero)
maxFieldLen:(Input)Maximum index token length for each field. Negative values were upper limits. Positive values are the maximum in the data
fields:(Input)Field names
fieldTot:(Input)Number of unique field tokens
nfields:(Input)Number of fields
nfiles:(Input)Number of input files
idDone:(Input)Number of unique IDs indexed
idCount:(Input)Total number of IDs indexed
Input & Output
logfile:(Modify)Log file
Returns
void:No return value

Description

Writes database indexing logfile report of final totals

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0

Function embDbiExit

Cleanup database indexing internals on exit

Synopsis

Prototype
void embDbiExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Cleanup database indexing internals on exit

Usage

See source code

Example

In preparation

Errors

See source code

Dependencies

See source code

See Also

See other functions in this section

Availability

In release 6.4.0