home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
i18nv102.zip
/
SAMPLE
/
PRINTF
/
READ.ME
< prev
Wrap
Text File
|
1995-09-19
|
4KB
|
106 lines
===============================================================================
Internationalization (I18N) For OS/2
===============================================================================
Copyright IBM Corporation -- 1993, 1994, 1995
DISCLAIMER: This I18N package has been made available solely to gauge OS/2
developer interest in the industry standard XPG4 internationalization
programming model. This does not mean that IBM will introduce a product based
on the contents of this package. This package is not a full implementation of
the X/Open XPG4 specification and does not make any claims of XPG4 branding.
It implements only the portions of the XPG4 specification which deal with
internationalization.
X/Open is a trademark of the X/Open Company Limited.
===============================================================================
/************************/
/*** Contents ***/
/************************/
1. Overview
2. Files in this directory
3. How to run the sample program
4. How to compile the sample program
5. Notes
1. Overview
============
The sample program in this directory demonstrates the use of the printf
family of functions. These functions have been augmented in a variety of ways,
including:
1. They allow for the printing of wide characters and strings.
Use the %C for wide characters and the %S for wide strings.
2. Formatters (such as %f for floating point) have been augmented to
use the program's locale (set with setlocale).
3. They support positional parameters. Inserting a string of the form:
n$ after a '%' in a format string will cause the formatter to be
positional. Consider the following printf statement:
printf("%2$s %1$s", "world", "hello");
will print out the string "hello world", because the first formatter
uses (because of the 2$) the second argument from the argument list.
Positional formatters are crucial for multi-locale programs, since the
message strings (when translated) often have to move the arguments
around in the string. An example of this can be seen in the sample
program.
2. Files in this directory
===========================
File Purpose
------------------------------------------------------------------------------
printf.c Source code for the printf sample program.
printf.def Definition file needed for compiling the program.
makefile Make file used to compile the sample.
printf.exe Compiled version of the printf sample.
build.cmd A command file which will compile and link the sample program.
read.me This file.
3. How to run the sample program
=================================
The following steps show how the program can be run.
1) Run the \i18n\bin\new_vars command file (or have the environment
variables already set).
2) Set the current locale (e.g. to US English)
Ex: set LANG=en_us.437
3) Execute the printf.exe program.
Ex: printf
4. How to compile the sample program
=====================================
NOTE: The sample program is already compiled for you. If you want to see the
behavior of the program, you can just run it. The following instructions
are needed only if you want to modify the program and recompile it.
To compile the sample application:
1) Make sure that the CSET compiler and OS/2 toolkit are installed
correctly on your system.
2) cd to the directory which contains the info source files.
3) Type "build" at the command prompt.