X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Flib%2Fcompat%2FCompat%2FUnicode.hs;fp=ghc%2Flib%2Fcompat%2FCompat%2FUnicode.hs;h=3c8bfc6a06011db59673cf9c227ec6b203646de8;hb=274a7b1ab7cf30fd1ceaddd02f991eaf694cc37c;hp=4765511954783d005b2d7b9c470df5bd42c9d107;hpb=c117f1be1a1923f5a87369d738cca562c3481fcc;p=ghc-hetmet.git diff --git a/ghc/lib/compat/Compat/Unicode.hs b/ghc/lib/compat/Compat/Unicode.hs index 4765511..3c8bfc6 100644 --- a/ghc/lib/compat/Compat/Unicode.hs +++ b/ghc/lib/compat/Compat/Unicode.hs @@ -1,6 +1,6 @@ {-# OPTIONS -cpp #-} module Compat.Unicode ( - GeneralCategory(..), generalCategory, + GeneralCategory(..), generalCategory, isPrint, isUpper ) where #if __GLASGOW_HASKELL__ > 604 @@ -54,4 +54,13 @@ generalCategory c = toEnum (wgencat (fromIntegral (ord c))) foreign import ccall unsafe "u_gencat" wgencat :: CInt -> Int + +isPrint c = iswprint (fromIntegral (ord c)) /= 0 +isUpper c = iswupper (fromIntegral (ord c)) /= 0 + +foreign import ccall unsafe "u_iswprint" + iswprint :: CInt -> CInt + +foreign import ccall unsafe "u_iswupper" + iswupper :: CInt -> CInt #endif