summaryrefslogtreecommitdiff
path: root/epoc/epocish.c
diff options
context:
space:
mode:
authorOlaf Flebbe <o.flebbe@science-computing.de>2001-02-27 00:34:36 +0100
committerJarkko Hietaniemi <jhi@iki.fi>2001-02-27 06:12:11 +0000
commitd5ff79b3161a608c49c52fd6aa22cff1af6f6b82 (patch)
tree020e9213536d2108b5cf5da6059511b1d3b53ebb /epoc/epocish.c
parente4f0d88dd7061f3d9b4bbe01e378d668273f5363 (diff)
downloadperl-d5ff79b3161a608c49c52fd6aa22cff1af6f6b82.tar.gz
[perl-current] EPOC
Message-ID: <Pine.LNX.4.02.10102262333490.3781-100000@milkyway.science-computing.de> p4raw-id: //depot/perl@8956
Diffstat (limited to 'epoc/epocish.c')
-rw-r--r--epoc/epocish.c45
1 files changed, 40 insertions, 5 deletions
diff --git a/epoc/epocish.c b/epoc/epocish.c
index a0557cc129..a8b95972d0 100644
--- a/epoc/epocish.c
+++ b/epoc/epocish.c
@@ -9,31 +9,60 @@
/* This is C++ Code !! */
#include <e32std.h>
+#include <stdlib.h>
+#include <estlib.h>
+#include <string.h>
extern "C" {
+#if 1
+int
epoc_spawn( char *cmd, char *cmdline) {
RProcess p;
TRequestStatus status;
TInt rc;
rc = p.Create( _L( cmd), _L( cmdline));
- if (rc != KErrNone)
+ if (rc != KErrNone) {
return -1;
+ }
p.Resume();
p.Logon( status);
User::WaitForRequest( status);
+ p.Kill( 0);
if (status!=KErrNone) {
return -1;
}
return 0;
}
+#else
+int
+epoc_spawn( char *cmd, char *cmdline) {
+ int len = strlen(cmd) + strlen(cmdline) + 4;
+ char *n = (char *) malloc( len);
+ int r;
+ strcpy( n, cmd);
+ strcat( n, " ");
+ strcat( n, cmdline);
+ r = system( n);
+ free( n);
+ return r;
+}
+#endif
+/* Workaround for defect strtoul(). Values with leading + are zero */
+
+unsigned long int epoc_strtoul(const char *nptr, char **endptr,
+ int base) {
+ if (nptr && *nptr == '+')
+ nptr++;
+ return strtoul( nptr, endptr, base);
+}
- /* Workaround for defect atof(), see java defect list for epoc */
- double epoc_atof( char* str) {
+/* Workaround for defect atof(), see java defect list for epoc */
+double epoc_atof( char* str) {
TReal64 aRes;
while (TChar( *str).IsSpace()) {
@@ -43,9 +72,9 @@ epoc_spawn( char *cmd, char *cmdline) {
TLex lex( _L( str));
TInt err = lex.Val( aRes, TChar( '.'));
return aRes;
- }
+}
- void epoc_gcvt( double x, int digits, unsigned char *buf) {
+void epoc_gcvt( double x, int digits, unsigned char *buf) {
TRealFormat trel;
trel.iPlaces = digits;
@@ -57,3 +86,9 @@ epoc_spawn( char *cmd, char *cmdline) {
result.Append( TChar( 0));
}
}
+
+#if 0
+void epoc_spawn_posix_server() {
+ SpawnPosixServerThread();
+}
+#endif