ismccollel() — Identify a multicharacter collating element
Standards
Standards / Extensions | C or C++ | Dependencies |
---|---|---|
Language Environment | both |
Format
#include <collate.h>
int ismccollel(collel_t c);
General description
Determines whether a character is a multicharacter collating element. A collating element is a glyph, usually a character, that has a value used to define its order in a collating sequence. A multicharacter collating element is a sequence of two or more characters that are to be collated as one entity.
Returned value
ismccollel() returns:
- 1
- if collel_t represents a multicharacter collating element
- 0
- if collel_t represents a single-character collating element
- -1
- if collel_t is out of range, or otherwise not valid
Example
CELEBI05
/* CELEBI05
This example prints all of the collating elements in the
collating sequence, by using the &ismc. function to determine
if the collating element is a multi-character collating
element.
*/
#include <collate.h>
#include <locale.h>
#include <stdio.h>
#include <wchar.h>
#include <wctype.h>
main(int argc, char *argv[]) {
collel_t e, *rp;
int i;
setlocale(LC_ALL, "");
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
- collorder() — Return list of 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
- maxcoll() — Return maximum collating element
- strtocoll() — Return collating element for string