1
#ifndef NCBI_ASN_CONNECTION__H
2
#define NCBI_ASN_CONNECTION__H
4
/* $Id: asn_connection.h,v 1.4 2001/12/02 21:17:28 lavr Exp $
5
* ===========================================================================
8
* National Center for Biotechnology Information
10
* This software/database is a "United States Government Work" under the
11
* terms of the United States Copyright Act. It was written as part of
12
* the author's official duties as a United States Government employee and
13
* thus cannot be copyrighted. This software/database is freely available
14
* to the public for use. The National Library of Medicine and the U.S.
15
* Government have not placed any restriction on its use or reproduction.
17
* Although all reasonable efforts have been taken to ensure the accuracy
18
* and reliability of the software and data, the NLM and the U.S.
19
* Government do not and cannot warrant the performance or results that
20
* may be obtained by using this software or data. The NLM and the U.S.
21
* Government disclaim all warranties, express or implied, including
22
* warranties of performance, merchantability or fitness for any particular
25
* Please cite the author in any work or product based on this material.
27
* ===========================================================================
29
* Author: Denis Vakatov, Anton Lavrentiev
32
* Build C Toolkit ANS streams on top of CONN (connection).
34
* --------------------------------------------------------------------------
35
* $Log: asn_connection.h,v $
36
* Revision 1.4 2001/12/02 21:17:28 lavr
39
* Revision 1.3 2001/09/24 20:32:34 lavr
40
* +SSERVICE_Extra* parameter in CreateAsnConn_ServiceEx()
42
* Revision 1.2 2001/06/28 23:01:53 vakatov
43
* Typo fixed (self-#include)
45
* Revision 1.1 2001/06/28 21:59:24 lavr
48
* ==========================================================================
51
#include <connect/ncbi_connection.h>
72
/* Build ASN stream on top of CONN (connection) handle.
73
* According to arguments, the stream is created
74
* either for reading or writing, and is capable to handle
75
* either binary or text ASN.
76
* Return ASN stream pointer on success, or 0 on error.
77
* NOTE: Returned stream is valid while the underlying conn exists. After call
78
* to CONN_Close() the stream becomes invalid, and should not be used.
80
AsnIoPtr CreateAsnConn
82
EAsnConn_Direction direction,
87
/* Create service connection using provided service name,
88
* type and connection parameters, info (use default connection
89
* parameters if info is passed NULL).
90
* Create two ASN streams based on the connection -- one stream is for
91
* input and one is for output. Return pointers to the streams
92
* via 'input' and 'output' arguments.
93
* No corresponding stream is created if pointer is passed NULL.
94
* On success, return created CONN handle; otherwise, return 0.
95
* NOTE: Returned ASN stream pointers are valid as long as connection
96
* handle exists, that is after the connection handle is passed to
97
* CONN_Close(), both pointers become invalid, and should not be used.
99
CONN CreateAsnConn_ServiceEx
100
(const char* service,
101
EAsnConn_Format input_fmt,
103
EAsnConn_Format output_fmt,
106
const SConnNetInfo* net_info,
107
const SSERVICE_Extra* params
111
/* Equivalent of CreateAsnConn_ServiceEx with zeroes in last three arguments.
113
CONN CreateAsnConn_Service
114
(const char* service,
115
EAsnConn_Format input_fmt,
117
EAsnConn_Format output_fmt,
126
#endif /* NCBI_ASN_CONNECTION__H */