-- Copyright 2013 Evan Laforge
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or http://www.gnu.org/licenses/gpl-3.0.txt

module Ui.StyleC (insert_style) where
import ForeignC

import qualified Ui.Style as Style


insert_style :: Style.StyleId -> Style.Style -> IO ()
insert_style :: StyleId -> Style -> IO ()
insert_style (Style.StyleId Word8
style_id) Style
style =
    forall a b. CStorable a => a -> (Ptr a -> IO b) -> IO b
with Style
style forall a b. (a -> b) -> a -> b
$ \Ptr Style
stylep -> CUChar -> Ptr Style -> IO ()
c_insert_style (forall a b. (Integral a, Num b) => a -> b
fromIntegral Word8
style_id) Ptr Style
stylep

foreign import ccall "insert_style"
    c_insert_style :: CUChar -> Ptr Style.Style -> IO ()