nsprpub/pr/include/prdtoa.h

Fri, 16 Jan 2015 04:50:19 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 04:50:19 +0100
branch
TOR_BUG_9701
changeset 13
44a2da4a2ab2
permissions
-rw-r--r--

Replace accessor implementation with direct member state manipulation, by
request https://trac.torproject.org/projects/tor/ticket/9701#comment:32

     1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     2 /* This Source Code Form is subject to the terms of the Mozilla Public
     3  * License, v. 2.0. If a copy of the MPL was not distributed with this
     4  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     6 #ifndef prdtoa_h___
     7 #define prdtoa_h___
     9 #include "prtypes.h"
    11 PR_BEGIN_EXTERN_C
    13 /*
    14 ** PR_strtod() returns as a double-precision floating-point number
    15 ** the  value represented by the character string pointed to by
    16 ** s00. The string is scanned up to the first unrecognized
    17 ** character.
    18 **a
    19 ** If the value of se is not (char **)NULL, a  pointer  to
    20 ** the  character terminating the scan is returned in the location pointed
    21 ** to by se. If no number can be formed, se is set to s00, and
    22 ** zero is returned.
    23 */
    24 NSPR_API(PRFloat64)
    25 PR_strtod(const char *s00, char **se);
    27 /*
    28 ** PR_cnvtf()
    29 ** conversion routines for floating point
    30 ** prcsn - number of digits of precision to generate floating
    31 ** point value.
    32 */
    33 NSPR_API(void) PR_cnvtf(char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval);
    35 /*
    36 ** PR_dtoa() converts double to a string.
    37 **
    38 ** ARGUMENTS:
    39 ** If rve is not null, *rve is set to point to the end of the return value.
    40 ** If d is +-Infinity or NaN, then *decpt is set to 9999.
    41 **
    42 ** mode:
    43 **     0 ==> shortest string that yields d when read in
    44 **           and rounded to nearest.
    45 */
    46 NSPR_API(PRStatus) PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits,
    47 	PRIntn *decpt, PRIntn *sign, char **rve, char *buf, PRSize bufsize);
    49 PR_END_EXTERN_C
    51 #endif /* prdtoa_h___ */

mercurial