155714Skris/* crypto/err/err.h */
255714Skris/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
355714Skris * All rights reserved.
455714Skris *
555714Skris * This package is an SSL implementation written
655714Skris * by Eric Young (eay@cryptsoft.com).
755714Skris * The implementation was written so as to conform with Netscapes SSL.
8296341Sdelphij *
955714Skris * This library is free for commercial and non-commercial use as long as
1055714Skris * the following conditions are aheared to.  The following conditions
1155714Skris * apply to all code found in this distribution, be it the RC4, RSA,
1255714Skris * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
1355714Skris * included with this distribution is covered by the same copyright terms
1455714Skris * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15296341Sdelphij *
1655714Skris * Copyright remains Eric Young's, and as such any Copyright notices in
1755714Skris * the code are not to be removed.
1855714Skris * If this package is used in a product, Eric Young should be given attribution
1955714Skris * as the author of the parts of the library used.
2055714Skris * This can be in the form of a textual message at program startup or
2155714Skris * in documentation (online or textual) provided with the package.
22296341Sdelphij *
2355714Skris * Redistribution and use in source and binary forms, with or without
2455714Skris * modification, are permitted provided that the following conditions
2555714Skris * are met:
2655714Skris * 1. Redistributions of source code must retain the copyright
2755714Skris *    notice, this list of conditions and the following disclaimer.
2855714Skris * 2. Redistributions in binary form must reproduce the above copyright
2955714Skris *    notice, this list of conditions and the following disclaimer in the
3055714Skris *    documentation and/or other materials provided with the distribution.
3155714Skris * 3. All advertising materials mentioning features or use of this software
3255714Skris *    must display the following acknowledgement:
3355714Skris *    "This product includes cryptographic software written by
3455714Skris *     Eric Young (eay@cryptsoft.com)"
3555714Skris *    The word 'cryptographic' can be left out if the rouines from the library
3655714Skris *    being used are not cryptographic related :-).
37296341Sdelphij * 4. If you include any Windows specific code (or a derivative thereof) from
3855714Skris *    the apps directory (application code) you must include an acknowledgement:
3955714Skris *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40296341Sdelphij *
4155714Skris * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
4255714Skris * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
4355714Skris * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
4455714Skris * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
4555714Skris * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
4655714Skris * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
4755714Skris * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
4855714Skris * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
4955714Skris * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
5055714Skris * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
5155714Skris * SUCH DAMAGE.
52296341Sdelphij *
5355714Skris * The licence and distribution terms for any publically available version or
5455714Skris * derivative of this code cannot be changed.  i.e. this code cannot simply be
5555714Skris * copied and put under another distribution licence
5655714Skris * [including the GNU Public Licence.]
5755714Skris */
58238405Sjkim/* ====================================================================
59238405Sjkim * Copyright (c) 1998-2006 The OpenSSL Project.  All rights reserved.
60238405Sjkim *
61238405Sjkim * Redistribution and use in source and binary forms, with or without
62238405Sjkim * modification, are permitted provided that the following conditions
63238405Sjkim * are met:
64238405Sjkim *
65238405Sjkim * 1. Redistributions of source code must retain the above copyright
66296341Sdelphij *    notice, this list of conditions and the following disclaimer.
67238405Sjkim *
68238405Sjkim * 2. Redistributions in binary form must reproduce the above copyright
69238405Sjkim *    notice, this list of conditions and the following disclaimer in
70238405Sjkim *    the documentation and/or other materials provided with the
71238405Sjkim *    distribution.
72238405Sjkim *
73238405Sjkim * 3. All advertising materials mentioning features or use of this
74238405Sjkim *    software must display the following acknowledgment:
75238405Sjkim *    "This product includes software developed by the OpenSSL Project
76238405Sjkim *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77238405Sjkim *
78238405Sjkim * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79238405Sjkim *    endorse or promote products derived from this software without
80238405Sjkim *    prior written permission. For written permission, please contact
81238405Sjkim *    openssl-core@openssl.org.
82238405Sjkim *
83238405Sjkim * 5. Products derived from this software may not be called "OpenSSL"
84238405Sjkim *    nor may "OpenSSL" appear in their names without prior written
85238405Sjkim *    permission of the OpenSSL Project.
86238405Sjkim *
87238405Sjkim * 6. Redistributions of any form whatsoever must retain the following
88238405Sjkim *    acknowledgment:
89238405Sjkim *    "This product includes software developed by the OpenSSL Project
90238405Sjkim *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91238405Sjkim *
92238405Sjkim * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93238405Sjkim * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94238405Sjkim * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95238405Sjkim * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
96238405Sjkim * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97238405Sjkim * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98238405Sjkim * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99238405Sjkim * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100238405Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101238405Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102238405Sjkim * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103238405Sjkim * OF THE POSSIBILITY OF SUCH DAMAGE.
104238405Sjkim * ====================================================================
105238405Sjkim *
106238405Sjkim * This product includes cryptographic software written by Eric Young
107238405Sjkim * (eay@cryptsoft.com).  This product includes software written by Tim
108238405Sjkim * Hudson (tjh@cryptsoft.com).
109238405Sjkim *
110238405Sjkim */
11155714Skris
11255714Skris#ifndef HEADER_ERR_H
113296341Sdelphij# define HEADER_ERR_H
11455714Skris
115296341Sdelphij# include <openssl/e_os2.h>
116160814Ssimon
117296341Sdelphij# ifndef OPENSSL_NO_FP_API
118296341Sdelphij#  include <stdio.h>
119296341Sdelphij#  include <stdlib.h>
120296341Sdelphij# endif
12168651Skris
122296341Sdelphij# include <openssl/ossl_typ.h>
123296341Sdelphij# ifndef OPENSSL_NO_BIO
124296341Sdelphij#  include <openssl/bio.h>
125296341Sdelphij# endif
126296341Sdelphij# ifndef OPENSSL_NO_LHASH
127296341Sdelphij#  include <openssl/lhash.h>
128296341Sdelphij# endif
12968651Skris
130296341Sdelphij#ifdef  __cplusplus
13155714Skrisextern "C" {
13255714Skris#endif
13355714Skris
134296341Sdelphij# ifndef OPENSSL_NO_ERR
135296341Sdelphij#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,d,e)
136296341Sdelphij# else
137296341Sdelphij#  define ERR_PUT_error(a,b,c,d,e)        ERR_put_error(a,b,c,NULL,0)
138296341Sdelphij# endif
13955714Skris
140296341Sdelphij# include <errno.h>
14155714Skris
142296341Sdelphij# define ERR_TXT_MALLOCED        0x01
143296341Sdelphij# define ERR_TXT_STRING          0x02
14455714Skris
145296341Sdelphij# define ERR_FLAG_MARK           0x01
146160814Ssimon
147296341Sdelphij# define ERR_NUM_ERRORS  16
148296341Sdelphijtypedef struct err_state_st {
149296341Sdelphij    CRYPTO_THREADID tid;
150296341Sdelphij    int err_flags[ERR_NUM_ERRORS];
151296341Sdelphij    unsigned long err_buffer[ERR_NUM_ERRORS];
152296341Sdelphij    char *err_data[ERR_NUM_ERRORS];
153296341Sdelphij    int err_data_flags[ERR_NUM_ERRORS];
154296341Sdelphij    const char *err_file[ERR_NUM_ERRORS];
155296341Sdelphij    int err_line[ERR_NUM_ERRORS];
156296341Sdelphij    int top, bottom;
157296341Sdelphij} ERR_STATE;
15855714Skris
15955714Skris/* library */
160296341Sdelphij# define ERR_LIB_NONE            1
161296341Sdelphij# define ERR_LIB_SYS             2
162296341Sdelphij# define ERR_LIB_BN              3
163296341Sdelphij# define ERR_LIB_RSA             4
164296341Sdelphij# define ERR_LIB_DH              5
165296341Sdelphij# define ERR_LIB_EVP             6
166296341Sdelphij# define ERR_LIB_BUF             7
167296341Sdelphij# define ERR_LIB_OBJ             8
168296341Sdelphij# define ERR_LIB_PEM             9
169296341Sdelphij# define ERR_LIB_DSA             10
170296341Sdelphij# define ERR_LIB_X509            11
171109998Smarkm/* #define ERR_LIB_METH         12 */
172296341Sdelphij# define ERR_LIB_ASN1            13
173296341Sdelphij# define ERR_LIB_CONF            14
174296341Sdelphij# define ERR_LIB_CRYPTO          15
175296341Sdelphij# define ERR_LIB_EC              16
176296341Sdelphij# define ERR_LIB_SSL             20
177109998Smarkm/* #define ERR_LIB_SSL23        21 */
178109998Smarkm/* #define ERR_LIB_SSL2         22 */
179109998Smarkm/* #define ERR_LIB_SSL3         23 */
180109998Smarkm/* #define ERR_LIB_RSAREF       30 */
181109998Smarkm/* #define ERR_LIB_PROXY        31 */
182296341Sdelphij# define ERR_LIB_BIO             32
183296341Sdelphij# define ERR_LIB_PKCS7           33
184296341Sdelphij# define ERR_LIB_X509V3          34
185296341Sdelphij# define ERR_LIB_PKCS12          35
186296341Sdelphij# define ERR_LIB_RAND            36
187296341Sdelphij# define ERR_LIB_DSO             37
188296341Sdelphij# define ERR_LIB_ENGINE          38
189296341Sdelphij# define ERR_LIB_OCSP            39
190296341Sdelphij# define ERR_LIB_UI              40
191296341Sdelphij# define ERR_LIB_COMP            41
192296341Sdelphij# define ERR_LIB_ECDSA           42
193296341Sdelphij# define ERR_LIB_ECDH            43
194296341Sdelphij# define ERR_LIB_STORE           44
195296341Sdelphij# define ERR_LIB_FIPS            45
196296341Sdelphij# define ERR_LIB_CMS             46
197296341Sdelphij# define ERR_LIB_TS              47
198296341Sdelphij# define ERR_LIB_HMAC            48
199296341Sdelphij# define ERR_LIB_JPAKE           49
20055714Skris
201296341Sdelphij# define ERR_LIB_USER            128
20255714Skris
203296341Sdelphij# define SYSerr(f,r)  ERR_PUT_error(ERR_LIB_SYS,(f),(r),__FILE__,__LINE__)
204296341Sdelphij# define BNerr(f,r)   ERR_PUT_error(ERR_LIB_BN,(f),(r),__FILE__,__LINE__)
205296341Sdelphij# define RSAerr(f,r)  ERR_PUT_error(ERR_LIB_RSA,(f),(r),__FILE__,__LINE__)
206296341Sdelphij# define DHerr(f,r)   ERR_PUT_error(ERR_LIB_DH,(f),(r),__FILE__,__LINE__)
207296341Sdelphij# define EVPerr(f,r)  ERR_PUT_error(ERR_LIB_EVP,(f),(r),__FILE__,__LINE__)
208296341Sdelphij# define BUFerr(f,r)  ERR_PUT_error(ERR_LIB_BUF,(f),(r),__FILE__,__LINE__)
209296341Sdelphij# define OBJerr(f,r)  ERR_PUT_error(ERR_LIB_OBJ,(f),(r),__FILE__,__LINE__)
210296341Sdelphij# define PEMerr(f,r)  ERR_PUT_error(ERR_LIB_PEM,(f),(r),__FILE__,__LINE__)
211296341Sdelphij# define DSAerr(f,r)  ERR_PUT_error(ERR_LIB_DSA,(f),(r),__FILE__,__LINE__)
212296341Sdelphij# define X509err(f,r) ERR_PUT_error(ERR_LIB_X509,(f),(r),__FILE__,__LINE__)
213296341Sdelphij# define ASN1err(f,r) ERR_PUT_error(ERR_LIB_ASN1,(f),(r),__FILE__,__LINE__)
214296341Sdelphij# define CONFerr(f,r) ERR_PUT_error(ERR_LIB_CONF,(f),(r),__FILE__,__LINE__)
215296341Sdelphij# define CRYPTOerr(f,r) ERR_PUT_error(ERR_LIB_CRYPTO,(f),(r),__FILE__,__LINE__)
216296341Sdelphij# define ECerr(f,r)   ERR_PUT_error(ERR_LIB_EC,(f),(r),__FILE__,__LINE__)
217296341Sdelphij# define SSLerr(f,r)  ERR_PUT_error(ERR_LIB_SSL,(f),(r),__FILE__,__LINE__)
218296341Sdelphij# define BIOerr(f,r)  ERR_PUT_error(ERR_LIB_BIO,(f),(r),__FILE__,__LINE__)
219296341Sdelphij# define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),__FILE__,__LINE__)
220296341Sdelphij# define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),__FILE__,__LINE__)
221296341Sdelphij# define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),__FILE__,__LINE__)
222296341Sdelphij# define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),__FILE__,__LINE__)
223296341Sdelphij# define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),__FILE__,__LINE__)
224296341Sdelphij# define ENGINEerr(f,r) ERR_PUT_error(ERR_LIB_ENGINE,(f),(r),__FILE__,__LINE__)
225296341Sdelphij# define OCSPerr(f,r) ERR_PUT_error(ERR_LIB_OCSP,(f),(r),__FILE__,__LINE__)
226296341Sdelphij# define UIerr(f,r) ERR_PUT_error(ERR_LIB_UI,(f),(r),__FILE__,__LINE__)
227296341Sdelphij# define COMPerr(f,r) ERR_PUT_error(ERR_LIB_COMP,(f),(r),__FILE__,__LINE__)
228296341Sdelphij# define ECDSAerr(f,r)  ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
229296341Sdelphij# define ECDHerr(f,r)  ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)
230296341Sdelphij# define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
231296341Sdelphij# define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
232296341Sdelphij# define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
233296341Sdelphij# define TSerr(f,r) ERR_PUT_error(ERR_LIB_TS,(f),(r),__FILE__,__LINE__)
234296341Sdelphij# define HMACerr(f,r) ERR_PUT_error(ERR_LIB_HMAC,(f),(r),__FILE__,__LINE__)
235296341Sdelphij# define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
23655714Skris
237296341Sdelphij/*
238296341Sdelphij * Borland C seems too stupid to be able to shift and do longs in the
239296341Sdelphij * pre-processor :-(
240296341Sdelphij */
241296341Sdelphij# define ERR_PACK(l,f,r)         (((((unsigned long)l)&0xffL)*0x1000000)| \
242296341Sdelphij                                ((((unsigned long)f)&0xfffL)*0x1000)| \
243296341Sdelphij                                ((((unsigned long)r)&0xfffL)))
244296341Sdelphij# define ERR_GET_LIB(l)          (int)((((unsigned long)l)>>24L)&0xffL)
245296341Sdelphij# define ERR_GET_FUNC(l)         (int)((((unsigned long)l)>>12L)&0xfffL)
246296341Sdelphij# define ERR_GET_REASON(l)       (int)((l)&0xfffL)
247296341Sdelphij# define ERR_FATAL_ERROR(l)      (int)((l)&ERR_R_FATAL)
24855714Skris
24959191Skris/* OS functions */
250296341Sdelphij# define SYS_F_FOPEN             1
251296341Sdelphij# define SYS_F_CONNECT           2
252296341Sdelphij# define SYS_F_GETSERVBYNAME     3
253296341Sdelphij# define SYS_F_SOCKET            4
254296341Sdelphij# define SYS_F_IOCTLSOCKET       5
255296341Sdelphij# define SYS_F_BIND              6
256296341Sdelphij# define SYS_F_LISTEN            7
257296341Sdelphij# define SYS_F_ACCEPT            8
258296341Sdelphij# define SYS_F_WSASTARTUP        9/* Winsock stuff */
259296341Sdelphij# define SYS_F_OPENDIR           10
260296341Sdelphij# define SYS_F_FREAD             11
26155714Skris
26255714Skris/* reasons */
263296341Sdelphij# define ERR_R_SYS_LIB   ERR_LIB_SYS/* 2 */
264296341Sdelphij# define ERR_R_BN_LIB    ERR_LIB_BN/* 3 */
265296341Sdelphij# define ERR_R_RSA_LIB   ERR_LIB_RSA/* 4 */
266296341Sdelphij# define ERR_R_DH_LIB    ERR_LIB_DH/* 5 */
267296341Sdelphij# define ERR_R_EVP_LIB   ERR_LIB_EVP/* 6 */
268296341Sdelphij# define ERR_R_BUF_LIB   ERR_LIB_BUF/* 7 */
269296341Sdelphij# define ERR_R_OBJ_LIB   ERR_LIB_OBJ/* 8 */
270296341Sdelphij# define ERR_R_PEM_LIB   ERR_LIB_PEM/* 9 */
271296341Sdelphij# define ERR_R_DSA_LIB   ERR_LIB_DSA/* 10 */
272296341Sdelphij# define ERR_R_X509_LIB  ERR_LIB_X509/* 11 */
273296341Sdelphij# define ERR_R_ASN1_LIB  ERR_LIB_ASN1/* 13 */
274296341Sdelphij# define ERR_R_CONF_LIB  ERR_LIB_CONF/* 14 */
275296341Sdelphij# define ERR_R_CRYPTO_LIB ERR_LIB_CRYPTO/* 15 */
276296341Sdelphij# define ERR_R_EC_LIB    ERR_LIB_EC/* 16 */
277296341Sdelphij# define ERR_R_SSL_LIB   ERR_LIB_SSL/* 20 */
278296341Sdelphij# define ERR_R_BIO_LIB   ERR_LIB_BIO/* 32 */
279296341Sdelphij# define ERR_R_PKCS7_LIB ERR_LIB_PKCS7/* 33 */
280296341Sdelphij# define ERR_R_X509V3_LIB ERR_LIB_X509V3/* 34 */
281296341Sdelphij# define ERR_R_PKCS12_LIB ERR_LIB_PKCS12/* 35 */
282296341Sdelphij# define ERR_R_RAND_LIB  ERR_LIB_RAND/* 36 */
283296341Sdelphij# define ERR_R_DSO_LIB   ERR_LIB_DSO/* 37 */
284296341Sdelphij# define ERR_R_ENGINE_LIB ERR_LIB_ENGINE/* 38 */
285296341Sdelphij# define ERR_R_OCSP_LIB  ERR_LIB_OCSP/* 39 */
286296341Sdelphij# define ERR_R_UI_LIB    ERR_LIB_UI/* 40 */
287296341Sdelphij# define ERR_R_COMP_LIB  ERR_LIB_COMP/* 41 */
288296341Sdelphij# define ERR_R_ECDSA_LIB ERR_LIB_ECDSA/* 42 */
289296341Sdelphij# define ERR_R_ECDH_LIB  ERR_LIB_ECDH/* 43 */
290296341Sdelphij# define ERR_R_STORE_LIB ERR_LIB_STORE/* 44 */
291296341Sdelphij# define ERR_R_TS_LIB    ERR_LIB_TS/* 45 */
29255714Skris
293296341Sdelphij# define ERR_R_NESTED_ASN1_ERROR                 58
294296341Sdelphij# define ERR_R_BAD_ASN1_OBJECT_HEADER            59
295296341Sdelphij# define ERR_R_BAD_GET_ASN1_OBJECT_CALL          60
296296341Sdelphij# define ERR_R_EXPECTING_AN_ASN1_SEQUENCE        61
297296341Sdelphij# define ERR_R_ASN1_LENGTH_MISMATCH              62
298296341Sdelphij# define ERR_R_MISSING_ASN1_EOS                  63
299109998Smarkm
30055714Skris/* fatal error */
301296341Sdelphij# define ERR_R_FATAL                             64
302296341Sdelphij# define ERR_R_MALLOC_FAILURE                    (1|ERR_R_FATAL)
303296341Sdelphij# define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED       (2|ERR_R_FATAL)
304296341Sdelphij# define ERR_R_PASSED_NULL_PARAMETER             (3|ERR_R_FATAL)
305296341Sdelphij# define ERR_R_INTERNAL_ERROR                    (4|ERR_R_FATAL)
306296341Sdelphij# define ERR_R_DISABLED                          (5|ERR_R_FATAL)
30755714Skris
308296341Sdelphij/*
309296341Sdelphij * 99 is the maximum possible ERR_R_... code, higher values are reserved for
310296341Sdelphij * the individual libraries
311296341Sdelphij */
312109998Smarkm
313296341Sdelphijtypedef struct ERR_string_data_st {
314296341Sdelphij    unsigned long error;
315296341Sdelphij    const char *string;
316296341Sdelphij} ERR_STRING_DATA;
317109998Smarkm
318296341Sdelphijvoid ERR_put_error(int lib, int func, int reason, const char *file, int line);
319296341Sdelphijvoid ERR_set_error_data(char *data, int flags);
32055714Skris
321109998Smarkmunsigned long ERR_get_error(void);
322296341Sdelphijunsigned long ERR_get_error_line(const char **file, int *line);
323296341Sdelphijunsigned long ERR_get_error_line_data(const char **file, int *line,
324296341Sdelphij                                      const char **data, int *flags);
325109998Smarkmunsigned long ERR_peek_error(void);
326296341Sdelphijunsigned long ERR_peek_error_line(const char **file, int *line);
327296341Sdelphijunsigned long ERR_peek_error_line_data(const char **file, int *line,
328296341Sdelphij                                       const char **data, int *flags);
329109998Smarkmunsigned long ERR_peek_last_error(void);
330296341Sdelphijunsigned long ERR_peek_last_error_line(const char **file, int *line);
331296341Sdelphijunsigned long ERR_peek_last_error_line_data(const char **file, int *line,
332296341Sdelphij                                            const char **data, int *flags);
333296341Sdelphijvoid ERR_clear_error(void);
334296341Sdelphijchar *ERR_error_string(unsigned long e, char *buf);
33568651Skrisvoid ERR_error_string_n(unsigned long e, char *buf, size_t len);
33655714Skrisconst char *ERR_lib_error_string(unsigned long e);
33755714Skrisconst char *ERR_func_error_string(unsigned long e);
33855714Skrisconst char *ERR_reason_error_string(unsigned long e);
339296341Sdelphijvoid ERR_print_errors_cb(int (*cb) (const char *str, size_t len, void *u),
340296341Sdelphij                         void *u);
341296341Sdelphij# ifndef OPENSSL_NO_FP_API
34255714Skrisvoid ERR_print_errors_fp(FILE *fp);
343296341Sdelphij# endif
344296341Sdelphij# ifndef OPENSSL_NO_BIO
34555714Skrisvoid ERR_print_errors(BIO *bp);
346296341Sdelphij# endif
34755714Skrisvoid ERR_add_error_data(int num, ...);
348238405Sjkimvoid ERR_add_error_vdata(int num, va_list args);
349296341Sdelphijvoid ERR_load_strings(int lib, ERR_STRING_DATA str[]);
350296341Sdelphijvoid ERR_unload_strings(int lib, ERR_STRING_DATA str[]);
35159191Skrisvoid ERR_load_ERR_strings(void);
35259191Skrisvoid ERR_load_crypto_strings(void);
35359191Skrisvoid ERR_free_strings(void);
35455714Skris
355238405Sjkimvoid ERR_remove_thread_state(const CRYPTO_THREADID *tid);
356296341Sdelphij# ifndef OPENSSL_NO_DEPRECATED
35755714Skrisvoid ERR_remove_state(unsigned long pid); /* if zero we look it up */
358296341Sdelphij# endif
35955714SkrisERR_STATE *ERR_get_state(void);
36055714Skris
361296341Sdelphij# ifndef OPENSSL_NO_LHASH
362238405SjkimLHASH_OF(ERR_STRING_DATA) *ERR_get_string_table(void);
363238405SjkimLHASH_OF(ERR_STATE) *ERR_get_err_state_table(void);
364238405Sjkimvoid ERR_release_err_state_table(LHASH_OF(ERR_STATE) **hash);
365296341Sdelphij# endif
36655714Skris
36768651Skrisint ERR_get_next_error_library(void);
36855714Skris
369160814Ssimonint ERR_set_mark(void);
370160814Ssimonint ERR_pop_to_mark(void);
371160814Ssimon
372160814Ssimon/* Already defined in ossl_typ.h */
373160814Ssimon/* typedef struct st_ERR_FNS ERR_FNS; */
374296341Sdelphij/*
375296341Sdelphij * An application can use this function and provide the return value to
376296341Sdelphij * loaded modules that should use the application's ERR state/functionality
377296341Sdelphij */
378109998Smarkmconst ERR_FNS *ERR_get_implementation(void);
379296341Sdelphij/*
380296341Sdelphij * A loaded module should call this function prior to any ERR operations
381296341Sdelphij * using the application's "ERR_FNS".
382296341Sdelphij */
383109998Smarkmint ERR_set_implementation(const ERR_FNS *fns);
384109998Smarkm
385296341Sdelphij#ifdef  __cplusplus
38655714Skris}
38755714Skris#endif
38855714Skris
38955714Skris#endif
390