1 /* objpub.h 2 * =========================================================================== 3 * 4 * PUBLIC DOMAIN NOTICE 5 * National Center for Biotechnology Information 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 have not placed any restriction on its use or reproduction. 13 * 14 * Although all reasonable efforts have been taken to ensure the accuracy 15 * and reliability of the software and data, the NLM and the U.S. 16 * Government do not and cannot warrant the performance or results that 17 * may be obtained by using this software or data. The NLM and the U.S. 18 * Government disclaim all warranties, express or implied, including 19 * warranties of performance, merchantability or fitness for any particular 20 * purpose. 21 * 22 * Please cite the author in any work or product based on this material. 23 * 24 * =========================================================================== 25 * 26 * File Name: objpub.h 27 * 28 * Author: James Ostell 29 * 30 * Version Creation Date: 4/1/91 31 * 32 * $Revision: 6.0 $ 33 * 34 * File Description: Object manager interface for module NCBI-Pub 35 * 36 * Modifications: 37 * -------------------------------------------------------------------------- 38 * Date Name Description of modification 39 * ------- ---------- ----------------------------------------------------- 40 * 41 * 42 * $Log: objpub.h,v $ 43 * Revision 6.0 1997/08/25 18:50:30 madden 44 * Revision changed to 6.0 45 * 46 * Revision 4.3 1997/06/19 18:41:48 vakatov 47 * [WIN32,MSVC++] Adopted for the "NCBIOBJ.LIB" DLL'ization 48 * 49 * Revision 4.2 1996/03/29 21:09:59 ostell 50 * added support for PubMedId 51 * 52 * Revision 4.1 1995/08/30 18:33:53 ostell 53 * added PubLabelUnique function 54 * 55 * Revision 4.0 1995/07/26 13:48:06 ostell 56 * force revision to 4.0 57 * 58 * Revision 3.3 1995/05/15 21:22:00 ostell 59 * added Log line 60 * 61 * 62 * 63 * ========================================================================== 64 */ 65 66 #ifndef _NCBI_Pub_ 67 #define _NCBI_Pub_ 68 69 #ifndef _ASNTOOL_ 70 #include <asn.h> 71 #endif 72 #ifndef _NCBI_Biblio_ 73 #include <objbibli.h> 74 #endif 75 #ifndef _NCBI_Medline_ 76 #include <objmedli.h> 77 #endif 78 79 #undef NLM_EXTERN 80 #ifdef NLM_IMPORT 81 #define NLM_EXTERN NLM_IMPORT 82 #else 83 #define NLM_EXTERN extern 84 #endif 85 86 #ifdef __cplusplus 87 extern "C" { 88 #endif 89 90 /***************************************************************************** 91 * 92 * loader 93 * 94 *****************************************************************************/ 95 NLM_EXTERN Boolean LIBCALL PubAsnLoad PROTO((void)); 96 97 /***************************************************************************** 98 * 99 * internal structures for NCBI-Pub objects 100 * 101 *****************************************************************************/ 102 103 /***************************************************************************** 104 * 105 * Pub is a choice using an ValNode, most types in data.ptrvalue 106 * choice: 107 * 0 = not set 108 1 = gen Cit-gen , -- general or generic unparsed 109 2 = sub Cit-sub , -- submission 110 3 = medline Medline-entry , 111 4 = muid INTEGER , -- medline uid (stored in data.intvalue) 112 5 = article Cit-art , 113 6 = journal Cit-jour , 114 7 = book Cit-book , 115 8 = proc Cit-proc , -- proceedings of a meeting 116 9 = patent Cit-pat , 117 10 = pat-id Id-pat , -- identify a patent 118 11 = man Cit-let -- manuscript or letter 119 12 = equiv Pub-equiv -- set of equivalent citation forms for 1 pub 120 13 = pmid INTEGER -- PubMedId 121 * 122 *****************************************************************************/ 123 NLM_EXTERN Boolean LIBCALL PubAsnWrite PROTO((ValNodePtr anp, AsnIoPtr aip, AsnTypePtr atp)); 124 NLM_EXTERN ValNodePtr LIBCALL PubAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp)); 125 NLM_EXTERN ValNodePtr LIBCALL PubFree PROTO((ValNodePtr anp)); 126 NLM_EXTERN Int2 LIBCALL PubLabel PROTO((ValNodePtr pub, CharPtr buf, Int2 buflen, Uint1 content)); 127 128 /***************************************************************************** 129 * 130 * PubLabelUnique(pubptr, buf, buflen, content, unique) 131 * makes a short label for any Pub in buf, up to buflen size 132 * content follows objmgr OM_LABEL_ 133 * if (unique is TRUE, appends a string based on title words to make 134 * unique key base on ANSI std Z39.56-1991 135 * 136 *****************************************************************************/ 137 NLM_EXTERN Int2 LIBCALL PubLabelUnique PROTO((ValNodePtr pub, CharPtr buf, Int2 buflen, Uint1 content, Boolean unique)); 138 139 #define PUB_Gen 1 140 #define PUB_Sub 2 141 #define PUB_Medline 3 142 #define PUB_Muid 4 143 #define PUB_Article 5 144 #define PUB_Journal 6 145 #define PUB_Book 7 146 #define PUB_Proc 8 147 #define PUB_Patent 9 148 #define PUB_Pat_id 10 149 #define PUB_Man 11 150 #define PUB_Equiv 12 151 #define PUB_PMid 13 152 153 /**** 154 * Pub and PubEquiv Matching functions (same citation, not same form) 155 * PubMatch() returns 156 * 0 = point to same citation 157 * 1,-1 = same pub type, but different 158 * 2,-2 = different put types, don't match 159 * PubEquivMatch() returns 160 * 0 = point to same citation 161 * 1,-1 = point to different citations 162 *****/ 163 NLM_EXTERN Int2 LIBCALL PubMatch PROTO((ValNodePtr a, ValNodePtr b)); 164 NLM_EXTERN Int2 LIBCALL PubEquivMatch PROTO((ValNodePtr a, ValNodePtr b)); 165 166 /***************************************************************************** 167 * 168 * PubSet is a choice using an ValNode, PubSet->data.ptrvalue is chain of 169 * Pubs (ValNodes) holding data for set for all types. 170 * PubSet->choice: 171 * 0 = not set 172 1 = pub Pub -- set of real Pubs 173 -- the rest are implemented as Pubs anyway 174 3 = medline Medline-entry , 175 5 = article Cit-art , 176 6 = journal Cit-jour , 177 7 = book Cit-book , 178 8 = proc Cit-proc , -- proceedings of a meeting 179 9 = patent Cit-pat , 180 * 181 *****************************************************************************/ 182 NLM_EXTERN Boolean LIBCALL PubSetAsnWrite PROTO((ValNodePtr anp, AsnIoPtr aip, AsnTypePtr atp)); 183 NLM_EXTERN ValNodePtr LIBCALL PubSetAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp)); 184 NLM_EXTERN ValNodePtr LIBCALL PubSetFree PROTO((ValNodePtr anp)); 185 NLM_EXTERN Int2 LIBCALL PubSetLabel PROTO((ValNodePtr pubset, CharPtr buffer, Int2 buflen, Uint1 content)); 186 187 /***************************************************************************** 188 * 189 * PubEquiv is just a chain of Pubs (ValNodes) 190 * 191 *****************************************************************************/ 192 NLM_EXTERN Boolean LIBCALL PubEquivAsnWrite PROTO((ValNodePtr anp, AsnIoPtr aip, AsnTypePtr atp)); 193 NLM_EXTERN ValNodePtr LIBCALL PubEquivAsnRead PROTO((AsnIoPtr aip, AsnTypePtr atp)); 194 NLM_EXTERN ValNodePtr LIBCALL PubEquivFree PROTO((ValNodePtr anp)); 195 196 #ifdef __cplusplus 197 } 198 #endif 199 200 #undef NLM_EXTERN 201 #ifdef NLM_EXPORT 202 #define NLM_EXTERN NLM_EXPORT 203 #else 204 #define NLM_EXTERN 205 #endif 206 207 #endif 208