{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.GLib.Structs.Scanner
(
Scanner(..) ,
newZeroScanner ,
#if defined(ENABLE_OVERLOADING)
ResolveScannerMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
ScannerCurLineMethodInfo ,
#endif
scannerCurLine ,
#if defined(ENABLE_OVERLOADING)
ScannerCurPositionMethodInfo ,
#endif
scannerCurPosition ,
#if defined(ENABLE_OVERLOADING)
ScannerCurTokenMethodInfo ,
#endif
scannerCurToken ,
#if defined(ENABLE_OVERLOADING)
ScannerDestroyMethodInfo ,
#endif
scannerDestroy ,
#if defined(ENABLE_OVERLOADING)
ScannerEofMethodInfo ,
#endif
scannerEof ,
#if defined(ENABLE_OVERLOADING)
ScannerGetNextTokenMethodInfo ,
#endif
scannerGetNextToken ,
#if defined(ENABLE_OVERLOADING)
ScannerInputFileMethodInfo ,
#endif
scannerInputFile ,
#if defined(ENABLE_OVERLOADING)
ScannerInputTextMethodInfo ,
#endif
scannerInputText ,
#if defined(ENABLE_OVERLOADING)
ScannerLookupSymbolMethodInfo ,
#endif
scannerLookupSymbol ,
#if defined(ENABLE_OVERLOADING)
ScannerPeekNextTokenMethodInfo ,
#endif
scannerPeekNextToken ,
#if defined(ENABLE_OVERLOADING)
ScannerScopeAddSymbolMethodInfo ,
#endif
scannerScopeAddSymbol ,
#if defined(ENABLE_OVERLOADING)
ScannerScopeLookupSymbolMethodInfo ,
#endif
scannerScopeLookupSymbol ,
#if defined(ENABLE_OVERLOADING)
ScannerScopeRemoveSymbolMethodInfo ,
#endif
scannerScopeRemoveSymbol ,
#if defined(ENABLE_OVERLOADING)
ScannerSetScopeMethodInfo ,
#endif
scannerSetScope ,
#if defined(ENABLE_OVERLOADING)
ScannerSyncFileOffsetMethodInfo ,
#endif
scannerSyncFileOffset ,
#if defined(ENABLE_OVERLOADING)
ScannerUnexpTokenMethodInfo ,
#endif
scannerUnexpToken ,
clearScannerConfig ,
getScannerConfig ,
#if defined(ENABLE_OVERLOADING)
scanner_config ,
#endif
setScannerConfig ,
clearScannerInputName ,
getScannerInputName ,
#if defined(ENABLE_OVERLOADING)
scanner_inputName ,
#endif
setScannerInputName ,
getScannerLine ,
#if defined(ENABLE_OVERLOADING)
scanner_line ,
#endif
setScannerLine ,
getScannerMaxParseErrors ,
#if defined(ENABLE_OVERLOADING)
scanner_maxParseErrors ,
#endif
setScannerMaxParseErrors ,
clearScannerMsgHandler ,
getScannerMsgHandler ,
#if defined(ENABLE_OVERLOADING)
scanner_msgHandler ,
#endif
setScannerMsgHandler ,
getScannerNextLine ,
#if defined(ENABLE_OVERLOADING)
scanner_nextLine ,
#endif
setScannerNextLine ,
getScannerNextPosition ,
#if defined(ENABLE_OVERLOADING)
scanner_nextPosition ,
#endif
setScannerNextPosition ,
getScannerNextToken ,
#if defined(ENABLE_OVERLOADING)
scanner_nextToken ,
#endif
setScannerNextToken ,
getScannerNextValue ,
#if defined(ENABLE_OVERLOADING)
scanner_nextValue ,
#endif
getScannerParseErrors ,
#if defined(ENABLE_OVERLOADING)
scanner_parseErrors ,
#endif
setScannerParseErrors ,
getScannerPosition ,
#if defined(ENABLE_OVERLOADING)
scanner_position ,
#endif
setScannerPosition ,
clearScannerQdata ,
getScannerQdata ,
#if defined(ENABLE_OVERLOADING)
scanner_qdata ,
#endif
setScannerQdata ,
getScannerToken ,
#if defined(ENABLE_OVERLOADING)
scanner_token ,
#endif
setScannerToken ,
clearScannerUserData ,
getScannerUserData ,
#if defined(ENABLE_OVERLOADING)
scanner_userData ,
#endif
setScannerUserData ,
getScannerValue ,
#if defined(ENABLE_OVERLOADING)
scanner_value ,
#endif
) 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.GArray as B.GArray
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.Coerce as Coerce
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 GHC.Records as R
import qualified GI.GLib.Callbacks as GLib.Callbacks
import {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums
import {-# SOURCE #-} qualified GI.GLib.Structs.Data as GLib.Data
import {-# SOURCE #-} qualified GI.GLib.Structs.ScannerConfig as GLib.ScannerConfig
import {-# SOURCE #-} qualified GI.GLib.Unions.TokenValue as GLib.TokenValue
newtype Scanner = Scanner (SP.ManagedPtr Scanner)
deriving (Scanner -> Scanner -> Bool
(Scanner -> Scanner -> Bool)
-> (Scanner -> Scanner -> Bool) -> Eq Scanner
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Scanner -> Scanner -> Bool
$c/= :: Scanner -> Scanner -> Bool
== :: Scanner -> Scanner -> Bool
$c== :: Scanner -> Scanner -> Bool
Eq)
instance SP.ManagedPtrNewtype Scanner where
toManagedPtr :: Scanner -> ManagedPtr Scanner
toManagedPtr (Scanner ManagedPtr Scanner
p) = ManagedPtr Scanner
p
instance BoxedPtr Scanner where
boxedPtrCopy :: Scanner -> IO Scanner
boxedPtrCopy = \Scanner
p -> Scanner -> (Ptr Scanner -> IO Scanner) -> IO Scanner
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr Scanner
p (Int -> Ptr Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, CallocPtr a) => Int -> Ptr a -> IO (Ptr a)
copyBytes Int
144 (Ptr Scanner -> IO (Ptr Scanner))
-> (Ptr Scanner -> IO Scanner) -> Ptr Scanner -> IO Scanner
forall (m :: * -> *) a b c.
Monad m =>
(a -> m b) -> (b -> m c) -> a -> m c
>=> (ManagedPtr Scanner -> Scanner) -> Ptr Scanner -> IO Scanner
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
B.ManagedPtr.wrapPtr ManagedPtr Scanner -> Scanner
Scanner)
boxedPtrFree :: Scanner -> IO ()
boxedPtrFree = \Scanner
x -> Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
SP.withManagedPtr Scanner
x Ptr Scanner -> IO ()
forall a. Ptr a -> IO ()
SP.freeMem
instance CallocPtr Scanner where
boxedPtrCalloc :: IO (Ptr Scanner)
boxedPtrCalloc = Int -> IO (Ptr Scanner)
forall a. Int -> IO (Ptr a)
callocBytes Int
144
newZeroScanner :: MonadIO m => m Scanner
newZeroScanner :: forall (m :: * -> *). MonadIO m => m Scanner
newZeroScanner = IO Scanner -> m Scanner
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Scanner -> m Scanner) -> IO Scanner -> m Scanner
forall a b. (a -> b) -> a -> b
$ IO (Ptr Scanner)
forall a. CallocPtr a => IO (Ptr a)
boxedPtrCalloc IO (Ptr Scanner) -> (Ptr Scanner -> IO Scanner) -> IO Scanner
forall (m :: * -> *) a b. Monad m => m a -> (a -> m b) -> m b
>>= (ManagedPtr Scanner -> Scanner) -> Ptr Scanner -> IO Scanner
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Scanner -> Scanner
Scanner
instance tag ~ 'AttrSet => Constructible Scanner tag where
new :: forall (m :: * -> *).
MonadIO m =>
(ManagedPtr Scanner -> Scanner)
-> [AttrOp Scanner tag] -> m Scanner
new ManagedPtr Scanner -> Scanner
_ [AttrOp Scanner tag]
attrs = do
Scanner
o <- m Scanner
forall (m :: * -> *). MonadIO m => m Scanner
newZeroScanner
Scanner -> [AttrOp Scanner 'AttrSet] -> m ()
forall o (m :: * -> *).
MonadIO m =>
o -> [AttrOp o 'AttrSet] -> m ()
GI.Attributes.set Scanner
o [AttrOp Scanner tag]
[AttrOp Scanner 'AttrSet]
attrs
Scanner -> m Scanner
forall (m :: * -> *) a. Monad m => a -> m a
return Scanner
o
getScannerUserData :: MonadIO m => Scanner -> m (Ptr ())
getScannerUserData :: forall (m :: * -> *). MonadIO m => Scanner -> m (Ptr ())
getScannerUserData Scanner
s = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO (Ptr ())) -> IO (Ptr ())
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO (Ptr ())) -> IO (Ptr ()))
-> (Ptr Scanner -> IO (Ptr ())) -> IO (Ptr ())
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr ()
val <- Ptr (Ptr ()) -> IO (Ptr ())
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) :: IO (Ptr ())
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val
setScannerUserData :: MonadIO m => Scanner -> Ptr () -> m ()
setScannerUserData :: forall (m :: * -> *). MonadIO m => Scanner -> Ptr () -> m ()
setScannerUserData Scanner
s Ptr ()
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
val :: Ptr ())
clearScannerUserData :: MonadIO m => Scanner -> m ()
clearScannerUserData :: forall (m :: * -> *). MonadIO m => Scanner -> m ()
clearScannerUserData Scanner
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (Ptr ()) -> Ptr () -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr ())
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
0) (Ptr ()
forall a. Ptr a
FP.nullPtr :: Ptr ())
#if defined(ENABLE_OVERLOADING)
data ScannerUserDataFieldInfo
instance AttrInfo ScannerUserDataFieldInfo where
type AttrBaseTypeConstraint ScannerUserDataFieldInfo = (~) Scanner
type AttrAllowedOps ScannerUserDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerUserDataFieldInfo = (~) (Ptr ())
type AttrTransferTypeConstraint ScannerUserDataFieldInfo = (~)(Ptr ())
type AttrTransferType ScannerUserDataFieldInfo = (Ptr ())
type AttrGetType ScannerUserDataFieldInfo = Ptr ()
type AttrLabel ScannerUserDataFieldInfo = "user_data"
type AttrOrigin ScannerUserDataFieldInfo = Scanner
attrGet = getScannerUserData
attrSet = setScannerUserData
attrConstruct = undefined
attrClear = clearScannerUserData
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.userData"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:userData"
})
scanner_userData :: AttrLabelProxy "userData"
scanner_userData = AttrLabelProxy
#endif
getScannerMaxParseErrors :: MonadIO m => Scanner -> m Word32
getScannerMaxParseErrors :: forall (m :: * -> *). MonadIO m => Scanner -> m Word32
getScannerMaxParseErrors Scanner
s = 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
$ Scanner -> (Ptr Scanner -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO Word32) -> IO Word32)
-> (Ptr Scanner -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setScannerMaxParseErrors :: MonadIO m => Scanner -> Word32 -> m ()
setScannerMaxParseErrors :: forall (m :: * -> *). MonadIO m => Scanner -> Word32 -> m ()
setScannerMaxParseErrors Scanner
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
8) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data ScannerMaxParseErrorsFieldInfo
instance AttrInfo ScannerMaxParseErrorsFieldInfo where
type AttrBaseTypeConstraint ScannerMaxParseErrorsFieldInfo = (~) Scanner
type AttrAllowedOps ScannerMaxParseErrorsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerMaxParseErrorsFieldInfo = (~) Word32
type AttrTransferTypeConstraint ScannerMaxParseErrorsFieldInfo = (~)Word32
type AttrTransferType ScannerMaxParseErrorsFieldInfo = Word32
type AttrGetType ScannerMaxParseErrorsFieldInfo = Word32
type AttrLabel ScannerMaxParseErrorsFieldInfo = "max_parse_errors"
type AttrOrigin ScannerMaxParseErrorsFieldInfo = Scanner
attrGet = getScannerMaxParseErrors
attrSet = setScannerMaxParseErrors
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.maxParseErrors"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:maxParseErrors"
})
scanner_maxParseErrors :: AttrLabelProxy "maxParseErrors"
scanner_maxParseErrors = AttrLabelProxy
#endif
getScannerParseErrors :: MonadIO m => Scanner -> m Word32
getScannerParseErrors :: forall (m :: * -> *). MonadIO m => Scanner -> m Word32
getScannerParseErrors Scanner
s = 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
$ Scanner -> (Ptr Scanner -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO Word32) -> IO Word32)
-> (Ptr Scanner -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setScannerParseErrors :: MonadIO m => Scanner -> Word32 -> m ()
setScannerParseErrors :: forall (m :: * -> *). MonadIO m => Scanner -> Word32 -> m ()
setScannerParseErrors Scanner
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
12) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data ScannerParseErrorsFieldInfo
instance AttrInfo ScannerParseErrorsFieldInfo where
type AttrBaseTypeConstraint ScannerParseErrorsFieldInfo = (~) Scanner
type AttrAllowedOps ScannerParseErrorsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerParseErrorsFieldInfo = (~) Word32
type AttrTransferTypeConstraint ScannerParseErrorsFieldInfo = (~)Word32
type AttrTransferType ScannerParseErrorsFieldInfo = Word32
type AttrGetType ScannerParseErrorsFieldInfo = Word32
type AttrLabel ScannerParseErrorsFieldInfo = "parse_errors"
type AttrOrigin ScannerParseErrorsFieldInfo = Scanner
attrGet = getScannerParseErrors
attrSet = setScannerParseErrors
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.parseErrors"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:parseErrors"
})
scanner_parseErrors :: AttrLabelProxy "parseErrors"
scanner_parseErrors = AttrLabelProxy
#endif
getScannerInputName :: MonadIO m => Scanner -> m (Maybe T.Text)
getScannerInputName :: forall (m :: * -> *). MonadIO m => Scanner -> m (Maybe Text)
getScannerInputName Scanner
s = IO (Maybe Text) -> m (Maybe Text)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Text) -> m (Maybe Text))
-> IO (Maybe Text) -> m (Maybe Text)
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO (Maybe Text)) -> IO (Maybe Text)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO (Maybe Text)) -> IO (Maybe Text))
-> (Ptr Scanner -> IO (Maybe Text)) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
CString
val <- Ptr CString -> IO CString
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) :: IO CString
Maybe Text
result <- CString -> (CString -> IO Text) -> IO (Maybe Text)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull CString
val ((CString -> IO Text) -> IO (Maybe Text))
-> (CString -> IO Text) -> IO (Maybe Text)
forall a b. (a -> b) -> a -> b
$ \CString
val' -> do
Text
val'' <- HasCallStack => CString -> IO Text
CString -> IO Text
cstringToText CString
val'
Text -> IO Text
forall (m :: * -> *) a. Monad m => a -> m a
return Text
val''
Maybe Text -> IO (Maybe Text)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Text
result
setScannerInputName :: MonadIO m => Scanner -> CString -> m ()
setScannerInputName :: forall (m :: * -> *). MonadIO m => Scanner -> CString -> m ()
setScannerInputName Scanner
s CString
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CString
val :: CString)
clearScannerInputName :: MonadIO m => Scanner -> m ()
clearScannerInputName :: forall (m :: * -> *). MonadIO m => Scanner -> m ()
clearScannerInputName Scanner
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr CString -> CString -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CString
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
16) (CString
forall a. Ptr a
FP.nullPtr :: CString)
#if defined(ENABLE_OVERLOADING)
data ScannerInputNameFieldInfo
instance AttrInfo ScannerInputNameFieldInfo where
type AttrBaseTypeConstraint ScannerInputNameFieldInfo = (~) Scanner
type AttrAllowedOps ScannerInputNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerInputNameFieldInfo = (~) CString
type AttrTransferTypeConstraint ScannerInputNameFieldInfo = (~)CString
type AttrTransferType ScannerInputNameFieldInfo = CString
type AttrGetType ScannerInputNameFieldInfo = Maybe T.Text
type AttrLabel ScannerInputNameFieldInfo = "input_name"
type AttrOrigin ScannerInputNameFieldInfo = Scanner
attrGet = getScannerInputName
attrSet = setScannerInputName
attrConstruct = undefined
attrClear = clearScannerInputName
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.inputName"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:inputName"
})
scanner_inputName :: AttrLabelProxy "inputName"
scanner_inputName = AttrLabelProxy
#endif
getScannerQdata :: MonadIO m => Scanner -> m (Maybe GLib.Data.Data)
getScannerQdata :: forall (m :: * -> *). MonadIO m => Scanner -> m (Maybe Data)
getScannerQdata Scanner
s = IO (Maybe Data) -> m (Maybe Data)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe Data) -> m (Maybe Data))
-> IO (Maybe Data) -> m (Maybe Data)
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO (Maybe Data)) -> IO (Maybe Data)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO (Maybe Data)) -> IO (Maybe Data))
-> (Ptr Scanner -> IO (Maybe Data)) -> IO (Maybe Data)
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Data
val <- Ptr (Ptr Data) -> IO (Ptr Data)
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr Data)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) :: IO (Ptr GLib.Data.Data)
Maybe Data
result <- Ptr Data -> (Ptr Data -> IO Data) -> IO (Maybe Data)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr Data
val ((Ptr Data -> IO Data) -> IO (Maybe Data))
-> (Ptr Data -> IO Data) -> IO (Maybe Data)
forall a b. (a -> b) -> a -> b
$ \Ptr Data
val' -> do
Data
val'' <- ((ManagedPtr Data -> Data) -> Ptr Data -> IO Data
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr Data -> Data
GLib.Data.Data) Ptr Data
val'
Data -> IO Data
forall (m :: * -> *) a. Monad m => a -> m a
return Data
val''
Maybe Data -> IO (Maybe Data)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe Data
result
setScannerQdata :: MonadIO m => Scanner -> Ptr GLib.Data.Data -> m ()
setScannerQdata :: forall (m :: * -> *). MonadIO m => Scanner -> Ptr Data -> m ()
setScannerQdata Scanner
s Ptr Data
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (Ptr Data) -> Ptr Data -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr Data)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr Data
val :: Ptr GLib.Data.Data)
clearScannerQdata :: MonadIO m => Scanner -> m ()
clearScannerQdata :: forall (m :: * -> *). MonadIO m => Scanner -> m ()
clearScannerQdata Scanner
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (Ptr Data) -> Ptr Data -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr Data)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
24) (Ptr Data
forall a. Ptr a
FP.nullPtr :: Ptr GLib.Data.Data)
#if defined(ENABLE_OVERLOADING)
data ScannerQdataFieldInfo
instance AttrInfo ScannerQdataFieldInfo where
type AttrBaseTypeConstraint ScannerQdataFieldInfo = (~) Scanner
type AttrAllowedOps ScannerQdataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerQdataFieldInfo = (~) (Ptr GLib.Data.Data)
type AttrTransferTypeConstraint ScannerQdataFieldInfo = (~)(Ptr GLib.Data.Data)
type AttrTransferType ScannerQdataFieldInfo = (Ptr GLib.Data.Data)
type AttrGetType ScannerQdataFieldInfo = Maybe GLib.Data.Data
type AttrLabel ScannerQdataFieldInfo = "qdata"
type AttrOrigin ScannerQdataFieldInfo = Scanner
attrGet = getScannerQdata
attrSet = setScannerQdata
attrConstruct = undefined
attrClear = clearScannerQdata
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.qdata"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:qdata"
})
scanner_qdata :: AttrLabelProxy "qdata"
scanner_qdata = AttrLabelProxy
#endif
getScannerConfig :: MonadIO m => Scanner -> m (Maybe GLib.ScannerConfig.ScannerConfig)
getScannerConfig :: forall (m :: * -> *).
MonadIO m =>
Scanner -> m (Maybe ScannerConfig)
getScannerConfig Scanner
s = IO (Maybe ScannerConfig) -> m (Maybe ScannerConfig)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ScannerConfig) -> m (Maybe ScannerConfig))
-> IO (Maybe ScannerConfig) -> m (Maybe ScannerConfig)
forall a b. (a -> b) -> a -> b
$ Scanner
-> (Ptr Scanner -> IO (Maybe ScannerConfig))
-> IO (Maybe ScannerConfig)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO (Maybe ScannerConfig))
-> IO (Maybe ScannerConfig))
-> (Ptr Scanner -> IO (Maybe ScannerConfig))
-> IO (Maybe ScannerConfig)
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr ScannerConfig
val <- Ptr (Ptr ScannerConfig) -> IO (Ptr ScannerConfig)
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr ScannerConfig)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) :: IO (Ptr GLib.ScannerConfig.ScannerConfig)
Maybe ScannerConfig
result <- Ptr ScannerConfig
-> (Ptr ScannerConfig -> IO ScannerConfig)
-> IO (Maybe ScannerConfig)
forall a b. Ptr a -> (Ptr a -> IO b) -> IO (Maybe b)
SP.convertIfNonNull Ptr ScannerConfig
val ((Ptr ScannerConfig -> IO ScannerConfig)
-> IO (Maybe ScannerConfig))
-> (Ptr ScannerConfig -> IO ScannerConfig)
-> IO (Maybe ScannerConfig)
forall a b. (a -> b) -> a -> b
$ \Ptr ScannerConfig
val' -> do
ScannerConfig
val'' <- ((ManagedPtr ScannerConfig -> ScannerConfig)
-> Ptr ScannerConfig -> IO ScannerConfig
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr ScannerConfig -> ScannerConfig
GLib.ScannerConfig.ScannerConfig) Ptr ScannerConfig
val'
ScannerConfig -> IO ScannerConfig
forall (m :: * -> *) a. Monad m => a -> m a
return ScannerConfig
val''
Maybe ScannerConfig -> IO (Maybe ScannerConfig)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ScannerConfig
result
setScannerConfig :: MonadIO m => Scanner -> Ptr GLib.ScannerConfig.ScannerConfig -> m ()
setScannerConfig :: forall (m :: * -> *).
MonadIO m =>
Scanner -> Ptr ScannerConfig -> m ()
setScannerConfig Scanner
s Ptr ScannerConfig
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (Ptr ScannerConfig) -> Ptr ScannerConfig -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr ScannerConfig)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (Ptr ScannerConfig
val :: Ptr GLib.ScannerConfig.ScannerConfig)
clearScannerConfig :: MonadIO m => Scanner -> m ()
clearScannerConfig :: forall (m :: * -> *). MonadIO m => Scanner -> m ()
clearScannerConfig Scanner
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (Ptr ScannerConfig) -> Ptr ScannerConfig -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (Ptr ScannerConfig)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
32) (Ptr ScannerConfig
forall a. Ptr a
FP.nullPtr :: Ptr GLib.ScannerConfig.ScannerConfig)
#if defined(ENABLE_OVERLOADING)
data ScannerConfigFieldInfo
instance AttrInfo ScannerConfigFieldInfo where
type AttrBaseTypeConstraint ScannerConfigFieldInfo = (~) Scanner
type AttrAllowedOps ScannerConfigFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerConfigFieldInfo = (~) (Ptr GLib.ScannerConfig.ScannerConfig)
type AttrTransferTypeConstraint ScannerConfigFieldInfo = (~)(Ptr GLib.ScannerConfig.ScannerConfig)
type AttrTransferType ScannerConfigFieldInfo = (Ptr GLib.ScannerConfig.ScannerConfig)
type AttrGetType ScannerConfigFieldInfo = Maybe GLib.ScannerConfig.ScannerConfig
type AttrLabel ScannerConfigFieldInfo = "config"
type AttrOrigin ScannerConfigFieldInfo = Scanner
attrGet = getScannerConfig
attrSet = setScannerConfig
attrConstruct = undefined
attrClear = clearScannerConfig
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.config"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:config"
})
scanner_config :: AttrLabelProxy "config"
scanner_config = AttrLabelProxy
#endif
getScannerToken :: MonadIO m => Scanner -> m GLib.Enums.TokenType
getScannerToken :: forall (m :: * -> *). MonadIO m => Scanner -> m TokenType
getScannerToken Scanner
s = IO TokenType -> m TokenType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenType -> m TokenType) -> IO TokenType -> m TokenType
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO TokenType) -> IO TokenType
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO TokenType) -> IO TokenType)
-> (Ptr Scanner -> IO TokenType) -> IO TokenType
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) :: IO CUInt
let val' :: TokenType
val' = (Int -> TokenType
forall a. Enum a => Int -> a
toEnum (Int -> TokenType) -> (CUInt -> Int) -> CUInt -> TokenType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
val
TokenType -> IO TokenType
forall (m :: * -> *) a. Monad m => a -> m a
return TokenType
val'
setScannerToken :: MonadIO m => Scanner -> GLib.Enums.TokenType -> m ()
setScannerToken :: forall (m :: * -> *). MonadIO m => Scanner -> TokenType -> m ()
setScannerToken Scanner
s TokenType
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
let val' :: CUInt
val' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TokenType -> Int) -> TokenType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TokenType -> Int
forall a. Enum a => a -> Int
fromEnum) TokenType
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
40) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data ScannerTokenFieldInfo
instance AttrInfo ScannerTokenFieldInfo where
type AttrBaseTypeConstraint ScannerTokenFieldInfo = (~) Scanner
type AttrAllowedOps ScannerTokenFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerTokenFieldInfo = (~) GLib.Enums.TokenType
type AttrTransferTypeConstraint ScannerTokenFieldInfo = (~)GLib.Enums.TokenType
type AttrTransferType ScannerTokenFieldInfo = GLib.Enums.TokenType
type AttrGetType ScannerTokenFieldInfo = GLib.Enums.TokenType
type AttrLabel ScannerTokenFieldInfo = "token"
type AttrOrigin ScannerTokenFieldInfo = Scanner
attrGet = getScannerToken
attrSet = setScannerToken
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.token"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:token"
})
scanner_token :: AttrLabelProxy "token"
scanner_token = AttrLabelProxy
#endif
getScannerValue :: MonadIO m => Scanner -> m GLib.TokenValue.TokenValue
getScannerValue :: forall (m :: * -> *). MonadIO m => Scanner -> m TokenValue
getScannerValue Scanner
s = IO TokenValue -> m TokenValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenValue -> m TokenValue) -> IO TokenValue -> m TokenValue
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO TokenValue) -> IO TokenValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO TokenValue) -> IO TokenValue)
-> (Ptr Scanner -> IO TokenValue) -> IO TokenValue
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
let val :: Ptr TokenValue
val = Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr TokenValue
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
48 :: (Ptr GLib.TokenValue.TokenValue)
TokenValue
val' <- ((ManagedPtr TokenValue -> TokenValue)
-> Ptr TokenValue -> IO TokenValue
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TokenValue -> TokenValue
GLib.TokenValue.TokenValue) Ptr TokenValue
val
TokenValue -> IO TokenValue
forall (m :: * -> *) a. Monad m => a -> m a
return TokenValue
val'
#if defined(ENABLE_OVERLOADING)
data ScannerValueFieldInfo
instance AttrInfo ScannerValueFieldInfo where
type AttrBaseTypeConstraint ScannerValueFieldInfo = (~) Scanner
type AttrAllowedOps ScannerValueFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint ScannerValueFieldInfo = (~) (Ptr GLib.TokenValue.TokenValue)
type AttrTransferTypeConstraint ScannerValueFieldInfo = (~)(Ptr GLib.TokenValue.TokenValue)
type AttrTransferType ScannerValueFieldInfo = (Ptr GLib.TokenValue.TokenValue)
type AttrGetType ScannerValueFieldInfo = GLib.TokenValue.TokenValue
type AttrLabel ScannerValueFieldInfo = "value"
type AttrOrigin ScannerValueFieldInfo = Scanner
attrGet = getScannerValue
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.value"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:value"
})
scanner_value :: AttrLabelProxy "value"
scanner_value = AttrLabelProxy
#endif
getScannerLine :: MonadIO m => Scanner -> m Word32
getScannerLine :: forall (m :: * -> *). MonadIO m => Scanner -> m Word32
getScannerLine Scanner
s = 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
$ Scanner -> (Ptr Scanner -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO Word32) -> IO Word32)
-> (Ptr Scanner -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setScannerLine :: MonadIO m => Scanner -> Word32 -> m ()
setScannerLine :: forall (m :: * -> *). MonadIO m => Scanner -> Word32 -> m ()
setScannerLine Scanner
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
56) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data ScannerLineFieldInfo
instance AttrInfo ScannerLineFieldInfo where
type AttrBaseTypeConstraint ScannerLineFieldInfo = (~) Scanner
type AttrAllowedOps ScannerLineFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerLineFieldInfo = (~) Word32
type AttrTransferTypeConstraint ScannerLineFieldInfo = (~)Word32
type AttrTransferType ScannerLineFieldInfo = Word32
type AttrGetType ScannerLineFieldInfo = Word32
type AttrLabel ScannerLineFieldInfo = "line"
type AttrOrigin ScannerLineFieldInfo = Scanner
attrGet = getScannerLine
attrSet = setScannerLine
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.line"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:line"
})
scanner_line :: AttrLabelProxy "line"
scanner_line = AttrLabelProxy
#endif
getScannerPosition :: MonadIO m => Scanner -> m Word32
getScannerPosition :: forall (m :: * -> *). MonadIO m => Scanner -> m Word32
getScannerPosition Scanner
s = 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
$ Scanner -> (Ptr Scanner -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO Word32) -> IO Word32)
-> (Ptr Scanner -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setScannerPosition :: MonadIO m => Scanner -> Word32 -> m ()
setScannerPosition :: forall (m :: * -> *). MonadIO m => Scanner -> Word32 -> m ()
setScannerPosition Scanner
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
60) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data ScannerPositionFieldInfo
instance AttrInfo ScannerPositionFieldInfo where
type AttrBaseTypeConstraint ScannerPositionFieldInfo = (~) Scanner
type AttrAllowedOps ScannerPositionFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerPositionFieldInfo = (~) Word32
type AttrTransferTypeConstraint ScannerPositionFieldInfo = (~)Word32
type AttrTransferType ScannerPositionFieldInfo = Word32
type AttrGetType ScannerPositionFieldInfo = Word32
type AttrLabel ScannerPositionFieldInfo = "position"
type AttrOrigin ScannerPositionFieldInfo = Scanner
attrGet = getScannerPosition
attrSet = setScannerPosition
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.position"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:position"
})
scanner_position :: AttrLabelProxy "position"
scanner_position = AttrLabelProxy
#endif
getScannerNextToken :: MonadIO m => Scanner -> m GLib.Enums.TokenType
getScannerNextToken :: forall (m :: * -> *). MonadIO m => Scanner -> m TokenType
getScannerNextToken Scanner
s = IO TokenType -> m TokenType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenType -> m TokenType) -> IO TokenType -> m TokenType
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO TokenType) -> IO TokenType
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO TokenType) -> IO TokenType)
-> (Ptr Scanner -> IO TokenType) -> IO TokenType
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
CUInt
val <- Ptr CUInt -> IO CUInt
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64) :: IO CUInt
let val' :: TokenType
val' = (Int -> TokenType
forall a. Enum a => Int -> a
toEnum (Int -> TokenType) -> (CUInt -> Int) -> CUInt -> TokenType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
val
TokenType -> IO TokenType
forall (m :: * -> *) a. Monad m => a -> m a
return TokenType
val'
setScannerNextToken :: MonadIO m => Scanner -> GLib.Enums.TokenType -> m ()
setScannerNextToken :: forall (m :: * -> *). MonadIO m => Scanner -> TokenType -> m ()
setScannerNextToken Scanner
s TokenType
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
let val' :: CUInt
val' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TokenType -> Int) -> TokenType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TokenType -> Int
forall a. Enum a => a -> Int
fromEnum) TokenType
val
Ptr CUInt -> CUInt -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr CUInt
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
64) (CUInt
val' :: CUInt)
#if defined(ENABLE_OVERLOADING)
data ScannerNextTokenFieldInfo
instance AttrInfo ScannerNextTokenFieldInfo where
type AttrBaseTypeConstraint ScannerNextTokenFieldInfo = (~) Scanner
type AttrAllowedOps ScannerNextTokenFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerNextTokenFieldInfo = (~) GLib.Enums.TokenType
type AttrTransferTypeConstraint ScannerNextTokenFieldInfo = (~)GLib.Enums.TokenType
type AttrTransferType ScannerNextTokenFieldInfo = GLib.Enums.TokenType
type AttrGetType ScannerNextTokenFieldInfo = GLib.Enums.TokenType
type AttrLabel ScannerNextTokenFieldInfo = "next_token"
type AttrOrigin ScannerNextTokenFieldInfo = Scanner
attrGet = getScannerNextToken
attrSet = setScannerNextToken
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.nextToken"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:nextToken"
})
scanner_nextToken :: AttrLabelProxy "nextToken"
scanner_nextToken = AttrLabelProxy
#endif
getScannerNextValue :: MonadIO m => Scanner -> m GLib.TokenValue.TokenValue
getScannerNextValue :: forall (m :: * -> *). MonadIO m => Scanner -> m TokenValue
getScannerNextValue Scanner
s = IO TokenValue -> m TokenValue
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenValue -> m TokenValue) -> IO TokenValue -> m TokenValue
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO TokenValue) -> IO TokenValue
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO TokenValue) -> IO TokenValue)
-> (Ptr Scanner -> IO TokenValue) -> IO TokenValue
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
let val :: Ptr TokenValue
val = Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr TokenValue
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
72 :: (Ptr GLib.TokenValue.TokenValue)
TokenValue
val' <- ((ManagedPtr TokenValue -> TokenValue)
-> Ptr TokenValue -> IO TokenValue
forall a.
(HasCallStack, BoxedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
newPtr ManagedPtr TokenValue -> TokenValue
GLib.TokenValue.TokenValue) Ptr TokenValue
val
TokenValue -> IO TokenValue
forall (m :: * -> *) a. Monad m => a -> m a
return TokenValue
val'
#if defined(ENABLE_OVERLOADING)
data ScannerNextValueFieldInfo
instance AttrInfo ScannerNextValueFieldInfo where
type AttrBaseTypeConstraint ScannerNextValueFieldInfo = (~) Scanner
type AttrAllowedOps ScannerNextValueFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint ScannerNextValueFieldInfo = (~) (Ptr GLib.TokenValue.TokenValue)
type AttrTransferTypeConstraint ScannerNextValueFieldInfo = (~)(Ptr GLib.TokenValue.TokenValue)
type AttrTransferType ScannerNextValueFieldInfo = (Ptr GLib.TokenValue.TokenValue)
type AttrGetType ScannerNextValueFieldInfo = GLib.TokenValue.TokenValue
type AttrLabel ScannerNextValueFieldInfo = "next_value"
type AttrOrigin ScannerNextValueFieldInfo = Scanner
attrGet = getScannerNextValue
attrSet = undefined
attrConstruct = undefined
attrClear = undefined
attrTransfer = undefined
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.nextValue"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:nextValue"
})
scanner_nextValue :: AttrLabelProxy "nextValue"
scanner_nextValue = AttrLabelProxy
#endif
getScannerNextLine :: MonadIO m => Scanner -> m Word32
getScannerNextLine :: forall (m :: * -> *). MonadIO m => Scanner -> m Word32
getScannerNextLine Scanner
s = 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
$ Scanner -> (Ptr Scanner -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO Word32) -> IO Word32)
-> (Ptr Scanner -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setScannerNextLine :: MonadIO m => Scanner -> Word32 -> m ()
setScannerNextLine :: forall (m :: * -> *). MonadIO m => Scanner -> Word32 -> m ()
setScannerNextLine Scanner
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
80) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data ScannerNextLineFieldInfo
instance AttrInfo ScannerNextLineFieldInfo where
type AttrBaseTypeConstraint ScannerNextLineFieldInfo = (~) Scanner
type AttrAllowedOps ScannerNextLineFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerNextLineFieldInfo = (~) Word32
type AttrTransferTypeConstraint ScannerNextLineFieldInfo = (~)Word32
type AttrTransferType ScannerNextLineFieldInfo = Word32
type AttrGetType ScannerNextLineFieldInfo = Word32
type AttrLabel ScannerNextLineFieldInfo = "next_line"
type AttrOrigin ScannerNextLineFieldInfo = Scanner
attrGet = getScannerNextLine
attrSet = setScannerNextLine
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.nextLine"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:nextLine"
})
scanner_nextLine :: AttrLabelProxy "nextLine"
scanner_nextLine = AttrLabelProxy
#endif
getScannerNextPosition :: MonadIO m => Scanner -> m Word32
getScannerNextPosition :: forall (m :: * -> *). MonadIO m => Scanner -> m Word32
getScannerNextPosition Scanner
s = 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
$ Scanner -> (Ptr Scanner -> IO Word32) -> IO Word32
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO Word32) -> IO Word32)
-> (Ptr Scanner -> IO Word32) -> IO Word32
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Word32
val <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84) :: IO Word32
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val
setScannerNextPosition :: MonadIO m => Scanner -> Word32 -> m ()
setScannerNextPosition :: forall (m :: * -> *). MonadIO m => Scanner -> Word32 -> m ()
setScannerNextPosition Scanner
s Word32
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr Word32 -> Word32 -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr Word32
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
84) (Word32
val :: Word32)
#if defined(ENABLE_OVERLOADING)
data ScannerNextPositionFieldInfo
instance AttrInfo ScannerNextPositionFieldInfo where
type AttrBaseTypeConstraint ScannerNextPositionFieldInfo = (~) Scanner
type AttrAllowedOps ScannerNextPositionFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerNextPositionFieldInfo = (~) Word32
type AttrTransferTypeConstraint ScannerNextPositionFieldInfo = (~)Word32
type AttrTransferType ScannerNextPositionFieldInfo = Word32
type AttrGetType ScannerNextPositionFieldInfo = Word32
type AttrLabel ScannerNextPositionFieldInfo = "next_position"
type AttrOrigin ScannerNextPositionFieldInfo = Scanner
attrGet = getScannerNextPosition
attrSet = setScannerNextPosition
attrConstruct = undefined
attrClear = undefined
attrTransfer _ v = do
return v
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.nextPosition"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:nextPosition"
})
scanner_nextPosition :: AttrLabelProxy "nextPosition"
scanner_nextPosition = AttrLabelProxy
#endif
getScannerMsgHandler :: MonadIO m => Scanner -> m (Maybe GLib.Callbacks.ScannerMsgFunc)
getScannerMsgHandler :: forall (m :: * -> *).
MonadIO m =>
Scanner -> m (Maybe ScannerMsgFunc)
getScannerMsgHandler Scanner
s = IO (Maybe ScannerMsgFunc) -> m (Maybe ScannerMsgFunc)
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Maybe ScannerMsgFunc) -> m (Maybe ScannerMsgFunc))
-> IO (Maybe ScannerMsgFunc) -> m (Maybe ScannerMsgFunc)
forall a b. (a -> b) -> a -> b
$ Scanner
-> (Ptr Scanner -> IO (Maybe ScannerMsgFunc))
-> IO (Maybe ScannerMsgFunc)
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO (Maybe ScannerMsgFunc))
-> IO (Maybe ScannerMsgFunc))
-> (Ptr Scanner -> IO (Maybe ScannerMsgFunc))
-> IO (Maybe ScannerMsgFunc)
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
FunPtr C_ScannerMsgFunc
val <- Ptr (FunPtr C_ScannerMsgFunc) -> IO (FunPtr C_ScannerMsgFunc)
forall a. Storable a => Ptr a -> IO a
peek (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (FunPtr C_ScannerMsgFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136) :: IO (FunPtr GLib.Callbacks.C_ScannerMsgFunc)
Maybe ScannerMsgFunc
result <- FunPtr C_ScannerMsgFunc
-> (FunPtr C_ScannerMsgFunc -> IO ScannerMsgFunc)
-> IO (Maybe ScannerMsgFunc)
forall a b. FunPtr a -> (FunPtr a -> IO b) -> IO (Maybe b)
SP.convertFunPtrIfNonNull FunPtr C_ScannerMsgFunc
val ((FunPtr C_ScannerMsgFunc -> IO ScannerMsgFunc)
-> IO (Maybe ScannerMsgFunc))
-> (FunPtr C_ScannerMsgFunc -> IO ScannerMsgFunc)
-> IO (Maybe ScannerMsgFunc)
forall a b. (a -> b) -> a -> b
$ \FunPtr C_ScannerMsgFunc
val' -> do
let val'' :: ScannerMsgFunc
val'' = FunPtr C_ScannerMsgFunc -> ScannerMsgFunc
forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
FunPtr C_ScannerMsgFunc -> Scanner -> Text -> Bool -> m ()
GLib.Callbacks.dynamic_ScannerMsgFunc FunPtr C_ScannerMsgFunc
val'
ScannerMsgFunc -> IO ScannerMsgFunc
forall (m :: * -> *) a. Monad m => a -> m a
return ScannerMsgFunc
val''
Maybe ScannerMsgFunc -> IO (Maybe ScannerMsgFunc)
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe ScannerMsgFunc
result
setScannerMsgHandler :: MonadIO m => Scanner -> FunPtr GLib.Callbacks.C_ScannerMsgFunc -> m ()
setScannerMsgHandler :: forall (m :: * -> *).
MonadIO m =>
Scanner -> FunPtr C_ScannerMsgFunc -> m ()
setScannerMsgHandler Scanner
s FunPtr C_ScannerMsgFunc
val = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (FunPtr C_ScannerMsgFunc) -> FunPtr C_ScannerMsgFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (FunPtr C_ScannerMsgFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136) (FunPtr C_ScannerMsgFunc
val :: FunPtr GLib.Callbacks.C_ScannerMsgFunc)
clearScannerMsgHandler :: MonadIO m => Scanner -> m ()
clearScannerMsgHandler :: forall (m :: * -> *). MonadIO m => Scanner -> m ()
clearScannerMsgHandler Scanner
s = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ Scanner -> (Ptr Scanner -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
s ((Ptr Scanner -> IO ()) -> IO ())
-> (Ptr Scanner -> IO ()) -> IO ()
forall a b. (a -> b) -> a -> b
$ \Ptr Scanner
ptr -> do
Ptr (FunPtr C_ScannerMsgFunc) -> FunPtr C_ScannerMsgFunc -> IO ()
forall a. Storable a => Ptr a -> a -> IO ()
poke (Ptr Scanner
ptr Ptr Scanner -> Int -> Ptr (FunPtr C_ScannerMsgFunc)
forall a b. Ptr a -> Int -> Ptr b
`plusPtr` Int
136) (FunPtr C_ScannerMsgFunc
forall a. FunPtr a
FP.nullFunPtr :: FunPtr GLib.Callbacks.C_ScannerMsgFunc)
#if defined(ENABLE_OVERLOADING)
data ScannerMsgHandlerFieldInfo
instance AttrInfo ScannerMsgHandlerFieldInfo where
type AttrBaseTypeConstraint ScannerMsgHandlerFieldInfo = (~) Scanner
type AttrAllowedOps ScannerMsgHandlerFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerMsgHandlerFieldInfo = (~) (FunPtr GLib.Callbacks.C_ScannerMsgFunc)
type AttrTransferTypeConstraint ScannerMsgHandlerFieldInfo = (~)GLib.Callbacks.ScannerMsgFunc
type AttrTransferType ScannerMsgHandlerFieldInfo = (FunPtr GLib.Callbacks.C_ScannerMsgFunc)
type AttrGetType ScannerMsgHandlerFieldInfo = Maybe GLib.Callbacks.ScannerMsgFunc
type AttrLabel ScannerMsgHandlerFieldInfo = "msg_handler"
type AttrOrigin ScannerMsgHandlerFieldInfo = Scanner
attrGet = getScannerMsgHandler
attrSet = setScannerMsgHandler
attrConstruct = undefined
attrClear = clearScannerMsgHandler
attrTransfer _ v = do
GLib.Callbacks.mk_ScannerMsgFunc (GLib.Callbacks.wrap_ScannerMsgFunc Nothing v)
dbgAttrInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.msgHandler"
, O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#g:attr:msgHandler"
})
scanner_msgHandler :: AttrLabelProxy "msgHandler"
scanner_msgHandler = AttrLabelProxy
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList Scanner
type instance O.AttributeList Scanner = ScannerAttributeList
type ScannerAttributeList = ('[ '("userData", ScannerUserDataFieldInfo), '("maxParseErrors", ScannerMaxParseErrorsFieldInfo), '("parseErrors", ScannerParseErrorsFieldInfo), '("inputName", ScannerInputNameFieldInfo), '("qdata", ScannerQdataFieldInfo), '("config", ScannerConfigFieldInfo), '("token", ScannerTokenFieldInfo), '("value", ScannerValueFieldInfo), '("line", ScannerLineFieldInfo), '("position", ScannerPositionFieldInfo), '("nextToken", ScannerNextTokenFieldInfo), '("nextValue", ScannerNextValueFieldInfo), '("nextLine", ScannerNextLineFieldInfo), '("nextPosition", ScannerNextPositionFieldInfo), '("msgHandler", ScannerMsgHandlerFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_scanner_cur_line" g_scanner_cur_line ::
Ptr Scanner ->
IO Word32
scannerCurLine ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m Word32
scannerCurLine :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> m Word32
scannerCurLine Scanner
scanner = 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
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Word32
result <- Ptr Scanner -> IO Word32
g_scanner_cur_line Ptr Scanner
scanner'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ScannerCurLineMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod ScannerCurLineMethodInfo Scanner signature where
overloadedMethod = scannerCurLine
instance O.OverloadedMethodInfo ScannerCurLineMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerCurLine",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerCurLine"
})
#endif
foreign import ccall "g_scanner_cur_position" g_scanner_cur_position ::
Ptr Scanner ->
IO Word32
scannerCurPosition ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m Word32
scannerCurPosition :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> m Word32
scannerCurPosition Scanner
scanner = 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
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Word32
result <- Ptr Scanner -> IO Word32
g_scanner_cur_position Ptr Scanner
scanner'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ScannerCurPositionMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.OverloadedMethod ScannerCurPositionMethodInfo Scanner signature where
overloadedMethod = scannerCurPosition
instance O.OverloadedMethodInfo ScannerCurPositionMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerCurPosition",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerCurPosition"
})
#endif
foreign import ccall "g_scanner_cur_token" g_scanner_cur_token ::
Ptr Scanner ->
IO CUInt
scannerCurToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m GLib.Enums.TokenType
scannerCurToken :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> m TokenType
scannerCurToken Scanner
scanner = IO TokenType -> m TokenType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenType -> m TokenType) -> IO TokenType -> m TokenType
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CUInt
result <- Ptr Scanner -> IO CUInt
g_scanner_cur_token Ptr Scanner
scanner'
let result' :: TokenType
result' = (Int -> TokenType
forall a. Enum a => Int -> a
toEnum (Int -> TokenType) -> (CUInt -> Int) -> CUInt -> TokenType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
TokenType -> IO TokenType
forall (m :: * -> *) a. Monad m => a -> m a
return TokenType
result'
#if defined(ENABLE_OVERLOADING)
data ScannerCurTokenMethodInfo
instance (signature ~ (m GLib.Enums.TokenType), MonadIO m) => O.OverloadedMethod ScannerCurTokenMethodInfo Scanner signature where
overloadedMethod = scannerCurToken
instance O.OverloadedMethodInfo ScannerCurTokenMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerCurToken",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerCurToken"
})
#endif
foreign import ccall "g_scanner_destroy" g_scanner_destroy ::
Ptr Scanner ->
IO ()
scannerDestroy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m ()
scannerDestroy :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Scanner -> m ()
scannerDestroy Scanner
scanner = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Ptr Scanner -> IO ()
g_scanner_destroy Ptr Scanner
scanner'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod ScannerDestroyMethodInfo Scanner signature where
overloadedMethod = scannerDestroy
instance O.OverloadedMethodInfo ScannerDestroyMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerDestroy",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerDestroy"
})
#endif
foreign import ccall "g_scanner_eof" g_scanner_eof ::
Ptr Scanner ->
IO CInt
scannerEof ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m Bool
scannerEof :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> m Bool
scannerEof Scanner
scanner = 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
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CInt
result <- Ptr Scanner -> IO CInt
g_scanner_eof Ptr Scanner
scanner'
let result' :: Bool
result' = (CInt -> CInt -> Bool
forall a. Eq a => a -> a -> Bool
/= CInt
0) CInt
result
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
Bool -> IO Bool
forall (m :: * -> *) a. Monad m => a -> m a
return Bool
result'
#if defined(ENABLE_OVERLOADING)
data ScannerEofMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.OverloadedMethod ScannerEofMethodInfo Scanner signature where
overloadedMethod = scannerEof
instance O.OverloadedMethodInfo ScannerEofMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerEof",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerEof"
})
#endif
foreign import ccall "g_scanner_get_next_token" g_scanner_get_next_token ::
Ptr Scanner ->
IO CUInt
scannerGetNextToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m GLib.Enums.TokenType
scannerGetNextToken :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> m TokenType
scannerGetNextToken Scanner
scanner = IO TokenType -> m TokenType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenType -> m TokenType) -> IO TokenType -> m TokenType
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CUInt
result <- Ptr Scanner -> IO CUInt
g_scanner_get_next_token Ptr Scanner
scanner'
let result' :: TokenType
result' = (Int -> TokenType
forall a. Enum a => Int -> a
toEnum (Int -> TokenType) -> (CUInt -> Int) -> CUInt -> TokenType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
TokenType -> IO TokenType
forall (m :: * -> *) a. Monad m => a -> m a
return TokenType
result'
#if defined(ENABLE_OVERLOADING)
data ScannerGetNextTokenMethodInfo
instance (signature ~ (m GLib.Enums.TokenType), MonadIO m) => O.OverloadedMethod ScannerGetNextTokenMethodInfo Scanner signature where
overloadedMethod = scannerGetNextToken
instance O.OverloadedMethodInfo ScannerGetNextTokenMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerGetNextToken",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerGetNextToken"
})
#endif
foreign import ccall "g_scanner_input_file" g_scanner_input_file ::
Ptr Scanner ->
Int32 ->
IO ()
scannerInputFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Int32
-> m ()
scannerInputFile :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Int32 -> m ()
scannerInputFile Scanner
scanner Int32
inputFd = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Ptr Scanner -> Int32 -> IO ()
g_scanner_input_file Ptr Scanner
scanner' Int32
inputFd
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerInputFileMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m) => O.OverloadedMethod ScannerInputFileMethodInfo Scanner signature where
overloadedMethod = scannerInputFile
instance O.OverloadedMethodInfo ScannerInputFileMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerInputFile",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerInputFile"
})
#endif
foreign import ccall "g_scanner_input_text" g_scanner_input_text ::
Ptr Scanner ->
CString ->
Word32 ->
IO ()
scannerInputText ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> T.Text
-> Word32
-> m ()
scannerInputText :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Text -> Word32 -> m ()
scannerInputText Scanner
scanner Text
text Word32
textLen = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CString
text' <- Text -> IO CString
textToCString Text
text
Ptr Scanner -> CString -> Word32 -> IO ()
g_scanner_input_text Ptr Scanner
scanner' CString
text' Word32
textLen
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
text'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerInputTextMethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m) => O.OverloadedMethod ScannerInputTextMethodInfo Scanner signature where
overloadedMethod = scannerInputText
instance O.OverloadedMethodInfo ScannerInputTextMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerInputText",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerInputText"
})
#endif
foreign import ccall "g_scanner_lookup_symbol" g_scanner_lookup_symbol ::
Ptr Scanner ->
CString ->
IO (Ptr ())
scannerLookupSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> T.Text
-> m (Ptr ())
scannerLookupSymbol :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Text -> m (Ptr ())
scannerLookupSymbol Scanner
scanner Text
symbol = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CString
symbol' <- Text -> IO CString
textToCString Text
symbol
Ptr ()
result <- Ptr Scanner -> CString -> IO (Ptr ())
g_scanner_lookup_symbol Ptr Scanner
scanner' CString
symbol'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
symbol'
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data ScannerLookupSymbolMethodInfo
instance (signature ~ (T.Text -> m (Ptr ())), MonadIO m) => O.OverloadedMethod ScannerLookupSymbolMethodInfo Scanner signature where
overloadedMethod = scannerLookupSymbol
instance O.OverloadedMethodInfo ScannerLookupSymbolMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerLookupSymbol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerLookupSymbol"
})
#endif
foreign import ccall "g_scanner_peek_next_token" g_scanner_peek_next_token ::
Ptr Scanner ->
IO CUInt
scannerPeekNextToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m GLib.Enums.TokenType
scannerPeekNextToken :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> m TokenType
scannerPeekNextToken Scanner
scanner = IO TokenType -> m TokenType
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO TokenType -> m TokenType) -> IO TokenType -> m TokenType
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CUInt
result <- Ptr Scanner -> IO CUInt
g_scanner_peek_next_token Ptr Scanner
scanner'
let result' :: TokenType
result' = (Int -> TokenType
forall a. Enum a => Int -> a
toEnum (Int -> TokenType) -> (CUInt -> Int) -> CUInt -> TokenType
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CUInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CUInt
result
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
TokenType -> IO TokenType
forall (m :: * -> *) a. Monad m => a -> m a
return TokenType
result'
#if defined(ENABLE_OVERLOADING)
data ScannerPeekNextTokenMethodInfo
instance (signature ~ (m GLib.Enums.TokenType), MonadIO m) => O.OverloadedMethod ScannerPeekNextTokenMethodInfo Scanner signature where
overloadedMethod = scannerPeekNextToken
instance O.OverloadedMethodInfo ScannerPeekNextTokenMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerPeekNextToken",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerPeekNextToken"
})
#endif
foreign import ccall "g_scanner_scope_add_symbol" g_scanner_scope_add_symbol ::
Ptr Scanner ->
Word32 ->
CString ->
Ptr () ->
IO ()
scannerScopeAddSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> T.Text
-> Ptr ()
-> m ()
scannerScopeAddSymbol :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Word32 -> Text -> Ptr () -> m ()
scannerScopeAddSymbol Scanner
scanner Word32
scopeId Text
symbol Ptr ()
value = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CString
symbol' <- Text -> IO CString
textToCString Text
symbol
Ptr Scanner -> Word32 -> CString -> Ptr () -> IO ()
g_scanner_scope_add_symbol Ptr Scanner
scanner' Word32
scopeId CString
symbol' Ptr ()
value
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
symbol'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerScopeAddSymbolMethodInfo
instance (signature ~ (Word32 -> T.Text -> Ptr () -> m ()), MonadIO m) => O.OverloadedMethod ScannerScopeAddSymbolMethodInfo Scanner signature where
overloadedMethod = scannerScopeAddSymbol
instance O.OverloadedMethodInfo ScannerScopeAddSymbolMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerScopeAddSymbol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerScopeAddSymbol"
})
#endif
foreign import ccall "g_scanner_scope_lookup_symbol" g_scanner_scope_lookup_symbol ::
Ptr Scanner ->
Word32 ->
CString ->
IO (Ptr ())
scannerScopeLookupSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> T.Text
-> m (Ptr ())
scannerScopeLookupSymbol :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Word32 -> Text -> m (Ptr ())
scannerScopeLookupSymbol Scanner
scanner Word32
scopeId Text
symbol = IO (Ptr ()) -> m (Ptr ())
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO (Ptr ()) -> m (Ptr ())) -> IO (Ptr ()) -> m (Ptr ())
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CString
symbol' <- Text -> IO CString
textToCString Text
symbol
Ptr ()
result <- Ptr Scanner -> Word32 -> CString -> IO (Ptr ())
g_scanner_scope_lookup_symbol Ptr Scanner
scanner' Word32
scopeId CString
symbol'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
symbol'
Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
result
#if defined(ENABLE_OVERLOADING)
data ScannerScopeLookupSymbolMethodInfo
instance (signature ~ (Word32 -> T.Text -> m (Ptr ())), MonadIO m) => O.OverloadedMethod ScannerScopeLookupSymbolMethodInfo Scanner signature where
overloadedMethod = scannerScopeLookupSymbol
instance O.OverloadedMethodInfo ScannerScopeLookupSymbolMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerScopeLookupSymbol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerScopeLookupSymbol"
})
#endif
foreign import ccall "g_scanner_scope_remove_symbol" g_scanner_scope_remove_symbol ::
Ptr Scanner ->
Word32 ->
CString ->
IO ()
scannerScopeRemoveSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> T.Text
-> m ()
scannerScopeRemoveSymbol :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Word32 -> Text -> m ()
scannerScopeRemoveSymbol Scanner
scanner Word32
scopeId Text
symbol = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
CString
symbol' <- Text -> IO CString
textToCString Text
symbol
Ptr Scanner -> Word32 -> CString -> IO ()
g_scanner_scope_remove_symbol Ptr Scanner
scanner' Word32
scopeId CString
symbol'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
symbol'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerScopeRemoveSymbolMethodInfo
instance (signature ~ (Word32 -> T.Text -> m ()), MonadIO m) => O.OverloadedMethod ScannerScopeRemoveSymbolMethodInfo Scanner signature where
overloadedMethod = scannerScopeRemoveSymbol
instance O.OverloadedMethodInfo ScannerScopeRemoveSymbolMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerScopeRemoveSymbol",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerScopeRemoveSymbol"
})
#endif
foreign import ccall "g_scanner_set_scope" g_scanner_set_scope ::
Ptr Scanner ->
Word32 ->
IO Word32
scannerSetScope ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> m Word32
scannerSetScope :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner -> Word32 -> m Word32
scannerSetScope Scanner
scanner Word32
scopeId = 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
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Word32
result <- Ptr Scanner -> Word32 -> IO Word32
g_scanner_set_scope Ptr Scanner
scanner' Word32
scopeId
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
result
#if defined(ENABLE_OVERLOADING)
data ScannerSetScopeMethodInfo
instance (signature ~ (Word32 -> m Word32), MonadIO m) => O.OverloadedMethod ScannerSetScopeMethodInfo Scanner signature where
overloadedMethod = scannerSetScope
instance O.OverloadedMethodInfo ScannerSetScopeMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerSetScope",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerSetScope"
})
#endif
foreign import ccall "g_scanner_sync_file_offset" g_scanner_sync_file_offset ::
Ptr Scanner ->
IO ()
scannerSyncFileOffset ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m ()
scannerSyncFileOffset :: forall (m :: * -> *). (HasCallStack, MonadIO m) => Scanner -> m ()
scannerSyncFileOffset Scanner
scanner = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
Ptr Scanner -> IO ()
g_scanner_sync_file_offset Ptr Scanner
scanner'
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerSyncFileOffsetMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.OverloadedMethod ScannerSyncFileOffsetMethodInfo Scanner signature where
overloadedMethod = scannerSyncFileOffset
instance O.OverloadedMethodInfo ScannerSyncFileOffsetMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerSyncFileOffset",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerSyncFileOffset"
})
#endif
foreign import ccall "g_scanner_unexp_token" g_scanner_unexp_token ::
Ptr Scanner ->
CUInt ->
CString ->
CString ->
CString ->
CString ->
Int32 ->
IO ()
scannerUnexpToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> GLib.Enums.TokenType
-> T.Text
-> T.Text
-> T.Text
-> T.Text
-> Int32
-> m ()
scannerUnexpToken :: forall (m :: * -> *).
(HasCallStack, MonadIO m) =>
Scanner
-> TokenType -> Text -> Text -> Text -> Text -> Int32 -> m ()
scannerUnexpToken Scanner
scanner TokenType
expectedToken Text
identifierSpec Text
symbolSpec Text
symbolName Text
message Int32
isError = IO () -> m ()
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr Scanner
scanner' <- Scanner -> IO (Ptr Scanner)
forall a. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr a)
unsafeManagedPtrGetPtr Scanner
scanner
let expectedToken' :: CUInt
expectedToken' = (Int -> CUInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CUInt) -> (TokenType -> Int) -> TokenType -> CUInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. TokenType -> Int
forall a. Enum a => a -> Int
fromEnum) TokenType
expectedToken
CString
identifierSpec' <- Text -> IO CString
textToCString Text
identifierSpec
CString
symbolSpec' <- Text -> IO CString
textToCString Text
symbolSpec
CString
symbolName' <- Text -> IO CString
textToCString Text
symbolName
CString
message' <- Text -> IO CString
textToCString Text
message
Ptr Scanner
-> CUInt
-> CString
-> CString
-> CString
-> CString
-> Int32
-> IO ()
g_scanner_unexp_token Ptr Scanner
scanner' CUInt
expectedToken' CString
identifierSpec' CString
symbolSpec' CString
symbolName' CString
message' Int32
isError
Scanner -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr Scanner
scanner
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
identifierSpec'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
symbolSpec'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
symbolName'
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
message'
() -> IO ()
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data ScannerUnexpTokenMethodInfo
instance (signature ~ (GLib.Enums.TokenType -> T.Text -> T.Text -> T.Text -> T.Text -> Int32 -> m ()), MonadIO m) => O.OverloadedMethod ScannerUnexpTokenMethodInfo Scanner signature where
overloadedMethod = scannerUnexpToken
instance O.OverloadedMethodInfo ScannerUnexpTokenMethodInfo Scanner where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.GLib.Structs.Scanner.scannerUnexpToken",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-glib-2.0.26/docs/GI-GLib-Structs-Scanner.html#v:scannerUnexpToken"
})
#endif
#if defined(ENABLE_OVERLOADING)
type family ResolveScannerMethod (t :: Symbol) (o :: *) :: * where
ResolveScannerMethod "curLine" o = ScannerCurLineMethodInfo
ResolveScannerMethod "curPosition" o = ScannerCurPositionMethodInfo
ResolveScannerMethod "curToken" o = ScannerCurTokenMethodInfo
ResolveScannerMethod "destroy" o = ScannerDestroyMethodInfo
ResolveScannerMethod "eof" o = ScannerEofMethodInfo
ResolveScannerMethod "inputFile" o = ScannerInputFileMethodInfo
ResolveScannerMethod "inputText" o = ScannerInputTextMethodInfo
ResolveScannerMethod "lookupSymbol" o = ScannerLookupSymbolMethodInfo
ResolveScannerMethod "peekNextToken" o = ScannerPeekNextTokenMethodInfo
ResolveScannerMethod "scopeAddSymbol" o = ScannerScopeAddSymbolMethodInfo
ResolveScannerMethod "scopeLookupSymbol" o = ScannerScopeLookupSymbolMethodInfo
ResolveScannerMethod "scopeRemoveSymbol" o = ScannerScopeRemoveSymbolMethodInfo
ResolveScannerMethod "syncFileOffset" o = ScannerSyncFileOffsetMethodInfo
ResolveScannerMethod "unexpToken" o = ScannerUnexpTokenMethodInfo
ResolveScannerMethod "getNextToken" o = ScannerGetNextTokenMethodInfo
ResolveScannerMethod "setScope" o = ScannerSetScopeMethodInfo
ResolveScannerMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveScannerMethod t Scanner, O.OverloadedMethod info Scanner p) => OL.IsLabel t (Scanner -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveScannerMethod t Scanner, O.OverloadedMethod info Scanner p, R.HasField t Scanner p) => R.HasField t Scanner p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveScannerMethod t Scanner, O.OverloadedMethodInfo info Scanner) => OL.IsLabel t (O.MethodProxy info Scanner) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif