-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria

#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif

module GI.JavaScriptCore.Functions
    ( 

 -- * Methods
-- ** getMajorVersion #method:getMajorVersion#

    getMajorVersion                         ,


-- ** getMicroVersion #method:getMicroVersion#

    getMicroVersion                         ,


-- ** getMinorVersion #method:getMinorVersion#

    getMinorVersion                         ,


-- ** optionsForeach #method:optionsForeach#

    optionsForeach                          ,


-- ** optionsGetBoolean #method:optionsGetBoolean#

    optionsGetBoolean                       ,


-- ** optionsGetDouble #method:optionsGetDouble#

    optionsGetDouble                        ,


-- ** optionsGetInt #method:optionsGetInt#

    optionsGetInt                           ,


-- ** optionsGetOptionGroup #method:optionsGetOptionGroup#

    optionsGetOptionGroup                   ,


-- ** optionsGetRangeString #method:optionsGetRangeString#

    optionsGetRangeString                   ,


-- ** optionsGetSize #method:optionsGetSize#

    optionsGetSize                          ,


-- ** optionsGetString #method:optionsGetString#

    optionsGetString                        ,


-- ** optionsGetUint #method:optionsGetUint#

    optionsGetUint                          ,


-- ** optionsSetBoolean #method:optionsSetBoolean#

    optionsSetBoolean                       ,


-- ** optionsSetDouble #method:optionsSetDouble#

    optionsSetDouble                        ,


-- ** optionsSetInt #method:optionsSetInt#

    optionsSetInt                           ,


-- ** optionsSetRangeString #method:optionsSetRangeString#

    optionsSetRangeString                   ,


-- ** optionsSetSize #method:optionsSetSize#

    optionsSetSize                          ,


-- ** optionsSetString #method:optionsSetString#

    optionsSetString                        ,


-- ** optionsSetUint #method:optionsSetUint#

    optionsSetUint                          ,




    ) where

import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P

import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL

import qualified GI.GLib.Structs.OptionGroup as GLib.OptionGroup
import qualified GI.JavaScriptCore.Callbacks as JavaScriptCore.Callbacks

-- function options_set_uint
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_uint" jsc_options_set_uint :: 
    CString ->                              -- option : TBasicType TUTF8
    Word32 ->                               -- value : TBasicType TUInt
    IO CInt

-- | Set /@option@/ as a @/guint/@ value.
-- 
-- /Since: 2.24/
optionsSetUint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> Word32
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetUint :: Text -> Word32 -> m Bool
optionsSetUint Text
option Word32
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    CInt
result <- CString -> Word32 -> IO CInt
jsc_options_set_uint CString
option' Word32
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_set_string
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_string" jsc_options_set_string :: 
    CString ->                              -- option : TBasicType TUTF8
    CString ->                              -- value : TBasicType TUTF8
    IO CInt

-- | Set /@option@/ as a string.
-- 
-- /Since: 2.24/
optionsSetString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> T.Text
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetString :: Text -> Text -> m Bool
optionsSetString Text
option Text
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    CString
value' <- Text -> IO CString
textToCString Text
value
    CInt
result <- CString -> CString -> IO CInt
jsc_options_set_string CString
option' CString
value'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_set_size
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt64
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_size" jsc_options_set_size :: 
    CString ->                              -- option : TBasicType TUTF8
    Word64 ->                               -- value : TBasicType TUInt64
    IO CInt

-- | Set /@option@/ as a @/gsize/@ value.
-- 
-- /Since: 2.24/
optionsSetSize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> Word64
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetSize :: Text -> Word64 -> m Bool
optionsSetSize Text
option Word64
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    CInt
result <- CString -> Word64 -> IO CInt
jsc_options_set_size CString
option' Word64
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_set_range_string
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_range_string" jsc_options_set_range_string :: 
    CString ->                              -- option : TBasicType TUTF8
    CString ->                              -- value : TBasicType TUTF8
    IO CInt

-- | Set /@option@/ as a range string. The string must be in the
-- format \<emphasis>[!]&lt;low&gt;[:&lt;high&gt;]\<\/emphasis> where low and high are @/guint/@ values.
-- Values between low and high (both included) will be considered in
-- the range, unless \<emphasis>!\<\/emphasis> is used to invert the range.
-- 
-- /Since: 2.24/
optionsSetRangeString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> T.Text
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetRangeString :: Text -> Text -> m Bool
optionsSetRangeString Text
option Text
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    CString
value' <- Text -> IO CString
textToCString Text
value
    CInt
result <- CString -> CString -> IO CInt
jsc_options_set_range_string CString
option' CString
value'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_set_int
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_int" jsc_options_set_int :: 
    CString ->                              -- option : TBasicType TUTF8
    Int32 ->                                -- value : TBasicType TInt
    IO CInt

-- | Set /@option@/ as a @/gint/@ value.
-- 
-- /Since: 2.24/
optionsSetInt ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> Int32
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetInt :: Text -> Int32 -> m Bool
optionsSetInt Text
option Int32
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    CInt
result <- CString -> Int32 -> IO CInt
jsc_options_set_int CString
option' Int32
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_set_double
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TDouble
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_double" jsc_options_set_double :: 
    CString ->                              -- option : TBasicType TUTF8
    CDouble ->                              -- value : TBasicType TDouble
    IO CInt

-- | Set /@option@/ as a @/gdouble/@ value.
-- 
-- /Since: 2.24/
optionsSetDouble ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> Double
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetDouble :: Text -> Double -> m Bool
optionsSetDouble Text
option Double
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    let value' :: CDouble
value' = Double -> CDouble
forall a b. (Real a, Fractional b) => a -> b
realToFrac Double
value
    CInt
result <- CString -> CDouble -> IO CInt
jsc_options_set_double CString
option' CDouble
value'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_set_boolean
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TBoolean
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value to set" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_set_boolean" jsc_options_set_boolean :: 
    CString ->                              -- option : TBasicType TUTF8
    CInt ->                                 -- value : TBasicType TBoolean
    IO CInt

-- | Set /@option@/ as a t'P.Bool' value.
-- 
-- /Since: 2.24/
optionsSetBoolean ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> Bool
    -- ^ /@value@/: the value to set
    -> m Bool
    -- ^ __Returns:__ 'P.True' if option was correctly set or 'P.False' otherwise.
optionsSetBoolean :: Text -> Bool -> m Bool
optionsSetBoolean Text
option Bool
value = IO Bool -> m Bool
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Bool -> m Bool) -> IO Bool -> m Bool
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    let value' :: CInt
value' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Bool -> Int) -> Bool -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Bool -> Int
forall a. Enum a => a -> Int
fromEnum) Bool
value
    CInt
result <- CString -> CInt -> IO CInt
jsc_options_set_boolean CString
option' CInt
value'
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'


-- function options_get_uint
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_uint" jsc_options_get_uint :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr Word32 ->                           -- value : TBasicType TUInt
    IO CInt

-- | Get /@option@/ as a @/guint/@ value.
-- 
-- /Since: 2.24/
optionsGetUint ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, Word32))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetUint :: Text -> m (Bool, Word32)
optionsGetUint Text
option = IO (Bool, Word32) -> m (Bool, Word32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word32) -> m (Bool, Word32))
-> IO (Bool, Word32) -> m (Bool, Word32)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr Word32
value <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
    CInt
result <- CString -> Ptr Word32 -> IO CInt
jsc_options_get_uint CString
option' Ptr Word32
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Word32
value' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
value
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
value
    (Bool, Word32) -> IO (Bool, Word32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word32
value')


-- function options_get_string
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_string" jsc_options_get_string :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr CString ->                          -- value : TBasicType TUTF8
    IO CInt

-- | Get /@option@/ as a string.
-- 
-- /Since: 2.24/
optionsGetString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, T.Text))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetString :: Text -> m (Bool, Text)
optionsGetString Text
option = IO (Bool, Text) -> m (Bool, Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Text) -> m (Bool, Text))
-> IO (Bool, Text) -> m (Bool, Text)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr CString
value <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
    CInt
result <- CString -> Ptr CString -> IO CInt
jsc_options_get_string CString
option' Ptr CString
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString
value' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
value
    Text
value'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
value'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
value
    (Bool, Text) -> IO (Bool, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Text
value'')


-- function options_get_size
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUInt64
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_size" jsc_options_get_size :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr Word64 ->                           -- value : TBasicType TUInt64
    IO CInt

-- | Get /@option@/ as a @/gsize/@ value.
-- 
-- /Since: 2.24/
optionsGetSize ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, Word64))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetSize :: Text -> m (Bool, Word64)
optionsGetSize Text
option = IO (Bool, Word64) -> m (Bool, Word64)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Word64) -> m (Bool, Word64))
-> IO (Bool, Word64) -> m (Bool, Word64)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr Word64
value <- IO (Ptr Word64)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word64)
    CInt
result <- CString -> Ptr Word64 -> IO CInt
jsc_options_get_size CString
option' Ptr Word64
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Word64
value' <- Ptr Word64 -> IO Word64
forall a. Storable a => Ptr a -> IO a
peek Ptr Word64
value
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr Word64 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word64
value
    (Bool, Word64) -> IO (Bool, Word64)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Word64
value')


-- function options_get_range_string
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TUTF8
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_range_string" jsc_options_get_range_string :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr CString ->                          -- value : TBasicType TUTF8
    IO CInt

-- | Get /@option@/ as a range string. The string must be in the
-- format \<emphasis>[!]&lt;low&gt;[:&lt;high&gt;]\<\/emphasis> where low and high are @/guint/@ values.
-- Values between low and high (both included) will be considered in
-- the range, unless \<emphasis>!\<\/emphasis> is used to invert the range.
-- 
-- /Since: 2.24/
optionsGetRangeString ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, T.Text))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetRangeString :: Text -> m (Bool, Text)
optionsGetRangeString Text
option = IO (Bool, Text) -> m (Bool, Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Text) -> m (Bool, Text))
-> IO (Bool, Text) -> m (Bool, Text)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr CString
value <- IO (Ptr CString)
forall a. Storable a => IO (Ptr a)
callocMem :: IO (Ptr CString)
    CInt
result <- CString -> Ptr CString -> IO CInt
jsc_options_get_range_string CString
option' Ptr CString
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CString
value' <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek Ptr CString
value
    Text
value'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
value'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
value'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
value
    (Bool, Text) -> IO (Bool, Text)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Text
value'')


-- function options_get_option_group
-- Args: []
-- Lengths: []
-- returnType: Just
--               (TInterface Name { namespace = "GLib" , name = "OptionGroup" })
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_option_group" jsc_options_get_option_group :: 
    IO (Ptr GLib.OptionGroup.OptionGroup)

-- | Create a t'GI.GLib.Structs.OptionGroup.OptionGroup' to handle JSCOptions as command line arguments.
-- The options will be exposed as command line arguments with the form
-- \<emphasis>--jsc-&lt;option&gt;=&lt;value&gt;\<\/emphasis>.
-- Each entry in the returned t'GI.GLib.Structs.OptionGroup.OptionGroup' is configured to apply the
-- corresponding option during command line parsing. Applications only need to
-- pass the returned group to 'GI.GLib.Structs.OptionContext.optionContextAddGroup', and the rest will
-- be taken care for automatically.
-- 
-- /Since: 2.24/
optionsGetOptionGroup ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m GLib.OptionGroup.OptionGroup
    -- ^ __Returns:__ a t'GI.GLib.Structs.OptionGroup.OptionGroup' for the JSCOptions
optionsGetOptionGroup :: m OptionGroup
optionsGetOptionGroup  = IO OptionGroup -> m OptionGroup
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO OptionGroup -> m OptionGroup)
-> IO OptionGroup -> m OptionGroup
forall a b. (a -> b) -> a -> b
$ do
    Ptr OptionGroup
result <- IO (Ptr OptionGroup)
jsc_options_get_option_group
    Text -> Ptr OptionGroup -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"optionsGetOptionGroup" Ptr OptionGroup
result
    OptionGroup
result' <- ((ManagedPtr OptionGroup -> OptionGroup)
-> Ptr OptionGroup -> IO OptionGroup
forall a.
(HasCallStack, GBoxed a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapBoxed ManagedPtr OptionGroup -> OptionGroup
GLib.OptionGroup.OptionGroup) Ptr OptionGroup
result
    OptionGroup -> IO OptionGroup
forall (m :: * -> *) a. Monad m => a -> m a
return OptionGroup
result'


-- function options_get_int
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TInt
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_int" jsc_options_get_int :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr Int32 ->                            -- value : TBasicType TInt
    IO CInt

-- | Get /@option@/ as a @/gint/@ value.
-- 
-- /Since: 2.24/
optionsGetInt ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, Int32))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetInt :: Text -> m (Bool, Int32)
optionsGetInt Text
option = IO (Bool, Int32) -> m (Bool, Int32)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Int32) -> m (Bool, Int32))
-> IO (Bool, Int32) -> m (Bool, Int32)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr Int32
value <- IO (Ptr Int32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Int32)
    CInt
result <- CString -> Ptr Int32 -> IO CInt
jsc_options_get_int CString
option' Ptr Int32
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    Int32
value' <- Ptr Int32 -> IO Int32
forall a. Storable a => Ptr a -> IO a
peek Ptr Int32
value
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr Int32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Int32
value
    (Bool, Int32) -> IO (Bool, Int32)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Int32
value')


-- function options_get_double
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TDouble
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_double" jsc_options_get_double :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr CDouble ->                          -- value : TBasicType TDouble
    IO CInt

-- | Get /@option@/ as a @/gdouble/@ value.
-- 
-- /Since: 2.24/
optionsGetDouble ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, Double))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetDouble :: Text -> m (Bool, Double)
optionsGetDouble Text
option = IO (Bool, Double) -> m (Bool, Double)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Double) -> m (Bool, Double))
-> IO (Bool, Double) -> m (Bool, Double)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr CDouble
value <- IO (Ptr CDouble)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CDouble)
    CInt
result <- CString -> Ptr CDouble -> IO CInt
jsc_options_get_double CString
option' Ptr CDouble
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CDouble
value' <- Ptr CDouble -> IO CDouble
forall a. Storable a => Ptr a -> IO a
peek Ptr CDouble
value
    let value'' :: Double
value'' = CDouble -> Double
forall a b. (Real a, Fractional b) => a -> b
realToFrac CDouble
value'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr CDouble -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CDouble
value
    (Bool, Double) -> IO (Bool, Double)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Double
value'')


-- function options_get_boolean
-- Args: [ Arg
--           { argCName = "option"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the option identifier"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TBoolean
--           , direction = DirectionOut
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "return location for the option value"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferEverything
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TBoolean)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_get_boolean" jsc_options_get_boolean :: 
    CString ->                              -- option : TBasicType TUTF8
    Ptr CInt ->                             -- value : TBasicType TBoolean
    IO CInt

-- | Get /@option@/ as a t'P.Bool' value.
-- 
-- /Since: 2.24/
optionsGetBoolean ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    T.Text
    -- ^ /@option@/: the option identifier
    -> m ((Bool, Bool))
    -- ^ __Returns:__ 'P.True' if /@value@/ has been set or 'P.False' if the option doesn\'t exist
optionsGetBoolean :: Text -> m (Bool, Bool)
optionsGetBoolean Text
option = IO (Bool, Bool) -> m (Bool, Bool)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Bool, Bool) -> m (Bool, Bool))
-> IO (Bool, Bool) -> m (Bool, Bool)
forall a b. (a -> b) -> a -> b
$ do
    CString
option' <- Text -> IO CString
textToCString Text
option
    Ptr CInt
value <- IO (Ptr CInt)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr CInt)
    CInt
result <- CString -> Ptr CInt -> IO CInt
jsc_options_get_boolean CString
option' Ptr CInt
value
    let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
    CInt
value' <- Ptr CInt -> IO CInt
forall a. Storable a => Ptr a -> IO a
peek Ptr CInt
value
    let value'' :: Bool
value'' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
value'
    CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
option'
    Ptr CInt -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CInt
value
    (Bool, Bool) -> IO (Bool, Bool)
forall (m :: * -> *) a. Monad m => a -> m a
return (Bool
result', Bool
value'')


-- function options_foreach
-- Args: [ Arg
--           { argCName = "function"
--           , argType =
--               TInterface
--                 Name { namespace = "JavaScriptCore" , name = "OptionsFunc" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #JSCOptionsFunc callback"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeCall
--           , argClosure = 1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "user_data"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "callback user data" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "jsc_options_foreach" jsc_options_foreach :: 
    FunPtr JavaScriptCore.Callbacks.C_OptionsFunc -> -- function : TInterface (Name {namespace = "JavaScriptCore", name = "OptionsFunc"})
    Ptr () ->                               -- user_data : TBasicType TPtr
    IO ()

-- | Iterates all available options calling /@function@/ for each one. Iteration can
-- stop early if /@function@/ returns 'P.False'.
-- 
-- /Since: 2.24/
optionsForeach ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    JavaScriptCore.Callbacks.OptionsFunc
    -- ^ /@function@/: a t'GI.JavaScriptCore.Callbacks.OptionsFunc' callback
    -> m ()
optionsForeach :: OptionsFunc -> m ()
optionsForeach OptionsFunc
function = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
    FunPtr C_OptionsFunc
function' <- C_OptionsFunc -> IO (FunPtr C_OptionsFunc)
JavaScriptCore.Callbacks.mk_OptionsFunc (Maybe (Ptr (FunPtr C_OptionsFunc))
-> OptionsFunc_WithClosures -> C_OptionsFunc
JavaScriptCore.Callbacks.wrap_OptionsFunc Maybe (Ptr (FunPtr C_OptionsFunc))
forall a. Maybe a
Nothing (OptionsFunc -> OptionsFunc_WithClosures
JavaScriptCore.Callbacks.drop_closures_OptionsFunc OptionsFunc
function))
    let userData :: Ptr a
userData = Ptr a
forall a. Ptr a
nullPtr
    FunPtr C_OptionsFunc -> Ptr () -> IO ()
jsc_options_foreach FunPtr C_OptionsFunc
function' Ptr ()
forall a. Ptr a
userData
    Ptr Any -> IO ()
forall a. Ptr a -> IO ()
safeFreeFunPtr (Ptr Any -> IO ()) -> Ptr Any -> IO ()
forall a b. (a -> b) -> a -> b
$ FunPtr C_OptionsFunc -> Ptr Any
forall a b. FunPtr a -> Ptr b
castFunPtrToPtr FunPtr C_OptionsFunc
function'
    () -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()


-- function get_minor_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_get_minor_version" jsc_get_minor_version :: 
    IO Word32

-- | Returns the minor version number of the JavaScriptCore library.
-- (e.g. in JavaScriptCore version 1.8.3 this is 8.)
-- 
-- This function is in the library, so it represents the JavaScriptCore library
-- your code is running against. Contrast with the 'GI.JavaScriptCore.Constants.MINOR_VERSION'
-- macro, which represents the minor version of the JavaScriptCore headers you
-- have included when compiling your code.
getMinorVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the minor version number of the JavaScriptCore library
getMinorVersion :: m Word32
getMinorVersion  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
jsc_get_minor_version
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_micro_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_get_micro_version" jsc_get_micro_version :: 
    IO Word32

-- | Returns the micro version number of the JavaScriptCore library.
-- (e.g. in JavaScriptCore version 1.8.3 this is 3.)
-- 
-- This function is in the library, so it represents the JavaScriptCore library
-- your code is running against. Contrast with the 'GI.JavaScriptCore.Constants.MICRO_VERSION'
-- macro, which represents the micro version of the JavaScriptCore headers you
-- have included when compiling your code.
getMicroVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the micro version number of the JavaScriptCore library
getMicroVersion :: m Word32
getMicroVersion  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
jsc_get_micro_version
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result


-- function get_major_version
-- Args: []
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "jsc_get_major_version" jsc_get_major_version :: 
    IO Word32

-- | Returns the major version number of the JavaScriptCore library.
-- (e.g. in JavaScriptCore version 1.8.3 this is 1.)
-- 
-- This function is in the library, so it represents the JavaScriptCore library
-- your code is running against. Contrast with the 'GI.JavaScriptCore.Constants.MAJOR_VERSION'
-- macro, which represents the major version of the JavaScriptCore headers you
-- have included when compiling your code.
getMajorVersion ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    m Word32
    -- ^ __Returns:__ the major version number of the JavaScriptCore library
getMajorVersion :: m Word32
getMajorVersion  = IO Word32 -> m Word32
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Word32 -> m Word32) -> IO Word32 -> m Word32
forall a b. (a -> b) -> a -> b
$ do
    Word32
result <- IO Word32
jsc_get_major_version
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result