|
|
1.1 root 1: /*
2: * Example of DOSGETCTRYINFO usage
3: *
4: * This rouitine is an example of how to get country dependant
5: * information. This program works Family API. IMPORTANT NOTE: In order
6: * to run this in Family API under DOS 2/3 you must put a copy of the
7: * 286DOS file "country.sys" in the root directory of your boot drive.
8: *
9: * Compile as: cl -AL -Lp -G0 country.c
10: *
11: * Copyright (C) Microsoft Corp. 1986
12: */
13:
14: #include <doscalls.h>
15:
16:
17: main()
18: {
19: struct countrycode CountryCode; /* Numeric code for country */
20: struct CountryInfo Buffa; /* Buffer to receive country info */
21: unsigned int DataLength; /* Length actually copied into buffer */
22: /*
23: * Get current country code and related information.
24: * DOSGETCTRYINFO will return an error code if LENGTH
25: * is less than the actual amount of information,
26: * however as much information as possible will be
27: * copied to MemoryBuffer.
28: *
29: * CountryCode = 0 means return current info, else
30: * return info for a particular code.
31: */
32: CountryCode.country=0;
33: CountryCode.codepage=0;
34: DOSGETCTRYINFO(sizeof(Buffa), &CountryCode, &Buffa , &DataLength);
35:
36: /* Display current country code and currency symbol */
37: printf("Current country code: %d\n", CountryCode.country);
38: printf("Currency Indicator: %s\n", Buffa.currency);
39:
40: DOSEXIT(1,0);
41: }
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.