This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Integrate perlio:
[perl5.git] / ext / Cwd / Cwd.xs
CommitLineData
0d2079fa
BS
1#include "EXTERN.h"
2#include "perl.h"
3#include "XSUB.h"
4
f22d8e4b 5MODULE = Cwd PACKAGE = Cwd
0d2079fa 6
f22d8e4b 7PROTOTYPES: ENABLE
0d2079fa 8
f22d8e4b
DM
9void
10fastcwd()
11PPCODE:
12{
13 dXSTARG;
14 sv_getcwd(TARG);
15 XSprePUSH; PUSHTARG;
0d2079fa
BS
16}
17
f22d8e4b
DM
18void
19abs_path(svpath=Nullsv)
20 SV *svpath
21PPCODE:
2ae52c40 22{
f22d8e4b
DM
23 dXSTARG;
24 char *path;
25 STRLEN len;
2ae52c40 26
f22d8e4b
DM
27 if (svpath) {
28 path = SvPV(svpath, len);
2ae52c40 29 }
f22d8e4b
DM
30 else {
31 path = ".";
32 len = 1;
2ae52c40 33 }
2ae52c40 34
f22d8e4b
DM
35 sv_realpath(TARG, path, len);
36 XSprePUSH; PUSHTARG;
2ae52c40 37}