Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
en:docs:fapi:dosgetcollate [2021/08/20 06:57] – created prokushev | en:docs:fapi:dosgetcollate [2021/09/18 11:07] (current) – prokushev | ||
---|---|---|---|
Line 1: | Line 1: | ||
{{page> | {{page> | ||
+ | |||
+ | ====== DosGetCollate ====== | ||
This call obtains a collating sequence table (for characters hex 00H through FFH) that resides in the country information file. It is used by the [[SORT.EXE|SORT]] utility to sort text according to the collating sequence. | This call obtains a collating sequence table (for characters hex 00H through FFH) that resides in the country information file. It is used by the [[SORT.EXE|SORT]] utility to sort text according to the collating sequence. | ||
- | ==Syntax== | + | ===== Syntax |
- | | + | <code c> |
+ | DosGetCollate (Length, Country, MemoryBuffer, | ||
+ | </ | ||
- | ==Parameters== | + | ===== Parameters ===== |
- | ;Length (USHORT) - input: Length, in bytes, of the data area (MemoryBuffer). A length value of 256 is sufficient. | + | |
- | ;Country (P[[COUNTRYCODE]]) - input: Address of the country information structure | + | |
- | ; | + | |
- | :The buffer format for the returned information is: | + | |
- | | + | |
- | | + | |
- | | + | |
- | . | + | |
- | . | + | |
- | . | + | |
- | | + | |
- | ;DataLength (PUSHORT) - output : Address of the length, in bytes, of the collate table. | + | |
- | ==Returns== | + | * Length ([[USHORT]]) - input: Length, in bytes, of the data area (MemoryBuffer). A length value of 256 is sufficient. |
- | ;rc (USHORT) - return: | + | * Country ([[PCOUNTRYCODE]]) - input: Address of the country information structure |
- | *0 NO_ERROR | + | * MemoryBuffer ([[PCHAR]]) - output: Address of the collating table. This memory area is provided by the caller. The size of the area is provided by the input parameter Length. If it is too small to hold all the available information then as much information as possible is provided in the available space (in the order that the data would appear). If the amount of returned data does not fill the memory area provided by the caller, the unaltered memory is set at 0. |
- | *396 ERROR_NLS_NO_COUNTRY_FILE | + | |
- | *397 ERROR_NLS_OPEN_FAILED | + | The buffer format for the returned information is: |
- | *398 ERROR_NO_COUNTRY_OR_CODEPAGE | + | |
- | *399 ERROR_NLS_TABLE_TRUNCATED | + | ^ Byte ^ Description ^ |
+ | | 0 | Sort weight of ASCII (0) | | ||
+ | | 1 | Sort weight of ASCII (1) | | ||
+ | | | ||
+ | | | ||
+ | | | ||
+ | | 255 | Sort weight of ASCII (255) | | ||
+ | |||
+ | * DataLength ([[PUSHORT]]) - output : Address of the length, in bytes, of the collate table. | ||
+ | |||
+ | ===== Returns ===== | ||
+ | |||
+ | rc ([[USHORT]]) - return: | ||
+ | |||
+ | | ||
+ | *396 ERROR_NLS_NO_COUNTRY_FILE | ||
+ | *397 ERROR_NLS_OPEN_FAILED | ||
+ | *398 ERROR_NO_COUNTRY_OR_CODEPAGE | ||
+ | *399 ERROR_NLS_TABLE_TRUNCATED | ||
+ | |||
+ | ===== Remarks ===== | ||
- | ==Remarks== | ||
The returned country-dependent information can be for the default country and current process code page or for a specific country and code page. For more information see [[DosSetCp]]. | The returned country-dependent information can be for the default country and current process code page or for a specific country and code page. For more information see [[DosSetCp]]. | ||
- | ==Bindings== | + | ===== Bindings ===== |
- | ===C=== | + | |
- | <PRE> | + | ==== C ==== |
+ | |||
+ | <code c> | ||
typedef struct _COUNTRYCODE { /* ctryc */ | typedef struct _COUNTRYCODE { /* ctryc */ | ||
Line 51: | Line 64: | ||
USHORT | USHORT | ||
- | </PRE> | + | </code> |
- | ===MASM=== | + | ==== MASM ==== |
- | <PRE> | + | |
+ | <code asm> | ||
COUNTRYCODE struc | COUNTRYCODE struc | ||
ctryc_country | ctryc_country | ||
Line 70: | Line 84: | ||
Returns WORD | Returns WORD | ||
- | </PRE> | + | </code> |
+ | |||
+ | ===== Example ===== | ||
- | ==Example== | ||
This example gets a collating sequence table for codepage 850 and the current country. | This example gets a collating sequence table for codepage 850 and the current country. | ||
- | <PRE> | + | <code c> |
#define INCL_DOSNLS | #define INCL_DOSNLS | ||
#define CURRENT_COUNTRY 0 | #define CURRENT_COUNTRY 0 | ||
Line 91: | Line 106: | ||
CollBuffer, | CollBuffer, | ||
& | & | ||
- | </PRE> | + | </code> |
{{page> | {{page> |