int status;
int flag = P_WAIT;
int index = 0;
- STRLEN n_a;
if (sp <= mark)
return -1;
}
while (++mark <= sp) {
- if (*mark && (str = SvPV(*mark, n_a)))
+ if (*mark && (str = SvPV_nolen(*mark)))
argv[index++] = str;
else
argv[index++] = "";
argv[index++] = 0;
status = win32_spawnvp(flag,
- (const char*)(really ? SvPV(really,n_a) : argv[0]),
+ (const char*)(really ? SvPV_nolen(really) : argv[0]),
(const char* const*)argv);
if (status < 0 && (errno == ENOEXEC || errno == ENOENT)) {
argv[sh_items] = w32_perlshell_vec[sh_items];
status = win32_spawnvp(flag,
- (const char*)(really ? SvPV(really,n_a) : argv[0]),
+ (const char*)(really ? SvPV_nolen(really) : argv[0]),
(const char* const*)argv);
}
* then it worked, set PV valid,
* else leave it 'undef'
*/
- if (SvCUR(sv))
+ if (SvCUR(sv)) {
SvPOK_on(sv);
- EXTEND(SP,1);
- ST(0) = sv;
- XSRETURN(1);
+ EXTEND(SP,1);
+ ST(0) = sv;
+ XSRETURN(1);
+ }
+ XSRETURN_EMPTY;
}
static
XS(w32_SetCwd)
{
dXSARGS;
- STRLEN n_a;
if (items != 1)
croak("usage: Win32::SetCurrentDirectory($cwd)");
- if (SetCurrentDirectory(SvPV(ST(0),n_a)))
+ if (SetCurrentDirectory(SvPV_nolen(ST(0))))
XSRETURN_YES;
XSRETURN_NO;
root[0] = ix++;
if (GetDriveType(root) == 1) {
root[2] = '\0';
+ EXTEND(SP,1);
XSRETURN_PV(root);
}
}
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
XS(w32_GetLastError)
{
dXSARGS;
+ EXTEND(SP,1);
XSRETURN_IV(GetLastError());
}
if (items != 1)
croak("usage: Win32::SetLastError($error)");
SetLastError(SvIV(ST(0)));
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
char *name = getlogin_buffer;
DWORD size = sizeof(getlogin_buffer);
if (GetUserName(name,&size)) {
+ EXTEND(SP,1);
/* size includes NULL */
ST(0) = sv_2mortal(newSVpv(name,size-1));
XSRETURN(1);
}
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
char name[MAX_COMPUTERNAME_LENGTH+1];
DWORD size = sizeof(name);
if (GetComputerName(name,&size)) {
+ EXTEND(SP,1);
/* size does NOT include NULL :-( */
ST(0) = sv_2mortal(newSVpv(name,size));
XSRETURN(1);
}
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
SID_NAME_USE snu;
if (LookupAccountName(NULL, name, (PSID)&sid, &sidlen,
dname, &dnamelen, &snu)) {
+ EXTEND(SP,1);
XSRETURN_PV(dname); /* all that for this */
}
}
-1, (LPSTR)dname, dnamelen, NULL, NULL);
}
NetApiBufferFree(pwi);
+ EXTEND(SP,1);
XSRETURN_PV(dname);
}
#endif
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
DWORD flags, filecomplen;
if (GetVolumeInformation(NULL, NULL, 0, NULL, &filecomplen,
&flags, fsname, sizeof(fsname))) {
- if (GIMME == G_ARRAY) {
+ if (GIMME_V == G_ARRAY) {
XPUSHs(sv_2mortal(newSVpv(fsname,0)));
XPUSHs(sv_2mortal(newSViv(flags)));
XPUSHs(sv_2mortal(newSViv(filecomplen)));
PUTBACK;
return;
}
+ EXTEND(SP,1);
XSRETURN_PV(fsname);
}
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
PUTBACK;
return;
}
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
XS(w32_IsWinNT)
{
dXSARGS;
+ EXTEND(SP,1);
XSRETURN_IV(IsWinNT());
}
XS(w32_IsWin95)
{
dXSARGS;
+ EXTEND(SP,1);
XSRETURN_IV(IsWin95());
}
msgbuf, sizeof(msgbuf)-1, NULL))
XSRETURN_PV(msgbuf);
- XSRETURN_UNDEF;
+ XSRETURN_EMPTY;
}
static
PROCESS_INFORMATION stProcInfo;
STARTUPINFO stStartInfo;
BOOL bSuccess = FALSE;
- STRLEN n_a;
if (items != 3)
croak("usage: Win32::Spawn($cmdName, $args, $PID)");
- cmd = SvPV(ST(0),n_a);
- args = SvPV(ST(1), n_a);
+ cmd = SvPV_nolen(ST(0));
+ args = SvPV_nolen(ST(1));
memset(&stStartInfo, 0, sizeof(stStartInfo)); /* Clear the block */
stStartInfo.cb = sizeof(stStartInfo); /* Set the structure size */
XS(w32_GetTickCount)
{
dXSARGS;
+ EXTEND(SP,1);
XSRETURN_IV(GetTickCount());
}
if (len) {
SvCUR_set(shortpath,len);
ST(0) = shortpath;
+ XSRETURN(1);
}
- else
- ST(0) = &PL_sv_undef;
- XSRETURN(1);
+ XSRETURN_EMPTY;
}
static
if (len) {
if (GIMME_V == G_ARRAY) {
EXTEND(SP,1);
- ST(1) = sv_2mortal(newSVpv(filepart,0));
+ XST_mPV(1,filepart);
len = filepart - SvPVX(fullpath);
items = 2;
}
SvCUR_set(fullpath,len);
ST(0) = fullpath;
+ XSRETURN(items);
}
- else
- ST(0) = &PL_sv_undef;
- XSRETURN(items);
+ XSRETURN_EMPTY;
}
static