Copy and paste error... bn_add_part_words() should of course call
[openssl.git] / perl / openssl_err.xs
1
2 #include "openssl.h"
3
4 int boot_err()
5         {
6         SSL_load_error_strings();
7         return(1);
8         }
9
10 MODULE =  OpenSSL::ERR  PACKAGE = OpenSSL::ERR  PREFIX = p5_ERR_
11
12 PROTOTYPES: ENABLE
13 VERSIONCHECK: DISABLE
14
15 #       md->error() - returns the last error in text or numeric context
16
17 void
18 p5_ERR_get_error(...)
19         PPCODE:
20                 char buf[512];
21                 unsigned long l;
22
23                 pr_name("p5_ERR_get_code");
24                 EXTEND(sp,1);
25                 PUSHs(sv_newmortal());
26                 l=ERR_get_error();
27                 ERR_error_string(l,buf);
28                 sv_setiv(ST(0),l);
29                 sv_setpv(ST(0),buf);
30                 SvIOK_on(ST(0));
31
32 void
33 p5_ERR_peek_error(...)
34         PPCODE:
35                 char buf[512];
36                 unsigned long l;
37
38                 pr_name("p5_ERR_get_code");
39                 EXTEND(sp,1);
40                 PUSHs(sv_newmortal());
41                 l=ERR_peek_error();
42                 ERR_error_string(l,buf);
43                 sv_setiv(ST(0),l);
44                 sv_setpv(ST(0),buf);
45                 SvIOK_on(ST(0));
46
47