projects
/
p5sagit/p5-mst-13.2.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
static functions should be prefixed S_
[p5sagit/p5-mst-13.2.git]
/
ext
/
XS
/
APItest
/
exception.c
1
#include "EXTERN.h"
2
#include "perl.h"
3
4
#define NO_XSLOCKS
5
#include "XSUB.h"
6
7
static void throws_exception(int throw_e)
8
{
9
if (throw_e)
10
croak("boo\n");
11
}
12
13
int exception(int throw_e)
14
{
15
dTHR;
16
dXCPT;
17
SV *caught = get_sv("XS::APItest::exception_caught", 0);
18
19
XCPT_TRY_START {
20
throws_exception(throw_e);
21
} XCPT_TRY_END
22
23
XCPT_CATCH
24
{
25
sv_setiv(caught, 1);
26
XCPT_RETHROW;
27
}
28
29
sv_setiv(caught, 0);
30
31
return 42;
32
}
33