1 /* ffprint.h 2 * =========================================================================== 3 * 4 * PUBLIC DOMAIN NOTICE 5 * National Center for Biotechnology Information (NCBI) 6 * 7 * This software/database is a "United States Government Work" under the 8 * terms of the United States Copyright Act. It was written as part of 9 * the author's official duties as a United States Government employee and 10 * thus cannot be copyrighted. This software/database is freely available 11 * to the public for use. The National Library of Medicine and the U.S. 12 * Government do not place any restriction on its use or reproduction. 13 * We would, however, appreciate having the NCBI and the author cited in 14 * any work or product based on this material 15 * 16 * Although all reasonable efforts have been taken to ensure the accuracy 17 * and reliability of the software and data, the NLM and the U.S. 18 * Government do not and cannot warrant the performance or results that 19 * may be obtained by using this software or data. The NLM and the U.S. 20 * Government disclaim all warranties, express or implied, including 21 * warranties of performance, merchantability or fitness for any particular 22 * purpose. 23 * 24 * =========================================================================== 25 * 26 * File Name: ffprint.h 27 * 28 * Author: Karl Sirotkin, Tom Madden, Tatiana Tatusov 29 * 30 * Version Creation Date: 7/15/95 31 * 32 * $Revision: 6.14 $ 33 * 34 * File Description: 35 * 36 * Modifications: 37 * -------------------------------------------------------------------------- 38 * Date Name Description of modification 39 * ------- ---------- ----------------------------------------------------- 40 * 41 * 42 * ========================================================================== 43 */ 44 45 #ifndef _FFPRINT_ 46 #define _FFPRINT_ 47 48 #include <asn2ffg.h> 49 50 /*--------------the structure for the buffered printing-----*/ 51 52 #define LINKS 20 53 54 #define LOCUS_line 1 55 #define DEF_line 2 56 #define ACC_line 3 57 #define NID_line 4 58 #define KW_line 5 59 #define SOURCE_line 6 60 #define BASECOUNT_line 7 61 #define ORIGIN_line 8 62 #define SEQ_line 9 63 64 typedef void (*HeadTailProc) PROTO((Pointer, FILE*)); 65 66 typedef struct buffstruct { 67 68 /* The next eight variables are used by the "printing" utilities of asn2ff6.c 69 (StartPrint, AddChar, CheckBufferState, NewContLine) to perform the "buffered" 70 printing */ 71 CharPtr buffer; /* buffer to hold line */ 72 Int2 init_indent; /*indentation of the first line, set by StartPrint */ 73 Int2 cont_indent; /*indentation of continuation lines */ 74 Int2 line_max; /* maximum allowable length of line, set in StartPrint*/ 75 CharPtr line_prefix; /* prefix, such as "ID" on EMBL id lines */ 76 Char newline; /* newline character */ 77 FILE *fp; /* file to print to. */ 78 ByteStorePtr byte_sp; /* Used to save paragraph (i.e., several lines) 79 until printing. */ 80 CharPtr line_return; 81 /* next three variables are used for HTML URLs */ 82 Int4 PNTR pos_links; 83 CharPtr PNTR links; 84 Int2 n_links; 85 Int2 buf_n_links; 86 } BuffStruct, PNTR BuffStructPtr; 87 88 89 #undef NLM_EXTERN 90 #ifdef NLM_IMPORT 91 #define NLM_EXTERN NLM_IMPORT 92 #else 93 #define NLM_EXTERN extern 94 #endif 95 96 #ifdef __cplusplus 97 extern "C" { 98 #endif 99 100 NLM_EXTERN void LIBCALL asn2ff_set_output PROTO((FILE *fp, CharPtr line_return)); 101 NLM_EXTERN CharPtr LIBCALL ff_MergeString PROTO((void)); 102 NLM_EXTERN CharPtr LIBCALL FFPrint PROTO((FFPrintArrayPtr pap, Int4 index, Int4 pap_size)); 103 NLM_EXTERN void LIBCALL FFBSPrint PROTO((FFPrintArrayPtr pap, Int4 index, Int4 pap_size)); 104 NLM_EXTERN void LIBCALL ff_print_string PROTO((FILE *fp, CharPtr string, CharPtr line_return)); 105 NLM_EXTERN CharPtr LIBCALL ff_print_string_mem PROTO((CharPtr string)); 106 NLM_EXTERN Int2 LIBCALL ff_StartPrint PROTO((Int2 init_indent, Int2 cont_indent, Int2 line_max, CharPtr line_prefix)); 107 NLM_EXTERN void LIBCALL ff_AddString PROTO((CharPtr string)); 108 NLM_EXTERN void LIBCALL ff_AddInteger PROTO((CharPtr fmt, long integer)); 109 NLM_EXTERN void LIBCALL AddLink PROTO((CharPtr str)); 110 NLM_EXTERN void LIBCALL AddLinkLater PROTO((CharPtr str, Int2 prevlen)); 111 NLM_EXTERN void LIBCALL ff_AddChar PROTO((Char character)); 112 NLM_EXTERN void LIBCALL PrintXX PROTO((void)); 113 NLM_EXTERN void LIBCALL ff_AddStringWithTildes PROTO ((CharPtr string)); 114 NLM_EXTERN void LIBCALL ChangeStringWithTildes PROTO ((CharPtr string)); 115 NLM_EXTERN CharPtr LIBCALL CheckBufferState PROTO((Int2Ptr increment_string, Char next_char)); 116 NLM_EXTERN Int2 LIBCALL NewContLine PROTO((void)); 117 NLM_EXTERN Int2 LIBCALL TabToColumn PROTO((Int2 column)); 118 NLM_EXTERN void LIBCALL ff_EndPrint PROTO((void)); 119 NLM_EXTERN void LIBCALL FlushBuffer PROTO((void)); 120 NLM_EXTERN CharPtr LIBCALL CheckEndPunctuation PROTO((CharPtr string, Char end)); 121 NLM_EXTERN CharPtr PrintDate PROTO((NCBI_DatePtr date)); 122 NLM_EXTERN void LIBCALL BuffFree PROTO((void)); 123 NLM_EXTERN void LIBCALL init_buff PROTO((void)); 124 NLM_EXTERN void LIBCALL init_buff_ex PROTO((Int2 init_size)); 125 NLM_EXTERN void LIBCALL free_buff PROTO((void)); 126 NLM_EXTERN void LIBCALL init_www PROTO((void)); 127 NLM_EXTERN void LIBCALL fini_www PROTO((void)); 128 NLM_EXTERN void LIBCALL head_tail_ff PROTO((Pointer mydata, HeadTailProc headfun, HeadTailProc tailfun)); 129 NLM_EXTERN void LIBCALL head_www PROTO((FILE *fp, SeqEntryPtr sep)); 130 NLM_EXTERN void LIBCALL tail_www PROTO((FILE *fp)); 131 NLM_EXTERN Boolean LIBCALL get_www PROTO((void)); 132 NLM_EXTERN Boolean LIBCALL www_muid PROTO((Int4 muid)); 133 NLM_EXTERN Boolean LIBCALL www_gcode PROTO((CharPtr gcode)); 134 NLM_EXTERN Boolean LIBCALL www_source PROTO((CharPtr orgname, OrgRefPtr orp)); 135 NLM_EXTERN Boolean LIBCALL www_organism PROTO((CharPtr orgname, Int4 id)); 136 NLM_EXTERN Boolean LIBCALL www_taxid PROTO((CharPtr orgname, Int4 id)); 137 NLM_EXTERN Boolean LIBCALL www_extra_acc PROTO((CharPtr acc, Boolean ncbi)); 138 NLM_EXTERN Boolean LIBCALL www_note_gi PROTO((CharPtr str)); 139 NLM_EXTERN Boolean LIBCALL www_db_xref PROTO((CharPtr str)); 140 NLM_EXTERN Boolean LIBCALL www_protein_id PROTO((CharPtr str)); 141 NLM_EXTERN Boolean LIBCALL www_map PROTO((CharPtr str)); 142 NLM_EXTERN Boolean LIBCALL www_genpept_gi PROTO((CharPtr str)); 143 NLM_EXTERN Boolean LIBCALL www_dbsource PROTO((CharPtr str, Boolean first, Uint1 choice)); 144 NLM_EXTERN Boolean LIBCALL www_xref PROTO((CharPtr str, Uint1 link)); 145 NLM_EXTERN Boolean LIBCALL www_xref_button PROTO((FILE *fp, CharPtr str, Uint1 link, Uint1 db)); 146 NLM_EXTERN CharPtr LIBCALL ReportPrint PROTO((FFPrintArrayPtr pap, Int4 index, Int4 pap_size)); 147 NLM_EXTERN Boolean LIBCALL PrintSPBlock PROTO((Asn2ffJobPtr ajp, GBEntryPtr gbp)); 148 NLM_EXTERN Boolean LIBCALL ff_PrintLine PROTO((Asn2ffJobPtr ajp, GBEntryPtr gbp, Int2 type)); 149 NLM_EXTERN CharPtr LIBCALL www_featloc PROTO((CharPtr loc)); 150 NLM_EXTERN void LIBCALL GetHelpMsg PROTO((SeqEntryPtr sep)); 151 NLM_EXTERN void LIBCALL www_PrintComment PROTO((CharPtr string, Boolean identifier, Uint1 format)); 152 NLM_EXTERN Boolean LIBCALL www_featkey PROTO((CharPtr key, BIG_ID gi, Int2 entityID, Uint4 itemID)); 153 NLM_EXTERN void LIBCALL www_accession PROTO((CharPtr string)); 154 NLM_EXTERN void LIBCALL ff_RecalculateLinks(Int4 indent); 155 156 #ifdef __cplusplus 157 } 158 #endif 159 160 #undef NLM_EXTERN 161 #ifdef NLM_EXPORT 162 #define NLM_EXTERN NLM_EXPORT 163 #else 164 #define NLM_EXTERN 165 #endif 166 167 #endif /* _FFPRINT_ */ 168