Change versions for 0.9.8n-dev
[oweals/openssl.git] / crypto / err / err.h
index 08838190fdbaf55b25951fac265cd6c6551d41a3..dcac415231013224428c48969ce4488a63fbd555 100644 (file)
@@ -66,6 +66,7 @@
 #include <stdlib.h>
 #endif
 
+#include <openssl/ossl_typ.h>
 #ifndef OPENSSL_NO_BIO
 #include <openssl/bio.h>
 #endif
@@ -88,10 +89,13 @@ extern "C" {
 #define ERR_TXT_MALLOCED       0x01
 #define ERR_TXT_STRING         0x02
 
+#define ERR_FLAG_MARK          0x01
+
 #define ERR_NUM_ERRORS 16
 typedef struct err_state_st
        {
        unsigned long pid;
+       int err_flags[ERR_NUM_ERRORS];
        unsigned long err_buffer[ERR_NUM_ERRORS];
        char *err_data[ERR_NUM_ERRORS];
        int err_data_flags[ERR_NUM_ERRORS];
@@ -136,6 +140,9 @@ typedef struct err_state_st
 #define ERR_LIB_ECDSA          42
 #define ERR_LIB_ECDH           43
 #define ERR_LIB_STORE           44
+#define ERR_LIB_FIPS           45
+#define ERR_LIB_CMS            46
+#define ERR_LIB_JPAKE          47
 
 #define ERR_LIB_USER           128
 
@@ -167,6 +174,9 @@ typedef struct err_state_st
 #define ECDSAerr(f,r)  ERR_PUT_error(ERR_LIB_ECDSA,(f),(r),__FILE__,__LINE__)
 #define ECDHerr(f,r)  ERR_PUT_error(ERR_LIB_ECDH,(f),(r),__FILE__,__LINE__)
 #define STOREerr(f,r) ERR_PUT_error(ERR_LIB_STORE,(f),(r),__FILE__,__LINE__)
+#define FIPSerr(f,r) ERR_PUT_error(ERR_LIB_FIPS,(f),(r),__FILE__,__LINE__)
+#define CMSerr(f,r) ERR_PUT_error(ERR_LIB_CMS,(f),(r),__FILE__,__LINE__)
+#define JPAKEerr(f,r) ERR_PUT_error(ERR_LIB_JPAKE,(f),(r),__FILE__,__LINE__)
 
 /* Borland C seems too stupid to be able to shift and do longs in
  * the pre-processor :-( */
@@ -290,12 +300,22 @@ ERR_STATE *ERR_get_state(void);
 #ifndef OPENSSL_NO_LHASH
 LHASH *ERR_get_string_table(void);
 LHASH *ERR_get_err_state_table(void);
+void ERR_release_err_state_table(LHASH **hash);
 #endif
 
 int ERR_get_next_error_library(void);
 
-/* This opaque type encapsulates the low-level error-state functions */
-typedef struct st_ERR_FNS ERR_FNS;
+int ERR_set_mark(void);
+int ERR_pop_to_mark(void);
+
+#ifdef OPENSSL_FIPS
+void int_ERR_set_state_func(ERR_STATE *(*get_func)(void),
+                               void (*remove_func)(unsigned long pid));
+void int_ERR_lib_init(void);
+#endif
+
+/* Already defined in ossl_typ.h */
+/* typedef struct st_ERR_FNS ERR_FNS; */
 /* An application can use this function and provide the return value to loaded
  * modules that should use the application's ERR state/functionality */
 const ERR_FNS *ERR_get_implementation(void);