NCBI C++ ToolKit
Functions | Variables
blast_message.c File Reference

These functions provide access to Blast_Message objects, used by the BLAST code as a wrapper for error and warning messages. More...

#include <algo/blast/core/blast_def.h>
#include <algo/blast/core/blast_message.h>
+ Include dependency graph for blast_message.c:

Go to the source code of this file.

Go to the SVN repository for this file.

Functions

SMessageOriginSMessageOriginNew (const char *filename, unsigned int lineno)
 Allocate a new SMessageOrigin structure. More...
 
SMessageOriginSMessageOriginFree (SMessageOrigin *msgo)
 Deallocate a SMessageOrigin structure. More...
 
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 = -1
 Declared in blast_message.h as extern const. More...
 
const char * kBlastErrMsg_CantCalculateUngappedKAParams
 

Detailed Description

These functions provide access to Blast_Message objects, used by the BLAST code as a wrapper for error and warning messages.

Definition in file blast_message.c.

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(), context, 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, 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().

◆ SMessageOriginFree()

SMessageOrigin* SMessageOriginFree ( SMessageOrigin msgo)

Deallocate a SMessageOrigin structure.

Parameters
msgostructure to deallocate [in]
Returns
NULL

Definition at line 70 of file blast_message.c.

References SMessageOrigin::filename, NULL, and sfree.

Referenced by Blast_MessageFree().

◆ SMessageOriginNew()

SMessageOrigin* SMessageOriginNew ( const char *  filename,
unsigned int  lineno 
)

Allocate a new SMessageOrigin structure.

Parameters
filenamename of the file [in]
linenoline number in the file above [in]
Returns
newly allocated structure or NULL in case of memory allocation failure.

Definition at line 48 of file blast_message.c.

References calloc(), SMessageOrigin::filename, SMessageOrigin::lineno, lineno, NULL, and strdup.

Referenced by Blast_PerrorEx().

Variable Documentation

◆ kBlastErrMsg_CantCalculateUngappedKAParams

const char* kBlastErrMsg_CantCalculateUngappedKAParams
Initial value:
= "Could not calculate ungapped Karlin-Altschul parameters due "
"to an invalid query sequence or its translation. Please verify the "
"query sequence(s) and/or filtering options"

Definition at line 37 of file blast_message.c.

Referenced by Blast_PerrorEx(), Blast_ScoreBlkKbpUngappedCalc(), BlastSetupPreliminarySearchEx(), BOOST_AUTO_TEST_CASE(), and CBlastPrelimSearch::Run().

◆ kBlastMessageNoContext

const int kBlastMessageNoContext = -1
Modified on Sun May 19 04:43:09 2024 by modify_doxy.py rev. 669887