dos12.hlp (Table of Contents; Topic list)
DosGetCollate (1.2)
Function Group                                      Up Next Previous
────────────────────────────────────────────────────────────────────────────
 
#define INCL_DOSNLS
 
USHORT DosGetCollate(cbBuf, pctryc, pchBuf, pcbTable)
USHORT cbBuf;           /* size of buffer                               */
PCOUNTRYCODE pctryc;    /* pointer to structure containing country code */
PCHAR pchBuf;           /* pointer to buffer for table                  */
PUSHORT pcbTable;       /* pointer to variable receiving table length   */
 
The DosGetCollate function retrieves the collating-sequence table for the
given country code and code-page identifier. The collating-sequence table is
a character array with 256 elements in which each element specifies the
sorting weight of the corresponding character. (The sorting weight is the
value used to determine if a character appears before or after another
character in a sorted list.) Sorting weights and character values are not
necessarily the same──for example, in a given character set, the sorting
weights for the letters A and B might be 1 and 2, even though their
character values are 65 and 66.
 
The DosGetCollate function copies the collating-sequence table from the
country.sys file to a buffer. If the buffer is too small to hold all the
information, DosGetCollate truncates the information. If the buffer is
larger than the information, DosGetCollate fills any remaining bytes with
zeros.
 
The DosGetCollate function is a family API function.
 
Parameter  Description
────────────────────────────────────────────────────────────────────────────
 
cbBuf      Specifies the size (in bytes) of the buffer that receives the
           collating-sequence table.
 
pctryc     Points to the COUNTRYCODE structure that contains the country
           code and the code-page identifier used to retrieve the
           collating-sequence table.
 
pchBuf     Points to the buffer that receives the collating-sequence table.
 
pcbTable   Points to the variable that receives the number of bytes copied
           to the buffer.
 
Return Value
 
The return value is zero if the function is successful. Otherwise, it is an
error value.
 
Comments
 
The MS OS/2 sort command uses the DosGetCollate function to sort text
according to the collating-sequence table.
 
See Also
 
DosCaseMap, DosGetCtryInfo, COUNTRYCODE