diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-22 20:34:28 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2002-03-22 20:34:28 +0000 |
commit | 85ca448a836bf0ba175d8874ee540094ff909f93 (patch) | |
tree | 86b6cebd52d43163073c1b5f8f08b8ab9b5abff5 /epoc/epoc.c | |
parent | 1f56d61a5b03f36bb86c918d42e906ba72608431 (diff) | |
download | perl-85ca448a836bf0ba175d8874ee540094ff909f93.tar.gz |
EPOC update from Olaf Flebbe.
p4raw-id: //depot/perl@15426
Diffstat (limited to 'epoc/epoc.c')
-rw-r--r-- | epoc/epoc.c | 125 |
1 files changed, 4 insertions, 121 deletions
diff --git a/epoc/epoc.c b/epoc/epoc.c index 1348109371..88dca1e7cf 100644 --- a/epoc/epoc.c +++ b/epoc/epoc.c @@ -10,88 +10,8 @@ #include <string.h> #include <stdio.h> #include <sys/unistd.h> +#include <process.h> -void -Perl_epoc_init(int *argcp, char ***argvp) { - int i; - int truecount=0; - char **lastcp = (*argvp); - char *ptr; - -#if 0 - epoc_spawn_posix_server(); -#endif - for (i=0; i< *argcp; i++) { - if ((*argvp)[i]) { - if (*((*argvp)[i]) == '<') { - if (strlen((*argvp)[i]) > 1) { - ptr =((*argvp)[i])+1; - } else { - i++; - ptr = ((*argvp)[i]); - } - freopen( ptr, "r", stdin); - } else if (*((*argvp)[i]) == '>') { - if (strlen((*argvp)[i]) > 1) { - ptr =((*argvp)[i])+1; - } else { - i++; - ptr = ((*argvp)[i]); - } - freopen( ptr, "w", stdout); - } else if ((*((*argvp)[i]) == '2') && (*(((*argvp)[i])+1) == '>')) { - if (strcmp( (*argvp)[i], "2>&1") == 0) { - dup2( fileno( stdout), fileno( stderr)); - } else { - if (strlen((*argvp)[i]) > 2) { - ptr =((*argvp)[i])+2; - } else { - i++; - ptr = ((*argvp)[i]); - } - freopen( ptr, "w", stderr); - } - } else { - *lastcp++ = (*argvp)[i]; - truecount++; - } - } - } - *argcp=truecount; - - -} - - -#ifdef __MARM__ -/* Symbian forgot to include __fixunsdfi into the MARM euser.lib */ -/* This is from libgcc2.c , gcc-2.7.2.3 */ - -typedef unsigned int UQItype __attribute__ ((mode (QI))); -typedef int SItype __attribute__ ((mode (SI))); -typedef unsigned int USItype __attribute__ ((mode (SI))); -typedef int DItype __attribute__ ((mode (DI))); -typedef unsigned int UDItype __attribute__ ((mode (DI))); - -typedef float SFtype __attribute__ ((mode (SF))); -typedef float DFtype __attribute__ ((mode (DF))); - - - -extern DItype __fixunssfdi (SFtype a); -extern DItype __fixunsdfdi (DFtype a); - - -USItype -__fixunsdfsi (a) - DFtype a; -{ - if (a >= - (DFtype) (- 2147483647L -1) ) - return (SItype) (a + (- 2147483647L -1) ) - (- 2147483647L -1) ; - return (SItype) a; -} - -#endif #include "EXTERN.h" #include "perl.h" @@ -100,26 +20,7 @@ __fixunsdfsi (a) int do_spawn( char *cmd) { dTHX; - char *argv0, *ptr; - char *cmdptr = cmd; - int ret; - - argv0 = ptr = malloc( strlen(cmd) + 1); - - while (*cmdptr && !isSPACE( *cmdptr)) { - *ptr = *cmdptr; - if (*ptr == '/') { - *ptr = '\\'; - } - ptr++; cmdptr++; - } - while (*cmdptr && isSPACE( *cmdptr)) { - cmdptr++; - } - *ptr = '\0'; - ret = epoc_spawn( argv0, cmdptr); - free( argv0); - return ret; + return system( cmd); } int @@ -134,12 +35,11 @@ do_aspawn ( void *vreally, void **vmark, void **vsp) { char **argv; char *str; char *p2, **ptr; - char *cmd, *cmdline; + char *cmd; int rc; int index = 0; - int len = 0; if (sp<=mark) return -1; @@ -151,30 +51,13 @@ do_aspawn ( void *vreally, void **vmark, void **vsp) { argv[index] = str; else argv[index] = ""; - - len += strlen(argv[ index++]) + 1; } argv[index++] = 0; cmd = strdup((const char*)(really ? SvPV_nolen(really) : argv[0])); - for (p2=cmd; *p2 != '\0'; p2++) { - /* Change / to \ */ - if ( *p2 == '/') - *p2 = '\\'; - } - - cmdline = (char * ) malloc( len + 1); - cmdline[ 0] = '\0'; - while (*argv != NULL) { - strcat( cmdline, *ptr++); - strcat( cmdline, " "); - } - + spawnvp( P_WAIT, cmd, argv); free( argv); - - rc = epoc_spawn( cmd, cmdline); - free( cmdline); free( cmd); return rc; |