summaryrefslogtreecommitdiff
path: root/crypto/objects/obj_err.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/objects/obj_err.c')
-rw-r--r--crypto/objects/obj_err.c37
1 files changed, 19 insertions, 18 deletions
diff --git a/crypto/objects/obj_err.c b/crypto/objects/obj_err.c
index 2b5f43e3cc..2e7a034c3f 100644
--- a/crypto/objects/obj_err.c
+++ b/crypto/objects/obj_err.c
@@ -1,6 +1,6 @@
/* crypto/objects/obj_err.c */
/* ====================================================================
- * Copyright (c) 1999-2004 The OpenSSL Project. All rights reserved.
+ * Copyright (c) 1999-2006 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -64,22 +64,26 @@
/* BEGIN ERROR CODES */
#ifndef OPENSSL_NO_ERR
+
+#define ERR_FUNC(func) ERR_PACK(ERR_LIB_OBJ,func,0)
+#define ERR_REASON(reason) ERR_PACK(ERR_LIB_OBJ,0,reason)
+
static ERR_STRING_DATA OBJ_str_functs[]=
{
-{ERR_PACK(0,OBJ_F_OBJ_ADD_OBJECT,0), "OBJ_add_object"},
-{ERR_PACK(0,OBJ_F_OBJ_CREATE,0), "OBJ_create"},
-{ERR_PACK(0,OBJ_F_OBJ_DUP,0), "OBJ_dup"},
-{ERR_PACK(0,OBJ_F_OBJ_NAME_NEW_INDEX,0), "OBJ_NAME_new_index"},
-{ERR_PACK(0,OBJ_F_OBJ_NID2LN,0), "OBJ_nid2ln"},
-{ERR_PACK(0,OBJ_F_OBJ_NID2OBJ,0), "OBJ_nid2obj"},
-{ERR_PACK(0,OBJ_F_OBJ_NID2SN,0), "OBJ_nid2sn"},
+{ERR_FUNC(OBJ_F_OBJ_ADD_OBJECT), "OBJ_add_object"},
+{ERR_FUNC(OBJ_F_OBJ_CREATE), "OBJ_create"},
+{ERR_FUNC(OBJ_F_OBJ_DUP), "OBJ_dup"},
+{ERR_FUNC(OBJ_F_OBJ_NAME_NEW_INDEX), "OBJ_NAME_new_index"},
+{ERR_FUNC(OBJ_F_OBJ_NID2LN), "OBJ_nid2ln"},
+{ERR_FUNC(OBJ_F_OBJ_NID2OBJ), "OBJ_nid2obj"},
+{ERR_FUNC(OBJ_F_OBJ_NID2SN), "OBJ_nid2sn"},
{0,NULL}
};
static ERR_STRING_DATA OBJ_str_reasons[]=
{
-{OBJ_R_MALLOC_FAILURE ,"malloc failure"},
-{OBJ_R_UNKNOWN_NID ,"unknown nid"},
+{ERR_REASON(OBJ_R_MALLOC_FAILURE) ,"malloc failure"},
+{ERR_REASON(OBJ_R_UNKNOWN_NID) ,"unknown nid"},
{0,NULL}
};
@@ -87,15 +91,12 @@ static ERR_STRING_DATA OBJ_str_reasons[]=
void ERR_load_OBJ_strings(void)
{
- static int init=1;
-
- if (init)
- {
- init=0;
#ifndef OPENSSL_NO_ERR
- ERR_load_strings(ERR_LIB_OBJ,OBJ_str_functs);
- ERR_load_strings(ERR_LIB_OBJ,OBJ_str_reasons);
-#endif
+ if (ERR_func_error_string(OBJ_str_functs[0].error) == NULL)
+ {
+ ERR_load_strings(0,OBJ_str_functs);
+ ERR_load_strings(0,OBJ_str_reasons);
}
+#endif
}