diff options
author | Olaf Flebbe <o.flebbe@science-computing.de> | 1999-08-27 23:50:41 +0200 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 1999-08-29 15:29:29 +0000 |
commit | ae2d1787751a38d67ea377bb8eb603cbbf3a36bc (patch) | |
tree | bc8ebc422524380a06924cc0c9baeae4d9eda129 /epoc/epoc.c | |
parent | 53d56f489ebe1bcc7275d0e6802b73a7c3b91665 (diff) | |
download | perl-ae2d1787751a38d67ea377bb8eb603cbbf3a36bc.tar.gz |
Sender: owner-perl5-porters@perl.org
To: perl5-porters@perl.org
Subject: [ID 19990827.003] [PATCH]5.005_60 Patch for EPOC Support
p4raw-id: //depot/cfgperl@4047
Diffstat (limited to 'epoc/epoc.c')
-rw-r--r-- | epoc/epoc.c | 83 |
1 files changed, 56 insertions, 27 deletions
diff --git a/epoc/epoc.c b/epoc/epoc.c index a7c7e1090b..d0fae23f7e 100644 --- a/epoc/epoc.c +++ b/epoc/epoc.c @@ -1,35 +1,64 @@ -/* Epoc helper Routines */ +/* + * Copyright (c) 1999 Olaf Flebbe o.flebbe@gmx.de + * + * You may distribute under the terms of either the GNU General Public + * License or the Artistic License, as specified in the README file. + * + */ #include <stdlib.h> +#include <string.h> +#include <stdio.h> +#include <sys/unistd.h> + +char *environ = NULL; +void +Perl_epoc_init(int *argcp, char ***argvp) { + int i; + int truecount=0; + char **lastcp = (*argvp); + char *ptr; + 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; + -int getgid() {return 0;} -int getegid() {return 0;} -int geteuid() {return 0;} -int getuid() {return 0;} -int setgid() {return -1;} -int setuid() {return -1;} - - -char *environ; - -int Perl_my_popen( int a, int b) { - return 0; -} -int Perl_my_pclose( int a) { - return 0; } -kill() {} -signal() {} - -void execv() {} -void execvp() {} - - -void do_spawn() {} -void do_aspawn() {} -void Perl_do_exec() {} - #ifdef __MARM__ /* Symbian forgot to include __fixunsdfi into the MARM euser.lib */ /* This is from libgcc2.c , gcc-2.7.2.3 */ |