NCBI C++ ToolKit
asn_connection.h
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef CTOOLS___ASN_CONNECTION__H
2 #define CTOOLS___ASN_CONNECTION__H
3 
4 /* $Id: asn_connection.h 53206 2012-02-29 20:10:03Z lavr $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
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.
16  *
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
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Author: Denis Vakatov, Anton Lavrentiev
30  *
31  * File Description:
32  * Build C Toolkit ASN.1 streams on top of CONN (connection).
33  *
34  */
35 
37 #include <asn.h>
38 
39 
40 /** @addtogroup CToolsASNConn
41  *
42  * @{
43  */
44 
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 
51 typedef enum {
55 
56 
57 typedef enum {
61 
62 
63 /* Build a ASN.1 stream on top of a CONN (connection) handle.
64  * According to arguments, the stream is created for either reading or writing,
65  * and is capable to handle either binary or text ASN.1.
66  * Return ASN.1 stream pointer on success, or 0 on error.
67  * NOTE: Returned stream is valid while the underlying conn exists. After call
68  * to CONN_Close() the stream becomes invalid, and should not be used.
69  * Don't destroy the ASN.1 stream explicitly using AsnIoFree()!
70  */
71 AsnIoPtr CreateAsnConn
72 (CONN conn,
73  EAsnConn_Direction direction,
74  EAsnConn_Format fmt
75  );
76 
77 
78 /* Create a service connection using the service name, type, and connection
79  * parameters (use default connection parameters if 'net_info' is passed NULL).
80  * Create two ASN.1 streams based on the connection: one stream for input, and
81  * another one for output. Return pointers to the streams via the 'input' and
82  * 'output' arguments. No corresponding stream is created if either pointer is
83  * passed NULL.
84  * On success, return the created CONN handle; otherwise, return 0.
85  * NOTE: Both returned ASN.1 streams are valid as long as the connection handle
86  * exists; that is, after the connection handle is passed to CONN_Close()
87  * either pointer becomes invalid, and should not be used.
88  * Don't destroy the ASN.1 streams explicitly using AsnIoFree()!
89  */
91 (const char* service,
92  EAsnConn_Format input_fmt,
93  AsnIoPtr* input,
94  EAsnConn_Format output_fmt,
95  AsnIoPtr* output,
97  const SConnNetInfo* net_info,
98  const SSERVICE_Extra* params
99  );
100 
101 
102 /* Equivalent of CreateAsnConn_ServiceEx with zeroes in last three arguments.
103  */
105 (const char* service,
106  EAsnConn_Format input_fmt,
107  AsnIoPtr* input,
108  EAsnConn_Format output_fmt,
109  AsnIoPtr* output
110  );
111 
112 
113 #ifdef __cplusplus
114 } /* extern "C" */
115 #endif
116 
117 
118 /* @} */
119 
120 
121 #endif /* CTOOLS___ASN_CONNECTION__H */
static CS_CONNECTION * conn
Definition: ct_dynamic.c:25
static SQLCHAR output[256]
Definition: print.c:5
AsnIoPtr CreateAsnConn(CONN conn, EAsnConn_Direction direction, EAsnConn_Format fmt)
EAsnConn_Format
CONN CreateAsnConn_ServiceEx(const char *service, EAsnConn_Format input_fmt, AsnIoPtr *input, EAsnConn_Format output_fmt, AsnIoPtr *output, TSERV_Type type, const SConnNetInfo *net_info, const SSERVICE_Extra *params)
EAsnConn_Direction
CONN CreateAsnConn_Service(const char *service, EAsnConn_Format input_fmt, AsnIoPtr *input, EAsnConn_Format output_fmt, AsnIoPtr *output)
@ eAsnConn_Text
@ eAsnConn_Binary
@ eAsnConn_Input
@ eAsnConn_Output
unsigned int TSERV_Type
Bitwise OR of ESERV_Type[Special].
Definition: ncbi_service.h:94
static int input()
Definition: type.c:6
Modified on Wed Apr 17 13:09:09 2024 by modify_doxy.py rev. 669887