ajquery.c

Datatypes:
AjPQuery Query object
AjPQueryField Query fields
AjPList Query field list
AjPStr Query string


Datatype: AjPQuery

Function is for manipulating query objects

Sections:
Query ConstructorsConstructors
Query DestructorsDestructors
Query CastsCasts
ModifiersModifiers
DebugMiscellaneous
exitMiscellaneous


AjPQuery: Query Constructors

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

Functions:
ajQueryNewCreates a new query object for a specific datatype from the AJDATATYPE enumerated types


Function ajQueryNew

Creates a new query object for a specific datatype from the AJDATATYPE enumerated types

Prototype

AjPQuery ajQueryNew (
      const AjEDataType datatype
);

TypeNameRead/WriteDescription
const AjEDataTypedatatypeInputEnumerated datatype
AjPQuery RETURNNew query object.

From EMBOSS 6.4.0


AjPQuery: Query Destructors

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

Functions:
ajQueryDelDeletes a query object


Function ajQueryDel

Deletes a query object

Prototype

void ajQueryDel (
      AjPQuery* pthis
);

TypeNameRead/WriteDescription
AjPQuery*pthisDeleteAddress of query object
void RETURN

From EMBOSS 6.4.0


AjPQuery: Query Casts

These functions examine the contents of a query object and return some derived information. Some of them provide access to the internal components of a query object. They are provided for programming convenience but should be used with caution.

Functions:
ajQueryGetDatatypeReturns the query datatype from a query
ajQueryGetFormatReturns the format name from a query
ajQueryGetIdReturns the ID query string from a query
ajQueryGetQueryReturns a report of the query string from a query
ajQueryGetallFieldsReturns the standard sequence query string from a query


Function ajQueryGetDatatype

Returns the query datatype from a query

Prototype

const char* ajQueryGetDatatype (
      const AjPQuery query
);

TypeNameRead/WriteDescription
const AjPQueryqueryInputQuery
const char* RETURNStandard name for query datatype

From EMBOSS 6.4.0


Function ajQueryGetFormat

Returns the format name from a query

Prototype

const AjPStr ajQueryGetFormat (
      const AjPQuery query
);

TypeNameRead/WriteDescription
const AjPQueryqueryInputQuery
const AjPStr RETURNFormat name

From EMBOSS 6.4.0


Function ajQueryGetId

Returns the ID query string from a query

Prototype

const AjPStr ajQueryGetId (
      const AjPQuery query
);

TypeNameRead/WriteDescription
const AjPQueryqueryInputQuery
const AjPStr RETURNWildcard ID query string

From EMBOSS 6.4.0


Function ajQueryGetQuery

Returns a report of the query string from a query

Prototype

AjBool ajQueryGetQuery (
      const AjPQuery query,
      AjPStr* Pdest
);

TypeNameRead/WriteDescription
const AjPQueryqueryInputQuery
AjPStr*PdestOutputQuery string
AjBool RETURNTrue on success

From EMBOSS 6.4.0


Function ajQueryGetallFields

Returns the standard sequence query string from a query

Prototype

const AjPList ajQueryGetallFields (
      const AjPQuery query
);

TypeNameRead/WriteDescription
const AjPQueryqueryInputQuery
const AjPList RETURNList of field objects

From EMBOSS 6.4.0


Function ajQueryIsSet

Tests whether any element of a query has been set.

Prototype

AjBool ajQueryIsSet (
      const AjPQuery thys
);

TypeNameRead/WriteDescription
const AjPQuerythysInputQuery object.
AjBool RETURNajTrue if query should be made. ajFalse if the query includes all entries.

From EMBOSS 6.4.0


Function ajQueryKnownFieldC

Checks whether a query field is defined for a database as a "fields:" string in the database definition.

Prototype

AjBool ajQueryKnownFieldC (
      const AjPQuery thys,
      const char* fieldtxt
);

TypeNameRead/WriteDescription
const AjPQuerythysInputQuery object
const char*fieldtxtInputfield name
AjBool RETURNajTrue if the field is defined

From EMBOSS 6.4.0


Function ajQueryKnownFieldS

Checks whether a query field is defined for a database as a "fields:" string in the database definition.

Prototype

AjBool ajQueryKnownFieldS (
      const AjPQuery thys,
      const AjPStr field
);

TypeNameRead/WriteDescription
const AjPQuerythysInputQuery object
const AjPStrfieldInputfield name
AjBool RETURNajTrue if the field is defined

From EMBOSS 6.4.0


AjPQuery: Modifiers

Modify values in a query object

Functions:
ajQueryAddFieldAndCAdds a query with an 'AND' operator
ajQueryAddFieldAndSAdds a query with an 'AND' operator
ajQueryAddFieldElseCAdds a query with an 'ELSE' operator
ajQueryAddFieldElseSAdds a query with an 'ELSE' operator
ajQueryAddFieldEorCAdds a query with an 'EOR' operator
ajQueryAddFieldEorSAdds a query with an 'EOR' operator
ajQueryAddFieldNotCAdds a query with a 'NOT' operator
ajQueryAddFieldNotSAdds a query with a 'NOT' operator
ajQueryAddFieldOrCAdds a query with an 'OR' operator
ajQueryAddFieldOrSAdds a query with an 'OR' operator
ajQueryClearResets a query object to a clean state for reuse. Keep the begin, end and reverse values.
ajQuerySetWildTests whether a query includes wild cards in any element, or can return more than one entry (keyword and some other search terms will find multiple entries)
ajQueryStarclearClears elements of a query object if they are simply "*" because this is equivalent to a null string.


Function ajQueryAddFieldAndC

Adds a query with an 'AND' operator

Prototype

AjBool ajQueryAddFieldAndC (
      AjPQuery thys,
      const char* fieldtxt,
      const char* wildquerytxt
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const char*fieldtxtInputfield name
const char*wildquerytxtInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldAndS

Adds a query with an 'AND' operator

Prototype

AjBool ajQueryAddFieldAndS (
      AjPQuery thys,
      const AjPStr field,
      const AjPStr wildquery
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const AjPStrfieldInputfield name
const AjPStrwildqueryInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldElseC

Adds a query with an 'ELSE' operator

Prototype

AjBool ajQueryAddFieldElseC (
      AjPQuery thys,
      const char* fieldtxt,
      const char* wildquerytxt
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const char*fieldtxtInputfield name
const char*wildquerytxtInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldElseS

Adds a query with an 'ELSE' operator

Prototype

AjBool ajQueryAddFieldElseS (
      AjPQuery thys,
      const AjPStr field,
      const AjPStr wildquery
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const AjPStrfieldInputfield name
const AjPStrwildqueryInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldEorC

Adds a query with an 'EOR' operator

Prototype

AjBool ajQueryAddFieldEorC (
      AjPQuery thys,
      const char* fieldtxt,
      const char* wildquerytxt
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const char*fieldtxtInputfield name
const char*wildquerytxtInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldEorS

Adds a query with an 'EOR' operator

Prototype

AjBool ajQueryAddFieldEorS (
      AjPQuery thys,
      const AjPStr field,
      const AjPStr wildquery
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const AjPStrfieldInputfield name
const AjPStrwildqueryInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldNotC

Adds a query with a 'NOT' operator

Prototype

AjBool ajQueryAddFieldNotC (
      AjPQuery thys,
      const char* fieldtxt,
      const char* wildquerytxt
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const char*fieldtxtInputfield name
const char*wildquerytxtInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldNotS

Adds a query with a 'NOT' operator

Prototype

AjBool ajQueryAddFieldNotS (
      AjPQuery thys,
      const AjPStr field,
      const AjPStr wildquery
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const AjPStrfieldInputfield name
const AjPStrwildqueryInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldOrC

Adds a query with an 'OR' operator

Prototype

AjBool ajQueryAddFieldOrC (
      AjPQuery thys,
      const char* fieldtxt,
      const char* wildquerytxt
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const char*fieldtxtInputfield name
const char*wildquerytxtInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryAddFieldOrS

Adds a query with an 'OR' operator

Prototype

AjBool ajQueryAddFieldOrS (
      AjPQuery thys,
      const AjPStr field,
      const AjPStr wildquery
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object
const AjPStrfieldInputfield name
const AjPStrwildqueryInputwildcard query string
AjBool RETURNajTrue on success

From EMBOSS 6.4.0


Function ajQueryClear

Resets a query object to a clean state for reuse. Keep the begin, end and reverse values.

Prototype

void ajQueryClear (
      AjPQuery thys
);

TypeNameRead/WriteDescription
AjPQuerythysModifyquery object
void RETURN

From EMBOSS 6.4.0


Function ajQuerySetWild

Tests whether a query includes wild cards in any element, or can return more than one entry (keyword and some other search terms will find multiple entries)

Prototype

AjBool ajQuerySetWild (
      AjPQuery thys
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object.
AjBool RETURNajTrue if query had wild cards.

From EMBOSS 6.4.0


Function ajQueryStarclear

Clears elements of a query object if they are simply "*" because this is equivalent to a null string.

Prototype

void ajQueryStarclear (
      AjPQuery thys
);

TypeNameRead/WriteDescription
AjPQuerythysModifyQuery object.
void RETURN

From EMBOSS 6.4.0


AjPQuery: Debug

Reports sequence contents for debugging purposes

Functions:
ajQueryTraceDebug calls to trace the data in a query object.


Function ajQueryTrace

Debug calls to trace the data in a query object.

Prototype

void ajQueryTrace (
      const AjPQuery thys
);

TypeNameRead/WriteDescription
const AjPQuerythysInputquery object.
void RETURN

From EMBOSS 6.4.0


AjPQuery: exit

Functions called on exit from the program by ajExit to do any necessary cleanup and to report internal statistics to the debug file

Functions:
ajQueryExitCleans up query processing internal memory


Function ajQueryExit

Cleans up query processing internal memory

Prototype

void ajQueryExit (
      void
);

TypeNameRead/WriteDescription
void RETURN

From EMBOSS 6.4.0


Datatype: AjPQueryField

Query field processing

Sections:
constructorsConstructors
Query Field DestructorsDestructors


AjPQueryField: constructors

Constructors

Functions:
ajQueryfieldNewCConstructor for a query field
ajQueryfieldNewSConstructor for a query field


Function ajQueryfieldNewC

Constructor for a query field

Prototype

AjPQueryField ajQueryfieldNewC (
      const char* fieldtxt,
      const char* wildtxt,
      AjEQryLink oper
);

TypeNameRead/WriteDescription
const char*fieldtxtInputField name
const char*wildtxtInputWildcard query string
AjEQryLinkoperInputOperator
AjPQueryField RETURNQuery field

From EMBOSS 6.4.0


Function ajQueryfieldNewS

Constructor for a query field

Prototype

AjPQueryField ajQueryfieldNewS (
      const AjPStr field,
      const AjPStr wild,
      AjEQryLink oper
);

TypeNameRead/WriteDescription
const AjPStrfieldInputField name
const AjPStrwildInputWildcard query string
AjEQryLinkoperInputOperator
AjPQueryField RETURNQuery field

From EMBOSS 6.4.0


AjPQueryField: Query Field Destructors

Destruction destroys all internal data structures and frees the memory allocated for the query field object.

Functions:
ajQueryfieldDelDestructor for a query field


Function ajQueryfieldDel

Destructor for a query field

Prototype

void ajQueryfieldDel (
      AjPQueryField* Pthis
);

TypeNameRead/WriteDescription
AjPQueryField*PthisDeleteQuery field object to be deleted
void RETURN

From EMBOSS 6.4.0


Datatype: AjPList

Query fields lists are handled internally. Only static functions should appear here

Sections:
DebugMiscellaneous


AjPList: Debug

Reports sequence contents for debugging purposes

Functions:
ajQuerylistTraceTraces the nodes in a query list


Function ajQuerylistTrace

Traces the nodes in a query list

Prototype

void ajQuerylistTrace (
      const AjPList list
);

TypeNameRead/WriteDescription
const AjPListlistInputThe query list
void RETURN

From EMBOSS 6.4.0


Datatype: AjPStr

Function is for manipulating query strings

Sections:
Query string parsingModifiers


AjPStr: Query string parsing

Parses a query string and removes the processed string trokens

Functions:
ajQuerystrParseFormatParses a query (USA, UFO or general query).
ajQuerystrParseListfileParses a query (USA, UFO or general query).
ajQuerystrParseRangeParses a query (USA, UFO or general query).
ajQuerystrParseReadParses a query (USA, UFO or general query).


Function ajQuerystrParseFormat

Parses a query (USA, UFO or general query).

Prototype

const AjPStr ajQuerystrParseFormat (
      AjPStr* Pqry,
      AjPTextin textin,
      AjBool function findformat
);

TypeNameRead/WriteDescription
AjPStr*PqryModifyQuery string
AjPTextintextinModifyText input object
AjBool functionfindformatFunctionFunction to validate format name
const AjPStr RETURNFormat name if found

From EMBOSS 6.4.0


Function ajQuerystrParseListfile

Parses a query (USA, UFO or general query).

Prototype

AjBool ajQuerystrParseListfile (
      AjPStr* Pqry
);

TypeNameRead/WriteDescription
AjPStr*PqryModifyQuery string
AjBool RETURNTrue if found

From EMBOSS 6.4.0


Function ajQuerystrParseRange

Parses a query (USA, UFO or general query).

Prototype

AjBool ajQuerystrParseRange (
      AjPStr* Pqry,
      ajint* Pbegin,
      ajint* Pend,
      AjBool* Prev
);

TypeNameRead/WriteDescription
AjPStr*PqryModifyQuery string
ajint*PbeginModifyBegin position
ajint*PendModifyEnd position
AjBool*PrevModifyReverse orientation
AjBool RETURNTrue if range was found.

From EMBOSS 6.4.0


Function ajQuerystrParseRead

Parses a query (USA, UFO or general query).

Prototype

AjBool ajQuerystrParseRead (
      AjPStr* Pqry,
      AjPTextin textin,
      AjBool function findformat,
      AjBool* Pnontext
);

TypeNameRead/WriteDescription
AjPStr*PqryModifyQuery string
AjPTextintextinModifyText input structure.
AjBool functionfindformatFunctionFunction to validate format name
AjBool*PnontextOutputTrue if access is a non-text method
AjBool RETURNajTrue on success.

From EMBOSS 6.4.0