Welcome to mirror list, hosted at ThFree Co, Russian Federation.

iswupper_l.c « ctype « libc « newlib - cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: e772f929bb0882fc6f75e57825656e89a3ae3fba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
/* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
#include <_ansi.h>
#include <ctype.h>
#include <wctype.h>
#include "local.h"
#include "categories.h"

int
iswupper_l (wint_t c, struct __locale_t *locale)
{
#ifdef _MB_CAPABLE
  c = _jp2uc_l (c, locale);
  // The wide-character class "upper" contains at least those characters wc
  // which are equal to towupper(wc) and different from towlower(wc).
  enum category cat = category (c);
  return cat == CAT_Lu || (cat == CAT_LC && towupper (c) == c);
#else
  return c < 0x100 ? isupper (c) : 0;
#endif /* _MB_CAPABLE */
}