diff options
Diffstat (limited to 'HsLocale.hsc')
-rw-r--r-- | HsLocale.hsc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/HsLocale.hsc b/HsLocale.hsc new file mode 100644 index 0000000..a54ff34 --- /dev/null +++ b/HsLocale.hsc @@ -0,0 +1,27 @@ +{-# OPTIONS -fglasgow-exts #-} +----------------------------------------------------------------------------- +-- | +-- Module : HsLocale +-- Copyright : (C) 2007 Andrea Rossato +-- License : BSD3 +-- +-- Maintainer : andrea.rossato@unibz.it +-- Stability : unstable +-- Portability : unportable +-- +----------------------------------------------------------------------------- + +module HsLocale + ( setupLocale + ) where + +import Foreign.C + +#include <locale.h> +foreign import ccall unsafe "locale.h setlocale" + setlocale :: CInt -> CString -> IO CString + +setupLocale :: IO () +setupLocale = withCString "" $ \s -> do + setlocale (#const LC_ALL) s + return () |