Upgrade to Test::Simple 0.61
[p5sagit/p5-mst-13.2.git] / wince / wince.c
index 2d728f9..e498f07 100644 (file)
@@ -41,6 +41,8 @@
 #include "cewin32_defs.h"
 #include "cecrt_defs.h"
 
+#define GetCurrentDirectoryW XCEGetCurrentDirectoryW
+
 #ifdef PALM_SIZE
 #include "stdio-palmsize.h"
 #endif
@@ -412,8 +414,8 @@ tokenize(const char *str, char **dest, char ***destv)
        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;
@@ -539,8 +541,8 @@ do_spawn2(pTHX_ char *cmd, int exectype)
     /* 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;) {
@@ -577,7 +579,7 @@ do_spawn2(pTHX_ char *cmd, int exectype)
        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;
@@ -641,7 +643,7 @@ Perl_do_exec(pTHX_ char *cmd)
  * return the pointer to the current file name.
  */
 DllExport DIR *
-win32_opendir(char *filename)
+win32_opendir(const char *filename)
 {
     dTHX;
     DIR                        *dirp;
@@ -665,7 +667,7 @@ win32_opendir(char *filename)
        return NULL;
 
     /* Get us a DIR structure */
-    Newz(1303, dirp, 1, DIR);
+    Newxz(dirp, 1, DIR);
 
     /* Create the search pattern */
     strcpy(scanname, filename);
@@ -714,7 +716,7 @@ win32_opendir(char *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;
@@ -820,7 +822,7 @@ win32_closedir(DIR *dirp)
 /////!!!!!!!!!!! return here and do right stuff!!!!
 
 DllExport DIR *
-win32_opendir(char *filename)
+win32_opendir(const char *filename)
 {
   return opendir(filename);
 }
@@ -1253,52 +1255,6 @@ win32_crypt(const char *txt, const char *salt)
 #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
@@ -1771,7 +1727,7 @@ create_command_line(char *cname, STRLEN clen, const char * const *args)
     DEBUG_p(PerlIO_printf(Perl_debug_log, "\n"));
 
     argc = index;
-    New(1310, cmd, len, char);
+    Newx(cmd, len, char);
     ptr = cmd;
 
     if (bat_file) {
@@ -1872,7 +1828,7 @@ qualified_path(const char *cmd)
 
     /* look in PATH */
     pathstr = PerlEnv_getenv("PATH");
-    New(0, fullcmd, MAX_PATH+1, char);
+    Newx(fullcmd, MAX_PATH+1, char);
     curfullcmd = fullcmd;
 
     while (1) {
@@ -1991,7 +1947,7 @@ win32_get_childdir(void)
        GetCurrentDirectoryA(MAX_PATH+1, szfilename);
     }
 
-    New(0, ptr, strlen(szfilename)+1, char);
+    Newx(ptr, strlen(szfilename)+1, char);
     strcpy(ptr, szfilename);
     return ptr;
 }
@@ -2038,7 +1994,7 @@ win32_spawnvp(int mode, const char *cmdname, const char *const *argv)
        /* 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 != '"') {
@@ -2669,7 +2625,7 @@ Perl_init_os_extras(void)
     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);
@@ -2981,11 +2937,11 @@ Perl_sys_intern_init(pTHX)
     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;
@@ -3018,9 +2974,9 @@ Perl_sys_intern_dup(pTHX_ struct interp_intern *src, struct interp_intern *dst)
     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;