summaryrefslogtreecommitdiffstats
path: root/perl/openssl_err.xs
blob: 3a6f698f2854a2c27e22910f26982ac5c09004bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "openssl.h"

int boot_err()
	{
	SSL_load_error_strings();
	return(1);
	}

MODULE =  OpenSSL::ERR	PACKAGE = OpenSSL::ERR	PREFIX = p5_ERR_

PROTOTYPES: ENABLE
VERSIONCHECK: DISABLE

#	md->error() - returns the last error in text or numeric context

void
p5_ERR_get_error(...)
	PPCODE:
		char buf[512];
		unsigned long l;

		pr_name("p5_ERR_get_code");
		EXTEND(sp,1);
		PUSHs(sv_newmortal());
		l=ERR_get_error();
		ERR_error_string(l,buf);
		sv_setiv(ST(0),l);
		sv_setpv(ST(0),buf);
		SvIOK_on(ST(0));

void
p5_ERR_peek_error(...)
	PPCODE:
		char buf[512];
		unsigned long l;

		pr_name("p5_ERR_get_code");
		EXTEND(sp,1);
		PUSHs(sv_newmortal());
		l=ERR_peek_error();
		ERR_error_string(l,buf);
		sv_setiv(ST(0),l);
		sv_setpv(ST(0),buf);
		SvIOK_on(ST(0));