ajtextread.c

Datatypes:
AjPTextin Text input objects
none Miscellaneous
AjPTable Internal call register table
AjPTextall Text Input Stream
none Input formats


Datatype: AjPTextin

Function is for manipulating text input objects

Sections:
Text Input ConstructorsConstructors
Text Input DestructorsDestructors
text input modifiersModifiers
storeCasts
castsCasts
Text data inputsInput
File AccessInput


AjPTextin: 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:
ajTextinNewCreates a new text input object.
ajTextinNewDatatypeCreates a new text input object for assembly data


Function ajTextinNew

Creates a new text input object.

Prototype

AjPTextin ajTextinNew (
      void
);

TypeNameRead/WriteDescription
AjPTextin RETURNNew text input object.

From EMBOSS 6.4.0


Function ajTextinNewDatatype

Creates a new text input object for assembly data

Prototype

AjPTextin ajTextinNewDatatype (
      const AjEDataType datatype
);

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

From EMBOSS 6.4.0


AjPTextin: Text Input Destructors

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

Functions:
ajTextinDelDeletes a text input object.
ajTextinDelNofileDeletes a text input object but do not close the file as it is a copy of a file buffer elsewhere


Function ajTextinDel

Deletes a text input object.

Prototype

void ajTextinDel (
      AjPTextin* pthis
);

TypeNameRead/WriteDescription
AjPTextin*pthisDeleteText input
void RETURN

From EMBOSS 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

Prototype

void ajTextinDelNofile (
      AjPTextin* pthis
);

TypeNameRead/WriteDescription
AjPTextin*pthisDeleteText input
void RETURN

From EMBOSS 6.4.0


AjPTextin: text input modifiers

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

Functions:
ajTextinClearClears a text input object back to "as new" condition, except for the query list which must be preserved.
ajTextinClearNewfileClears a text input object statistics for continued input with a new file
ajTextinClearNewinputClears a text input object statistics for continued input with same file
ajTextinClearNofileClears a text input object back to "as new" condition, except for the query list which must be preserved.
ajTextinQryCResets a text input object using a new Universal Query Address
ajTextinQrySResets a text input object using a new Universal Query Address


Function ajTextinClear

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

Prototype

void ajTextinClear (
      AjPTextin thys
);

TypeNameRead/WriteDescription
AjPTextinthysOutputText input
void RETURN

From EMBOSS 6.4.0


Function ajTextinClearNewfile

Clears a text input object statistics for continued input with a new file

Prototype

void ajTextinClearNewfile (
      AjPTextin thys
);

TypeNameRead/WriteDescription
AjPTextinthysOutputText input
void RETURN

From EMBOSS 6.6.0


Function ajTextinClearNewinput

Clears a text input object statistics for continued input with same file

Prototype

void ajTextinClearNewinput (
      AjPTextin thys
);

TypeNameRead/WriteDescription
AjPTextinthysOutputText input
void RETURN

From EMBOSS 6.6.0


Function ajTextinClearNofile

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

Prototype

void ajTextinClearNofile (
      AjPTextin thys
);

TypeNameRead/WriteDescription
AjPTextinthysOutputText input
void RETURN

From EMBOSS 6.4.0


Function ajTextinQryC

Resets a text input object using a new Universal Query Address

Prototype

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

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

From EMBOSS 6.4.0


Function ajTextinQryS

Resets a text input object using a new Universal Query Address

Prototype

void ajTextinQryS (
      AjPTextin thys,
      const AjPStr str
);

TypeNameRead/WriteDescription
AjPTextinthysModifyText input object.
const AjPStrstrInputQuery
void RETURN

From EMBOSS 6.4.0


AjPTextin: store

Read text data using a text input object and if saved text is defined, maintain a text argument.

Functions:
ajTextinStoreClearClear the latest record from a text input buffer and any saved buffered text
ajTextinStoreReadlineRead the next line of input and if required store in buffer
ajTextinStoreResetReset a text input object buffer and any saved buffered text


Function ajTextinStoreClear

Clear the latest record from a text input buffer and any saved buffered text

Prototype

void ajTextinStoreClear (
      AjPTextin thys,
      ajint lines,
      const AjPStr rdline,
      AjPStr* astr
);

TypeNameRead/WriteDescription
AjPTextinthysModifyText input object
ajintlinesInputNumber of lines to keep
const AjPStrrdlineInputLast input record to trim
AjPStr*astrModifyCurrent text buffer
void RETURN

In release 6.5.0


Function ajTextinStoreReadline

Read the next line of input and if required store in buffer

Prototype

AjBool ajTextinStoreReadline (
      AjPTextin thys,
      AjPStr* pdest,
      AjPStr* astr
);

TypeNameRead/WriteDescription
AjPTextinthysModifyText input object
AjPStr*pdestOutputNext input record
AjPStr*astrModifyCurrent text buffer
AjBool RETURNTrue on success

In release 6.5.0


Function ajTextinStoreReset

Reset a text input object buffer and any saved buffered text

Prototype

void ajTextinStoreReset (
      AjPTextin thys,
      AjPStr* astr
);

TypeNameRead/WriteDescription
AjPTextinthysModifyText input object
AjPStr*astrModifyCurrent text buffer
void RETURN

In release 6.5.0


AjPTextin: casts

Return values

Functions:
ajTextinGetCountReturns the input count of a text input object
ajTextinGetFposReturns the file position of a text input object
ajTextinGetQrySReturns the query of a text input object
ajTextinGetRecordsReturns the record count of a text input object
ajTextinGetTotrecordsReturns the total record count of a text input object
ajTextinTraceDebug calls to trace the data in a text input object.


Function ajTextinGetCount

Returns the input count of a text input object

Prototype

ajuint ajTextinGetCount (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
ajuint RETURNInput count

From EMBOSS 6.6.0


Function ajTextinGetFpos

Returns the file position of a text input object

Prototype

ajlong ajTextinGetFpos (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
ajlong RETURNFile position

From EMBOSS 6.6.0


Function ajTextinGetQryS

Returns the query of a text input object

Prototype

const AjPStr ajTextinGetQryS (
      const AjPTextin thys
);

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

From EMBOSS 6.4.0


Function ajTextinGetRecords

Returns the record count of a text input object

Prototype

ajuint ajTextinGetRecords (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
ajuint RETURNRecord count

From EMBOSS 6.6.0


Function ajTextinGetTotrecords

Returns the total record count of a text input object

Prototype

ajuint ajTextinGetTotrecords (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
ajuint RETURNTotal record count

From EMBOSS 6.6.0


Function ajTextinTrace

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

Prototype

void ajTextinTrace (
      const AjPTextin thys
);

TypeNameRead/WriteDescription
const AjPTextinthysInputText input object.
void RETURN

From EMBOSS 6.4.0


AjPTextin: Text data inputs

These functions read the text data provided by the first argument

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


Function ajTextinRead

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

Prototype

AjBool ajTextinRead (
      AjPTextin textin,
      AjPText text
);

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

From EMBOSS 6.4.0


AjPTextin: File Access

These functions manage the text file access methods.

Functions:
ajTextinAccessAsisReads text using the 'filename' as the single input line
ajTextinAccessFileReads data from a named file.
ajTextinAccessFtpReads data from an FTP URL
ajTextinAccessHttpReads data from an HTTP URL. No HTML is stripped.
ajTextinAccessOffsetReads a text from a named file, at a given offset within the file.


Function ajTextinAccessAsis

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

Prototype

AjBool ajTextinAccessAsis (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

From EMBOSS 6.4.0


Function ajTextinAccessFile

Reads data from a named file.

Prototype

AjBool ajTextinAccessFile (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

From EMBOSS 6.4.0


Function ajTextinAccessFtp

Reads data from an FTP URL

Prototype

AjBool ajTextinAccessFtp (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

From EMBOSS 6.5.0


Function ajTextinAccessHttp

Reads data from an HTTP URL. No HTML is stripped.

Prototype

AjBool ajTextinAccessHttp (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

From EMBOSS 6.5.0


Function ajTextinAccessOffset

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

Prototype

AjBool ajTextinAccessOffset (
      AjPTextin textin
);

TypeNameRead/WriteDescription
AjPTextintextinModifyText input.
AjBool RETURNajTrue on success.

From EMBOSS 6.4.0


Datatype: none

Text input internals

Sections:
PrintCasts


Section: Print

Printing to a file

Functions:
ajTextinprintBookReports the internal data structures as a Docbook table
ajTextinprintHtmlReports the internal data structures as an HTML table
ajTextinprintTextReports the internal data structures
ajTextinprintWikiReports the internal data structures as a wiki table


Function ajTextinprintBook

Reports the internal data structures as a Docbook table

Prototype

void ajTextinprintBook (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.4.0


Function ajTextinprintHtml

Reports the internal data structures as an HTML table

Prototype

void ajTextinprintHtml (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.4.0


Function ajTextinprintText

Reports the internal data structures

Prototype

void ajTextinprintText (
      AjPFile outf,
      AjBool full
);

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

From EMBOSS 6.4.0


Function ajTextinprintWiki

Reports the internal data structures as a wiki table

Prototype

void ajTextinprintWiki (
      AjPFile outf
);

TypeNameRead/WriteDescription
AjPFileoutfModifyOutput file
void RETURN

From EMBOSS 6.4.0


Section: Miscellaneous

Functions to initialise and clean up internals

Functions:
ajTextinExitCleans up text data input internal memory


Function ajTextinExit

Cleans up text data input internal memory

Prototype

void ajTextinExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 6.4.0


Section: Internals

Functions to return internal values

Functions:
ajTextinTypeGetFieldsReturns the listof known field names for ajTextinRead
ajTextinTypeGetQlinksReturns the listof known query link operators for ajTextinRead


Function ajTextinTypeGetFields

Returns the listof known field names for ajTextinRead

Prototype

const char* ajTextinTypeGetFields (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

From EMBOSS 6.4.0


Function ajTextinTypeGetQlinks

Returns the listof known query link operators for ajTextinRead

Prototype

const char* ajTextinTypeGetQlinks (
      void
);

TypeNameRead/WriteDescription
const char* RETURNList of field names

From EMBOSS 6.4.0


Datatype: AjPTable

Functions to manage the internal call register table that links the ajaxdb library functions with code in the core AJAX library.

Sections:
CastCasts


AjPTable: Cast

Return a reference to the call table

Functions:
ajTextaccessGetDbReturns the table in which text database access details are registered
ajTextaccessMethodGetQlinksTests for a named method for text file reading and returns the known query link operators
ajTextaccessMethodGetScopeTests for a named method for text file reading and returns the scope (entry, query or all).
ajTextaccessMethodTestTests for a named method for text reading.


Function ajTextaccessGetDb

Returns the table in which text database access details are registered

Prototype

AjPTable ajTextaccessGetDb (
      void
);

TypeNameRead/WriteDescription
AjPTable RETURNAccess functions hash table

From EMBOSS 6.4.0


Function ajTextaccessMethodGetQlinks

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

Prototype

const char* ajTextaccessMethodGetQlinks (
      const AjPStr method
);

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

From EMBOSS 6.4.0


Function ajTextaccessMethodGetScope

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

Prototype

ajuint ajTextaccessMethodGetScope (
      const AjPStr method
);

TypeNameRead/WriteDescription
const AjPStrmethodInputMethod required.
ajuint RETURNScope flags

From EMBOSS 6.4.0


Function ajTextaccessMethodTest

Tests for a named method for text reading.

Prototype

AjBool ajTextaccessMethodTest (
      const AjPStr method
);

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

From EMBOSS 6.4.0


Datatype: AjPTextall

Function is for manipulating text block input stream objects

Sections:
Text Input ConstructorsConstructors
Text Input Stream DestructorsDestructors
Text input stream modifiersModifiers
Text inputInput


AjPTextall: 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:
ajTextallNewCreates a new text input stream object.


Function ajTextallNew

Creates a new text input stream object.

Prototype

AjPTextall ajTextallNew (
      void
);

TypeNameRead/WriteDescription
AjPTextall RETURNNew text input stream object.

From EMBOSS 6.4.0


AjPTextall: Text Input Stream Destructors

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

Functions:
ajTextallDelDeletes a text input stream object.


Function ajTextallDel

Deletes a text input stream object.

Prototype

void ajTextallDel (
      AjPTextall* pthis
);

TypeNameRead/WriteDescription
AjPTextall*pthisDeleteText input stream
void RETURN

From EMBOSS 6.4.0


AjPTextall: Text input stream modifiers

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

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


Function ajTextallClear

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

Prototype

void ajTextallClear (
      AjPTextall thys
);

TypeNameRead/WriteDescription
AjPTextallthysOutputText input stream
void RETURN

From EMBOSS 6.4.0


AjPTextall: Text input

These functions use a text input stream object to read text

Functions:
ajTextallNextParse a text query into format, access, file and entry


Function ajTextallNext

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

Prototype

AjBool ajTextallNext (
      AjPTextall thys,
      AjPText* Ptext
);

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

From EMBOSS 6.4.0


Datatype: none

Input formats internals

Sections:
castCasts


Section: cast

Values for input formats

Functions:
ajTextinformatTermtests whether a text input format term is known
ajTextinformatTesttests whether a named text input format is known


Function ajTextinformatTerm

tests whether a text input format term is known

Prototype

AjBool ajTextinformatTerm (
      const AjPStr term
);

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

From EMBOSS 6.4.0


Function ajTextinformatTest

tests whether a named text input format is known

Prototype

AjBool ajTextinformatTest (
      const AjPStr format
);

TypeNameRead/WriteDescription
const AjPStrformatInputFormat
AjBool RETURNajTrue if format was accepted

From EMBOSS 6.4.0