1 /*
2 Copyright (c) 2016 Corinna Vinschen <corinna@vinschen.de>
3 Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling
4  */
5 /* Modified (m) 2017 Thomas Wolff: revise Unicode and locale/wchar handling */
6 #define _DEFAULT_SOURCE
7 #include <ctype.h>
8 #include <wctype.h>
9 #include "local.h"
10 #include "categories.h"
11 
12 int
iswgraph_l(wint_t c,struct __locale_t * locale)13 iswgraph_l (wint_t c, struct __locale_t *locale)
14 {
15 #ifdef _MB_CAPABLE
16   //return iswprint (c, locale) && !iswspace (c, locale);
17   c = _jp2uc_l (c, locale);
18   enum category cat = category (c);
19   return cat != CAT_error
20       && cat != CAT_Cc && cat != CAT_Cf
21       && cat != CAT_Cs // Surrogate
22       && cat != CAT_Zs
23       && cat != CAT_Zl && cat != CAT_Zp // Line/Paragraph Separator
24       ;
25 #else
26   (void) locale;
27   return c < (wint_t)0x100 ? isgraph (c) : 0;
28 #endif /* _MB_CAPABLE */
29 }
30