NCBI C Toolkit Cross Reference

C/biostruc/PubStructAsn.h


  1 /*   $Id: PubStructAsn.h,v 6.7 2001/05/25 01:42:10 kimelman Exp $
  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  * Author:  Michael Kimelman
 27  *
 28  * File Description: PubStruct DB Asn (down)loader.
 29  * All functions can wotk with SQL server directly. Path of them, marked
 30  * 'production' can work throuth OpenServer. - only retrieval stuff
 31  *                   
 32  * Modifications:  
 33  * --------------------------------------------------------------------------
 34  * $Log: PubStructAsn.h,v $
 35  * Revision 6.7  2001/05/25 01:42:10  kimelman
 36  * mmdb2livemmdb
 37  *
 38  * Revision 6.6  1999/08/02 19:50:51  kimelman
 39  * keep connection alive foor mmdbsrv & vastsrv sessions
 40  *
 41  * Revision 6.5  1999/05/11 23:37:15  kimelman
 42  * throw away 'extern info' -- it's mmdbsrv specifics
 43  *
 44  * Revision 6.4  1998/05/14 16:11:14  kimelman
 45  * Compression stuff added in debug mode.
 46  * few bugs fixed, related to OpenServer/SQL Server switching
 47  *
 48  * Revision 6.3  1998/05/08 03:03:44  kimelman
 49  * Open Server fix
 50  *
 51  * Revision 6.2  1998/04/15 14:53:56  kimelman
 52  * 1. Make retrieval unifirm from open server and sql server.
 53  * 2. mmdbsrv retrival performance tuning:
 54  *      - size of read-in buffers
 55  *      - direct pdb2mmdb DB lookup instead of full loading pdb to mmdb translataion
 56  *        table
 57  * 3. cleaning mmdblocl.* and make.mmdbsrv in order to remove obsolete code
 58  *
 59  * Revision 6.1  1998/04/03 20:25:17  kimelman
 60  * PubStruct access code added to mmdbsrv
 61  *
 62  *
 63  * ==========================================================================
 64  */
 65 
 66 #ifndef __PUBSTRUCTASN_H__ 
 67 #define __PUBSTRUCTASN_H__
 68 
 69 #include <ncbi.h>
 70 #include <asn.h>
 71 
 72 typedef struct pubstruct_t *ps_handle_t ;
 73 
 74 NLM_EXTERN ps_handle_t PubStruct_connect   (char *server);
 75 NLM_EXTERN void        PubStruct_disconnect(ps_handle_t handle);
 76 
 77 /**
 78  * PubStruct_lookup transforms mmdb and state into accession number (return value)
 79  * the meaning of state is as follows.
 80  * state = 0 : Production data
 81  * state = 1 : data for entrez indexing. After indexing it becomes 0
 82  * state > 1 : intermediate stages of asn assembling. "up to user"
 83  * state < 0 : prohibited value.
 84  *
 85  */
 86 NLM_EXTERN Int4     LIBCALL PubStruct_lookup(char       *server,Int4 mmdb,int state);
 87 NLM_EXTERN Int4     LIBCALL PubStruct_lookup1(ps_handle_t server,Int4 mmdb,int state);
 88 
 89 /** (production)
 90  * PubStruct_pdb2mmdb makes a lookup from pdb to current mmdb
 91  */
 92 
 93 NLM_EXTERN Int4     LIBCALL PubStruct_pdb2mmdb(char *server,CharPtr pcPdb);
 94 NLM_EXTERN Int4     LIBCALL PubStruct_pdb2mmdb1(ps_handle_t server,CharPtr pcPdb);
 95 NLM_EXTERN Boolean  LIBCALL PubStruct_mmdb2livemmdb(ps_handle_t server,Int4 ommdb,Int4Ptr newmmdbid,Int4Ptr live,CharPtr pdb);
 96 
 97 /**
 98  * PubStruct_newasn opens AsnIo stream to created new entry in the database. When
 99  * this stream is closed, database table's fields will be populated by data,
100  * extracted from written asn. state is the only data - which is absent in asn.
101  * (beside DB accession )
102  * accp argument is optional - side effect return of new accession number
103  */
104 NLM_EXTERN AsnIoPtr LIBCALL PubStruct_newasn     (char *server,int state,
105                                                   Int4 *accp);
106 
107 /**
108  * PubStruct_readasn opens AsnIo stream for reading asn found by accession number
109  */
110 NLM_EXTERN AsnIoPtr LIBCALL PubStruct_readasn    (char       *server,Int4 acc);
111 NLM_EXTERN AsnIoPtr LIBCALL PubStruct_readasn1   (ps_handle_t server,Int4 acc);
112 
113 /** (production)
114  * PubStruct_viewasn opens AsnIo stream for reading indexed structure found by mmdbID
115  * 
116  */
117 NLM_EXTERN AsnIoPtr LIBCALL PubStruct_viewasn    (char       *server,Int4 mmdbID);
118 NLM_EXTERN AsnIoPtr LIBCALL PubStruct_viewasn1   (ps_handle_t server,Int4 mmdbID);
119 
120 /**
121  * PubStruct_updateasn opens AsnIo stream for updating existing asn. asn identified
122  * by accession number. after updating the 'state' of the data become 'newstate'. 
123  */
124 NLM_EXTERN AsnIoPtr LIBCALL PubStruct_updateasn  (char *server,Int4 acc,
125                                                   int newstate);
126 
127 /** (production)
128  * PubStruct_closeasn closes AsnIO stream, which was open by some of functions
129  * above and does some "termination procedure" which determined by thw function,
130  * which opens connection.
131  */
132 NLM_EXTERN int      LIBCALL PubStruct_closeasn   (AsnIoPtr aip,int commit);
133 
134 /**
135  * PubStruct_closeasn suppress given asn. 
136  */
137 NLM_EXTERN int      LIBCALL PubStruct_removeasn  (char *server,Int4 acc);
138 
139 /**
140  * File reading wrappers. ( a bit optimized )
141  *
142  * PubStruct_load read given asn from file stream and put it in database
143  * (using ..._newasn) returns accession number if everything ok. or 0 in
144  * case of fail
145  */
146 
147 int PubStruct_load(FILE *infile, int state_out, char *server);
148 
149 /**
150  * PubStruct_download read given asn from DB and dump it to file stream
151  */
152 int PubStruct_download(char *server, Int4 acc, Int4 mmdb, FILE *outfile);
153 
154 #endif
155 

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.