summaryrefslogtreecommitdiff
path: root/perl/err.xs
blob: 6d1aec3ea12b85c3bb9337aa2aa9c19a3ad2f5ee (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
#include "p5SSLeay.h"

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

MODULE =  SSLeay::ERR	PACKAGE = SSLeay::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));