home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / i18nv102.zip / SAMPLE / PRINTF / READ.ME < prev   
Text File  |  1995-09-19  |  4KB  |  106 lines

  1.  
  2. ===============================================================================
  3.                   Internationalization (I18N) For OS/2                 
  4. ===============================================================================
  5.  
  6.                 Copyright IBM Corporation -- 1993, 1994, 1995
  7.  
  8. DISCLAIMER: This I18N package has been made available solely to gauge OS/2
  9. developer interest in the industry standard XPG4 internationalization 
  10. programming model. This does not mean that IBM will introduce a product based
  11. on the contents of this package. This package is not a full implementation of 
  12. the X/Open XPG4 specification and does not make any claims of XPG4 branding. 
  13. It implements only the portions of the XPG4 specification which deal with 
  14. internationalization.
  15.  
  16. X/Open is a trademark of the X/Open Company Limited.
  17.  
  18. ===============================================================================
  19.  
  20.  
  21. /************************/
  22. /***     Contents     ***/
  23. /************************/
  24.  
  25. 1.  Overview
  26. 2.  Files in this directory
  27. 3.  How to run the sample program
  28. 4.  How to compile the sample program
  29. 5.  Notes
  30.  
  31.  
  32. 1.  Overview
  33. ============
  34.  
  35. The sample program in this directory demonstrates the use of the printf
  36. family of functions. These functions have been augmented in a variety of ways,
  37. including: 
  38.  
  39.      1. They allow for the printing of wide characters and strings.
  40.         Use the %C for wide characters and the %S for wide strings.
  41.  
  42.      2. Formatters (such as %f for floating point) have been augmented to
  43.          use the program's locale (set with setlocale).
  44.  
  45.      3. They support positional parameters.  Inserting a string of the form:
  46.         n$ after a '%' in a format string will cause the formatter to be
  47.         positional.  Consider the following printf statement:
  48.  
  49.              printf("%2$s %1$s", "world", "hello");
  50.  
  51.         will print out the string "hello world", because the first formatter
  52.         uses (because of the 2$) the second argument from the argument list.
  53.  
  54.         Positional formatters are crucial for multi-locale programs, since the
  55.         message strings (when translated) often have to move the arguments
  56.         around in the string.  An example of this can be seen in the sample
  57.         program.
  58.  
  59.  
  60. 2.  Files in this directory
  61. ===========================
  62.  
  63. File            Purpose
  64. ------------------------------------------------------------------------------
  65. printf.c        Source code for the printf sample program.
  66. printf.def      Definition file needed for compiling the program.
  67. makefile        Make file used to compile the sample.
  68. printf.exe      Compiled version of the printf sample.
  69. build.cmd       A command file which will compile and link the sample program.
  70. read.me         This file.
  71.  
  72.  
  73. 3.  How to run the sample program
  74. =================================
  75.  
  76. The following steps show how the program can be run.
  77.  
  78.      1) Run the \i18n\bin\new_vars command file (or have the environment
  79.         variables already set).
  80.  
  81.      2) Set the current locale (e.g. to US English)
  82.  
  83.           Ex: set LANG=en_us.437
  84.  
  85.      3) Execute the printf.exe program.
  86.  
  87.           Ex:   printf
  88.  
  89.  
  90. 4.  How to compile the sample program
  91. =====================================
  92.  
  93. NOTE: The sample program is already compiled for you.  If you want to see the
  94.  behavior of the program, you can just run it.  The following instructions
  95.  are needed only if you want to modify the program and recompile it.
  96.  
  97. To compile the sample application:
  98.  
  99.      1) Make sure that the CSET compiler and OS/2 toolkit are installed
  100.         correctly on your system.
  101.  
  102.      2) cd to the directory which contains the info source files.
  103.  
  104.      3) Type "build" at the command prompt.
  105.  
  106.