File:  [OS/2 SDKs] / os2sdk / demos / examples / country / country.c
Revision 1.1.1.2 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 12:26:08 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: os2sdk-1988, HEAD
Microsoft OS/2 SDK 03-01-1988

/*
 * Example of DosGetCtryInfo usage
 *
 * 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
 * OS/2 file "country.sys" in the root directory of your boot drive.
 *
 * Compile as: cl -AL -Lp -G0 country.c
 *
 * Created by Microsoft Corp. 1986
 */

#define INCL_DOSNLS
#define INCL_DOSPROCESS

#include  <os2def.h>
#include  <bsedos.h>


main()
{
	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
	 * is less than the actual amount of information,
	 * however as much information as possible will be
	 * copied to MemoryBuffer.
	 *
	 * CountryCode = 0 means return current info, else
	 * return info for a particular code.
	 */
	CountryCode.country=0;
	CountryCode.codepage=0;
	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.szCurrency);

	DosExit(EXIT_PROCESS,0);
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.