X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=epoc%2Fepocish.c;h=d457fffcb08ecf54287e6a3ed879db245b42dcc2;hb=8141890a98cb18fe79a9b720aaed544527266f99;hp=134eaef0e0054b5df5acb352717c17e69f51b290;hpb=3a2f06e93704a4187f4ca10ac210246cacbd9b05;p=p5sagit%2Fp5-mst-13.2.git diff --git a/epoc/epocish.c b/epoc/epocish.c index 134eaef..d457fff 100644 --- a/epoc/epocish.c +++ b/epoc/epocish.c @@ -6,29 +6,36 @@ * */ -/* This is indeed C++ Code !! */ +/* 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 */ + +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) { + TRealFormat trel; + + trel.iPlaces = digits; + trel.iPoint = TChar( '.'); + + TPtr result( buf, 80); + + result.Num( x, trel); + result.Append( TChar( 0)); + } } + +