summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2001-07-02 08:03:55 +0000
committerGurusamy Sarathy <gsar@cpan.org>2001-07-02 08:03:55 +0000
commit894237640a8731055a749592e01318892443c38d (patch)
treecc8c55e633728ba8f48fa340a50ae81dda851e26
parent25716404fbbde2ca91832aab8c9157aafcdcc7e8 (diff)
downloadperl-894237640a8731055a749592e01318892443c38d.tar.gz
rename s/sv_getcwd/getcwd_sv/ for better conformance to existing
naming discipline win32 fix: enable getcwd_sv() to work on windows (POSIX.t was failing because of this) fix a warning about "fd" being used without being set in Cwd.xs p4raw-id: //depot/perl@11067
-rw-r--r--embed.h8
-rwxr-xr-xembed.pl2
-rw-r--r--ext/Cwd/Cwd.xs8
-rwxr-xr-xext/POSIX/POSIX.t2
-rw-r--r--ext/POSIX/POSIX.xs2
-rw-r--r--global.sym2
-rw-r--r--objXSUB.h8
-rw-r--r--perlapi.c6
-rw-r--r--pod/perlapi.pod78
-rw-r--r--proto.h2
-rw-r--r--util.c4
-rw-r--r--win32/config.bc2
-rw-r--r--win32/config.gc2
-rw-r--r--win32/config.vc2
14 files changed, 66 insertions, 62 deletions
diff --git a/embed.h b/embed.h
index 42013a1a8b..96a9dd715d 100644
--- a/embed.h
+++ b/embed.h
@@ -671,7 +671,7 @@
#define sv_collxfrm Perl_sv_collxfrm
#endif
#define sv_compile_2op Perl_sv_compile_2op
-#define sv_getcwd Perl_sv_getcwd
+#define getcwd_sv Perl_getcwd_sv
#define sv_dec Perl_sv_dec
#define sv_dump Perl_sv_dump
#define sv_derived_from Perl_sv_derived_from
@@ -2178,7 +2178,7 @@
#define sv_collxfrm(a,b) Perl_sv_collxfrm(aTHX_ a,b)
#endif
#define sv_compile_2op(a,b,c,d) Perl_sv_compile_2op(aTHX_ a,b,c,d)
-#define sv_getcwd(a) Perl_sv_getcwd(aTHX_ a)
+#define getcwd_sv(a) Perl_getcwd_sv(aTHX_ a)
#define sv_dec(a) Perl_sv_dec(aTHX_ a)
#define sv_dump(a) Perl_sv_dump(aTHX_ a)
#define sv_derived_from(a,b) Perl_sv_derived_from(aTHX_ a,b)
@@ -4279,8 +4279,8 @@
#endif
#define Perl_sv_compile_2op CPerlObj::Perl_sv_compile_2op
#define sv_compile_2op Perl_sv_compile_2op
-#define Perl_sv_getcwd CPerlObj::Perl_sv_getcwd
-#define sv_getcwd Perl_sv_getcwd
+#define Perl_getcwd_sv CPerlObj::Perl_getcwd_sv
+#define getcwd_sv Perl_getcwd_sv
#define Perl_sv_dec CPerlObj::Perl_sv_dec
#define sv_dec Perl_sv_dec
#define Perl_sv_dump CPerlObj::Perl_sv_dump
diff --git a/embed.pl b/embed.pl
index 9ad4767a4f..ca061f435d 100755
--- a/embed.pl
+++ b/embed.pl
@@ -2031,7 +2031,7 @@ Apd |I32 |sv_cmp_locale |SV* sv1|SV* sv2
Apd |char* |sv_collxfrm |SV* sv|STRLEN* nxp
#endif
Ap |OP* |sv_compile_2op |SV* sv|OP** startp|char* code|AV** avp
-Apd |int |sv_getcwd |SV* sv
+Apd |int |getcwd_sv |SV* sv
Apd |void |sv_dec |SV* sv
Ap |void |sv_dump |SV* sv
Apd |bool |sv_derived_from|SV* sv|const char* name
diff --git a/ext/Cwd/Cwd.xs b/ext/Cwd/Cwd.xs
index be9427bc41..b6f27b8d09 100644
--- a/ext/Cwd/Cwd.xs
+++ b/ext/Cwd/Cwd.xs
@@ -194,7 +194,11 @@ err1: serrno = errno;
#else
(void)chdir(wd);
#endif
-err2: (void)close(fd);
+
+err2:
+#ifdef HAS_FCHDIR
+ (void)close(fd);
+#endif
errno = serrno;
return (NULL);
#endif
@@ -209,7 +213,7 @@ fastcwd()
PPCODE:
{
dXSTARG;
- sv_getcwd(TARG);
+ getcwd_sv(TARG);
XSprePUSH; PUSHTARG;
}
diff --git a/ext/POSIX/POSIX.t b/ext/POSIX/POSIX.t
index aae4cf37c6..87a2aea89b 100755
--- a/ext/POSIX/POSIX.t
+++ b/ext/POSIX/POSIX.t
@@ -79,7 +79,7 @@ if ($Is_MPE) {
print &_POSIX_OPEN_MAX > $fds[1] ? "ok 12\n" : "not ok 12\n"
}
-print getcwd() =~ m#/t$# ? "ok 13\n" : "not ok 13\n";
+print getcwd() =~ m#[/\\]t$# ? "ok 13\n" : "not ok 13\n";
# Check string conversion functions.
diff --git a/ext/POSIX/POSIX.xs b/ext/POSIX/POSIX.xs
index 6f27ea3165..1bf8521a1a 100644
--- a/ext/POSIX/POSIX.xs
+++ b/ext/POSIX/POSIX.xs
@@ -1751,7 +1751,7 @@ getcwd()
PPCODE:
{
dXSTARG;
- sv_getcwd(TARG);
+ getcwd_sv(TARG);
XSprePUSH; PUSHTARG;
}
diff --git a/global.sym b/global.sym
index 50b6bd1963..53017399d7 100644
--- a/global.sym
+++ b/global.sym
@@ -413,7 +413,7 @@ Perl_sv_cmp
Perl_sv_cmp_locale
Perl_sv_collxfrm
Perl_sv_compile_2op
-Perl_sv_getcwd
+Perl_getcwd_sv
Perl_sv_dec
Perl_sv_dump
Perl_sv_derived_from
diff --git a/objXSUB.h b/objXSUB.h
index 6c7dcdd65e..43a10fa4fa 100644
--- a/objXSUB.h
+++ b/objXSUB.h
@@ -1657,10 +1657,10 @@
#define Perl_sv_compile_2op pPerl->Perl_sv_compile_2op
#undef sv_compile_2op
#define sv_compile_2op Perl_sv_compile_2op
-#undef Perl_sv_getcwd
-#define Perl_sv_getcwd pPerl->Perl_sv_getcwd
-#undef sv_getcwd
-#define sv_getcwd Perl_sv_getcwd
+#undef Perl_getcwd_sv
+#define Perl_getcwd_sv pPerl->Perl_getcwd_sv
+#undef getcwd_sv
+#define getcwd_sv Perl_getcwd_sv
#undef Perl_sv_dec
#define Perl_sv_dec pPerl->Perl_sv_dec
#undef sv_dec
diff --git a/perlapi.c b/perlapi.c
index b554ed539a..df16150c70 100644
--- a/perlapi.c
+++ b/perlapi.c
@@ -3002,11 +3002,11 @@ Perl_sv_compile_2op(pTHXo_ SV* sv, OP** startp, char* code, AV** avp)
return ((CPerlObj*)pPerl)->Perl_sv_compile_2op(sv, startp, code, avp);
}
-#undef Perl_sv_getcwd
+#undef Perl_getcwd_sv
int
-Perl_sv_getcwd(pTHXo_ SV* sv)
+Perl_getcwd_sv(pTHXo_ SV* sv)
{
- return ((CPerlObj*)pPerl)->Perl_sv_getcwd(sv);
+ return ((CPerlObj*)pPerl)->Perl_getcwd_sv(sv);
}
#undef Perl_sv_dec
diff --git a/pod/perlapi.pod b/pod/perlapi.pod
index 0f46c22790..4872a9fbc3 100644
--- a/pod/perlapi.pod
+++ b/pod/perlapi.pod
@@ -475,6 +475,15 @@ L<perlcall>.
=for hackers
Found in file scope.h
+=item getcwd_sv
+
+Fill the sv with current working directory
+
+ int getcwd_sv(SV* sv)
+
+=for hackers
+Found in file util.c
+
=item get_av
Returns the AV of the specified Perl array. If C<create> is set and the
@@ -2225,22 +2234,22 @@ which guarantees to evaluate sv only once.
=for hackers
Found in file sv.h
-=item SvNVX
+=item SvNVx
-Returns the raw value in the SV's NV slot, without checks or conversions.
-Only use when you are sure SvNOK is true. See also C<SvNV()>.
+Coerces the given SV to a double and returns it. Guarantees to evaluate
+sv only once. Use the more efficent C<SvNV> otherwise.
- NV SvNVX(SV* sv)
+ NV SvNVx(SV* sv)
=for hackers
Found in file sv.h
-=item SvNVx
+=item SvNVX
-Coerces the given SV to a double and returns it. Guarantees to evaluate
-sv only once. Use the more efficent C<SvNV> otherwise.
+Returns the raw value in the SV's NV slot, without checks or conversions.
+Only use when you are sure SvNOK is true. See also C<SvNV()>.
- NV SvNVx(SV* sv)
+ NV SvNVX(SV* sv)
=for hackers
Found in file sv.h
@@ -2434,21 +2443,21 @@ Like C<SvPV_nolen>, but converts sv to uft8 first if necessary.
=for hackers
Found in file sv.h
-=item SvPVx
+=item SvPVX
-A version of C<SvPV> which guarantees to evaluate sv only once.
+Returns a pointer to the physical string in the SV. The SV must contain a
+string.
- char* SvPVx(SV* sv, STRLEN len)
+ char* SvPVX(SV* sv)
=for hackers
Found in file sv.h
-=item SvPVX
+=item SvPVx
-Returns a pointer to the physical string in the SV. The SV must contain a
-string.
+A version of C<SvPV> which guarantees to evaluate sv only once.
- char* SvPVX(SV* sv)
+ char* SvPVx(SV* sv, STRLEN len)
=for hackers
Found in file sv.h
@@ -2655,19 +2664,19 @@ false, defined or undefined. Does not handle 'get' magic.
=for hackers
Found in file sv.h
-=item SvTYPE
-
-Returns the type of the SV. See C<svtype>.
+=item svtype
- svtype SvTYPE(SV* sv)
+An enum of flags for Perl types. These are found in the file B<sv.h>
+in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
=for hackers
Found in file sv.h
-=item svtype
+=item SvTYPE
-An enum of flags for Perl types. These are found in the file B<sv.h>
-in the C<svtype> enum. Test these flags with the C<SvTYPE> macro.
+Returns the type of the SV. See C<svtype>.
+
+ svtype SvTYPE(SV* sv)
=for hackers
Found in file sv.h
@@ -2778,22 +2787,22 @@ for a version which guarantees to evaluate sv only once.
=for hackers
Found in file sv.h
-=item SvUVx
+=item SvUVX
-Coerces the given SV to an unsigned integer and returns it. Guarantees to
-evaluate sv only once. Use the more efficent C<SvUV> otherwise.
+Returns the raw value in the SV's UV slot, without checks or conversions.
+Only use when you are sure SvIOK is true. See also C<SvUV()>.
- UV SvUVx(SV* sv)
+ UV SvUVX(SV* sv)
=for hackers
Found in file sv.h
-=item SvUVX
+=item SvUVx
-Returns the raw value in the SV's UV slot, without checks or conversions.
-Only use when you are sure SvIOK is true. See also C<SvUV()>.
+Coerces the given SV to an unsigned integer and returns it. Guarantees to
+evaluate sv only once. Use the more efficent C<SvUV> otherwise.
- UV SvUVX(SV* sv)
+ UV SvUVx(SV* sv)
=for hackers
Found in file sv.h
@@ -3205,15 +3214,6 @@ Normally called via a wrapper macro C<SvREFCNT_dec>.
=for hackers
Found in file sv.c
-=item sv_getcwd
-
-Fill the sv with current working directory
-
- int sv_getcwd(SV* sv)
-
-=for hackers
-Found in file util.c
-
=item sv_gets
Get a line from the filehandle and store it into the SV, optionally
diff --git a/proto.h b/proto.h
index 2d6e432272..ae4157cf0c 100644
--- a/proto.h
+++ b/proto.h
@@ -755,7 +755,7 @@ PERL_CALLCONV I32 Perl_sv_cmp_locale(pTHX_ SV* sv1, SV* sv2);
PERL_CALLCONV char* Perl_sv_collxfrm(pTHX_ SV* sv, STRLEN* nxp);
#endif
PERL_CALLCONV OP* Perl_sv_compile_2op(pTHX_ SV* sv, OP** startp, char* code, AV** avp);
-PERL_CALLCONV int Perl_sv_getcwd(pTHX_ SV* sv);
+PERL_CALLCONV int Perl_getcwd_sv(pTHX_ SV* sv);
PERL_CALLCONV void Perl_sv_dec(pTHX_ SV* sv);
PERL_CALLCONV void Perl_sv_dump(pTHX_ SV* sv);
PERL_CALLCONV bool Perl_sv_derived_from(pTHX_ SV* sv, const char* name);
diff --git a/util.c b/util.c
index 1ab05e667c..4b96250bf7 100644
--- a/util.c
+++ b/util.c
@@ -3614,7 +3614,7 @@ return FALSE
(dp->d_name[1] == '.' && dp->d_name[2] == '\0')))
/*
-=for apidoc sv_getcwd
+=for apidoc getcwd_sv
Fill the sv with current working directory
@@ -3630,7 +3630,7 @@ Fill the sv with current working directory
* back into. */
int
-Perl_sv_getcwd(pTHX_ register SV *sv)
+Perl_getcwd_sv(pTHX_ register SV *sv)
{
#ifndef PERL_MICRO
diff --git a/win32/config.bc b/win32/config.bc
index 16598d1234..1356adcf47 100644
--- a/win32/config.bc
+++ b/win32/config.bc
@@ -153,7 +153,7 @@ d_fstatvfs='undef'
d_fsync='undef'
d_ftello='undef'
d_ftime='define'
-d_getcwd='undef'
+d_getcwd='define'
d_getespwnam='undef'
d_getfsstat='undef'
d_getgrent='undef'
diff --git a/win32/config.gc b/win32/config.gc
index 0bf588d66c..bd3f4013d3 100644
--- a/win32/config.gc
+++ b/win32/config.gc
@@ -153,7 +153,7 @@ d_fstatvfs='undef'
d_fsync='undef'
d_ftello='undef'
d_ftime='define'
-d_getcwd='undef'
+d_getcwd='define'
d_getespwnam='undef'
d_getfsstat='undef'
d_getgrent='undef'
diff --git a/win32/config.vc b/win32/config.vc
index b5025fba67..486c5e28b5 100644
--- a/win32/config.vc
+++ b/win32/config.vc
@@ -153,7 +153,7 @@ d_fstatvfs='undef'
d_fsync='undef'
d_ftello='undef'
d_ftime='define'
-d_getcwd='undef'
+d_getcwd='define'
d_getespwnam='undef'
d_getfsstat='undef'
d_getgrent='undef'