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
Subject: [PATCH] Hash::Util & restricted hash touch up, part 1
[p5sagit/p5-mst-13.2.git]
/
ext
/
Data
/
Util
/
Util.xs
1
#include "EXTERN.h"
2
#include "perl.h"
3
#include "XSUB.h"
4
5
6
MODULE=Data::Util PACKAGE=Data::Util
7
8
int
9
sv_readonly_flag(...)
10
PROTOTYPE: \[$%@];$
11
CODE:
12
{
13
SV *sv = SvRV(ST(0));
14
IV old = SvREADONLY(sv);
15
16
if (items == 2) {
17
if (SvTRUE(ST(1))) {
18
SvREADONLY_on(sv);
19
}
20
else {
21
SvREADONLY_off(sv);
22
}
23
}
24
if (old)
25
XSRETURN_YES;
26
else
27
XSRETURN_NO;
28
}
29