en:docs:fapi:dosgetctryinfo

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
en:docs:fapi:dosgetctryinfo [2021/08/20 05:59] prokusheven:docs:fapi:dosgetctryinfo [2021/09/18 09:09] (current) prokushev
Line 5: Line 5:
 This call obtains country-dependent formatting information that resides in the country information file.  This call obtains country-dependent formatting information that resides in the country information file. 
  
-==Syntax== +===== Syntax ===== 
- DosGetCtryInfo (Length, Country, MemoryBuffer, DataLength)+<code c> 
 +DosGetCtryInfo (Length, Country, MemoryBuffer, DataLength) 
 +</code>
  
-==Parameters== +===== Parameters ===== 
-;Length (USHORT) - input : Length, in bytes, of the data area (MemoryBuffer). This length should be at least 38 bytes. + 
-;Country (PCOUNTRYCODE) - input : Address of the country information structure: +  * Length (USHORT) - input : Length, in bytes, of the data area (MemoryBuffer). This length should be at least 38 bytes. 
-::country (USHORT) - Country code identifier; 0 is the default country code.  +  Country (PCOUNTRYCODE) - input : Address of the country information structure: 
-::codepage (USHORT) - Code page identifier; 0 is the code page of the current process.  +    country (USHORT) - Country code identifier; 0 is the default country code.  
-MemoryBuffer (PCOUNTRYINFO) - output : Address of the buffer where the country-dependent data is returned. The application must request enough space in memory, a minimum of 38 bytes, to hold the returned data. If the requested space is not large enough, the system fills the allocated space with as much data as it can hold. If the requested space is too large, the extra memory requested is set to 0.+    codepage (USHORT) - Code page identifier; 0 is the code page of the current process.  
 +  MemoryBuffer (PCOUNTRYINFO) - output : Address of the buffer where the country-dependent data is returned. The application must request enough space in memory, a minimum of 38 bytes, to hold the returned data. If the requested space is not large enough, the system fills the allocated space with as much data as it can hold. If the requested space is too large, the extra memory requested is set to 0.
  
 The data is returned in the buffer in the following format: The data is returned in the buffer in the following format:
-::country (USHORT) - Country code identifier.  +  * country (USHORT) - Country code identifier.  
-::codepage (USHORT) -  Code page identifier.  +  codepage (USHORT) -  Code page identifier.  
-::dateformat (USHORT) - Date format.+  dateformat (USHORT) - Date format. 
 + 
 +^ Value ^ Definition ^ 
 +| 0 | mm/dd/yy | 
 +| 1 | dd/mm/yy | 
 +| 2 | yy/mm/dd | 
 + 
 +  * currency (CHAR) 
 +  * Currency identifier, terminated with a null. thousandsep (CHAR) 
 +  * Thousands separator, terminated with a null. decimalsep (CHAR) 
 +  * Decimal separator, terminated with a null. datesep (CHAR) 
 +  * Date separator, terminated with a null. timesep (CHAR) 
 +  * Time separator, terminated with a null. currencyformat (UCHAR)
  
- Value 
-  Definition 0 
-  mm/dd/yy 1 
-  dd/mm/yy 2 
-  yy/mm/dd currency (CHAR) 
-  Currency identifier, terminated with a null. thousandsep (CHAR) 
-  Thousands separator, terminated with a null. decimalsep (CHAR) 
-  Decimal separator, terminated with a null. datesep (CHAR) 
-  Date separator, terminated with a null. timesep (CHAR) 
-  Time separator, terminated with a null. currencyformat (UCHAR) 
   The currency bit fields in the following format:   The currency bit fields in the following format:
  
- Bit  Description +Bit Description ^ 
- 7-3  Reserved 2 +7-3 | Reserved | 
-      0 = Bits 0 and 1 are used. +  0 = Bits 0 and 1 are used. 1 = Bits 0 and 1 are ignored; the currency indicator replaces the decimal indicator. | 
-      1 = Bits 0 and 1 are ignored; the currency indicator replaces the decimal indicator.  +  | 0 = No space between the currency indicator and money value. 1 = One space between the currency indicator and money value. | 
- 1 +  | 0 = Currency indicator precedes the money value. 1 = Currency indicator follows the money value. | 
-      0 = No space between the currency indicator and money value. + 
-      1 = One space between the currency indicator and money value.  +  * decimalspace (UCHAR)  Number (in binary) of decimal spaces used to indicate currency value. 
- 0 +  timeformat (UCHAR) 
-      0 = Currency indicator precedes the money value. +
-      1 = Currency indicator follows the money value.  +
- decimalspace (UCHAR) +
-  Number (in binary) of decimal spaces used to indicate currency value. +
- timeformat (UCHAR)+
   Time format for presentation in file directory:   Time format for presentation in file directory:
-   Bit  Description + 
-   7-1  Reserved +Bit Description ^ 
-      0 = 12-hour format  +7-1 Reserved | 
-        1 = 24-hour format. +|   |  0 = 12-hour format 1 = 24-hour format | 
- reserved (USHORT) Reserved, set to zero.  + 
- datalistsep (CHAR) Data list separator, terminated with a null. +  * reserved (USHORT) Reserved, set to zero.  
- reserved (USHORT) Reserved, set to zero. +  datalistsep (CHAR) Data list separator, terminated with a null. 
-DataLength (PUSHORT) - output : Address of the length, in bytes, of the country dependent information. rc (USHORT) - return+  reserved (USHORT) Reserved, set to zero. 
 + 
 +  * DataLength (PUSHORT) - output : Address of the length, in bytes, of the country dependent information. rc (USHORT) - return
                                                        
-==Returns==+===== Returns ===== 
 Return code descriptions are: Return code descriptions are:
-* NO_ERROR  
-* 396 ERROR_NLS_NO_COUNTRY_FILE  
-* 397 ERROR_NLS_OPEN_FAILED  
-* 398 ERROR_NO_COUNTRY_OR_CODEPAGE  
-* 399 ERROR_NLS_TABLE_TRUNCATED  
  
-==Remarks==+  * NO_ERROR  
 +  * 396 ERROR_NLS_NO_COUNTRY_FILE  
 +  * 397 ERROR_NLS_OPEN_FAILED  
 +  * 398 ERROR_NO_COUNTRY_OR_CODEPAGE  
 +  * 399 ERROR_NLS_TABLE_TRUNCATED  
 + 
 +===== Remarks ===== 
 The returned country dependent information may be for the default country and current process code page, or for a specific country and code page. For more information on code page, see DosSetCp. The returned country dependent information may be for the default country and current process code page, or for a specific country and code page. For more information on code page, see DosSetCp.
  
-===Family API Considerations===+==== Family API Considerations ===
 Some options operate differently in DOS mode than in OS/2 mode. Note that not all country information is available in DOS 3.3.  Some options operate differently in DOS mode than in OS/2 mode. Note that not all country information is available in DOS 3.3. 
  
-==C Binding== +===== Bindings ===== 
-<PRE>+ 
 +==== C Binding ==== 
 + 
 +<code c>
 typedef struct _COUNTRYCODE {   /* ctryc */ typedef struct _COUNTRYCODE {   /* ctryc */
    
Line 107: Line 117:
  
 USHORT           rc;            /* return code */ USHORT           rc;            /* return code */
-</PRE>+</code>
  
-===Example=== +==== Example ===
-<PRE>+ 
 +<code c>
 This example gets country-dependent information. This example gets country-dependent information.
  
Line 130: Line 141:
                        &CtryBuffer,        /* Data area to be filled by function */                        &CtryBuffer,        /* Data area to be filled by function */
                        &Length);           /* Length of data returned */                        &Length);           /* Length of data returned */
-</PRE>+</code> 
 + 
 +==== MASM Binding ====
  
-==MASM Binding== +<code asm>
-<PRE>+
 COUNTRYCODE struc COUNTRYCODE struc
   ctryc_country   dw  ? ;country code   ctryc_country   dw  ? ;country code
Line 166: Line 178:
  
 Returns WORD Returns WORD
-</PRE>+</code>
  
-====== Note ======+===== Note =====
  
 Text on based [[http://www.edm2.com/index.php/DosGetCtryInfo]] Text on based [[http://www.edm2.com/index.php/DosGetCtryInfo]]