1
/* $Id: blast_message_api.h,v 1.1 2006/04/26 12:44:09 madden Exp $
2
***************************************************************************
6
* This software/database is categorized as "United States Government *
7
* Work" under the terms of the United States Copyright Act. It was *
8
* produced as part of the author's official duties as a Government *
9
* employee and thus can not be copyrighted. This software/database is *
10
* freely available to the public for use without a copyright notice. *
11
* Restrictions can not be placed on its present or future use. *
13
* Although all reasonable efforts have been taken to ensure the accuracy *
14
* and reliability of the software and data, the National Library of *
15
* Medicine (NLM) and the U.S. Government do not and can not warrant the *
16
* performance or results that may be obtained by using this software, *
17
* data, or derivative works thereof. The NLM and the U.S. Government *
18
* disclaim any and all warranties, expressed or implied, as to the *
19
* performance, merchantability or fitness for any particular purpose or *
22
* In any work or product derived from this material, proper attribution *
23
* of the author(s) as the source of the software or data would be *
25
***************************************************************************
30
/** @file blast_messge_api.h
31
* API for C Toolkit BLAST messages
34
#ifndef _BLAST_MESSAGE_API_H_
35
#define _BLAST_MESSAGE_API_H_
41
#ifndef NCBI_C_TOOLKIT
42
#define NCBI_C_TOOLKIT
47
#include <algo/blast/core/blast_message.h>
48
#include <algo/blast/core/blast_query_info.h>
50
/** @addtogroup CToolkitAlgoBlast
55
/** C Toolkit specific API for messages from BLAST.
57
typedef struct SBlastMessage {
58
struct SBlastMessage *next; /**< next message. */
59
ErrSev sev; /**< one of SEV_NONE=0, SEV_INFO, SEV_WARNING, SEV_ERROR, SEV_REJECT, SEV_FATAL, SEV_MAX */
60
char* message; /**< error string. Should be set, but may be NULL if unknown error */
61
SeqId* query_id; /**< used to label query that produced above message, may be NULL. */
62
Boolean believe_query; /**< specifies whether Query ID was parsed. */
66
/** Appends an SBlastMessage to the chain of messages, or creates new one
68
* @param blast_message linked list to be appended to. [in|out]
69
* @param sev severity level [in]
70
* @param message text to be printed for user. [in]
71
* @param seqid describes the query having problem, may be NULL if message applies to setup [in]
72
* @param believe_query whether Query ID was parsed [in]
74
void SBlastMessageWrite(SBlastMessage** blast_message, ErrSev sev, const char* message,
75
SeqId* seqid, Boolean believe_query);
77
/** Frees all memory associated with SBlastMessage*
78
* @param message object to be freed [in]
81
SBlastMessage* SBlastMessageFree(SBlastMessage* message);
84
/** Duplicates entire chain of old messages.
85
* @param old object(s) to be duplicated. [in]
86
* @return chain of new messages
88
SBlastMessage* SBlastMessageDup(SBlastMessage* old);
90
/** Copies messages on (the internal) Blast_Message format
91
* to (C API) SBlastMessage format.
92
* @param old object in Blast_Message format to be copied.
93
* @param query_slp pointers to queries [in]
94
* @param query_info maps context to query number [in]
95
* @param believe_query whether Query ID was parsed [in]
96
* @return object in SBlastMessage format.
98
SBlastMessage* Blast_MessageToSBlastMessage(const Blast_Message* old, SeqLoc* query_slp,
99
const BlastQueryInfo* query_info, Boolean believe_query);
101
/** Posts message using ErrPostEx after prefixing message identifying query.
102
* Returns the highest ErrSev status found.
103
* @param message Object to be ErrPostEx'd.
104
* @return highest severity encountered.
106
ErrSev SBlastMessageErrPost(const SBlastMessage* message);
114
#endif /* !_BLAST_MESSAGE_API_H_ */