@@ -14,21 +14,6 @@ import Data.Semigroup ((<>))
1414
1515import Graphics.Vty.UnicodeWidthTable.Types
1616
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−
3217-- | Returns True if and only if a custom table has been allocated and
3318-- marked as ready for use. Returns False otherwise.
3419isCustomTableReady :: IO Bool
@@ -91,3 +76,21 @@ installUnicodeWidthTable table = do
9176 when (actResult /= 0) $
9277 error $ "installUnicodeWidthTable: error activating custom " <>
9378 "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 ()