home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
winutil
/
intl
/
intlapi.txt
< prev
next >
Wrap
Text File
|
1992-04-08
|
13KB
|
366 lines
The functions in the INTL dll.
IntlVersion
-----------
Syntax: WORD FAR PASCAL IntlVersion(void)
Description: This function returns the version of the DLL. Backward
compatibility is promised.
Parameters: -
Returns: The version number. Major version in HIBYTE, and minor
version in LOBYTE.
Return value: Currently 0x0100 (i.e. ver 1.0)
Remark: The macros HIWORD and LOWORD are defined in windows.h
IntlInit
--------
Syntax: BOOL FAR PASCAL IntlInit(LPSTR lpLanguage)
Description: This function initiates the DLL. It should be called
before any use of the conversion functions (all functions
except IntlVersion), and when trapping a WM_WININICHANGE
message indicating a change in the [intl] section of
WIN.INI.
Parameters: lpLanguage: The string in which a copy of the sLanguage
variable will be stored.
Returns: Result of initialization.
Return value: FALSE if initiation failed
TRUE on success.
Comment: The sLanguage variable is a string containing a 3 letter
abbreviation of the language to use. For example "spa" for
Spanish or "itn" for Italian. Read WININI2.TXT for more
information. If the returned string is empty, no language is
set and you should provide the user a way of selecting a
language.
IntlDateToString
----------------
Syntax: LPSTR FAR PASCAL IntlDateToString(LPSTR lpString,
int nYear,
int nMon,
int nMday,
int nWday,
int nMode)
Description: This function converts a date, in year, month, day of month
and day of week, to a string. The conversion can be either
to a long or short format.
Parameters: lpString: The string in which the result of the
conversion will be stored.
nYear: as in struct tm.
nMon: as in struct tm.
nMday: as in struct tm (month day).
nWday: as in struct tm (week day).
nMode: IntlSHORT or IntlLONG. Anything else gives
unpredictable results.
Returns: lpString
Comment: There is no check if the date is valid or not.
Remark: IntlSHORT and IntlLONG are defined in intl.h
IntlTimeToString
----------------
Syntax: LPSTR FAR PASCAL IntlTimeToString(LPSTR lpString,
int nNour,
int nMin,
int nSec)
Description: This function converts a time in hours, minutes and seconds
to a string.
Parameters: lpString: The string in which the result of the
conversion will be stored.
nHour: as in struct tm.
nMin: as in struct tm or IntlSKIP.
nSec: as in struct tm or IntlSKIP.
Returns: lpString
Comment: There is no check if the time is valid or not.
If a parameter is IntlSKIP the field representing that
parameter and the fields after that will be ignored.
Remark: IntlSKIP is defined in intl.h
IntlFloatToString
-----------------
Syntax: LPSTR FAR PASCAL IntlFloatToString(LPSTR lpString,
double dVal,
int nMode,
size_t nWidth
int nDecimals)
Description: This function converts a floating point number to a string.
The conversion can be to any of the formats IntlSTD,
IntlFIX, IntlSCI, IntlENG or IntlPRE.
Parameters: lpString: The string in which the result of the conversion
will be stored
dVal: The floating point number to convert.
nMode: The mode to convert to. The modes are:
IntlSTD: The standard conversion. Numbers
formatted as xxxx.yyyy. There are
two exceptions to this. (1) The number
is too large to be contained in the
field. (2) The value of the number is
so small, it'd be converted to 0.000.
In both cases the mode becomes
IntlSCI.
IntlFIX: Same as IntlSTD, except the number
that are small will be converted to
0.000
IntlSCI: Scientific mode. The number will be
converted to the x.yyyEz format.
IntlENG: Engineering mode. Like the IntlSCI,
but the power of 10 will always be a
multiple of 3. The format can then be
either x.yyyEz, xx.yyEz or xxx.yEz
IntlPRE: Prefix mode. Like IntlENG, but the
power of 10, will be displayed using
scientific prefixes (y, z, a, f, p,
n, u, m, k, M, G, T, P, E, Z or Y) if
within that range. Otherwise identical
to IntlSCI.
nWidth: The width of the field to contain the number.
nDecilals: The numbers of decimals to show, or IntlDEFAULT
to use the settings in in WIN.INI.
Returns: lpString
Remarks: IntlSTD, IntlFIX, IntlSCI, IntlENG and IntlPRE are defined in
intl.h
IntlCurrencyToString
-------------------
Syntax: LPSTR FAR PASCAL IntlCurrencyToString(LPSTR lpString,
double dVal,
int nMode,
size_t nWidth,
int nDecimals)
Description: This function converts a floating point number to a string
representing a currency. The conversion can be to any of the
formats IntlSTD, IntlFIX, IntlSCI, IntlENG or IntlPRE. The
function is identical to IntlFloatToString with the addition
of the currency symbols.
Parameters: lpString: The string in which the result of the conversion
will be stored.
dVal: The floating point number to convert.
nMode: The mode to convert to. The modes are:
IntlSTD: The standard conversion. Numbers
formatted as xxxx.yyyy. There are two
exceptions to this. (1) The number is
too large to be contained in the
field. (2) The value of the number is
so small, it'd be converted to 0.000.
In both cases the mode becomes
IntlSCI.
IntlFIX: Same as IntlSTD, except the number
that are small will be displayed as
0.000
IntlSCI: Scientific mode. The number will be
converted to the x.yyyEz format.
IntlENG: Engineering mode. Like the IntlSCI,
but the power of 10 will always be a
multiple of 3. The format can then be
either x.yyyEz, xx.yyEz or xxx.yEz
IntlPRE: Prefix mode. Like IntlENG, but the
power of 10, will be displayed using
scientific prefixes (y, z, a, f, p,
n, u, m, k, M, G, T, P, E, Z, Y) if
within that range. Otherwise identical
to IntlSCI.
nWidth: The width of the field to contain the number.
nDecimals: The numbers of decimals to show, or IntlDEFAULT
to use the settings in WIN.INI.
Returns: lpString
Remarks: IntlSTD, IntlFIX, IntlSCI, IntlENG and IntlPRE are defined in
intl.h
IntlStringToDate
----------------
Syntax: BOOL FAR PASCAL IntlStringToDate(LPSTR lpString,
LPINT lpnYear,
LPINT lpnMon,
LPINT lpnMday,
LPSTR FAR *lpszEnd)
Description: This functions converts a string containing a date in short
form, to year, month and day of month. The conversion is
quite liberal. Either of short and long form of the year
is allowed. Leading zeroes are ignored.
Parameters: lpString: Contains the string to parse.
lpnYear: A pointer to an int where the year
(formatted as in struct tm) will be
stored. It can also be a NULL pointer.
lpnMon: A pointer to an int where the month
(formatted as in struct tm) will be
stored. It can also be a null pointer.
lpnMday: A pointer to an int where the day of
month (formatted as in struct tm) will
be stored. It can also be a null pointer.
lpszEnd: A pointer to a char pointer. It will
point to the location in lpString where
the conversion ended, either upon
completion or because of errors. You can
also send a NULL pointer.
Returns: Report of the success of the conversion.
Return value: TRUE: The conversion was successful.
FALSE: The conversion failed.
Comment: There is no check if the date is valid or not.
Remark: The type LPINT is defined as a pointer to an int, in intl.h
IntlStringToTime
----------------
Syntax: BOOL FAR PASCAL IntlStringToTime(LPSTR lpString,
LPINT lpnHour,
LPINT lpnMin,
LPINT lpnSec,
LPSTR FAR *lpszEnd)
Description: This function converts a time, stored in a string, to
hours, minutes and seconds. The conversion is quite
liberal. If the am/pm equivalence is omitted, the string
is interpreted as a 24 hour time. In 24 hour setting, a
trailing am/pm equivalence is ignored. Leading zeroes are
ignored.
Parameters: lpString: The string containing the time.
lpnHour: A pointer to an int where the
hour (formatted as in struct tm)
will be stored. It can also be a
NULL pointer.
lpnMin: A pointer to an int where the
minute (formatted as in struct tm)
will be stored. It can also be a
NULL pointer.
lpnSec: A pointer to an int where the
seconds (formatted as in struct tm)
will be stored. It can also be a
NULL pointer.
lpszEnd: A pointer to a char pointer. It will
point to the location in lpString where
the conversion ended, either upon
completion or because of errors. You
can also send a NULL pointer.
Returns: Report of the success of the conversion.
Return value: TRUE: The conversion was successful.
FALSE: The conversion failed
Comment: There is no check if the time is valid or not.
Remark: The type LPINT is defined as a pointer to an int, in intl.h
IntlStringToFloat
-----------------
Syntax: double FAR PASCAL IntlStringToFloat(LPSTR lpString,
LPSTR FAR *lpszEnd)
Description: This function converts string representation of a floating
point number to a double. The format of the string can be
any of the IntlSTD, IntlFIX, IntlSCI, IntlENG or IntlPRE.
Parameters: lpString: The string containing the number to convert.
lpszEnd: A pointer to a char pointer. It will point
to the location in lpString where the
conversion ended, either upun completion or
because of errors. You can also send a NULL
pointer.
Returns: The number or zero if the conversion failed.
Comment: The number can be in any of the IntlFIX, IntlSTD, IntlSCI,
IntlENG or the IntlPRE format.
IntlGetPhrase
-------------
Syntax: LPSTR FAR PASCAL IntlGetPhrase(LPSTR lpReturn,
int nWidth,
LPSTR lpIniFile,
LPSTR lpPhrase)
Description: This function looks up the phrase szPhrase in the current
language section of the application specific ini file,
specified in szIniFile, and if not found there, in INTL.INI,
which contains the phrases listed in appendix E of the
CUA. It the phrase is not found in neither the application
specific ini file, nor INTL.INI, szPhrase will be copied
into szReturn. The search is case insensitive. If the
first letter if the lookup-phrase is a capital letter, the
first letter of the returned string is capitalized.
Parameters: lpReturn: Points to the buffer that will contain the
returned string.
nWidth: The size of szReturn.
lpIniFile: String containing the name of the
application specific ini file. If it's
either NULL or points to en empty string,
only INTL.INI will be searched for the
phrase.
lpPhrase: Points to the null terminated phrase.
Returns: The pointer to lpReturn.
Comment: White space and punctuation characters, according to isspace()
and ispunct(), in the beginning and the end of the phrase
should be omitted in the ini files. They will be automatically
inserted/appended to the translated phrase.
Example:
Code example:
IntlGetPhrase((LPSTR)szPhrase,
sizeof szPhrase,
"myini.ini",
"** yellow submarine **");
.
.
MYINI.INI example:
[ger]
yellow submarine=gelbes U-Boot
[swe]
yellow submarine=gul ubåt
IntlGetMessage
--------------
Syntax: LPSTR FAR PASCAL IntlGetMessage(LPSTR lpReturn,
int nWidth,
LPSTR lpIniFile,
LPSTR lpIdent)
Description: This function fetches a message, in the current language,
defined in your application specific ini file. If the
message is not found in the current language section, the
[usa] section will be searched. The message identified by
szIdent MUST be defined in the [usa] section of your
application specific ini file.
Parameters: lpReturn: Points to the buffer that will contain
the returned string.
nWidth: The length of lpReturn.
lpIniFile: String containing the name of the
application specific ini file.
lpIdent: Points to the null terminated identifier
string of the message.
Returns: The pointer to lpReturn.
Comment: The message can contain the following escape sequences:
\a Alert
\b Backspace
\f Formfeed
\n Newline
\r Carriage return
\t tab
\v Vertical tab
\' Single quote
\" Double quote
\\ Backslash
Example:
Code example:
IntlGetMessage((LPSTR)szMess,
sizeof szMess,
"myini.ini",
"Demotext");
.
.
MYINI.INI example:
[usa]
Demotext=a few words.
[swe]
Demotext=några få ord.
[ger]
Demotext=Ein par Wörter.