]>
git.saurik.com Git - apple/security.git/blob - sec/SecurityTool/tool_errors.h
5 // Created by Mitch Adler on 1/9/13.
10 // These functions should be deprectaed!
11 // Try to find a better way instead of using them.
14 #ifndef _TOOL_ERRORS_H_
15 #define _TOOL_ERRORS_H_
19 #include "SecurityTool/SecurityTool.h"
21 static inline const char *
24 const char *errString
;
25 static char buffer
[12];
27 sprintf(buffer
, "%d", err
);
30 if (IS_SEC_ERROR(err
))
31 errString
= SECErrorString(err
);
33 errString
= cssmErrorString(err
);
39 sec_error(const char *msg
, ...)
43 fprintf(stderr
, "%s: ", prog_name
);
46 vfprintf(stderr
, msg
, args
);
49 fprintf(stderr
, "\n");
53 sec_perror(const char *msg
, int err
)
55 sec_error("%s: %s", msg
, sec_errstr(err
));