X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Ferr%2Ferr.h;h=eb62af2af8e87c76f0239e0b4a05fb161cb7d63d;hb=dcba2534fa9fb9e9a36be554ece9cb58ffc76f41;hp=c10868ac7f9aff4f695b87308306ef74cac4d960;hpb=8d8c7266d4de9887fb0190a0770df9dc254a16a3;p=oweals%2Fopenssl.git diff --git a/crypto/err/err.h b/crypto/err/err.h index c10868ac7f..eb62af2af8 100644 --- a/crypto/err/err.h +++ b/crypto/err/err.h @@ -63,6 +63,10 @@ extern "C" { #endif +#ifndef NO_FP_API +#include +#endif + /* The following is a bit of a trick to help the object files only contain * the 'name of the file' string once. Since 'err.h' is protected by the * HEADER_ERR_H stuff, this should be included only once per file. */ @@ -87,7 +91,7 @@ typedef struct err_state_st unsigned long err_buffer[ERR_NUM_ERRORS]; char *err_data[ERR_NUM_ERRORS]; int err_data_flags[ERR_NUM_ERRORS]; - char *err_file[ERR_NUM_ERRORS]; + const char *err_file[ERR_NUM_ERRORS]; int err_line[ERR_NUM_ERRORS]; int top,bottom; } ERR_STATE; @@ -118,6 +122,8 @@ typedef struct err_state_st #define ERR_LIB_PKCS7 33 #define ERR_LIB_X509V3 34 #define ERR_LIB_PKCS12 35 +#define ERR_LIB_RAND 36 +#define ERR_LIB_DSO 37 #define ERR_LIB_USER 128 @@ -145,6 +151,8 @@ typedef struct err_state_st #define PKCS7err(f,r) ERR_PUT_error(ERR_LIB_PKCS7,(f),(r),ERR_file_name,__LINE__) #define X509V3err(f,r) ERR_PUT_error(ERR_LIB_X509V3,(f),(r),ERR_file_name,__LINE__) #define PKCS12err(f,r) ERR_PUT_error(ERR_LIB_PKCS12,(f),(r),ERR_file_name,__LINE__) +#define RANDerr(f,r) ERR_PUT_error(ERR_LIB_RAND,(f),(r),ERR_file_name,__LINE__) +#define DSOerr(f,r) ERR_PUT_error(ERR_LIB_DSO,(f),(r),ERR_file_name,__LINE__) /* Borland C seems too stupid to be able to shift and do longs in * the pre-processor :-( */ @@ -156,7 +164,7 @@ typedef struct err_state_st #define ERR_GET_REASON(l) (int)((l)&0xfffL) #define ERR_FATAL_ERROR(l) (int)((l)&ERR_R_FATAL) -/* OS fuctions */ +/* OS functions */ #define SYS_F_FOPEN 1 #define SYS_F_CONNECT 2 #define SYS_F_GETSERVBYNAME 3 @@ -166,6 +174,7 @@ typedef struct err_state_st #define SYS_F_LISTEN 7 #define SYS_F_ACCEPT 8 #define SYS_F_WSASTARTUP 9 /* Winsock stuff */ +#define SYS_F_OPENDIR 10 #define ERR_R_FATAL 32 /* reasons */ @@ -191,6 +200,8 @@ typedef struct err_state_st #define ERR_R_PROXY_LIB ERR_LIB_PROXY #define ERR_R_BIO_LIB ERR_LIB_BIO #define ERR_R_PKCS7_LIB ERR_LIB_PKCS7 +#define ERR_R_PKCS12_LIB ERR_LIB_PKCS12 +#define ERR_R_DSO_LIB ERR_LIB_DSO /* fatal error */ #define ERR_R_MALLOC_FAILURE (1|ERR_R_FATAL) @@ -206,89 +217,48 @@ typedef struct err_state_st typedef struct ERR_string_data_st { unsigned long error; - char *string; + const char *string; } ERR_STRING_DATA; -#ifndef NOPROTO -void ERR_put_error(int lib, int func,int reason,char *file,int line); +void ERR_put_error(int lib, int func,int reason,const char *file,int line); void ERR_set_error_data(char *data,int flags); unsigned long ERR_get_error(void ); -unsigned long ERR_get_error_line(char **file,int *line); -unsigned long ERR_get_error_line_data(char **file,int *line, - char **data, int *flags); +unsigned long ERR_get_error_line(const char **file,int *line); +unsigned long ERR_get_error_line_data(const char **file,int *line, + const char **data, int *flags); unsigned long ERR_peek_error(void ); -unsigned long ERR_peek_error_line(char **file,int *line); -unsigned long ERR_peek_error_line_data(char **file,int *line, - char **data,int *flags); +unsigned long ERR_peek_error_line(const char **file,int *line); +unsigned long ERR_peek_error_line_data(const char **file,int *line, + const char **data,int *flags); void ERR_clear_error(void ); char *ERR_error_string(unsigned long e,char *buf); -char *ERR_lib_error_string(unsigned long e); -char *ERR_func_error_string(unsigned long e); -char *ERR_reason_error_string(unsigned long e); +void ERR_error_string_n(unsigned long e, char *buf, size_t len); +const char *ERR_lib_error_string(unsigned long e); +const char *ERR_func_error_string(unsigned long e); +const char *ERR_reason_error_string(unsigned long e); #ifndef NO_FP_API void ERR_print_errors_fp(FILE *fp); #endif #ifdef HEADER_BIO_H void ERR_print_errors(BIO *bp); -void ERR_add_error_data( VAR_PLIST( int, num ) ); +void ERR_add_error_data(int num, ...); #endif void ERR_load_strings(int lib,ERR_STRING_DATA str[]); -void ERR_load_ERR_strings(void ); -void ERR_load_crypto_strings(void ); -void ERR_free_strings(void ); +void ERR_load_ERR_strings(void); +void ERR_load_crypto_strings(void); +void ERR_free_strings(void); void ERR_remove_state(unsigned long pid); /* if zero we look it up */ ERR_STATE *ERR_get_state(void); #ifdef HEADER_LHASH_H -LHASH *ERR_get_string_table(void ); -LHASH *ERR_get_err_state_table(void ); -#else -char *ERR_get_string_table(void ); -char *ERR_get_err_state_table(void ); -#endif - -int ERR_get_next_error_library(void ); - -#else - -void ERR_put_error(); -void ERR_set_error_data(); - -unsigned long ERR_get_error(); -unsigned long ERR_get_error_line(); -unsigned long ERR_peek_error(); -unsigned long ERR_peek_error_line(); -void ERR_clear_error(); -char *ERR_error_string(); -char *ERR_lib_error_string(); -char *ERR_func_error_string(); -char *ERR_reason_error_string(); -#ifndef NO_FP_API -void ERR_print_errors_fp(); -#endif -void ERR_print_errors(); -void ERR_add_error_data(); -void ERR_load_strings(); -void ERR_load_ERR_strings(); -void ERR_load_crypto_strings(); -void ERR_free_strings(); - -void ERR_remove_state(); -ERR_STATE *ERR_get_state(); - -#ifdef HEADER_LHASH_H -LHASH *ERR_get_string_table(); -LHASH *ERR_get_err_state_table(); -#else -char *ERR_get_string_table(); -char *ERR_get_err_state_table(); +LHASH *ERR_get_string_table(void); +LHASH *ERR_get_err_state_table(void); /* even less thread-safe than + * ERR_get_string_table :-) */ #endif -int ERR_get_next_error_library(); - -#endif +int ERR_get_next_error_library(void); #ifdef __cplusplus }