NCBI C++ ToolKit
Classes | Macros | Typedefs | Enumerations | Functions | Variables
blast_message.h File Reference

Structures for BLAST messages. More...

#include <algo/blast/core/ncbi_std.h>
#include <algo/blast/core/blast_export.h>
+ Include dependency graph for blast_message.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Go to the SVN repository for this file.

Classes

struct  SMessageOrigin
 Structure to enclose the origin of an error message or warning. More...
 
struct  Blast_Message
 Structure to hold the a message from the core of the BLAST engine. More...
 

Macros

#define Blast_PerrorWithLocation(msg, error_code, context)   Blast_PerrorEx(msg, error_code, __FILE__, __LINE__, context)
 Convenient define to call the function Blast_PerrorEx. More...
 
#define BLASTERR_MEMORY   50
 System error: out of memory condition. More...
 
#define BLASTERR_INVALIDPARAM   75
 Invalid parameter: possible programmer error or pre-condition not met. More...
 
#define BLASTERR_IDEALSTATPARAMCALC   100
 Could not compute the ideal Karlin-Altschul parameters. More...
 
#define BLASTERR_REDOALIGNMENTCORE_NOTSUPPORTED   101
 Composition based statistics/Smith-Waterman not supported for a program type. More...
 
#define BLASTERR_INVALIDQUERIES   102
 All queries/contexts are determined invalid in the setup code. More...
 
#define BLASTERR_INTERRUPTED   103
 BLAST search was interrupted via a user-provided callback. More...
 
#define BLASTERR_NOVALIDKARLINALTSCHUL   104
 Could not calculate Karlin-Altschul statistics for any context. More...
 
#define BLASTERR_OPTION_PROGRAM_INVALID   201
 The option is not supported with the specified program. More...
 
#define BLASTERR_OPTION_VALUE_INVALID   202
 The value of the option is not supported (e.g., word size too small) More...
 
#define BLASTERR_SUBJECT_LENGTH_INVALID   203
 Subject seqs min avg length error. More...
 
#define BLASTERR_SEQSRC   300
 Blast seqsrc returns BLAST_SEQSRC_ERROR. More...
 

Typedefs

typedef struct SMessageOrigin SMessageOrigin
 Structure to enclose the origin of an error message or warning. More...
 
typedef struct Blast_Message Blast_Message
 Structure to hold the a message from the core of the BLAST engine. More...
 

Enumerations

enum  EBlastSeverity { eBlastSevInfo = 1 , eBlastSevWarning , eBlastSevError , eBlastSevFatal }
 Blast error message severities . More...
 

Functions

Blast_MessageBlast_MessageFree (Blast_Message *blast_msg)
 Deallocates message memory. More...
 
Int2 Blast_MessageWrite (Blast_Message **blast_msg, EBlastSeverity severity, int context, const char *message)
 Writes a message to a structure. More...
 
Int2 Blast_MessagePost (Blast_Message *blast_msg)
 Print a message with ErrPostEx. More...
 
void Blast_Perror (Blast_Message **msg, Int2 error_code, int context)
 Analogous to perror. More...
 
void Blast_PerrorEx (Blast_Message **msg, Int2 error_code, const char *file_name, int lineno, int context)
 Extended version of Blast_Perror which includes parameters for the file name and line number where the error/warning occurred. More...
 

Variables

const int kBlastMessageNoContext
 Declared in blast_message.h as extern const. More...
 
const char * kBlastErrMsg_CantCalculateUngappedKAParams
 

Detailed Description

Structures for BLAST messages.

Definition in file blast_message.h.

Macro Definition Documentation

◆ Blast_PerrorWithLocation

#define Blast_PerrorWithLocation (   msg,
  error_code,
  context 
)    Blast_PerrorEx(msg, error_code, __FILE__, __LINE__, context)

Convenient define to call the function Blast_PerrorEx.

Definition at line 119 of file blast_message.h.

◆ BLASTERR_IDEALSTATPARAMCALC

#define BLASTERR_IDEALSTATPARAMCALC   100

Could not compute the ideal Karlin-Altschul parameters.

Definition at line 149 of file blast_message.h.

◆ BLASTERR_INTERRUPTED

#define BLASTERR_INTERRUPTED   103

BLAST search was interrupted via a user-provided callback.

Definition at line 159 of file blast_message.h.

◆ BLASTERR_INVALIDPARAM

#define BLASTERR_INVALIDPARAM   75

Invalid parameter: possible programmer error or pre-condition not met.

Definition at line 146 of file blast_message.h.

◆ BLASTERR_INVALIDQUERIES

#define BLASTERR_INVALIDQUERIES   102

All queries/contexts are determined invalid in the setup code.

Definition at line 156 of file blast_message.h.

◆ BLASTERR_MEMORY

#define BLASTERR_MEMORY   50

System error: out of memory condition.

Definition at line 143 of file blast_message.h.

◆ BLASTERR_NOVALIDKARLINALTSCHUL

#define BLASTERR_NOVALIDKARLINALTSCHUL   104

Could not calculate Karlin-Altschul statistics for any context.

Definition at line 162 of file blast_message.h.

◆ BLASTERR_OPTION_PROGRAM_INVALID

#define BLASTERR_OPTION_PROGRAM_INVALID   201

The option is not supported with the specified program.

Definition at line 165 of file blast_message.h.

◆ BLASTERR_OPTION_VALUE_INVALID

#define BLASTERR_OPTION_VALUE_INVALID   202

The value of the option is not supported (e.g., word size too small)

Definition at line 168 of file blast_message.h.

◆ BLASTERR_REDOALIGNMENTCORE_NOTSUPPORTED

#define BLASTERR_REDOALIGNMENTCORE_NOTSUPPORTED   101

Composition based statistics/Smith-Waterman not supported for a program type.

Definition at line 153 of file blast_message.h.

◆ BLASTERR_SEQSRC

#define BLASTERR_SEQSRC   300

Blast seqsrc returns BLAST_SEQSRC_ERROR.

Definition at line 174 of file blast_message.h.

◆ BLASTERR_SUBJECT_LENGTH_INVALID

#define BLASTERR_SUBJECT_LENGTH_INVALID   203

Subject seqs min avg length error.

Definition at line 171 of file blast_message.h.

Typedef Documentation

◆ Blast_Message

typedef struct Blast_Message Blast_Message

Structure to hold the a message from the core of the BLAST engine.

◆ SMessageOrigin

Structure to enclose the origin of an error message or warning.

Enumeration Type Documentation

◆ EBlastSeverity

Blast error message severities .

These start with 1 to be consistent with the C toolkit severity numbers.

Enumerator
eBlastSevInfo 
eBlastSevWarning 
eBlastSevError 
eBlastSevFatal 

Definition at line 55 of file blast_message.h.

Function Documentation

◆ Blast_MessageFree()

Blast_Message* Blast_MessageFree ( Blast_Message blast_msg)

◆ Blast_MessagePost()

Int2 Blast_MessagePost ( Blast_Message blast_msg)

Print a message with ErrPostEx.

Parameters
blast_msgmessage to be printed [in]

Definition at line 136 of file blast_message.c.

References Blast_Message::message, and NULL.

◆ Blast_MessageWrite()

Int2 Blast_MessageWrite ( Blast_Message **  blast_msg,
EBlastSeverity  severity,
int  context,
const char *  message 
)

◆ Blast_Perror()

void Blast_Perror ( Blast_Message **  msg,
Int2  error_code,
int  context 
)

Analogous to perror.

Parameters
msgobject to be appended to or created [in|out]
error_codeerror code returned from BLAST function [in]
contextcontext number so that query or frame can be found [in]
Returns
Blast_Message structure containing error description

Definition at line 147 of file blast_message.c.

References Blast_PerrorEx(), and NULL.

◆ Blast_PerrorEx()

void Blast_PerrorEx ( Blast_Message **  msg,
Int2  error_code,
const char *  file_name,
int  lineno,
int  context 
)

Extended version of Blast_Perror which includes parameters for the file name and line number where the error/warning occurred.

This function should be invoked via the Blast_PerrorWithLocation macro.

Parameters
msgobject to be appended to or created [in|out]
error_codeone of the error codes defined below [in]
file_namename of the file where the error ocurred [in]
linenoline number where the error ocurred in the file above [in]
contextcontext number so that query or frame can be found [in]

Definition at line 154 of file blast_message.c.

References ASSERT, Blast_MessageFree(), BLASTERR_IDEALSTATPARAMCALC, BLASTERR_INTERRUPTED, BLASTERR_INVALIDPARAM, BLASTERR_INVALIDQUERIES, BLASTERR_MEMORY, BLASTERR_NOVALIDKARLINALTSCHUL, BLASTERR_REDOALIGNMENTCORE_NOTSUPPORTED, BLASTERR_SEQSRC, BLASTERR_SUBJECT_LENGTH_INVALID, buf, calloc(), Blast_Message::context, eBlastSevError, eBlastSevFatal, eBlastSevInfo, file_name, kBlastErrMsg_CantCalculateUngappedKAParams, lineno, Blast_Message::message, Blast_Message::next, Blast_Message::origin, Blast_Message::severity, SMessageOriginNew(), and strdup.

Referenced by Blast_Perror().

Variable Documentation

◆ kBlastErrMsg_CantCalculateUngappedKAParams

const char* kBlastErrMsg_CantCalculateUngappedKAParams
extern

◆ kBlastMessageNoContext

const int kBlastMessageNoContext
extern
Modified on Fri Jan 05 07:23:52 2024 by modify_doxy.py rev. 669887