*/
#include <stdio.h>
-#include "lhash.h"
-#include "crypto.h"
+#include <stdarg.h>
+#include <openssl/lhash.h>
+#include <openssl/crypto.h>
#include "cryptlib.h"
-#include "buffer.h"
-#include "err.h"
-#include "crypto.h"
+#include <openssl/buffer.h>
+#include <openssl/err.h>
+#include <openssl/crypto.h>
static LHASH *error_hash=NULL;
static LHASH *thread_hash=NULL;
-#ifndef NOPROTO
static unsigned long err_hash(ERR_STRING_DATA *a);
static int err_cmp(ERR_STRING_DATA *a, ERR_STRING_DATA *b);
static unsigned long pid_hash(ERR_STATE *pid);
static unsigned long get_error_values(int inc,const char **file,int *line,
const char **data,int *flags);
static void ERR_STATE_free(ERR_STATE *s);
-#else
-static unsigned long err_hash();
-static int err_cmp();
-static unsigned long pid_hash();
-static int pid_cmp();
-static unsigned long get_error_values();
-static void ERR_STATE_free();
-ERR_STATE *s;
-#endif
-
#ifndef NO_ERR
static ERR_STRING_DATA ERR_str_libraries[]=
{
#ifdef WINDOWS
{ERR_PACK(0,SYS_F_WSASTARTUP,0), "WSAstartup"},
#endif
+ {ERR_PACK(0,SYS_F_OPENDIR,0), "opendir"},
{0,NULL},
};
{ERR_R_PKCS7_LIB ,"PKCS7 lib"},
{ERR_R_PKCS12_LIB ,"PKCS12 lib"},
{ERR_R_MALLOC_FAILURE ,"Malloc failure"},
-{ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED ,"called a fuction you should not call"},
+{ERR_R_SHOULD_NOT_HAVE_BEEN_CALLED ,"called a function you should not call"},
{ERR_R_PASSED_NULL_PARAMETER ,"passed a null parameter"},
{ERR_R_NESTED_ASN1_ERROR ,"nested asn1 error"},
{ERR_R_BAD_ASN1_OBJECT_HEADER ,"bad asn1 object header"},
{
ERR_STATE *es;
+#ifdef _OSD_POSIX
+ /* In the BS2000-OSD POSIX subsystem, the compiler generates
+ * path names in the form "*POSIX(/etc/passwd)".
+ * This dirty hack strips them to something sensible.
+ * @@@ We shouldn't modify a const string, though.
+ */
+ if (strncmp(file,"*POSIX(", sizeof("*POSIX(")-1) == 0) {
+ char *end;
+
+ /* Skip the "*POSIX(" prefix */
+ file += sizeof("*POSIX(")-1;
+ end = &file[strlen(file)-1];
+ if (*end == ')')
+ *end = '\0';
+ /* Optional: use the basename of the path only. */
+ if ((end = strrchr(file, '/')) != NULL)
+ file = &end[1];
+ }
+#endif
es=ERR_get_state();
es->top=(es->top+1)%ERR_NUM_ERRORS;
es->err_data_flags[es->top]=flags;
}
-void ERR_add_error_data( VAR_PLIST(int , num))
-VAR_ALIST
- {
- VAR_BDEFN(args, int, num);
+void ERR_add_error_data(int num, ...)
+ {
+ va_list args;
int i,n,s;
char *str,*p,*a;
if (str == NULL) return;
str[0]='\0';
- VAR_INIT(args,int,num);
+ va_start(args, num);
n=0;
for (i=0; i<num; i++)
{
- VAR_ARG(args,char *,a);
+ a=va_arg(args, char*);
/* ignore NULLs, thanks to Bob Beck <beck@obtuse.com> */
if (a != NULL)
{
}
ERR_set_error_data(str,ERR_TXT_MALLOCED|ERR_TXT_STRING);
- VAR_END( args );
+ va_end(args);
}