X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=epoc%2Fepocish.c;h=d457fffcb08ecf54287e6a3ed879db245b42dcc2;hb=52c93dd194e572ccf0cd84fbd063340b76d1a6ba;hp=4963a2e5b555e942e28c982fad28d5ae9a281439;hpb=eb0d51032951025d503d808dc9e0dda8999ea12e;p=p5sagit%2Fp5-mst-13.2.git diff --git a/epoc/epocish.c b/epoc/epocish.c index 4963a2e5..d457fff 100644 --- a/epoc/epocish.c +++ b/epoc/epocish.c @@ -9,39 +9,23 @@ /* This is C++ Code !! */ #include +#include +#include +#include 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)); } } + +