Table of Contents

This is part of Family API which allow to create dual-os version of program runs under OS/2 and DOS

Note: This is legacy API call. It is recommended to use 32-bit equivalent

2021/09/17 04:47 · prokushev · 0 Comments
2021/08/20 03:18 · prokushev · 0 Comments

DosCaseMap

This call performs case mapping on a string of binary values that represent ASCII characters.

Syntax

DosCaseMap (Length, Country, BinaryString)

Parameters

Return Code

rc (USHORT) - return

Return code descriptions are:

Remarks

DosCaseMap is mainly used to map a lower case character string to an upper case character string. Unless the user replaces the country information file, DosCaseMap only does the conversion from lower case to upper case.

The case map information is taken from the country information file. See the COUNTRY statement in the IBM Operating System/2 Version 1.2 Command Reference for information on how to specify the country information file.

If countrycode is 0, the case mapping is performed using the information for the country specified in the COUNTRY statement in CONFIG.SYS.

If countrycode is not 0, the case mapping is performed using the information for that country.

If the code page identifier is 0, the case mapping is performed using the information for the current process code page. Refer to DosSetCp and the CHCP command in the IBM Operating System/2 Version 1.2 Command Reference for information on setting the process code page. If codepage is not 0, the case mapping is performed using the information for that code page.

The returned country dependent information may be for the default country and current process code page or for a specific country and code page.

Bindings

C Binding

typedef struct _COUNTRYCODE {   /* ctryc */
 
  USHORT country;               /* country code */
  USHORT codepage;              /* code page */
 
} COUNTRYCODE;
 
#define INCL_DOSNLS
 
USHORT  rc = DosCaseMap(Length, Structure, BinaryString);
 
USHORT           Length;        /* Length of string to case map */
PCOUNTRYCODE     Structure;     /* Input data structure */
PCHAR            BinaryString;  /* Address of binary string */
 
USHORT           rc;            /* return code */

MASM Binding

COUNTRYCODE struc
 
  ctryc_country   dw  ? ;country code
  ctryc_codepage  dw  ? ;code page
 
COUNTRYCODE ends
 
EXTRN  DosCaseMap:FAR
INCL_DOSNLS         EQU 1
 
PUSH   WORD    Length        ;Length of string to case map
PUSH@  OTHER   Structure     ;Input data structure
PUSH@  OTHER   BinaryString  ;Binary string
CALL   DosCaseMap

Returns WORD

Example Code

This example case maps a string for the default country and code page 850.

#define INCL_DOSNLS
 
#define CURRENT_COUNTRY 0
#define NLS_CODEPAGE 850
 
COUNTRYCODE Country;
CHAR        BinString[30];
USHORT      rc;
 
 
   Country.country = CURRENT_COUNTRY;         /* Country code */
   Country.codepage = NLS_CODEPAGE;           /* Code page */
   strcpy(BinString,"Howdy");                 /* String to map */
   rc = DosCaseMap(sizeof(BinString),         /* Length of string */
                   &Country,                  /* Input data structure */
                   BinString);                /* String */

Note

Text based on http://www.edm2.com/index.php/DosCaseMap_(FAPI)