ajtextread.c

Datatypes: AjPTextin none AjPTable AjPTextall none


Datatype: AjPTextin

Text input objects

Sections: Text Input Constructors Text Input Destructors text input modifiers casts Text data inputs File Access


Section: Text Input Constructors

All constructors return a new text input object by pointer. It is the responsibility of the user to first destroy any previous text input object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions: ajTextinNew ajTextinNewDatatype


Function ajTextinNew

Creates a new text input object.

Synopsis

Prototype
AjPTextin ajTextinNew (
      void
);

TypeNameRead/WriteDescription
AjPTextin RETURNNew text input object.

Returns
AjPTextin:New text input object.

Description

Creates a new text input object.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinNewDatatype

Creates a new text input object for assembly data

Synopsis

Prototype
AjPTextin ajTextinNewDatatype (
      const AjEDataType datatype
);

TypeNameRead/WriteDescription
const AjEDataTypedatatypeInputEnumerated datatype
AjPTextin RETURNNew text input object.

Input
datatype:(Input)Enumerated datatype
Returns
AjPTextin:New text input object.

Description

Creates a new text input object for assembly data

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Text Input Destructors

Destruction destroys all internal data structures and frees the memory allocated for the text input object.

Functions: ajTextinDel ajTextinDelNofile


Function ajTextinDel

Deletes a text input object.

Synopsis

Prototype
void ajTextinDel (
      AjPTextin* pthis
);

TypeNameRead/WriteDescription
AjPTextin*pthisDeleteText input
void RETURN

Output
pthis:(Delete)Text input
Returns
void:No return value

Description

Deletes a text input object.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinDelNofile

Deletes a text input object but do not close the file as it is a copy of a file buffer elsewhere

Synopsis

Prototype
void ajTextinDelNofile (
      AjPTextin* pthis
);

TypeNameRead/WriteDescription
AjPTextin*pthisDeleteText input
void RETURN

Output
pthis:(Delete)Text input
Returns
void:No return value

Description

Deletes a text input object but do not close the file as it is a copy of a file buffer elsewhere

See Also

See other functions in this section

Availability

In release 6.4.0

Section: text input modifiers

These functions use the contents of a text input object and update them.

Functions: ajTextinClear ajTextinClearNofile ajTextinQryC ajTextinQryS


Function ajTextinClear

Clears a text input object back to "as new" condition, except for the query list which must be preserved.

Synopsis

Prototype
void ajTextinClear (
      AjPTextin thys
);

TypeNameRead/WriteDescription
AjPTextinthysOutputText input
void RETURN

Output
thys:(Output)Text input
Returns
void:No return value

Description

Clears a text input object back to "as new" condition, except for the query list which must be preserved.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinClearNofile

Clears a text input object back to "as new" condition, except for the query list which must be preserved.

Synopsis

Prototype
void ajTextinClearNofile (
      AjPTextin thys
);

TypeNameRead/WriteDescription
AjPTextinthysOutputText input
void RETURN

Output
thys:(Output)Text input
Returns
void:No return value

Description

Clears a text input object back to "as new" condition, except for the query list which must be preserved.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinQryC

Resets a text input object using a new Universal Query Address

Synopsis

Prototype
void ajTextinQryC (
      AjPTextin thys,
      const char* txt
);

TypeNameRead/WriteDescription
AjPTextinthysModifytext input object.
const char*txtInputQuery
void RETURN

Input
txt:(Input)Query
Input & Output
thys:(Modify)text input object.
Returns
void:No return value

Description

Resets a text input object using a new Universal Query Address

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinQryS

Resets a text input object using a new Universal Query Address

Synopsis

Prototype
void ajTextinQryS (
      AjPTextin thys,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPTextinthysModifyText input object.
const AjPStrstrInputQuery
void RETURN

Input
str:(Input)Query
Input & Output
thys:(Modify)Text input object.
Returns
void:No return value

Description

Resets a text input object using a new Universal Query Address

See Also

See other functions in this section

Availability

In release 6.4.0

Section: casts

Return values

Functions: ajTextinGetQryS ajTextinTrace


Function ajTextinGetQryS

Returns the query of a text input object

Synopsis

Prototype
const AjPStr ajTextinGetQryS (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
const AjPStr RETURNQuery string

Input
thys:(Input)Text input object.
Returns
const AjPStr:Query string

Description

Returns the query of a text input object

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinTrace

Debug calls to trace the data in a text input object.

Synopsis

Prototype
void ajTextinTrace (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
void RETURN

Input
thys:(Input)Text input object.
Returns
void:No return value

Description

Debug calls to trace the data in a text input object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Text data inputs

These functions read the text data provided by the first argument

Functions: ajTextinRead


Function ajTextinRead

If the file is not yet open, calls textinQryProcess to convert the query into an open file stream.

Uses textinRead for the actual file reading.

Returns the results in the AjPText object.

Synopsis

Prototype
AjBool ajTextinRead (
      AjPTextin textin,
      AjPText text
);

TypeNameRead/WriteDescription
AjPTextintextinModifytext data input definitions
AjPTexttextOutputtext data returned.
AjBool RETURNajTrue on success.

Output
text:(Output)text data returned.
Input & Output
textin:(Modify)text data input definitions
Returns
AjBool:ajTrue on success.

Description

If the file is not yet open, calls textinQryProcess to convert the query into an open file stream.

Uses textinRead for the actual file reading.

Returns the results in the AjPText object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: File Access

These functions manage the text file access methods.

Functions: ajTextinAccessAsis ajTextinAccessFile ajTextinAccessOffset


Function ajTextinAccessAsis

Reads text using the 'filename' as the single input line

Synopsis

Prototype
AjBool ajTextinAccessAsis (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

Input & Output
textin:(Modify)Text input.
Returns
AjBool:ajTrue on success.

Description

Reads text using the 'filename' as the single input line

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinAccessFile

Reads data from a named file.

Synopsis

Prototype
AjBool ajTextinAccessFile (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

Input & Output
textin:(Modify)Text input.
Returns
AjBool:ajTrue on success.

Description

Reads data from a named file.

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinAccessOffset

Reads a text from a named file, at a given offset within the file.

Synopsis

Prototype
AjBool ajTextinAccessOffset (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

Input & Output
textin:(Modify)Text input.
Returns
AjBool:ajTrue on success.

Description

Reads a text from a named file, at a given offset within the file.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: none

Miscellaneous

Sections: Print


Section: Print

Printing to a file

Functions: ajTextinprintBook ajTextinprintHtml ajTextinprintText ajTextinprintWiki


Function ajTextinprintBook

Reports the internal data structures as a Docbook table

Synopsis

Prototype
void ajTextinprintBook (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

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

Description

Reports the internal data structures as a Docbook table

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinprintHtml

Reports the internal data structures as an HTML table

Synopsis

Prototype
void ajTextinprintHtml (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

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

Description

Reports the internal data structures as an HTML table

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinprintText

Reports the internal data structures

Synopsis

Prototype
void ajTextinprintText (
      AjPFile outf,
      AjBool full
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
AjBoolfullInputFull report (usually ajFalse)
void RETURN

Input
full:(Input)Full report (usually ajFalse)
Input & Output
outf:(Modify)Output file
Returns
void:No return value

Description

Reports the internal data structures

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinprintWiki

Reports the internal data structures as a wiki table

Synopsis

Prototype
void ajTextinprintWiki (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

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

Description

Reports the internal data structures as a wiki table

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Miscellaneous

Functions to initialise and clean up internals

Functions: ajTextinExit


Function ajTextinExit

Cleans up text data input internal memory

Synopsis

Prototype
void ajTextinExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

Returns
void:No return value

Description

Cleans up text data input internal memory

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Internals

Functions to return internal values

Functions: ajTextinTypeGetFields ajTextinTypeGetQlinks


Function ajTextinTypeGetFields

Returns the listof known field names for ajTextinRead

Synopsis

Prototype
const char* ajTextinTypeGetFields (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

Returns
const char*:List of field names

Description

Returns the listof known field names for ajTextinRead

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinTypeGetQlinks

Returns the listof known query link operators for ajTextinRead

Synopsis

Prototype
const char* ajTextinTypeGetQlinks (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

Returns
const char*:List of field names

Description

Returns the listof known query link operators for ajTextinRead

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPTable

Internal call register table

Sections: Cast


Section: Cast

Return a reference to the call table

Functions: ajTextaccessGetDb ajTextaccessMethodGetQlinks ajTextaccessMethodGetScope ajTextaccessMethodTest


Function ajTextaccessGetDb

Returns the table in which text database access details are registered

Synopsis

Prototype
AjPTable ajTextaccessGetDb (
      void
);

TypeNameRead/WriteDescription
AjPTable RETURNAccess functions hash table

Returns
AjPTable:Access functions hash table

Description

Returns the table in which text database access details are registered

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextaccessMethodGetQlinks

Tests for a named method for text file reading and returns the known query link operators

Synopsis

Prototype
const char* ajTextaccessMethodGetQlinks (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
const char* RETURNKnown link operators

Input
method:(Input)Method required.
Returns
const char*:Known link operators

Description

Tests for a named method for text file reading and returns the known query link operators

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextaccessMethodGetScope

Tests for a named method for text file reading and returns the scope (entry, query or all).

Synopsis

Prototype
ajuint ajTextaccessMethodGetScope (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
ajuint RETURNScope flags

Input
method:(Input)Method required.
Returns
ajuint:Scope flags

Description

Tests for a named method for text file reading and returns the scope (entry, query or all).

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextaccessMethodTest

Tests for a named method for text reading.

Synopsis

Prototype
AjBool ajTextaccessMethodTest (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
AjBool RETURNajTrue on success.

Input
method:(Input)Method required.
Returns
AjBool:ajTrue on success.

Description

Tests for a named method for text reading.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: AjPTextall

Text Input Stream

Sections: Text Input Constructors Text Input Stream Destructors Text input stream modifiers Text input


Section: Text Input Constructors

All constructors return a new text input stream object by pointer. It is the responsibility of the user to first destroy any previous text input object. The target pointer does not need to be initialised to NULL, but it is good programming practice to do so anyway.

Functions: ajTextallNew


Function ajTextallNew

Creates a new text input stream object.

Synopsis

Prototype
AjPTextall ajTextallNew (
      void
);

TypeNameRead/WriteDescription
AjPTextall RETURNNew text input stream object.

Returns
AjPTextall:New text input stream object.

Description

Creates a new text input stream object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Text Input Stream Destructors

Destruction destroys all internal data structures and frees the memory allocated for the text input stream object.

Functions: ajTextallDel


Function ajTextallDel

Deletes a text input stream object.

Synopsis

Prototype
void ajTextallDel (
      AjPTextall* pthis
);

TypeNameRead/WriteDescription
AjPTextall*pthisDeleteText input stream
void RETURN

Output
pthis:(Delete)Text input stream
Returns
void:No return value

Description

Deletes a text input stream object.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Text input stream modifiers

These functions use the contents of a text input stream object and update them.

Functions: ajTextallClear


Function ajTextallClear

Clears a text input stream object back to "as new" condition, except for the query list which must be preserved.

Synopsis

Prototype
void ajTextallClear (
      AjPTextall thys
);

TypeNameRead/WriteDescription
AjPTextallthysOutputText input stream
void RETURN

Output
thys:(Output)Text input stream
Returns
void:No return value

Description

Clears a text input stream object back to "as new" condition, except for the query list which must be preserved.

See Also

See other functions in this section

Availability

In release 6.4.0

Section: Text input

These functions use a text input stream object to read data

Functions: ajTextallNext


Function ajTextallNext

Parse a text query into format, access, file and entry

Split at delimiters. Check for the first part as a valid format Check for the remaining first part as a database name or as a file that can be opened. Anything left is an entryname spec.

Return the results in the AjPText object but leave the file open for future calls.

Synopsis

Prototype
AjBool ajTextallNext (
      AjPTextall thys,
      AjPText* Ptext
);

TypeNameRead/WriteDescription
AjPTextallthysOutputText input stream
AjPText*PtextModifyText block returned
AjBool RETURNajTrue on success.

Output
thys:(Output)Text input stream
Input & Output
Ptext:(Modify)Text block returned
Returns
AjBool:ajTrue on success.

Description

Parse a text query into format, access, file and entry

Split at delimiters. Check for the first part as a valid format Check for the remaining first part as a database name or as a file that can be opened. Anything left is an entryname spec.

Return the results in the AjPText object but leave the file open for future calls.

See Also

See other functions in this section

Availability

In release 6.4.0

Datatype: none

Input formats

Sections: cast


Section: cast

Values for input formats

Functions: ajTextinformatTerm ajTextinformatTest


Function ajTextinformatTerm

tests whether a text input format term is known

Synopsis

Prototype
AjBool ajTextinformatTerm (
      const AjPStr term
);

TypeNameRead/WriteDescription
const AjPStrtermInputFormat term EDAM ID
AjBool RETURNajTrue if term was accepted

Input
term:(Input)Format term EDAM ID
Returns
AjBool:ajTrue if term was accepted

Description

tests whether a text input format term is known

See Also

See other functions in this section

Availability

In release 6.4.0

Function ajTextinformatTest

tests whether a named text input format is known

Synopsis

Prototype
AjBool ajTextinformatTest (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputFormat
AjBool RETURNajTrue if format was accepted

Input
format:(Input)Format
Returns
AjBool:ajTrue if format was accepted

Description

tests whether a named text input format is known

See Also

See other functions in this section

Availability

In release 6.4.0