on master help sign in
Whitespace
132d5b3Jonathan Daugherty
src/Graphics/Vty/UnicodeWidthTable/Install.hs+18−15
@@ -14,21 +14,6 @@ import Data.Semigroup ((<>))
14
14
15import Graphics.Vty.UnicodeWidthTable.Types
15import Graphics.Vty.UnicodeWidthTable.Types
16
16
17−foreign import ccall unsafe "vty_init_custom_table"
18− initCustomTable :: Int -> IO Int
19−
20−foreign import ccall unsafe "vty_set_custom_table_range"
21− setCustomTableRange :: Word32 -> Word32 -> Word8 -> IO Int
22−
23−foreign import ccall unsafe "vty_activate_custom_table"
24− activateCustomTable :: IO Int
25−
26−foreign import ccall unsafe "vty_custom_table_ready"
27− c_isCustomTableReady :: IO Int
28−
29−foreign import ccall unsafe "vty_deallocate_custom_table"
30− deallocateCustomTable :: IO ()
31−
32-- | Returns True if and only if a custom table has been allocated and
17-- | Returns True if and only if a custom table has been allocated and
33-- marked as ready for use. Returns False otherwise.
18-- marked as ready for use. Returns False otherwise.
34isCustomTableReady :: IO Bool
19isCustomTableReady :: IO Bool
@@ -91,3 +76,21 @@ installUnicodeWidthTable table = do
91 when (actResult /= 0) $
76 when (actResult /= 0) $
92 error $ "installUnicodeWidthTable: error activating custom " <>
77 error $ "installUnicodeWidthTable: error activating custom " <>
93 "table, status " <> show actResult
78 "table, status " <> show actResult
79+
80+------------------------------------------------------------------------
81+-- C imports
82+
83+foreign import ccall unsafe "vty_init_custom_table"
84+ initCustomTable :: Int -> IO Int
85+
86+foreign import ccall unsafe "vty_set_custom_table_range"
87+ setCustomTableRange :: Word32 -> Word32 -> Word8 -> IO Int
88+
89+foreign import ccall unsafe "vty_activate_custom_table"
90+ activateCustomTable :: IO Int
91+
92+foreign import ccall unsafe "vty_custom_table_ready"
93+ c_isCustomTableReady :: IO Int
94+
95+foreign import ccall unsafe "vty_deallocate_custom_table"
96+ deallocateCustomTable :: IO ()