summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/err/err.h
diff options
context:
space:
mode:
authorbeck <>1999-09-29 04:37:45 +0000
committerbeck <>1999-09-29 04:37:45 +0000
commitde8f24ea083384bb66b32ec105dc4743c5663cdf (patch)
tree1412176ae62a3cab2cf2b0b92150fcbceaac6092 /src/lib/libcrypto/err/err.h
parentcb929d29896bcb87c2a97417fbd03e50078fc178 (diff)
downloadopenbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.gz
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.tar.bz2
openbsd-de8f24ea083384bb66b32ec105dc4743c5663cdf.zip
OpenSSL 0.9.4 merge
Diffstat (limited to 'src/lib/libcrypto/err/err.h')
-rw-r--r--src/lib/libcrypto/err/err.h82
1 files changed, 29 insertions, 53 deletions
diff --git a/src/lib/libcrypto/err/err.h b/src/lib/libcrypto/err/err.h
index 75f931be11..9411fb3568 100644
--- a/src/lib/libcrypto/err/err.h
+++ b/src/lib/libcrypto/err/err.h
@@ -63,6 +63,10 @@
63extern "C" { 63extern "C" {
64#endif 64#endif
65 65
66#ifndef NO_FP_API
67#include <stdio.h>
68#endif
69
66/* The following is a bit of a trick to help the object files only contain 70/* The following is a bit of a trick to help the object files only contain
67 * the 'name of the file' string once. Since 'err.h' is protected by the 71 * the 'name of the file' string once. Since 'err.h' is protected by the
68 * HEADER_ERR_H stuff, this should be included only once per file. */ 72 * HEADER_ERR_H stuff, this should be included only once per file. */
@@ -87,7 +91,7 @@ typedef struct err_state_st
87 unsigned long err_buffer[ERR_NUM_ERRORS]; 91 unsigned long err_buffer[ERR_NUM_ERRORS];
88 char *err_data[ERR_NUM_ERRORS]; 92 char *err_data[ERR_NUM_ERRORS];
89 int err_data_flags[ERR_NUM_ERRORS]; 93 int err_data_flags[ERR_NUM_ERRORS];
90 char *err_file[ERR_NUM_ERRORS]; 94 const char *err_file[ERR_NUM_ERRORS];
91 int err_line[ERR_NUM_ERRORS]; 95 int err_line[ERR_NUM_ERRORS];
92 int top,bottom; 96 int top,bottom;
93 } ERR_STATE; 97 } ERR_STATE;
@@ -116,6 +120,8 @@ typedef struct err_state_st
116#define ERR_LIB_PROXY 31 120#define ERR_LIB_PROXY 31
117#define ERR_LIB_BIO 32 121#define ERR_LIB_BIO 32
118#define ERR_LIB_PKCS7 33 122#define ERR_LIB_PKCS7 33
123#define ERR_LIB_X509V3 34
124#define ERR_LIB_PKCS12 35
119 125
120#define ERR_LIB_USER 128 126#define ERR_LIB_USER 128
121 127
@@ -141,6 +147,8 @@ typedef struct err_state_st
141#define RSAREFerr(f,r) ERR_PUT_error(ERR_LIB_RSAREF,(f),(r),ERR_file_name,__LINE__) 147#define RSAREFerr(f,r) ERR_PUT_error(ERR_LIB_RSAREF,(f),(r),ERR_file_name,__LINE__)
142#define PROXYerr(f,r) ERR_PUT_error(ERR_LIB_PROXY,(f),(r),ERR_file_name,__LINE__) 148#define PROXYerr(f,r) ERR_PUT_error(ERR_LIB_PROXY,(f),(r),ERR_file_name,__LINE__)
143#define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),ERR_file_name,__LINE__) 149#define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),ERR_file_name,__LINE__)
150#define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),ERR_file_name,__LINE__)
151#define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),ERR_file_name,__LINE__)
144 152
145/* Borland C seems too stupid to be able to shift and do longs in 153/* Borland C seems too stupid to be able to shift and do longs in
146 * the pre-processor :-( */ 154 * the pre-processor :-( */
@@ -162,6 +170,7 @@ typedef struct err_state_st
162#define SYS_F_LISTEN 7 170#define SYS_F_LISTEN 7
163#define SYS_F_ACCEPT 8 171#define SYS_F_ACCEPT 8
164#define SYS_F_WSASTARTUP 9 /* Winsock stuff */ 172#define SYS_F_WSASTARTUP 9 /* Winsock stuff */
173#define SYS_F_OPENDIR 10
165 174
166#define ERR_R_FATAL 32 175#define ERR_R_FATAL 32
167/* reasons */ 176/* reasons */
@@ -187,41 +196,47 @@ typedef struct err_state_st
187#define ERR_R_PROXY_LIB ERR_LIB_PROXY 196#define ERR_R_PROXY_LIB ERR_LIB_PROXY
188#define ERR_R_BIO_LIB ERR_LIB_BIO 197#define ERR_R_BIO_LIB ERR_LIB_BIO
189#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 198#define ERR_R_PKCS7_LIB ERR_LIB_PKCS7
199#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12
190 200
191/* fatal error */ 201/* fatal error */
192#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) 202#define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL)
193#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL) 203#define ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED (2|ERR_R_FATAL)
194#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL) 204#define ERR_R_PASSED_NULL_PARAMETER (3|ERR_R_FATAL)
205#define ERR_R_NESTED_ASN1_ERROR (4)
206#define ERR_R_BAD_ASN1_OBJECT_HEADER (5)
207#define ERR_R_BAD_GET_ASN1_OBJECT_CALL (6)
208#define ERR_R_EXPECTING_AN_ASN1_SEQUENCE (7)
209#define ERR_R_ASN1_LENGTH_MISMATCH (8)
210#define ERR_R_MISSING_ASN1_EOS (9)
195 211
196typedef struct ERR_string_data_st 212typedef struct ERR_string_data_st
197 { 213 {
198 unsigned long error; 214 unsigned long error;
199 char *string; 215 const char *string;
200 } ERR_STRING_DATA; 216 } ERR_STRING_DATA;
201 217
202#ifndef NOPROTO 218void ERR_put_error(int lib, int func,int reason,const char *file,int line);
203void ERR_put_error(int lib, int func,int reason,char *file,int line);
204void ERR_set_error_data(char *data,int flags); 219void ERR_set_error_data(char *data,int flags);
205 220
206unsigned long ERR_get_error(void ); 221unsigned long ERR_get_error(void );
207unsigned long ERR_get_error_line(char **file,int *line); 222unsigned long ERR_get_error_line(const char **file,int *line);
208unsigned long ERR_get_error_line_data(char **file,int *line, 223unsigned long ERR_get_error_line_data(const char **file,int *line,
209 char **data, int *flags); 224 const char **data, int *flags);
210unsigned long ERR_peek_error(void ); 225unsigned long ERR_peek_error(void );
211unsigned long ERR_peek_error_line(char **file,int *line); 226unsigned long ERR_peek_error_line(const char **file,int *line);
212unsigned long ERR_peek_error_line_data(char **file,int *line, 227unsigned long ERR_peek_error_line_data(const char **file,int *line,
213 char **data,int *flags); 228 const char **data,int *flags);
214void ERR_clear_error(void ); 229void ERR_clear_error(void );
215char *ERR_error_string(unsigned long e,char *buf); 230char *ERR_error_string(unsigned long e,char *buf);
216char *ERR_lib_error_string(unsigned long e); 231const char *ERR_lib_error_string(unsigned long e);
217char *ERR_func_error_string(unsigned long e); 232const char *ERR_func_error_string(unsigned long e);
218char *ERR_reason_error_string(unsigned long e); 233const char *ERR_reason_error_string(unsigned long e);
219#ifndef NO_FP_API 234#ifndef NO_FP_API
220void ERR_print_errors_fp(FILE *fp); 235void ERR_print_errors_fp(FILE *fp);
221#endif 236#endif
222#ifdef HEADER_BIO_H 237#ifdef HEADER_BIO_H
223void ERR_print_errors(BIO *bp); 238void ERR_print_errors(BIO *bp);
224void ERR_add_error_data( VAR_PLIST( int, num ) ); 239void ERR_add_error_data(int num, ...);
225#endif 240#endif
226void ERR_load_strings(int lib,ERR_STRING_DATA str[]); 241void ERR_load_strings(int lib,ERR_STRING_DATA str[]);
227void ERR_load_ERR_strings(void ); 242void ERR_load_ERR_strings(void );
@@ -241,45 +256,6 @@ char *ERR_get_err_state_table(void );
241 256
242int ERR_get_next_error_library(void ); 257int ERR_get_next_error_library(void );
243 258
244#else
245
246void ERR_put_error();
247void ERR_set_error_data();
248
249unsigned long ERR_get_error();
250unsigned long ERR_get_error_line();
251unsigned long ERR_peek_error();
252unsigned long ERR_peek_error_line();
253void ERR_clear_error();
254char *ERR_error_string();
255char *ERR_lib_error_string();
256char *ERR_func_error_string();
257char *ERR_reason_error_string();
258#ifndef NO_FP_API
259void ERR_print_errors_fp();
260#endif
261void ERR_print_errors();
262void ERR_add_error_data();
263void ERR_load_strings();
264void ERR_load_ERR_strings();
265void ERR_load_crypto_strings();
266void ERR_free_strings();
267
268void ERR_remove_state();
269ERR_STATE *ERR_get_state();
270
271#ifdef HEADER_LHASH_H
272LHASH *ERR_get_string_table();
273LHASH *ERR_get_err_state_table();
274#else
275char *ERR_get_string_table();
276char *ERR_get_err_state_table();
277#endif
278
279int ERR_get_next_error_library();
280
281#endif
282
283#ifdef __cplusplus 259#ifdef __cplusplus
284} 260}
285#endif 261#endif