source: trunk/src/network/ssl/qsslsocket_openssl_symbols_p.h

Last change on this file was 846, checked in by Dmitry A. Kuminov, 14 years ago

trunk: Merged in qt 4.7.2 sources from branches/vendor/nokia/qt.

File size: 17.5 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** This file is part of the QtNetwork module of the Qt Toolkit.
8**
9** $QT_BEGIN_LICENSE:LGPL$
10** Commercial Usage
11** Licensees holding valid Qt Commercial licenses may use this file in
12** accordance with the Qt Commercial License Agreement provided with the
13** Software or, alternatively, in accordance with the terms contained in
14** a written agreement between you and Nokia.
15**
16** GNU Lesser General Public License Usage
17** Alternatively, this file may be used under the terms of the GNU Lesser
18** General Public License version 2.1 as published by the Free Software
19** Foundation and appearing in the file LICENSE.LGPL included in the
20** packaging of this file. Please review the following information to
21** ensure the GNU Lesser General Public License version 2.1 requirements
22** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
23**
24** In addition, as a special exception, Nokia gives you certain additional
25** rights. These rights are described in the Nokia Qt LGPL Exception
26** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
27**
28** GNU General Public License Usage
29** Alternatively, this file may be used under the terms of the GNU
30** General Public License version 3.0 as published by the Free Software
31** Foundation and appearing in the file LICENSE.GPL included in the
32** packaging of this file. Please review the following information to
33** ensure the GNU General Public License version 3.0 requirements will be
34** met: http://www.gnu.org/copyleft/gpl.html.
35**
36** If you have questions regarding the use of this file, please contact
37** Nokia at [email protected].
38** $QT_END_LICENSE$
39**
40****************************************************************************/
41
42
43#ifndef QSSLSOCKET_OPENSSL_SYMBOLS_P_H
44#define QSSLSOCKET_OPENSSL_SYMBOLS_P_H
45
46//
47// W A R N I N G
48// -------------
49//
50// This file is not part of the Qt API. It exists for the convenience
51// of the QLibrary class. This header file may change from
52// version to version without notice, or even be removed.
53//
54// We mean it.
55//
56
57#include "qsslsocket_openssl_p.h"
58
59QT_BEGIN_NAMESPACE
60
61#define DUMMYARG
62
63#if !defined QT_LINKED_OPENSSL
64// **************** Shared declarations ******************
65// ret func(arg)
66
67# define DEFINEFUNC(ret, func, arg, a, err, funcret) \
68 typedef ret (*_q_PTR_##func)(arg); \
69 static _q_PTR_##func _q_##func = 0; \
70 ret q_##func(arg) { \
71 if (!_q_##func) { \
72 qWarning("QSslSocket: cannot call unresolved function "#func); \
73 err; \
74 } \
75 funcret _q_##func(a); \
76 }
77
78// ret func(arg1, arg2)
79# define DEFINEFUNC2(ret, func, arg1, a, arg2, b, err, funcret) \
80 typedef ret (*_q_PTR_##func)(arg1, arg2); \
81 static _q_PTR_##func _q_##func = 0; \
82 ret q_##func(arg1, arg2) { \
83 if (!_q_##func) { \
84 qWarning("QSslSocket: cannot call unresolved function "#func);\
85 err; \
86 } \
87 funcret _q_##func(a, b); \
88 }
89
90// ret func(arg1, arg2, arg3)
91# define DEFINEFUNC3(ret, func, arg1, a, arg2, b, arg3, c, err, funcret) \
92 typedef ret (*_q_PTR_##func)(arg1, arg2, arg3); \
93 static _q_PTR_##func _q_##func = 0; \
94 ret q_##func(arg1, arg2, arg3) { \
95 if (!_q_##func) { \
96 qWarning("QSslSocket: cannot call unresolved function "#func); \
97 err; \
98 } \
99 funcret _q_##func(a, b, c); \
100 }
101
102// ret func(arg1, arg2, arg3, arg4)
103# define DEFINEFUNC4(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, err, funcret) \
104 typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4); \
105 static _q_PTR_##func _q_##func = 0; \
106 ret q_##func(arg1, arg2, arg3, arg4) { \
107 if (!_q_##func) { \
108 qWarning("QSslSocket: cannot call unresolved function "#func); \
109 err; \
110 } \
111 funcret _q_##func(a, b, c, d); \
112 }
113
114// ret func(arg1, arg2, arg3, arg4, arg5)
115# define DEFINEFUNC5(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, err, funcret) \
116 typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5); \
117 static _q_PTR_##func _q_##func = 0; \
118 ret q_##func(arg1, arg2, arg3, arg4, arg5) { \
119 if (!_q_##func) { \
120 qWarning("QSslSocket: cannot call unresolved function "#func); \
121 err; \
122 } \
123 funcret _q_##func(a, b, c, d, e); \
124 }
125
126// ret func(arg1, arg2, arg3, arg4, arg6)
127# define DEFINEFUNC6(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, arg6, f, err, funcret) \
128 typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6); \
129 static _q_PTR_##func _q_##func = 0; \
130 ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6) { \
131 if (!_q_##func) { \
132 qWarning("QSslSocket: cannot call unresolved function "#func); \
133 err; \
134 } \
135 funcret _q_##func(a, b, c, d, e, f); \
136 }
137
138// ret func(arg1, arg2, arg3, arg4, arg6, arg7)
139# define DEFINEFUNC7(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, arg6, f, arg7, g, err, funcret) \
140 typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6, arg7); \
141 static _q_PTR_##func _q_##func = 0; \
142 ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { \
143 if (!_q_##func) { \
144 qWarning("QSslSocket: cannot call unresolved function "#func); \
145 err; \
146 } \
147 funcret _q_##func(a, b, c, d, e, f, g); \
148 }
149
150// ret func(arg1, arg2, arg3, arg4, arg6, arg7, arg8, arg9)
151# define DEFINEFUNC9(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, arg6, f, arg7, g, arg8, h, arg9, i, err, funcret) \
152 typedef ret (*_q_PTR_##func)(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9); \
153 static _q_PTR_##func _q_##func = 0; \
154 ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { \
155 if (_q_##func) { \
156 qWarning("QSslSocket: cannot call unresolved function "#func); \
157 err; \
158 } \
159 funcret _q_##func(a, b, c, d, e, f, g, h, i); \
160 }
161// **************** Shared declarations ******************
162
163#else // !defined QT_LINKED_OPENSSL
164
165// **************** Static declarations ******************
166
167// ret func(arg)
168# define DEFINEFUNC(ret, func, arg, a, err, funcret) \
169 ret q_##func(arg) { funcret func(a); }
170
171// ret func(arg1, arg2)
172# define DEFINEFUNC2(ret, func, arg1, a, arg2, b, err, funcret) \
173 ret q_##func(arg1, arg2) { funcret func(a, b); }
174
175// ret func(arg1, arg2, arg3)
176# define DEFINEFUNC3(ret, func, arg1, a, arg2, b, arg3, c, err, funcret) \
177 ret q_##func(arg1, arg2, arg3) { funcret func(a, b, c); }
178
179// ret func(arg1, arg2, arg3, arg4)
180# define DEFINEFUNC4(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, err, funcret) \
181 ret q_##func(arg1, arg2, arg3, arg4) { funcret func(a, b, c, d); }
182
183// ret func(arg1, arg2, arg3, arg4, arg5)
184# define DEFINEFUNC5(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, err, funcret) \
185 ret q_##func(arg1, arg2, arg3, arg4, arg5) { funcret func(a, b, c, d, e); }
186
187// ret func(arg1, arg2, arg3, arg4, arg6)
188# define DEFINEFUNC6(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, arg6, f, err, funcret) \
189 ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6) { funcret func(a, b, c, d, e, f); }
190
191// ret func(arg1, arg2, arg3, arg4, arg6, arg7)
192# define DEFINEFUNC7(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, arg6, f, arg7, g, err, funcret) \
193 ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7) { funcret func(a, b, c, d, e, f, g); }
194
195// ret func(arg1, arg2, arg3, arg4, arg6, arg7, arg8, arg9)
196# define DEFINEFUNC9(ret, func, arg1, a, arg2, b, arg3, c, arg4, d, arg5, e, arg6, f, arg7, g, arg8, h, arg9, i, err, funcret) \
197 ret q_##func(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) { funcret func(a, b, c, d, e, f, g, h, i); }
198
199// **************** Static declarations ******************
200
201#endif // !defined QT_LINKED_OPENSSL
202
203bool q_resolveOpenSslSymbols();
204long q_ASN1_INTEGER_get(ASN1_INTEGER *a);
205unsigned char * q_ASN1_STRING_data(ASN1_STRING *a);
206int q_ASN1_STRING_length(ASN1_STRING *a);
207long q_BIO_ctrl(BIO *a, int b, long c, void *d);
208int q_BIO_free(BIO *a);
209BIO *q_BIO_new(BIO_METHOD *a);
210BIO *q_BIO_new_mem_buf(void *a, int b);
211int q_BIO_read(BIO *a, void *b, int c);
212BIO_METHOD *q_BIO_s_mem();
213int q_BIO_write(BIO *a, const void *b, int c);
214int q_BN_num_bits(const BIGNUM *a);
215int q_CRYPTO_num_locks();
216void q_CRYPTO_set_locking_callback(void (*a)(int, int, const char *, int));
217void q_CRYPTO_set_id_callback(unsigned long (*a)());
218void q_CRYPTO_free(void *a);
219void q_DSA_free(DSA *a);
220#if OPENSSL_VERSION_NUMBER >= 0x00908000L
221// 0.9.8 broke SC and BC by changing this function's signature.
222X509 *q_d2i_X509(X509 **a, const unsigned char **b, long c);
223#else
224X509 *q_d2i_X509(X509 **a, unsigned char **b, long c);
225#endif
226char *q_ERR_error_string(unsigned long a, char *b);
227unsigned long q_ERR_get_error();
228const EVP_CIPHER *q_EVP_des_ede3_cbc();
229int q_EVP_PKEY_assign(EVP_PKEY *a, int b, char *c);
230int q_EVP_PKEY_set1_RSA(EVP_PKEY *a, RSA *b);
231int q_EVP_PKEY_set1_DSA(EVP_PKEY *a, DSA *b);
232void q_EVP_PKEY_free(EVP_PKEY *a);
233RSA *q_EVP_PKEY_get1_RSA(EVP_PKEY *a);
234DSA *q_EVP_PKEY_get1_DSA(EVP_PKEY *a);
235int q_EVP_PKEY_type(int a);
236EVP_PKEY *q_EVP_PKEY_new();
237int q_i2d_X509(X509 *a, unsigned char **b);
238const char *q_OBJ_nid2sn(int a);
239int q_OBJ_obj2nid(const ASN1_OBJECT *a);