collorder() — Return list of collating elements
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Language Environment | both |
Format
#include <collate.h>
int collorder(collel_t **list);
General description
Finds the number of collating elements in the collate order list and sets a pointer to the list. The list returned is valid until another call to setlocale().
Notes:
- Collating elements specified with the weight of IGNORE in the LC_COLLATE category are defined as having the lowest weight.
- The list will only contain characters defined in the charmap file in the current locale.
Example
CELEBC23
/* CELEBC23
This example creates a list of all the collating elements using
the &collo. function.
*/
#include <stdio.h>
#include <locale.h>
#include <collate.h>
#include <wchar.h>
#include <wctype.h>
main(int argc, char *argv[]) {
collel_t e, *rp;
int i;
setlocale(LC_ALL, "TEXAN.IBM-1024");
i = collorder(&rp);
for (; i-- > 0; rp++) {
if (ismccollel(*rp))
printf("'%s' ", colltostr(*rp));
else if (iswprint(*rp))
printf("'%lc' ", *rp);
else
printf("'%x' ", *rp);
}
}
Related information
- collate.h
- cclass() — Return characters in a character class
- collequiv() — Return a list of equivalent collating elements
- collrange() — Calculate the range list of collating elements
- colltostr() — Return a string for a collating element
- getmccoll() — Get next collating element from string
- getwmccoll() — Get next collating element from wide string
- ismccollel() — Identify a multicharacter collating element
- maxcoll() — Return maximum collating element
- strtocoll() — Return collating element for string