home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 4 / Apprentice-Release4.iso / Source Code / C / Snippets / Local Format / locfmt.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-12-16  |  1.7 KB  |  91 lines  |  [TEXT/R*ch]

  1. /**********************************************************
  2.  
  3.     Copyright (c) Dale Semchishen 1995
  4.     All Rights Reserved
  5.  
  6.     locfmt.h
  7.  
  8.     Description:
  9.         Definitions for the Localized string formatting library
  10.  
  11.     History:
  12.         Apr 20 1995    - Creation
  13.  
  14.  **********************************************************/
  15.  
  16. #ifndef __LOCFMT__
  17. #define __LOCFMT__
  18.  
  19. #ifndef __TYPES__
  20. #include <Types.h>
  21. #endif
  22.  
  23.  
  24. /* IF generating code for 680x0 CPUs */
  25. #if GENERATING68K
  26.  
  27. #ifndef __SANE__
  28. #include <SANE.h>
  29. #endif
  30.  
  31. /* IF compiling with MetroWorks, map SANE decimal type so the
  32.    same code compiles under both Symantec and MetroWorks */
  33. #ifdef __MWERKS__
  34. typedef Decimal decimal;
  35. #endif
  36.  
  37. /* ELSE generating code for PowerPC */
  38. #else
  39.  
  40. #ifndef __FP__
  41. #include <fp.h>
  42. #endif
  43.  
  44. #endif
  45.  
  46.  
  47. #ifdef __cplusplus
  48. extern "C" {
  49. #endif
  50.  
  51.  
  52.  
  53. /*------------------ Function Prototypes ------------------*/
  54.  
  55. void locfmt_Num2Str
  56. (
  57.     Byte        *localstr_ref,    /* out: formatted string (Pascal) */
  58.     long         number            /* in: the integer to convert */
  59. );
  60.  
  61. void locfmt_Dec2Str
  62. (
  63.     Byte        *localstr_ref,    /* out: formatted string (Pascal) */
  64.     decimal        *number_str        /* in: the 'decimal' string to convert */
  65. );
  66.  
  67. void locfmt_Str2Str
  68. (
  69.     Byte        *localstr_ref,    /* out: formatted local string (Pascal) */
  70.     Byte        *number_str        /* in: string to convert (Pascal) */
  71. );
  72.  
  73. void locfmt_Num2CurrStr
  74. (
  75.     Byte        *localstr_ref,    /* out: formatted string (Pascal) */
  76.     long        number,            /* in: the integer to convert */
  77.     short        fraction_digits /* in: number of digits to right of decimal point */
  78. );
  79.  
  80. void locfmt_Dec2CurrStr
  81. (
  82.     Byte        *localstr_ref,    /* out: formatted local currency string (Pascal) */
  83.     decimal        *number_ptr,    /* in: string to convert */
  84.     short        fraction_digits    /* in: number of digits to right of decimal point */
  85. );
  86.  
  87. #ifdef __cplusplus
  88. }
  89. #endif
  90.  
  91. #endif