{-# LANGUAGE TypeApplications #-}


-- | Copyright  : Will Thompson, Iñaki García Etxebarria and Jonas Platte
-- License    : LGPL-2.1
-- Maintainer : Iñaki García Etxebarria
-- 
-- The data structure representing a lexical scanner.
-- 
-- You should set /@inputName@/ after creating the scanner, since
-- it is used by the default message handler when displaying
-- warnings and errors. If you are scanning a file, the filename
-- would be a good choice.
-- 
-- The /@userData@/ and /@maxParseErrors@/ fields are not used.
-- If you need to associate extra data with the scanner you
-- can place them here.
-- 
-- If you want to use your own message handler you can set the
-- /@msgHandler@/ field. The type of the message handler function
-- is declared by t'GI.GLib.Callbacks.ScannerMsgFunc'.

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

module GI.GLib.Structs.Scanner
    ( 

-- * Exported types
    Scanner(..)                             ,
    newZeroScanner                          ,
    noScanner                               ,


 -- * Methods
-- ** Overloaded methods #method:Overloaded methods#

#if defined(ENABLE_OVERLOADING)
    ResolveScannerMethod                    ,
#endif


-- ** curLine #method:curLine#

#if defined(ENABLE_OVERLOADING)
    ScannerCurLineMethodInfo                ,
#endif
    scannerCurLine                          ,


-- ** curPosition #method:curPosition#

#if defined(ENABLE_OVERLOADING)
    ScannerCurPositionMethodInfo            ,
#endif
    scannerCurPosition                      ,


-- ** curToken #method:curToken#

#if defined(ENABLE_OVERLOADING)
    ScannerCurTokenMethodInfo               ,
#endif
    scannerCurToken                         ,


-- ** destroy #method:destroy#

#if defined(ENABLE_OVERLOADING)
    ScannerDestroyMethodInfo                ,
#endif
    scannerDestroy                          ,


-- ** eof #method:eof#

#if defined(ENABLE_OVERLOADING)
    ScannerEofMethodInfo                    ,
#endif
    scannerEof                              ,


-- ** getNextToken #method:getNextToken#

#if defined(ENABLE_OVERLOADING)
    ScannerGetNextTokenMethodInfo           ,
#endif
    scannerGetNextToken                     ,


-- ** inputFile #method:inputFile#

#if defined(ENABLE_OVERLOADING)
    ScannerInputFileMethodInfo              ,
#endif
    scannerInputFile                        ,


-- ** inputText #method:inputText#

#if defined(ENABLE_OVERLOADING)
    ScannerInputTextMethodInfo              ,
#endif
    scannerInputText                        ,


-- ** lookupSymbol #method:lookupSymbol#

#if defined(ENABLE_OVERLOADING)
    ScannerLookupSymbolMethodInfo           ,
#endif
    scannerLookupSymbol                     ,


-- ** peekNextToken #method:peekNextToken#

#if defined(ENABLE_OVERLOADING)
    ScannerPeekNextTokenMethodInfo          ,
#endif
    scannerPeekNextToken                    ,


-- ** scopeAddSymbol #method:scopeAddSymbol#

#if defined(ENABLE_OVERLOADING)
    ScannerScopeAddSymbolMethodInfo         ,
#endif
    scannerScopeAddSymbol                   ,


-- ** scopeLookupSymbol #method:scopeLookupSymbol#

#if defined(ENABLE_OVERLOADING)
    ScannerScopeLookupSymbolMethodInfo      ,
#endif
    scannerScopeLookupSymbol                ,


-- ** scopeRemoveSymbol #method:scopeRemoveSymbol#

#if defined(ENABLE_OVERLOADING)
    ScannerScopeRemoveSymbolMethodInfo      ,
#endif
    scannerScopeRemoveSymbol                ,


-- ** setScope #method:setScope#

#if defined(ENABLE_OVERLOADING)
    ScannerSetScopeMethodInfo               ,
#endif
    scannerSetScope                         ,


-- ** syncFileOffset #method:syncFileOffset#

#if defined(ENABLE_OVERLOADING)
    ScannerSyncFileOffsetMethodInfo         ,
#endif
    scannerSyncFileOffset                   ,


-- ** unexpToken #method:unexpToken#

#if defined(ENABLE_OVERLOADING)
    ScannerUnexpTokenMethodInfo             ,
#endif
    scannerUnexpToken                       ,




 -- * Properties
-- ** config #attr:config#
-- | link into the scanner configuration

    clearScannerConfig                      ,
    getScannerConfig                        ,
#if defined(ENABLE_OVERLOADING)
    scanner_config                          ,
#endif
    setScannerConfig                        ,


-- ** inputName #attr:inputName#
-- | name of input stream, featured by the default message handler

    clearScannerInputName                   ,
    getScannerInputName                     ,
#if defined(ENABLE_OVERLOADING)
    scanner_inputName                       ,
#endif
    setScannerInputName                     ,


-- ** line #attr:line#
-- | line number of the last token from 'GI.GLib.Structs.Scanner.scannerGetNextToken'

    getScannerLine                          ,
#if defined(ENABLE_OVERLOADING)
    scanner_line                            ,
#endif
    setScannerLine                          ,


-- ** maxParseErrors #attr:maxParseErrors#
-- | unused

    getScannerMaxParseErrors                ,
#if defined(ENABLE_OVERLOADING)
    scanner_maxParseErrors                  ,
#endif
    setScannerMaxParseErrors                ,


-- ** msgHandler #attr:msgHandler#
-- | handler function for _warn and _error

    clearScannerMsgHandler                  ,
    getScannerMsgHandler                    ,
#if defined(ENABLE_OVERLOADING)
    scanner_msgHandler                      ,
#endif
    setScannerMsgHandler                    ,


-- ** nextLine #attr:nextLine#
-- | line number of the last token from 'GI.GLib.Structs.Scanner.scannerPeekNextToken'

    getScannerNextLine                      ,
#if defined(ENABLE_OVERLOADING)
    scanner_nextLine                        ,
#endif
    setScannerNextLine                      ,


-- ** nextPosition #attr:nextPosition#
-- | char number of the last token from 'GI.GLib.Structs.Scanner.scannerPeekNextToken'

    getScannerNextPosition                  ,
#if defined(ENABLE_OVERLOADING)
    scanner_nextPosition                    ,
#endif
    setScannerNextPosition                  ,


-- ** nextToken #attr:nextToken#
-- | token parsed by the last 'GI.GLib.Structs.Scanner.scannerPeekNextToken'

    getScannerNextToken                     ,
#if defined(ENABLE_OVERLOADING)
    scanner_nextToken                       ,
#endif
    setScannerNextToken                     ,


-- ** nextValue #attr:nextValue#
-- | value of the last token from 'GI.GLib.Structs.Scanner.scannerPeekNextToken'

    getScannerNextValue                     ,
#if defined(ENABLE_OVERLOADING)
    scanner_nextValue                       ,
#endif


-- ** parseErrors #attr:parseErrors#
-- | @/g_scanner_error()/@ increments this field

    getScannerParseErrors                   ,
#if defined(ENABLE_OVERLOADING)
    scanner_parseErrors                     ,
#endif
    setScannerParseErrors                   ,


-- ** position #attr:position#
-- | char number of the last token from 'GI.GLib.Structs.Scanner.scannerGetNextToken'

    getScannerPosition                      ,
#if defined(ENABLE_OVERLOADING)
    scanner_position                        ,
#endif
    setScannerPosition                      ,


-- ** qdata #attr:qdata#
-- | quarked data

    clearScannerQdata                       ,
    getScannerQdata                         ,
#if defined(ENABLE_OVERLOADING)
    scanner_qdata                           ,
#endif
    setScannerQdata                         ,


-- ** token #attr:token#
-- | token parsed by the last 'GI.GLib.Structs.Scanner.scannerGetNextToken'

    getScannerToken                         ,
#if defined(ENABLE_OVERLOADING)
    scanner_token                           ,
#endif
    setScannerToken                         ,


-- ** userData #attr:userData#
-- | unused

    clearScannerUserData                    ,
    getScannerUserData                      ,
#if defined(ENABLE_OVERLOADING)
    scanner_userData                        ,
#endif
    setScannerUserData                      ,


-- ** value #attr:value#
-- | value of the last token from 'GI.GLib.Structs.Scanner.scannerGetNextToken'

    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.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 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.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

-- | Memory-managed wrapper type.
newtype Scanner = Scanner (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 WrappedPtr Scanner where
    wrappedPtrCalloc :: IO (Ptr Scanner)
wrappedPtrCalloc = Int -> IO (Ptr Scanner)
forall a. Int -> IO (Ptr a)
callocBytes 144
    wrappedPtrCopy :: Scanner -> IO Scanner
wrappedPtrCopy = \p :: Scanner
p -> Scanner -> (Ptr Scanner -> IO Scanner) -> IO Scanner
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
withManagedPtr Scanner
p (Int -> Ptr Scanner -> IO (Ptr Scanner)
forall a. WrappedPtr a => Int -> Ptr a -> IO (Ptr a)
copyBytes 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, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Scanner -> Scanner
Scanner)
    wrappedPtrFree :: Maybe (GDestroyNotify Scanner)
wrappedPtrFree = GDestroyNotify Scanner -> Maybe (GDestroyNotify Scanner)
forall a. a -> Maybe a
Just GDestroyNotify Scanner
forall a. FunPtr (Ptr a -> IO ())
ptr_to_g_free

-- | Construct a `Scanner` struct initialized to zero.
newZeroScanner :: MonadIO m => m Scanner
newZeroScanner :: 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. WrappedPtr a => IO (Ptr a)
wrappedPtrCalloc 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, WrappedPtr a) =>
(ManagedPtr a -> a) -> Ptr a -> IO a
wrapPtr ManagedPtr Scanner -> Scanner
Scanner

instance tag ~ 'AttrSet => Constructible Scanner tag where
    new :: (ManagedPtr Scanner -> Scanner)
-> [AttrOp Scanner tag] -> m Scanner
new _ attrs :: [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


-- | A convenience alias for `Nothing` :: `Maybe` `Scanner`.
noScanner :: Maybe Scanner
noScanner :: Maybe Scanner
noScanner = Maybe Scanner
forall a. Maybe a
Nothing

-- | Get the value of the “@user_data@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #userData
-- @
getScannerUserData :: MonadIO m => Scanner -> m (Ptr ())
getScannerUserData :: Scanner -> m (Ptr ())
getScannerUserData s :: 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 :: 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` 0) :: IO (Ptr ())
    Ptr () -> IO (Ptr ())
forall (m :: * -> *) a. Monad m => a -> m a
return Ptr ()
val

-- | Set the value of the “@user_data@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #userData 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerUserData :: MonadIO m => Scanner -> Ptr () -> m ()
setScannerUserData :: Scanner -> Ptr () -> m ()
setScannerUserData s :: Scanner
s val :: 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 :: 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` 0) (Ptr ()
val :: Ptr ())

-- | Set the value of the “@user_data@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #userData
-- @
clearScannerUserData :: MonadIO m => Scanner -> m ()
clearScannerUserData :: Scanner -> m ()
clearScannerUserData s :: 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 :: 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` 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

scanner_userData :: AttrLabelProxy "userData"
scanner_userData = AttrLabelProxy

#endif


-- | Get the value of the “@max_parse_errors@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #maxParseErrors
-- @
getScannerMaxParseErrors :: MonadIO m => Scanner -> m Word32
getScannerMaxParseErrors :: Scanner -> m Word32
getScannerMaxParseErrors s :: 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 :: 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` 8) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@max_parse_errors@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #maxParseErrors 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerMaxParseErrors :: MonadIO m => Scanner -> Word32 -> m ()
setScannerMaxParseErrors :: Scanner -> Word32 -> m ()
setScannerMaxParseErrors s :: Scanner
s val :: 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 :: 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` 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

scanner_maxParseErrors :: AttrLabelProxy "maxParseErrors"
scanner_maxParseErrors = AttrLabelProxy

#endif


-- | Get the value of the “@parse_errors@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #parseErrors
-- @
getScannerParseErrors :: MonadIO m => Scanner -> m Word32
getScannerParseErrors :: Scanner -> m Word32
getScannerParseErrors s :: 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 :: 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` 12) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@parse_errors@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #parseErrors 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerParseErrors :: MonadIO m => Scanner -> Word32 -> m ()
setScannerParseErrors :: Scanner -> Word32 -> m ()
setScannerParseErrors s :: Scanner
s val :: 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 :: 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` 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

scanner_parseErrors :: AttrLabelProxy "parseErrors"
scanner_parseErrors = AttrLabelProxy

#endif


-- | Get the value of the “@input_name@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #inputName
-- @
getScannerInputName :: MonadIO m => Scanner -> m (Maybe T.Text)
getScannerInputName :: Scanner -> m (Maybe Text)
getScannerInputName s :: 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 :: 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` 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
$ \val' :: 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

-- | Set the value of the “@input_name@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #inputName 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerInputName :: MonadIO m => Scanner -> CString -> m ()
setScannerInputName :: Scanner -> CString -> m ()
setScannerInputName s :: Scanner
s val :: 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 :: 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` 16) (CString
val :: CString)

-- | Set the value of the “@input_name@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #inputName
-- @
clearScannerInputName :: MonadIO m => Scanner -> m ()
clearScannerInputName :: Scanner -> m ()
clearScannerInputName s :: 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 :: 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` 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

scanner_inputName :: AttrLabelProxy "inputName"
scanner_inputName = AttrLabelProxy

#endif


-- | Get the value of the “@qdata@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #qdata
-- @
getScannerQdata :: MonadIO m => Scanner -> m (Maybe GLib.Data.Data)
getScannerQdata :: Scanner -> m (Maybe Data)
getScannerQdata s :: 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 :: 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` 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
$ \val' :: Ptr Data
val' -> do
        Data
val'' <- ((ManagedPtr Data -> Data) -> Ptr Data -> IO Data
forall a.
(HasCallStack, WrappedPtr 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

-- | Set the value of the “@qdata@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #qdata 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerQdata :: MonadIO m => Scanner -> Ptr GLib.Data.Data -> m ()
setScannerQdata :: Scanner -> Ptr Data -> m ()
setScannerQdata s :: Scanner
s val :: 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 :: 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` 24) (Ptr Data
val :: Ptr GLib.Data.Data)

-- | Set the value of the “@qdata@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #qdata
-- @
clearScannerQdata :: MonadIO m => Scanner -> m ()
clearScannerQdata :: Scanner -> m ()
clearScannerQdata s :: 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 :: 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` 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

scanner_qdata :: AttrLabelProxy "qdata"
scanner_qdata = AttrLabelProxy

#endif


-- | Get the value of the “@config@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #config
-- @
getScannerConfig :: MonadIO m => Scanner -> m (Maybe GLib.ScannerConfig.ScannerConfig)
getScannerConfig :: Scanner -> m (Maybe ScannerConfig)
getScannerConfig s :: 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 :: 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` 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
$ \val' :: Ptr ScannerConfig
val' -> do
        ScannerConfig
val'' <- ((ManagedPtr ScannerConfig -> ScannerConfig)
-> Ptr ScannerConfig -> IO ScannerConfig
forall a.
(HasCallStack, WrappedPtr 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

-- | Set the value of the “@config@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #config 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerConfig :: MonadIO m => Scanner -> Ptr GLib.ScannerConfig.ScannerConfig -> m ()
setScannerConfig :: Scanner -> Ptr ScannerConfig -> m ()
setScannerConfig s :: Scanner
s val :: 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 :: 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` 32) (Ptr ScannerConfig
val :: Ptr GLib.ScannerConfig.ScannerConfig)

-- | Set the value of the “@config@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #config
-- @
clearScannerConfig :: MonadIO m => Scanner -> m ()
clearScannerConfig :: Scanner -> m ()
clearScannerConfig s :: 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 :: 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` 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

scanner_config :: AttrLabelProxy "config"
scanner_config = AttrLabelProxy

#endif


-- | Get the value of the “@token@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #token
-- @
getScannerToken :: MonadIO m => Scanner -> m GLib.Enums.TokenType
getScannerToken :: Scanner -> m TokenType
getScannerToken s :: 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 :: 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` 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'

-- | Set the value of the “@token@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #token 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerToken :: MonadIO m => Scanner -> GLib.Enums.TokenType -> m ()
setScannerToken :: Scanner -> TokenType -> m ()
setScannerToken s :: Scanner
s val :: 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 :: 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` 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

scanner_token :: AttrLabelProxy "token"
scanner_token = AttrLabelProxy

#endif


-- | Get the value of the “@value@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #value
-- @
getScannerValue :: MonadIO m => Scanner -> m GLib.TokenValue.TokenValue
getScannerValue :: Scanner -> m TokenValue
getScannerValue s :: 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 :: 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` 48 :: (Ptr GLib.TokenValue.TokenValue)
    TokenValue
val' <- ((ManagedPtr TokenValue -> TokenValue)
-> Ptr TokenValue -> IO TokenValue
forall a.
(HasCallStack, WrappedPtr 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

scanner_value :: AttrLabelProxy "value"
scanner_value = AttrLabelProxy

#endif


-- | Get the value of the “@line@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #line
-- @
getScannerLine :: MonadIO m => Scanner -> m Word32
getScannerLine :: Scanner -> m Word32
getScannerLine s :: 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 :: 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` 56) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@line@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #line 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerLine :: MonadIO m => Scanner -> Word32 -> m ()
setScannerLine :: Scanner -> Word32 -> m ()
setScannerLine s :: Scanner
s val :: 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 :: 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` 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

scanner_line :: AttrLabelProxy "line"
scanner_line = AttrLabelProxy

#endif


-- | Get the value of the “@position@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #position
-- @
getScannerPosition :: MonadIO m => Scanner -> m Word32
getScannerPosition :: Scanner -> m Word32
getScannerPosition s :: 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 :: 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` 60) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@position@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #position 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerPosition :: MonadIO m => Scanner -> Word32 -> m ()
setScannerPosition :: Scanner -> Word32 -> m ()
setScannerPosition s :: Scanner
s val :: 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 :: 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` 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

scanner_position :: AttrLabelProxy "position"
scanner_position = AttrLabelProxy

#endif


-- | Get the value of the “@next_token@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #nextToken
-- @
getScannerNextToken :: MonadIO m => Scanner -> m GLib.Enums.TokenType
getScannerNextToken :: Scanner -> m TokenType
getScannerNextToken s :: 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 :: 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` 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'

-- | Set the value of the “@next_token@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #nextToken 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerNextToken :: MonadIO m => Scanner -> GLib.Enums.TokenType -> m ()
setScannerNextToken :: Scanner -> TokenType -> m ()
setScannerNextToken s :: Scanner
s val :: 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 :: 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` 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

scanner_nextToken :: AttrLabelProxy "nextToken"
scanner_nextToken = AttrLabelProxy

#endif


-- | Get the value of the “@next_value@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #nextValue
-- @
getScannerNextValue :: MonadIO m => Scanner -> m GLib.TokenValue.TokenValue
getScannerNextValue :: Scanner -> m TokenValue
getScannerNextValue s :: 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 :: 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` 72 :: (Ptr GLib.TokenValue.TokenValue)
    TokenValue
val' <- ((ManagedPtr TokenValue -> TokenValue)
-> Ptr TokenValue -> IO TokenValue
forall a.
(HasCallStack, WrappedPtr 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

scanner_nextValue :: AttrLabelProxy "nextValue"
scanner_nextValue = AttrLabelProxy

#endif


-- | Get the value of the “@next_line@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #nextLine
-- @
getScannerNextLine :: MonadIO m => Scanner -> m Word32
getScannerNextLine :: Scanner -> m Word32
getScannerNextLine s :: 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 :: 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` 80) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@next_line@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #nextLine 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerNextLine :: MonadIO m => Scanner -> Word32 -> m ()
setScannerNextLine :: Scanner -> Word32 -> m ()
setScannerNextLine s :: Scanner
s val :: 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 :: 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` 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

scanner_nextLine :: AttrLabelProxy "nextLine"
scanner_nextLine = AttrLabelProxy

#endif


-- | Get the value of the “@next_position@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #nextPosition
-- @
getScannerNextPosition :: MonadIO m => Scanner -> m Word32
getScannerNextPosition :: Scanner -> m Word32
getScannerNextPosition s :: 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 :: 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` 84) :: IO Word32
    Word32 -> IO Word32
forall (m :: * -> *) a. Monad m => a -> m a
return Word32
val

-- | Set the value of the “@next_position@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #nextPosition 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerNextPosition :: MonadIO m => Scanner -> Word32 -> m ()
setScannerNextPosition :: Scanner -> Word32 -> m ()
setScannerNextPosition s :: Scanner
s val :: 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 :: 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` 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

scanner_nextPosition :: AttrLabelProxy "nextPosition"
scanner_nextPosition = AttrLabelProxy

#endif


-- | Get the value of the “@msg_handler@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.get' scanner #msgHandler
-- @
getScannerMsgHandler :: MonadIO m => Scanner -> m (Maybe GLib.Callbacks.ScannerMsgFunc)
getScannerMsgHandler :: Scanner -> m (Maybe ScannerMsgFunc)
getScannerMsgHandler s :: 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 :: 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` 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
$ \val' :: 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

-- | Set the value of the “@msg_handler@” field.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.set' scanner [ #msgHandler 'Data.GI.Base.Attributes.:=' value ]
-- @
setScannerMsgHandler :: MonadIO m => Scanner -> FunPtr GLib.Callbacks.C_ScannerMsgFunc -> m ()
setScannerMsgHandler :: Scanner -> FunPtr C_ScannerMsgFunc -> m ()
setScannerMsgHandler s :: Scanner
s val :: 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 :: 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` 136) (FunPtr C_ScannerMsgFunc
val :: FunPtr GLib.Callbacks.C_ScannerMsgFunc)

-- | Set the value of the “@msg_handler@” field to `Nothing`.
-- When <https://github.com/haskell-gi/haskell-gi/wiki/Overloading overloading> is enabled, this is equivalent to
-- 
-- @
-- 'Data.GI.Base.Attributes.clear' #msgHandler
-- @
clearScannerMsgHandler :: MonadIO m => Scanner -> m ()
clearScannerMsgHandler :: Scanner -> m ()
clearScannerMsgHandler s :: 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 :: 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` 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)

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

-- method Scanner::cur_line
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_cur_line" g_scanner_cur_line :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO Word32

-- | Returns the current line in the input stream (counting
-- from 1). This is the line of the last token parsed via
-- 'GI.GLib.Structs.Scanner.scannerGetNextToken'.
scannerCurLine ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m Word32
    -- ^ __Returns:__ the current line
scannerCurLine :: Scanner -> m Word32
scannerCurLine scanner :: 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.MethodInfo ScannerCurLineMethodInfo Scanner signature where
    overloadedMethod = scannerCurLine

#endif

-- method Scanner::cur_position
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_cur_position" g_scanner_cur_position :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO Word32

-- | Returns the current position in the current line (counting
-- from 0). This is the position of the last token parsed via
-- 'GI.GLib.Structs.Scanner.scannerGetNextToken'.
scannerCurPosition ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m Word32
    -- ^ __Returns:__ the current position on the line
scannerCurPosition :: Scanner -> m Word32
scannerCurPosition scanner :: 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.MethodInfo ScannerCurPositionMethodInfo Scanner signature where
    overloadedMethod = scannerCurPosition

#endif

-- method Scanner::cur_token
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "TokenType" })
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_cur_token" g_scanner_cur_token :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO CUInt

-- | Gets the current token type. This is simply the /@token@/
-- field in the t'GI.GLib.Structs.Scanner.Scanner' structure.
scannerCurToken ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m GLib.Enums.TokenType
    -- ^ __Returns:__ the current token type
scannerCurToken :: Scanner -> m TokenType
scannerCurToken scanner :: 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.MethodInfo ScannerCurTokenMethodInfo Scanner signature where
    overloadedMethod = scannerCurToken

#endif

-- method Scanner::destroy
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_destroy" g_scanner_destroy :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO ()

-- | Frees all memory used by the t'GI.GLib.Structs.Scanner.Scanner'.
scannerDestroy ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m ()
scannerDestroy :: Scanner -> m ()
scannerDestroy scanner :: 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.MethodInfo ScannerDestroyMethodInfo Scanner signature where
    overloadedMethod = scannerDestroy

#endif

-- method Scanner::eof
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , 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 "g_scanner_eof" g_scanner_eof :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO CInt

-- | Returns 'P.True' if the scanner has reached the end of
-- the file or text buffer.
scannerEof ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m Bool
    -- ^ __Returns:__ 'P.True' if the scanner has reached the end of
    --     the file or text buffer
scannerEof :: Scanner -> m Bool
scannerEof scanner :: 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
/= 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.MethodInfo ScannerEofMethodInfo Scanner signature where
    overloadedMethod = scannerEof

#endif

-- method Scanner::get_next_token
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "TokenType" })
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_get_next_token" g_scanner_get_next_token :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO CUInt

-- | Parses the next token just like 'GI.GLib.Structs.Scanner.scannerPeekNextToken'
-- and also removes it from the input stream. The token data is
-- placed in the /@token@/, /@value@/, /@line@/, and /@position@/ fields of
-- the t'GI.GLib.Structs.Scanner.Scanner' structure.
scannerGetNextToken ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m GLib.Enums.TokenType
    -- ^ __Returns:__ the type of the token
scannerGetNextToken :: Scanner -> m TokenType
scannerGetNextToken scanner :: 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.MethodInfo ScannerGetNextTokenMethodInfo Scanner signature where
    overloadedMethod = scannerGetNextToken

#endif

-- method Scanner::input_file
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "input_fd"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a file descriptor" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_input_file" g_scanner_input_file :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Int32 ->                                -- input_fd : TBasicType TInt
    IO ()

-- | Prepares to scan a file.
scannerInputFile ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> Int32
    -- ^ /@inputFd@/: a file descriptor
    -> m ()
scannerInputFile :: Scanner -> Int32 -> m ()
scannerInputFile scanner :: Scanner
scanner inputFd :: 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.MethodInfo ScannerInputFileMethodInfo Scanner signature where
    overloadedMethod = scannerInputFile

#endif

-- method Scanner::input_text
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the text buffer to scan"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "text_len"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the length of the text buffer"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_input_text" g_scanner_input_text :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    CString ->                              -- text : TBasicType TUTF8
    Word32 ->                               -- text_len : TBasicType TUInt
    IO ()

-- | Prepares to scan a text buffer.
scannerInputText ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> T.Text
    -- ^ /@text@/: the text buffer to scan
    -> Word32
    -- ^ /@textLen@/: the length of the text buffer
    -> m ()
scannerInputText :: Scanner -> Text -> Word32 -> m ()
scannerInputText scanner :: Scanner
scanner text :: Text
text textLen :: 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.MethodInfo ScannerInputTextMethodInfo Scanner signature where
    overloadedMethod = scannerInputText

#endif

-- method Scanner::lookup_symbol
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symbol"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the symbol to look up"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_lookup_symbol" g_scanner_lookup_symbol :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    CString ->                              -- symbol : TBasicType TUTF8
    IO (Ptr ())

-- | Looks up a symbol in the current scope and return its value.
-- If the symbol is not bound in the current scope, 'P.Nothing' is
-- returned.
scannerLookupSymbol ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> T.Text
    -- ^ /@symbol@/: the symbol to look up
    -> m (Ptr ())
    -- ^ __Returns:__ the value of /@symbol@/ in the current scope, or 'P.Nothing'
    --     if /@symbol@/ is not bound in the current scope
scannerLookupSymbol :: Scanner -> Text -> m (Ptr ())
scannerLookupSymbol scanner :: Scanner
scanner symbol :: 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.MethodInfo ScannerLookupSymbolMethodInfo Scanner signature where
    overloadedMethod = scannerLookupSymbol

#endif

-- method Scanner::peek_next_token
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TInterface Name { namespace = "GLib" , name = "TokenType" })
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_peek_next_token" g_scanner_peek_next_token :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO CUInt

-- | Parses the next token, without removing it from the input stream.
-- The token data is placed in the /@nextToken@/, /@nextValue@/, /@nextLine@/,
-- and /@nextPosition@/ fields of the t'GI.GLib.Structs.Scanner.Scanner' structure.
-- 
-- Note that, while the token is not removed from the input stream
-- (i.e. the next call to 'GI.GLib.Structs.Scanner.scannerGetNextToken' will return the
-- same token), it will not be reevaluated. This can lead to surprising
-- results when changing scope or the scanner configuration after peeking
-- the next token. Getting the next token after switching the scope or
-- configuration will return whatever was peeked before, regardless of
-- any symbols that may have been added or removed in the new scope.
scannerPeekNextToken ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m GLib.Enums.TokenType
    -- ^ __Returns:__ the type of the token
scannerPeekNextToken :: Scanner -> m TokenType
scannerPeekNextToken scanner :: 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.MethodInfo ScannerPeekNextTokenMethodInfo Scanner signature where
    overloadedMethod = scannerPeekNextToken

#endif

-- method Scanner::scope_add_symbol
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "scope_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the scope id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symbol"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the symbol to add" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "value"
--           , argType = TBasicType TPtr
--           , direction = DirectionIn
--           , mayBeNull = True
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the value of the symbol"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_scope_add_symbol" g_scanner_scope_add_symbol :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Word32 ->                               -- scope_id : TBasicType TUInt
    CString ->                              -- symbol : TBasicType TUTF8
    Ptr () ->                               -- value : TBasicType TPtr
    IO ()

-- | Adds a symbol to the given scope.
scannerScopeAddSymbol ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> Word32
    -- ^ /@scopeId@/: the scope id
    -> T.Text
    -- ^ /@symbol@/: the symbol to add
    -> Ptr ()
    -- ^ /@value@/: the value of the symbol
    -> m ()
scannerScopeAddSymbol :: Scanner -> Word32 -> Text -> Ptr () -> m ()
scannerScopeAddSymbol scanner :: Scanner
scanner scopeId :: Word32
scopeId symbol :: Text
symbol value :: 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.MethodInfo ScannerScopeAddSymbolMethodInfo Scanner signature where
    overloadedMethod = scannerScopeAddSymbol

#endif

-- method Scanner::scope_lookup_symbol
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "scope_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the scope id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symbol"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the symbol to look up"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TPtr)
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_scope_lookup_symbol" g_scanner_scope_lookup_symbol :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Word32 ->                               -- scope_id : TBasicType TUInt
    CString ->                              -- symbol : TBasicType TUTF8
    IO (Ptr ())

-- | Looks up a symbol in a scope and return its value. If the
-- symbol is not bound in the scope, 'P.Nothing' is returned.
scannerScopeLookupSymbol ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> Word32
    -- ^ /@scopeId@/: the scope id
    -> T.Text
    -- ^ /@symbol@/: the symbol to look up
    -> m (Ptr ())
    -- ^ __Returns:__ the value of /@symbol@/ in the given scope, or 'P.Nothing'
    --     if /@symbol@/ is not bound in the given scope.
scannerScopeLookupSymbol :: Scanner -> Word32 -> Text -> m (Ptr ())
scannerScopeLookupSymbol scanner :: Scanner
scanner scopeId :: Word32
scopeId symbol :: 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.MethodInfo ScannerScopeLookupSymbolMethodInfo Scanner signature where
    overloadedMethod = scannerScopeLookupSymbol

#endif

-- method Scanner::scope_remove_symbol
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "scope_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the scope id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symbol"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the symbol to remove"
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_scope_remove_symbol" g_scanner_scope_remove_symbol :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Word32 ->                               -- scope_id : TBasicType TUInt
    CString ->                              -- symbol : TBasicType TUTF8
    IO ()

-- | Removes a symbol from a scope.
scannerScopeRemoveSymbol ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> Word32
    -- ^ /@scopeId@/: the scope id
    -> T.Text
    -- ^ /@symbol@/: the symbol to remove
    -> m ()
scannerScopeRemoveSymbol :: Scanner -> Word32 -> Text -> m ()
scannerScopeRemoveSymbol scanner :: Scanner
scanner scopeId :: Word32
scopeId symbol :: 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.MethodInfo ScannerScopeRemoveSymbolMethodInfo Scanner signature where
    overloadedMethod = scannerScopeRemoveSymbol

#endif

-- method Scanner::set_scope
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "scope_id"
--           , argType = TBasicType TUInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the new scope id" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Just (TBasicType TUInt)
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_set_scope" g_scanner_set_scope :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    Word32 ->                               -- scope_id : TBasicType TUInt
    IO Word32

-- | Sets the current scope.
scannerSetScope ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> Word32
    -- ^ /@scopeId@/: the new scope id
    -> m Word32
    -- ^ __Returns:__ the old scope id
scannerSetScope :: Scanner -> Word32 -> m Word32
scannerSetScope scanner :: Scanner
scanner scopeId :: 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.MethodInfo ScannerSetScopeMethodInfo Scanner signature where
    overloadedMethod = scannerSetScope

#endif

-- method Scanner::sync_file_offset
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_sync_file_offset" g_scanner_sync_file_offset :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    IO ()

-- | Rewinds the filedescriptor to the current buffer position
-- and blows the file read ahead buffer. This is useful for
-- third party uses of the scanners filedescriptor, which hooks
-- onto the current scanning position.
scannerSyncFileOffset ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> m ()
scannerSyncFileOffset :: Scanner -> m ()
scannerSyncFileOffset scanner :: 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.MethodInfo ScannerSyncFileOffsetMethodInfo Scanner signature where
    overloadedMethod = scannerSyncFileOffset

#endif

-- method Scanner::unexp_token
-- method type : OrdinaryMethod
-- Args: [ Arg
--           { argCName = "scanner"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "Scanner" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "a #GScanner" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "expected_token"
--           , argType =
--               TInterface Name { namespace = "GLib" , name = "TokenType" }
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText = Just "the expected token" , sinceVersion = Nothing }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "identifier_spec"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a string describing how the scanner's user\n    refers to identifiers (%NULL defaults to \"identifier\").\n    This is used if @expected_token is %G_TOKEN_IDENTIFIER or\n    %G_TOKEN_IDENTIFIER_NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symbol_spec"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a string describing how the scanner's user refers\n    to symbols (%NULL defaults to \"symbol\"). This is used if\n    @expected_token is %G_TOKEN_SYMBOL or any token value greater\n    than %G_TOKEN_LAST."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "symbol_name"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "the name of the symbol, if the scanner's current\n    token is a symbol."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "message"
--           , argType = TBasicType TUTF8
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "a message string to output at the end of the\n    warning/error, or %NULL."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       , Arg
--           { argCName = "is_error"
--           , argType = TBasicType TInt
--           , direction = DirectionIn
--           , mayBeNull = False
--           , argDoc =
--               Documentation
--                 { rawDocText =
--                     Just
--                       "if %TRUE it is output as an error. If %FALSE it is\n    output as a warning."
--                 , sinceVersion = Nothing
--                 }
--           , argScope = ScopeTypeInvalid
--           , argClosure = -1
--           , argDestroy = -1
--           , argCallerAllocates = False
--           , transfer = TransferNothing
--           }
--       ]
-- Lengths: []
-- returnType: Nothing
-- throws : False
-- Skip return : False

foreign import ccall "g_scanner_unexp_token" g_scanner_unexp_token :: 
    Ptr Scanner ->                          -- scanner : TInterface (Name {namespace = "GLib", name = "Scanner"})
    CUInt ->                                -- expected_token : TInterface (Name {namespace = "GLib", name = "TokenType"})
    CString ->                              -- identifier_spec : TBasicType TUTF8
    CString ->                              -- symbol_spec : TBasicType TUTF8
    CString ->                              -- symbol_name : TBasicType TUTF8
    CString ->                              -- message : TBasicType TUTF8
    Int32 ->                                -- is_error : TBasicType TInt
    IO ()

-- | Outputs a message through the scanner\'s msg_handler,
-- resulting from an unexpected token in the input stream.
-- Note that you should not call 'GI.GLib.Structs.Scanner.scannerPeekNextToken'
-- followed by 'GI.GLib.Structs.Scanner.scannerUnexpToken' without an intermediate
-- call to 'GI.GLib.Structs.Scanner.scannerGetNextToken', as 'GI.GLib.Structs.Scanner.scannerUnexpToken'
-- evaluates the scanner\'s current token (not the peeked token)
-- to construct part of the message.
scannerUnexpToken ::
    (B.CallStack.HasCallStack, MonadIO m) =>
    Scanner
    -- ^ /@scanner@/: a t'GI.GLib.Structs.Scanner.Scanner'
    -> GLib.Enums.TokenType
    -- ^ /@expectedToken@/: the expected token
    -> T.Text
    -- ^ /@identifierSpec@/: a string describing how the scanner\'s user
    --     refers to identifiers ('P.Nothing' defaults to \"identifier\").
    --     This is used if /@expectedToken@/ is 'GI.GLib.Enums.TokenTypeIdentifier' or
    --     'GI.GLib.Enums.TokenTypeIdentifierNull'.
    -> T.Text
    -- ^ /@symbolSpec@/: a string describing how the scanner\'s user refers
    --     to symbols ('P.Nothing' defaults to \"symbol\"). This is used if
    --     /@expectedToken@/ is 'GI.GLib.Enums.TokenTypeSymbol' or any token value greater
    --     than @/G_TOKEN_LAST/@.
    -> T.Text
    -- ^ /@symbolName@/: the name of the symbol, if the scanner\'s current
    --     token is a symbol.
    -> T.Text
    -- ^ /@message@/: a message string to output at the end of the
    --     warning\/error, or 'P.Nothing'.
    -> Int32
    -- ^ /@isError@/: if 'P.True' it is output as an error. If 'P.False' it is
    --     output as a warning.
    -> m ()
scannerUnexpToken :: Scanner
-> TokenType -> Text -> Text -> Text -> Text -> Int32 -> m ()
scannerUnexpToken scanner :: Scanner
scanner expectedToken :: TokenType
expectedToken identifierSpec :: Text
identifierSpec symbolSpec :: Text
symbolSpec symbolName :: Text
symbolName message :: Text
message isError :: 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.MethodInfo ScannerUnexpTokenMethodInfo Scanner signature where
    overloadedMethod = 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.MethodInfo 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

#endif