#include "cewin32_defs.h"
#include "cecrt_defs.h"
+#define GetCurrentDirectoryW XCEGetCurrentDirectoryW
+
#ifdef PALM_SIZE
#include "stdio-palmsize.h"
#endif
int slen = strlen(str);
register char *ret;
register char **retv;
- New(1307, ret, slen+2, char);
- New(1308, retv, (slen+3)/2, char*);
+ Newx(ret, slen+2, char);
+ Newx(retv, (slen+3)/2, char*);
retstart = ret;
retvstart = retv;
/* Save an extra exec if possible. See if there are shell
* metacharacters in it */
if (!has_shell_metachars(cmd)) {
- New(1301,argv, strlen(cmd) / 2 + 2, char*);
- New(1302,cmd2, strlen(cmd) + 1, char);
+ Newx(argv, strlen(cmd) / 2 + 2, char*);
+ Newx(cmd2, strlen(cmd) + 1, char);
strcpy(cmd2, cmd);
a = argv;
for (s = cmd2; *s;) {
char **argv;
int i = -1;
get_shell();
- New(1306, argv, w32_perlshell_items + 2, char*);
+ Newx(argv, w32_perlshell_items + 2, char*);
while (++i < w32_perlshell_items)
argv[i] = w32_perlshell_vec[i];
argv[i++] = cmd;
* return the pointer to the current file name.
*/
DllExport DIR *
-win32_opendir(char *filename)
+win32_opendir(const char *filename)
{
dTHX;
DIR *dirp;
return NULL;
/* Get us a DIR structure */
- Newz(1303, dirp, 1, DIR);
+ Newxz(dirp, 1, DIR);
/* Create the search pattern */
strcpy(scanname, filename);
dirp->size = 128;
else
dirp->size = idx;
- New(1304, dirp->start, dirp->size, char);
+ Newx(dirp->start, dirp->size, char);
strcpy(dirp->start, ptr);
dirp->nfiles++;
dirp->end = dirp->curr = dirp->start;
/////!!!!!!!!!!! return here and do right stuff!!!!
DllExport DIR *
-win32_opendir(char *filename)
+win32_opendir(const char *filename)
{
return opendir(filename);
}
#endif
}
-/* C doesn't like repeat struct definitions */
-
-#if defined(USE_FIXED_OSFHANDLE) || defined(PERL_MSVCRT_READFIX)
-
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-/*
- * Control structure for lowio file handles
- */
-typedef struct {
- long osfhnd; /* underlying OS file HANDLE */
- char osfile; /* attributes of file (e.g., open in text mode?) */
- char pipech; /* one char buffer for handles opened on pipes */
- int lockinitflag;
- CRITICAL_SECTION lock;
-} ioinfo;
-
-
-/*
- * Array of arrays of control structures for lowio files.
- */
-EXTERN_C _CRTIMP ioinfo* __pioinfo[];
-
-/*
- * Definition of IOINFO_L2E, the log base 2 of the number of elements in each
- * array of ioinfo structs.
- */
-#define IOINFO_L2E 5
-
-/*
- * Definition of IOINFO_ARRAY_ELTS, the number of elements in ioinfo array
- */
-#define IOINFO_ARRAY_ELTS (1 << IOINFO_L2E)
-
-/*
- * Access macros for getting at an ioinfo struct and its fields from a
- * file handle
- */
-#define _pioinfo(i) (__pioinfo[(i) >> IOINFO_L2E] + ((i) & (IOINFO_ARRAY_ELTS - 1)))
-#define _osfhnd(i) (_pioinfo(i)->osfhnd)
-#define _osfile(i) (_pioinfo(i)->osfile)
-#define _pipech(i) (_pioinfo(i)->pipech)
-
-#endif
/*
* redirected io subsystem for all XS modules
DEBUG_p(PerlIO_printf(Perl_debug_log, "\n"));
argc = index;
- New(1310, cmd, len, char);
+ Newx(cmd, len, char);
ptr = cmd;
if (bat_file) {
/* look in PATH */
pathstr = PerlEnv_getenv("PATH");
- New(0, fullcmd, MAX_PATH+1, char);
+ Newx(fullcmd, MAX_PATH+1, char);
curfullcmd = fullcmd;
while (1) {
GetCurrentDirectoryA(MAX_PATH+1, szfilename);
}
- New(0, ptr, strlen(szfilename)+1, char);
+ Newx(ptr, strlen(szfilename)+1, char);
strcpy(ptr, szfilename);
return ptr;
}
/* if command name contains dquotes, must remove them */
if (strchr(cname, '"')) {
cmd = cname;
- New(0,cname,clen+1,char);
+ Newx(cname,clen+1,char);
clen = 0;
while (*cmd) {
if (*cmd != '"') {
w32_perlshell_tokens = Nullch;
w32_perlshell_items = -1;
w32_fdpid = newAV(); /* XX needs to be in Perl_win32_init()? */
- New(1313, w32_children, 1, child_tab);
+ Newx(w32_children, 1, child_tab);
w32_num_children = 0;
newXS("Win32::GetCwd", w32_GetCwd, file);
w32_perlshell_vec = (char**)NULL;
w32_perlshell_items = 0;
w32_fdpid = newAV();
- New(1313, w32_children, 1, child_tab);
+ Newx(w32_children, 1, child_tab);
w32_num_children = 0;
# ifdef USE_ITHREADS
w32_pseudo_id = 0;
- New(1313, w32_pseudo_children, 1, child_tab);
+ Newx(w32_pseudo_children, 1, child_tab);
w32_num_pseudo_children = 0;
# endif
w32_init_socktype = 0;
dst->perlshell_vec = (char**)NULL;
dst->perlshell_items = 0;
dst->fdpid = newAV();
- Newz(1313, dst->children, 1, child_tab);
+ Newxz(dst->children, 1, child_tab);
dst->pseudo_id = 0;
- Newz(1313, dst->pseudo_children, 1, child_tab);
+ Newxz(dst->pseudo_children, 1, child_tab);
dst->thr_intern.Winit_socktype = 0;
dst->timerid = 0;
dst->poll_count = 0;