home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / nsprpub / pr / include / prdtoa.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.9 KB  |  86 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
  2. /*
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  * 
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  * 
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. #ifndef prdtoa_h___
  20. #define prdtoa_h___
  21.  
  22. #include "prtypes.h"
  23.  
  24. /*******************************************************************************/
  25. /*******************************************************************************/
  26. /****************** THESE FUNCTIONS MAY NOT BE THREAD SAFE *********************/
  27. /*******************************************************************************/
  28. /*******************************************************************************/
  29.  
  30. PR_BEGIN_EXTERN_C
  31.  
  32. /*
  33. ** PR_strtod() returns as a double-precision floating-point number
  34. ** the  value represented by the character string pointed to by
  35. ** s00. The string is scanned up to the first unrecognized
  36. ** character.
  37. **a
  38. ** If the value of se is not (char **)NULL, a  pointer  to
  39. ** the  character terminating the scan is returned in the location pointed
  40. ** to by se. If no number can be formed, se is set to s00, and
  41. ** zero is returned.
  42. */
  43. #if defined(HAVE_WATCOM_BUG_1)
  44. /* this is a hack to circumvent a bug in the Watcom C/C++ 11.0 compiler
  45. ** When Watcom fixes the bug, remove the special case for Win16
  46. */
  47. PRFloat64 __pascal __loadds __export
  48. #else
  49. PR_EXTERN(PRFloat64)
  50. #endif
  51. PR_strtod(const char *s00, char **se);
  52.  
  53. /*
  54. ** PR_cnvtf()
  55. ** conversion routines for floating point
  56. ** prcsn - number of digits of precision to generate floating
  57. ** point value.
  58. */
  59. PR_EXTERN(void) PR_cnvtf(char *buf, PRIntn bufsz, PRIntn prcsn, PRFloat64 fval);
  60.  
  61. /*
  62. ** PR_dtoa() converts double to a string.
  63. **
  64. ** ARGUMENTS:
  65. ** If rve is not null, *rve is set to point to the end of the return value.
  66. ** If d is +-Infinity or NaN, then *decpt is set to 9999.
  67. **
  68. ** mode:
  69. **     0 ==> shortest string that yields d when read in
  70. **           and rounded to nearest.
  71. */
  72. PR_EXTERN(char *) PR_dtoa(PRFloat64 d, PRIntn mode, PRIntn ndigits,
  73.                      PRIntn *decpt, PRIntn *sign, char **rve);
  74.  
  75. /*
  76. ** PR_dtoa_r() is the reentrant version of PR_dtoa().
  77. */
  78.  
  79. PR_EXTERN(PRStatus)
  80. PR_dtoa_r(PRFloat64 d, PRIntn mode, PRIntn ndigits,
  81.     PRIntn *decpt, PRIntn *sign, char **rve, char *buf, PRSize bufsize);
  82.  
  83. PR_END_EXTERN_C
  84.  
  85. #endif /* prdtoa_h___ */
  86.