NCBI C Toolkit Cross Reference

C/algo/blast/api/blast_message_api.h


  1 /* $Id: blast_message_api.h,v 1.2 2006/05/24 21:08:17 camacho Exp $
  2 ***************************************************************************
  3 *                                                                         *
  4 *                             COPYRIGHT NOTICE                            *
  5 *                                                                         *
  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.            *
 12 *                                                                         *
 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   *
 20 * use.                                                                    *
 21 *                                                                         *
 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         *
 24 * appreciated.                                                            *
 25 ***************************************************************************
 26 * Author: Tom Madden
 27 *
 28 */
 29 
 30 /** @file blast_message_api.h
 31  * API for C Toolkit BLAST messages
 32  */
 33 
 34 #ifndef _BLAST_MESSAGE_API_H_
 35 #define _BLAST_MESSAGE_API_H_
 36 
 37 #ifdef __cplusplus
 38 extern "C" {
 39 #endif
 40 
 41 #ifndef NCBI_C_TOOLKIT
 42 #define NCBI_C_TOOLKIT
 43 #endif
 44 
 45 #include <ncbierr.h>
 46 #include <objloc.h>
 47 #include <algo/blast/core/blast_message.h>
 48 #include <algo/blast/core/blast_query_info.h>
 49 
 50 /** @addtogroup CToolkitAlgoBlast
 51  *
 52  * @{
 53  */
 54 
 55 /** C Toolkit specific API for messages from BLAST. 
 56 */
 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. */
 63 } SBlastMessage;
 64 
 65 
 66 /** Appends an SBlastMessage to the chain of messages, or creates new one
 67  * if NULL.
 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]
 73  */
 74 void SBlastMessageWrite(SBlastMessage** blast_message, ErrSev sev, const char* message, 
 75    SeqId* seqid, Boolean believe_query);
 76 
 77 /** Frees all memory associated with SBlastMessage*
 78  * @param message object to be freed [in]
 79  * @return NULL
 80  */
 81 SBlastMessage* SBlastMessageFree(SBlastMessage* message);
 82 
 83 
 84 /** Duplicates entire chain of old messages.
 85  * @param old object(s) to be duplicated. [in]
 86  * @return chain of new messages
 87  */
 88 SBlastMessage* SBlastMessageDup(SBlastMessage* old);
 89 
 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.
 97  */
 98 SBlastMessage* Blast_MessageToSBlastMessage(const Blast_Message* old, SeqLoc* query_slp, 
 99      const BlastQueryInfo* query_info, Boolean believe_query);
100 
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. 
105  */
106 ErrSev SBlastMessageErrPost(const SBlastMessage* message);
107 
108 /* @} */
109 
110 #ifdef __cplusplus
111 }
112 #endif
113 
114 #endif  /* !_BLAST_MESSAGE_API_H_ */
115 

source navigation ]   [ diff markup ]   [ identifier search ]   [ freetext search ]   [ file search ]  

This page was automatically generated by the LXR engine.
Visit the LXR main site for more information.