This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
whoops, fix 'formline undef' test broken by change #23251
[perl5.git] / epoc / epocish.c
index 4963a2e..d457fff 100644 (file)
@@ -9,39 +9,23 @@
 /* This is C++ Code !! */
 
 #include <e32std.h>
+#include <stdlib.h>
+#include <estlib.h>
+#include <string.h>
 
 extern "C" { 
 
-epoc_spawn( char *cmd, char *cmdline) {
-  RProcess p;
-  TRequestStatus status;
-  TInt rc;
-
-  rc = p.Create( _L( cmd), _L( cmdline));
-  if (rc != KErrNone)
-    return -1;
-
-  p.Resume();
-  
-  p.Logon( status);
-  User::WaitForRequest( status);
-  if (status!=KErrNone) {
-    return -1;
-  }
-  return 0;
-}
 
+/* Workaround for defect strtoul(). Values with leading + are zero */
 
-  /* Workaround for defect atof(), see java defect list for epoc */
-  double epoc_atof( const char* str) {
-    TReal64 aRes;
-
-    TLex lex( _L( str));
-    TInt err = lex.Val( aRes, TChar( '.'));
-    return aRes;
-  }
+unsigned long int epoc_strtoul(const char *nptr, char **endptr,
+                              int base) {
+  if (nptr && *nptr == '+')
+    nptr++;
+  return strtoul( nptr, endptr, base);
+}
 
-  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;
@@ -53,3 +37,5 @@ epoc_spawn( char *cmd, char *cmdline) {
     result.Append( TChar( 0));
   }
 }
+
+