コード例 #1
0
ファイル: wcwidth.c プロジェクト: Fadekraft/MollenOS
int wcwidth(__CONST wchar_t wc)
{ 
  wint_t wi = wc;

#ifdef _MB_CAPABLE
  wi = _jp2uc (wi);
#endif /* _MB_CAPABLE */
  return __wcwidth (wi);
}
コード例 #2
0
ファイル: iswspace.c プロジェクト: Fadekraft/MollenOS
int iswspace(wint_t c)
{
#ifdef _MB_CAPABLE
  c = _jp2uc (c);
  /* Based on Unicode 5.2.  Control chars 09-0D, plus all characters
     from general category "Zs", which are not marked as decomposition
     type "noBreak". */
  return ((c >= 0x0009 && c <= 0x000d) || c == 0x0020 ||
	  c == 0x1680 || c == 0x180e ||
	  (c >= 0x2000 && c <= 0x2006) ||
	  (c >= 0x2008 && c <= 0x200a) ||
	  c == 0x2028 || c == 0x2029 ||
	  c == 0x205f || c == 0x3000);
#else
  return (c < 0x100 ? isspace (c) : 0);
#endif /* _MB_CAPABLE */
}
コード例 #3
0
ファイル: iswprint.c プロジェクト: CirnOS/newlib
#ifdef _MB_CAPABLE
#include "utf8print.h"
#endif /* _MB_CAPABLE */

int
_DEFUN(iswprint,(c), wint_t c)
{
#ifdef _MB_CAPABLE
  unsigned const char *table;
  unsigned char *ptr;
  unsigned char ctmp;
  int size;
  wint_t x;
  
  c = _jp2uc (c);

  /* Based on and tested against Unicode 5.2
     See utf8print.h for a description how to fetch the data. */
  x = (c >> 8);
  /* for some large sections, all characters are printuation so handle them here */
  if ((x >= 0x33 && x <= 0x4c) ||
      (x >= 0x4e && x <= 0x9e) ||
      (x >= 0xa0 && x <= 0xa3) ||
      (x >= 0xac && x <= 0xd6) ||
      (x >= 0xe0 && x <= 0xf9) ||
      (x >= 0x120 && x <= 0x122) ||
      (x >= 0x130 && x <= 0x133) ||
      (x >= 0x200 && x <= 0x2a5) ||
      (x >= 0x2a7 && x <= 0x2b6) ||
      (x >= 0xf00 && x <= 0xffe) ||