--- os2sdk/demos/examples/country/country.c 2018/08/09 12:25:13 1.1 +++ os2sdk/demos/examples/country/country.c 2018/08/09 12:26:08 1.1.1.2 @@ -1,27 +1,31 @@ /* - * Example of DOSGETCTRYINFO usage + * Example of DosGetCtryInfo usage * - * This rouitine is an example of how to get country dependant + * This routine is an example of how to get country dependant * information. This program works Family API. IMPORTANT NOTE: In order * to run this in Family API under DOS 2/3 you must put a copy of the - * 286DOS file "country.sys" in the root directory of your boot drive. + * OS/2 file "country.sys" in the root directory of your boot drive. * * Compile as: cl -AL -Lp -G0 country.c * - * Copyright (C) Microsoft Corp. 1986 + * Created by Microsoft Corp. 1986 */ -#include +#define INCL_DOSNLS +#define INCL_DOSPROCESS + +#include +#include main() { - struct countrycode CountryCode; /* Numeric code for country */ - struct CountryInfo Buffa; /* Buffer to receive country info */ - unsigned int DataLength; /* Length actually copied into buffer */ + COUNTRYCODE CountryCode; /* Numeric code for country */ + COUNTRYINFO Buffa; /* Buffer to receive country info */ + USHORT DataLength; /* Length actually copied into buffer */ /* * Get current country code and related information. - * DOSGETCTRYINFO will return an error code if LENGTH + * DosGetCtryInfo will return an error code if LENGTH * is less than the actual amount of information, * however as much information as possible will be * copied to MemoryBuffer. @@ -31,11 +35,11 @@ main() */ CountryCode.country=0; CountryCode.codepage=0; - DOSGETCTRYINFO(sizeof(Buffa), &CountryCode, &Buffa , &DataLength); + DosGetCtryInfo(sizeof(Buffa), &CountryCode, &Buffa , &DataLength); /* Display current country code and currency symbol */ printf("Current country code: %d\n", CountryCode.country); - printf("Currency Indicator: %s\n", Buffa.currency); + printf("Currency Indicator: %s\n", Buffa.szCurrency); - DOSEXIT(1,0); + DosExit(EXIT_PROCESS,0); }