on master help sign in
isCustomTableReady: translate C integer to Haskell Bool
21d7515Jonathan Daugherty
src/Graphics/Vty/UnicodeWidthTable/Install.hs+6−3
@@ -20,10 +20,13 @@ foreign import ccall unsafe "vty_set_custom_table_range"
20foreign import ccall unsafe "vty_activate_custom_table"
20foreign import ccall unsafe "vty_activate_custom_table"
21 activateCustomTable :: IO Int
21 activateCustomTable :: IO Int
22
22
23−-- | Returns 1 if and only if a custom table has been allocated and
24−-- marked as ready for use. Returns 0 otherwise.
25foreign import ccall unsafe "vty_custom_table_ready"
23foreign import ccall unsafe "vty_custom_table_ready"
26− isCustomTableReady :: IO Int
24+ c_isCustomTableReady :: IO Int
25+
26+-- | Returns True if and only if a custom table has been allocated and
27+-- marked as ready for use. Returns False otherwise.
28+isCustomTableReady :: IO Bool
29+isCustomTableReady = (== 1) <$> c_isCustomTableReady
27
30
28-- This is the size of the allocated custom character width table, in
31-- This is the size of the allocated custom character width table, in
29-- character slots. It's important that this be large enough to hold all
32-- character slots. It's important that this be large enough to hold all