#define ENABLE_OVERLOADING (MIN_VERSION_haskell_gi_overloading(1,0,0) \
&& !defined(__HADDOCK_VERSION__))
module GI.GLib.Structs.Scanner
(
Scanner(..) ,
newZeroScanner ,
noScanner ,
#if ENABLE_OVERLOADING
ScannerCurLineMethodInfo ,
#endif
scannerCurLine ,
#if ENABLE_OVERLOADING
ScannerCurPositionMethodInfo ,
#endif
scannerCurPosition ,
#if ENABLE_OVERLOADING
ScannerCurTokenMethodInfo ,
#endif
scannerCurToken ,
#if ENABLE_OVERLOADING
ScannerDestroyMethodInfo ,
#endif
scannerDestroy ,
#if ENABLE_OVERLOADING
ScannerEofMethodInfo ,
#endif
scannerEof ,
#if ENABLE_OVERLOADING
ScannerGetNextTokenMethodInfo ,
#endif
scannerGetNextToken ,
#if ENABLE_OVERLOADING
ScannerInputFileMethodInfo ,
#endif
scannerInputFile ,
#if ENABLE_OVERLOADING
ScannerInputTextMethodInfo ,
#endif
scannerInputText ,
#if ENABLE_OVERLOADING
ScannerLookupSymbolMethodInfo ,
#endif
scannerLookupSymbol ,
#if ENABLE_OVERLOADING
ScannerPeekNextTokenMethodInfo ,
#endif
scannerPeekNextToken ,
#if ENABLE_OVERLOADING
ScannerScopeAddSymbolMethodInfo ,
#endif
scannerScopeAddSymbol ,
#if ENABLE_OVERLOADING
ScannerScopeLookupSymbolMethodInfo ,
#endif
scannerScopeLookupSymbol ,
#if ENABLE_OVERLOADING
ScannerScopeRemoveSymbolMethodInfo ,
#endif
scannerScopeRemoveSymbol ,
#if ENABLE_OVERLOADING
ScannerSetScopeMethodInfo ,
#endif
scannerSetScope ,
#if ENABLE_OVERLOADING
ScannerSyncFileOffsetMethodInfo ,
#endif
scannerSyncFileOffset ,
#if ENABLE_OVERLOADING
ScannerUnexpTokenMethodInfo ,
#endif
scannerUnexpToken ,
clearScannerConfig ,
getScannerConfig ,
#if ENABLE_OVERLOADING
scanner_config ,
#endif
setScannerConfig ,
clearScannerInputName ,
getScannerInputName ,
#if ENABLE_OVERLOADING
scanner_inputName ,
#endif
setScannerInputName ,
getScannerLine ,
#if ENABLE_OVERLOADING
scanner_line ,
#endif
setScannerLine ,
getScannerMaxParseErrors ,
#if ENABLE_OVERLOADING
scanner_maxParseErrors ,
#endif
setScannerMaxParseErrors ,
clearScannerMsgHandler ,
getScannerMsgHandler ,
#if ENABLE_OVERLOADING
scanner_msgHandler ,
#endif
setScannerMsgHandler ,
getScannerNextLine ,
#if ENABLE_OVERLOADING
scanner_nextLine ,
#endif
setScannerNextLine ,
getScannerNextPosition ,
#if ENABLE_OVERLOADING
scanner_nextPosition ,
#endif
setScannerNextPosition ,
getScannerNextToken ,
#if ENABLE_OVERLOADING
scanner_nextToken ,
#endif
setScannerNextToken ,
getScannerNextValue ,
#if ENABLE_OVERLOADING
scanner_nextValue ,
#endif
getScannerParseErrors ,
#if ENABLE_OVERLOADING
scanner_parseErrors ,
#endif
setScannerParseErrors ,
getScannerPosition ,
#if ENABLE_OVERLOADING
scanner_position ,
#endif
setScannerPosition ,
clearScannerQdata ,
getScannerQdata ,
#if ENABLE_OVERLOADING
scanner_qdata ,
#endif
setScannerQdata ,
getScannerToken ,
#if ENABLE_OVERLOADING
scanner_token ,
#endif
setScannerToken ,
clearScannerUserData ,
getScannerUserData ,
#if ENABLE_OVERLOADING
scanner_userData ,
#endif
setScannerUserData ,
getScannerValue ,
#if 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.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.Text as T
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GI.GLib.Callbacks as GLib.Callbacks
import {-# SOURCE #-} qualified GI.GLib.Enums as GLib.Enums
import {-# SOURCE #-} qualified GI.GLib.Structs.Data as GLib.Data
import {-# SOURCE #-} qualified GI.GLib.Structs.ScannerConfig as GLib.ScannerConfig
import {-# SOURCE #-} qualified GI.GLib.Unions.TokenValue as GLib.TokenValue
newtype Scanner = Scanner (ManagedPtr Scanner)
instance WrappedPtr Scanner where
wrappedPtrCalloc = callocBytes 144
wrappedPtrCopy = \p -> withManagedPtr p (copyBytes 144 >=> wrapPtr Scanner)
wrappedPtrFree = Just ptr_to_g_free
newZeroScanner :: MonadIO m => m Scanner
newZeroScanner = liftIO $ wrappedPtrCalloc >>= wrapPtr Scanner
instance tag ~ 'AttrSet => Constructible Scanner tag where
new _ attrs = do
o <- newZeroScanner
GI.Attributes.set o attrs
return o
noScanner :: Maybe Scanner
noScanner = Nothing
getScannerUserData :: MonadIO m => Scanner -> m (Ptr ())
getScannerUserData s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 0) :: IO (Ptr ())
return val
setScannerUserData :: MonadIO m => Scanner -> Ptr () -> m ()
setScannerUserData s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (val :: Ptr ())
clearScannerUserData :: MonadIO m => Scanner -> m ()
clearScannerUserData s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 0) (FP.nullPtr :: Ptr ())
#if ENABLE_OVERLOADING
data ScannerUserDataFieldInfo
instance AttrInfo ScannerUserDataFieldInfo where
type AttrAllowedOps ScannerUserDataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerUserDataFieldInfo = (~) (Ptr ())
type AttrBaseTypeConstraint ScannerUserDataFieldInfo = (~) Scanner
type AttrGetType ScannerUserDataFieldInfo = Ptr ()
type AttrLabel ScannerUserDataFieldInfo = "user_data"
type AttrOrigin ScannerUserDataFieldInfo = Scanner
attrGet _ = getScannerUserData
attrSet _ = setScannerUserData
attrConstruct = undefined
attrClear _ = clearScannerUserData
scanner_userData :: AttrLabelProxy "userData"
scanner_userData = AttrLabelProxy
#endif
getScannerMaxParseErrors :: MonadIO m => Scanner -> m Word32
getScannerMaxParseErrors s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 8) :: IO Word32
return val
setScannerMaxParseErrors :: MonadIO m => Scanner -> Word32 -> m ()
setScannerMaxParseErrors s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 8) (val :: Word32)
#if ENABLE_OVERLOADING
data ScannerMaxParseErrorsFieldInfo
instance AttrInfo ScannerMaxParseErrorsFieldInfo where
type AttrAllowedOps ScannerMaxParseErrorsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerMaxParseErrorsFieldInfo = (~) Word32
type AttrBaseTypeConstraint ScannerMaxParseErrorsFieldInfo = (~) Scanner
type AttrGetType ScannerMaxParseErrorsFieldInfo = Word32
type AttrLabel ScannerMaxParseErrorsFieldInfo = "max_parse_errors"
type AttrOrigin ScannerMaxParseErrorsFieldInfo = Scanner
attrGet _ = getScannerMaxParseErrors
attrSet _ = setScannerMaxParseErrors
attrConstruct = undefined
attrClear _ = undefined
scanner_maxParseErrors :: AttrLabelProxy "maxParseErrors"
scanner_maxParseErrors = AttrLabelProxy
#endif
getScannerParseErrors :: MonadIO m => Scanner -> m Word32
getScannerParseErrors s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 12) :: IO Word32
return val
setScannerParseErrors :: MonadIO m => Scanner -> Word32 -> m ()
setScannerParseErrors s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 12) (val :: Word32)
#if ENABLE_OVERLOADING
data ScannerParseErrorsFieldInfo
instance AttrInfo ScannerParseErrorsFieldInfo where
type AttrAllowedOps ScannerParseErrorsFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerParseErrorsFieldInfo = (~) Word32
type AttrBaseTypeConstraint ScannerParseErrorsFieldInfo = (~) Scanner
type AttrGetType ScannerParseErrorsFieldInfo = Word32
type AttrLabel ScannerParseErrorsFieldInfo = "parse_errors"
type AttrOrigin ScannerParseErrorsFieldInfo = Scanner
attrGet _ = getScannerParseErrors
attrSet _ = setScannerParseErrors
attrConstruct = undefined
attrClear _ = undefined
scanner_parseErrors :: AttrLabelProxy "parseErrors"
scanner_parseErrors = AttrLabelProxy
#endif
getScannerInputName :: MonadIO m => Scanner -> m (Maybe T.Text)
getScannerInputName s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 16) :: IO CString
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- cstringToText val'
return val''
return result
setScannerInputName :: MonadIO m => Scanner -> CString -> m ()
setScannerInputName s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (val :: CString)
clearScannerInputName :: MonadIO m => Scanner -> m ()
clearScannerInputName s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 16) (FP.nullPtr :: CString)
#if ENABLE_OVERLOADING
data ScannerInputNameFieldInfo
instance AttrInfo ScannerInputNameFieldInfo where
type AttrAllowedOps ScannerInputNameFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerInputNameFieldInfo = (~) CString
type AttrBaseTypeConstraint ScannerInputNameFieldInfo = (~) Scanner
type AttrGetType ScannerInputNameFieldInfo = Maybe T.Text
type AttrLabel ScannerInputNameFieldInfo = "input_name"
type AttrOrigin ScannerInputNameFieldInfo = Scanner
attrGet _ = getScannerInputName
attrSet _ = setScannerInputName
attrConstruct = undefined
attrClear _ = clearScannerInputName
scanner_inputName :: AttrLabelProxy "inputName"
scanner_inputName = AttrLabelProxy
#endif
getScannerQdata :: MonadIO m => Scanner -> m (Maybe GLib.Data.Data)
getScannerQdata s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 24) :: IO (Ptr GLib.Data.Data)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newPtr GLib.Data.Data) val'
return val''
return result
setScannerQdata :: MonadIO m => Scanner -> Ptr GLib.Data.Data -> m ()
setScannerQdata s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (val :: Ptr GLib.Data.Data)
clearScannerQdata :: MonadIO m => Scanner -> m ()
clearScannerQdata s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 24) (FP.nullPtr :: Ptr GLib.Data.Data)
#if ENABLE_OVERLOADING
data ScannerQdataFieldInfo
instance AttrInfo ScannerQdataFieldInfo where
type AttrAllowedOps ScannerQdataFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerQdataFieldInfo = (~) (Ptr GLib.Data.Data)
type AttrBaseTypeConstraint ScannerQdataFieldInfo = (~) Scanner
type AttrGetType ScannerQdataFieldInfo = Maybe GLib.Data.Data
type AttrLabel ScannerQdataFieldInfo = "qdata"
type AttrOrigin ScannerQdataFieldInfo = Scanner
attrGet _ = getScannerQdata
attrSet _ = setScannerQdata
attrConstruct = undefined
attrClear _ = clearScannerQdata
scanner_qdata :: AttrLabelProxy "qdata"
scanner_qdata = AttrLabelProxy
#endif
getScannerConfig :: MonadIO m => Scanner -> m (Maybe GLib.ScannerConfig.ScannerConfig)
getScannerConfig s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 32) :: IO (Ptr GLib.ScannerConfig.ScannerConfig)
result <- SP.convertIfNonNull val $ \val' -> do
val'' <- (newPtr GLib.ScannerConfig.ScannerConfig) val'
return val''
return result
setScannerConfig :: MonadIO m => Scanner -> Ptr GLib.ScannerConfig.ScannerConfig -> m ()
setScannerConfig s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (val :: Ptr GLib.ScannerConfig.ScannerConfig)
clearScannerConfig :: MonadIO m => Scanner -> m ()
clearScannerConfig s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 32) (FP.nullPtr :: Ptr GLib.ScannerConfig.ScannerConfig)
#if ENABLE_OVERLOADING
data ScannerConfigFieldInfo
instance AttrInfo ScannerConfigFieldInfo where
type AttrAllowedOps ScannerConfigFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerConfigFieldInfo = (~) (Ptr GLib.ScannerConfig.ScannerConfig)
type AttrBaseTypeConstraint ScannerConfigFieldInfo = (~) Scanner
type AttrGetType ScannerConfigFieldInfo = Maybe GLib.ScannerConfig.ScannerConfig
type AttrLabel ScannerConfigFieldInfo = "config"
type AttrOrigin ScannerConfigFieldInfo = Scanner
attrGet _ = getScannerConfig
attrSet _ = setScannerConfig
attrConstruct = undefined
attrClear _ = clearScannerConfig
scanner_config :: AttrLabelProxy "config"
scanner_config = AttrLabelProxy
#endif
getScannerToken :: MonadIO m => Scanner -> m GLib.Enums.TokenType
getScannerToken s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 40) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setScannerToken :: MonadIO m => Scanner -> GLib.Enums.TokenType -> m ()
setScannerToken s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 40) (val' :: CUInt)
#if ENABLE_OVERLOADING
data ScannerTokenFieldInfo
instance AttrInfo ScannerTokenFieldInfo where
type AttrAllowedOps ScannerTokenFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerTokenFieldInfo = (~) GLib.Enums.TokenType
type AttrBaseTypeConstraint ScannerTokenFieldInfo = (~) Scanner
type AttrGetType ScannerTokenFieldInfo = GLib.Enums.TokenType
type AttrLabel ScannerTokenFieldInfo = "token"
type AttrOrigin ScannerTokenFieldInfo = Scanner
attrGet _ = getScannerToken
attrSet _ = setScannerToken
attrConstruct = undefined
attrClear _ = undefined
scanner_token :: AttrLabelProxy "token"
scanner_token = AttrLabelProxy
#endif
getScannerValue :: MonadIO m => Scanner -> m GLib.TokenValue.TokenValue
getScannerValue s = liftIO $ withManagedPtr s $ \ptr -> do
let val = ptr `plusPtr` 48 :: (Ptr GLib.TokenValue.TokenValue)
val' <- (newPtr GLib.TokenValue.TokenValue) val
return val'
#if ENABLE_OVERLOADING
data ScannerValueFieldInfo
instance AttrInfo ScannerValueFieldInfo where
type AttrAllowedOps ScannerValueFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint ScannerValueFieldInfo = (~) (Ptr GLib.TokenValue.TokenValue)
type AttrBaseTypeConstraint ScannerValueFieldInfo = (~) Scanner
type AttrGetType ScannerValueFieldInfo = GLib.TokenValue.TokenValue
type AttrLabel ScannerValueFieldInfo = "value"
type AttrOrigin ScannerValueFieldInfo = Scanner
attrGet _ = getScannerValue
attrSet _ = undefined
attrConstruct = undefined
attrClear _ = undefined
scanner_value :: AttrLabelProxy "value"
scanner_value = AttrLabelProxy
#endif
getScannerLine :: MonadIO m => Scanner -> m Word32
getScannerLine s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 56) :: IO Word32
return val
setScannerLine :: MonadIO m => Scanner -> Word32 -> m ()
setScannerLine s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 56) (val :: Word32)
#if ENABLE_OVERLOADING
data ScannerLineFieldInfo
instance AttrInfo ScannerLineFieldInfo where
type AttrAllowedOps ScannerLineFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerLineFieldInfo = (~) Word32
type AttrBaseTypeConstraint ScannerLineFieldInfo = (~) Scanner
type AttrGetType ScannerLineFieldInfo = Word32
type AttrLabel ScannerLineFieldInfo = "line"
type AttrOrigin ScannerLineFieldInfo = Scanner
attrGet _ = getScannerLine
attrSet _ = setScannerLine
attrConstruct = undefined
attrClear _ = undefined
scanner_line :: AttrLabelProxy "line"
scanner_line = AttrLabelProxy
#endif
getScannerPosition :: MonadIO m => Scanner -> m Word32
getScannerPosition s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 60) :: IO Word32
return val
setScannerPosition :: MonadIO m => Scanner -> Word32 -> m ()
setScannerPosition s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 60) (val :: Word32)
#if ENABLE_OVERLOADING
data ScannerPositionFieldInfo
instance AttrInfo ScannerPositionFieldInfo where
type AttrAllowedOps ScannerPositionFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerPositionFieldInfo = (~) Word32
type AttrBaseTypeConstraint ScannerPositionFieldInfo = (~) Scanner
type AttrGetType ScannerPositionFieldInfo = Word32
type AttrLabel ScannerPositionFieldInfo = "position"
type AttrOrigin ScannerPositionFieldInfo = Scanner
attrGet _ = getScannerPosition
attrSet _ = setScannerPosition
attrConstruct = undefined
attrClear _ = undefined
scanner_position :: AttrLabelProxy "position"
scanner_position = AttrLabelProxy
#endif
getScannerNextToken :: MonadIO m => Scanner -> m GLib.Enums.TokenType
getScannerNextToken s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 64) :: IO CUInt
let val' = (toEnum . fromIntegral) val
return val'
setScannerNextToken :: MonadIO m => Scanner -> GLib.Enums.TokenType -> m ()
setScannerNextToken s val = liftIO $ withManagedPtr s $ \ptr -> do
let val' = (fromIntegral . fromEnum) val
poke (ptr `plusPtr` 64) (val' :: CUInt)
#if ENABLE_OVERLOADING
data ScannerNextTokenFieldInfo
instance AttrInfo ScannerNextTokenFieldInfo where
type AttrAllowedOps ScannerNextTokenFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerNextTokenFieldInfo = (~) GLib.Enums.TokenType
type AttrBaseTypeConstraint ScannerNextTokenFieldInfo = (~) Scanner
type AttrGetType ScannerNextTokenFieldInfo = GLib.Enums.TokenType
type AttrLabel ScannerNextTokenFieldInfo = "next_token"
type AttrOrigin ScannerNextTokenFieldInfo = Scanner
attrGet _ = getScannerNextToken
attrSet _ = setScannerNextToken
attrConstruct = undefined
attrClear _ = undefined
scanner_nextToken :: AttrLabelProxy "nextToken"
scanner_nextToken = AttrLabelProxy
#endif
getScannerNextValue :: MonadIO m => Scanner -> m GLib.TokenValue.TokenValue
getScannerNextValue s = liftIO $ withManagedPtr s $ \ptr -> do
let val = ptr `plusPtr` 72 :: (Ptr GLib.TokenValue.TokenValue)
val' <- (newPtr GLib.TokenValue.TokenValue) val
return val'
#if ENABLE_OVERLOADING
data ScannerNextValueFieldInfo
instance AttrInfo ScannerNextValueFieldInfo where
type AttrAllowedOps ScannerNextValueFieldInfo = '[ 'AttrGet]
type AttrSetTypeConstraint ScannerNextValueFieldInfo = (~) (Ptr GLib.TokenValue.TokenValue)
type AttrBaseTypeConstraint ScannerNextValueFieldInfo = (~) Scanner
type AttrGetType ScannerNextValueFieldInfo = GLib.TokenValue.TokenValue
type AttrLabel ScannerNextValueFieldInfo = "next_value"
type AttrOrigin ScannerNextValueFieldInfo = Scanner
attrGet _ = getScannerNextValue
attrSet _ = undefined
attrConstruct = undefined
attrClear _ = undefined
scanner_nextValue :: AttrLabelProxy "nextValue"
scanner_nextValue = AttrLabelProxy
#endif
getScannerNextLine :: MonadIO m => Scanner -> m Word32
getScannerNextLine s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 80) :: IO Word32
return val
setScannerNextLine :: MonadIO m => Scanner -> Word32 -> m ()
setScannerNextLine s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 80) (val :: Word32)
#if ENABLE_OVERLOADING
data ScannerNextLineFieldInfo
instance AttrInfo ScannerNextLineFieldInfo where
type AttrAllowedOps ScannerNextLineFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerNextLineFieldInfo = (~) Word32
type AttrBaseTypeConstraint ScannerNextLineFieldInfo = (~) Scanner
type AttrGetType ScannerNextLineFieldInfo = Word32
type AttrLabel ScannerNextLineFieldInfo = "next_line"
type AttrOrigin ScannerNextLineFieldInfo = Scanner
attrGet _ = getScannerNextLine
attrSet _ = setScannerNextLine
attrConstruct = undefined
attrClear _ = undefined
scanner_nextLine :: AttrLabelProxy "nextLine"
scanner_nextLine = AttrLabelProxy
#endif
getScannerNextPosition :: MonadIO m => Scanner -> m Word32
getScannerNextPosition s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 84) :: IO Word32
return val
setScannerNextPosition :: MonadIO m => Scanner -> Word32 -> m ()
setScannerNextPosition s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 84) (val :: Word32)
#if ENABLE_OVERLOADING
data ScannerNextPositionFieldInfo
instance AttrInfo ScannerNextPositionFieldInfo where
type AttrAllowedOps ScannerNextPositionFieldInfo = '[ 'AttrSet, 'AttrGet]
type AttrSetTypeConstraint ScannerNextPositionFieldInfo = (~) Word32
type AttrBaseTypeConstraint ScannerNextPositionFieldInfo = (~) Scanner
type AttrGetType ScannerNextPositionFieldInfo = Word32
type AttrLabel ScannerNextPositionFieldInfo = "next_position"
type AttrOrigin ScannerNextPositionFieldInfo = Scanner
attrGet _ = getScannerNextPosition
attrSet _ = setScannerNextPosition
attrConstruct = undefined
attrClear _ = undefined
scanner_nextPosition :: AttrLabelProxy "nextPosition"
scanner_nextPosition = AttrLabelProxy
#endif
getScannerMsgHandler :: MonadIO m => Scanner -> m (Maybe GLib.Callbacks.ScannerMsgFunc)
getScannerMsgHandler s = liftIO $ withManagedPtr s $ \ptr -> do
val <- peek (ptr `plusPtr` 136) :: IO (FunPtr GLib.Callbacks.C_ScannerMsgFunc)
result <- SP.convertFunPtrIfNonNull val $ \val' -> do
let val'' = GLib.Callbacks.dynamic_ScannerMsgFunc val'
return val''
return result
setScannerMsgHandler :: MonadIO m => Scanner -> FunPtr GLib.Callbacks.C_ScannerMsgFunc -> m ()
setScannerMsgHandler s val = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 136) (val :: FunPtr GLib.Callbacks.C_ScannerMsgFunc)
clearScannerMsgHandler :: MonadIO m => Scanner -> m ()
clearScannerMsgHandler s = liftIO $ withManagedPtr s $ \ptr -> do
poke (ptr `plusPtr` 136) (FP.nullFunPtr :: FunPtr GLib.Callbacks.C_ScannerMsgFunc)
#if ENABLE_OVERLOADING
data ScannerMsgHandlerFieldInfo
instance AttrInfo ScannerMsgHandlerFieldInfo where
type AttrAllowedOps ScannerMsgHandlerFieldInfo = '[ 'AttrSet, 'AttrGet, 'AttrClear]
type AttrSetTypeConstraint ScannerMsgHandlerFieldInfo = (~) (FunPtr GLib.Callbacks.C_ScannerMsgFunc)
type AttrBaseTypeConstraint ScannerMsgHandlerFieldInfo = (~) Scanner
type AttrGetType ScannerMsgHandlerFieldInfo = Maybe GLib.Callbacks.ScannerMsgFunc
type AttrLabel ScannerMsgHandlerFieldInfo = "msg_handler"
type AttrOrigin ScannerMsgHandlerFieldInfo = Scanner
attrGet _ = getScannerMsgHandler
attrSet _ = setScannerMsgHandler
attrConstruct = undefined
attrClear _ = clearScannerMsgHandler
scanner_msgHandler :: AttrLabelProxy "msgHandler"
scanner_msgHandler = AttrLabelProxy
#endif
#if ENABLE_OVERLOADING
instance O.HasAttributeList Scanner
type instance O.AttributeList Scanner = ScannerAttributeList
type ScannerAttributeList = ('[ '("userData", ScannerUserDataFieldInfo), '("maxParseErrors", ScannerMaxParseErrorsFieldInfo), '("parseErrors", ScannerParseErrorsFieldInfo), '("inputName", ScannerInputNameFieldInfo), '("qdata", ScannerQdataFieldInfo), '("config", ScannerConfigFieldInfo), '("token", ScannerTokenFieldInfo), '("value", ScannerValueFieldInfo), '("line", ScannerLineFieldInfo), '("position", ScannerPositionFieldInfo), '("nextToken", ScannerNextTokenFieldInfo), '("nextValue", ScannerNextValueFieldInfo), '("nextLine", ScannerNextLineFieldInfo), '("nextPosition", ScannerNextPositionFieldInfo), '("msgHandler", ScannerMsgHandlerFieldInfo)] :: [(Symbol, *)])
#endif
foreign import ccall "g_scanner_cur_line" g_scanner_cur_line ::
Ptr Scanner ->
IO Word32
scannerCurLine ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m Word32
scannerCurLine scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_cur_line scanner'
touchManagedPtr scanner
return result
#if ENABLE_OVERLOADING
data ScannerCurLineMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo ScannerCurLineMethodInfo Scanner signature where
overloadedMethod _ = scannerCurLine
#endif
foreign import ccall "g_scanner_cur_position" g_scanner_cur_position ::
Ptr Scanner ->
IO Word32
scannerCurPosition ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m Word32
scannerCurPosition scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_cur_position scanner'
touchManagedPtr scanner
return result
#if ENABLE_OVERLOADING
data ScannerCurPositionMethodInfo
instance (signature ~ (m Word32), MonadIO m) => O.MethodInfo ScannerCurPositionMethodInfo Scanner signature where
overloadedMethod _ = scannerCurPosition
#endif
foreign import ccall "g_scanner_cur_token" g_scanner_cur_token ::
Ptr Scanner ->
IO CUInt
scannerCurToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m GLib.Enums.TokenType
scannerCurToken scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_cur_token scanner'
let result' = (toEnum . fromIntegral) result
touchManagedPtr scanner
return result'
#if ENABLE_OVERLOADING
data ScannerCurTokenMethodInfo
instance (signature ~ (m GLib.Enums.TokenType), MonadIO m) => O.MethodInfo ScannerCurTokenMethodInfo Scanner signature where
overloadedMethod _ = scannerCurToken
#endif
foreign import ccall "g_scanner_destroy" g_scanner_destroy ::
Ptr Scanner ->
IO ()
scannerDestroy ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m ()
scannerDestroy scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
g_scanner_destroy scanner'
touchManagedPtr scanner
return ()
#if ENABLE_OVERLOADING
data ScannerDestroyMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo ScannerDestroyMethodInfo Scanner signature where
overloadedMethod _ = scannerDestroy
#endif
foreign import ccall "g_scanner_eof" g_scanner_eof ::
Ptr Scanner ->
IO CInt
scannerEof ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m Bool
scannerEof scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_eof scanner'
let result' = (/= 0) result
touchManagedPtr scanner
return result'
#if ENABLE_OVERLOADING
data ScannerEofMethodInfo
instance (signature ~ (m Bool), MonadIO m) => O.MethodInfo ScannerEofMethodInfo Scanner signature where
overloadedMethod _ = scannerEof
#endif
foreign import ccall "g_scanner_get_next_token" g_scanner_get_next_token ::
Ptr Scanner ->
IO CUInt
scannerGetNextToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m GLib.Enums.TokenType
scannerGetNextToken scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_get_next_token scanner'
let result' = (toEnum . fromIntegral) result
touchManagedPtr scanner
return result'
#if ENABLE_OVERLOADING
data ScannerGetNextTokenMethodInfo
instance (signature ~ (m GLib.Enums.TokenType), MonadIO m) => O.MethodInfo ScannerGetNextTokenMethodInfo Scanner signature where
overloadedMethod _ = scannerGetNextToken
#endif
foreign import ccall "g_scanner_input_file" g_scanner_input_file ::
Ptr Scanner ->
Int32 ->
IO ()
scannerInputFile ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Int32
-> m ()
scannerInputFile scanner inputFd = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
g_scanner_input_file scanner' inputFd
touchManagedPtr scanner
return ()
#if ENABLE_OVERLOADING
data ScannerInputFileMethodInfo
instance (signature ~ (Int32 -> m ()), MonadIO m) => O.MethodInfo ScannerInputFileMethodInfo Scanner signature where
overloadedMethod _ = scannerInputFile
#endif
foreign import ccall "g_scanner_input_text" g_scanner_input_text ::
Ptr Scanner ->
CString ->
Word32 ->
IO ()
scannerInputText ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> T.Text
-> Word32
-> m ()
scannerInputText scanner text textLen = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
text' <- textToCString text
g_scanner_input_text scanner' text' textLen
touchManagedPtr scanner
freeMem text'
return ()
#if ENABLE_OVERLOADING
data ScannerInputTextMethodInfo
instance (signature ~ (T.Text -> Word32 -> m ()), MonadIO m) => O.MethodInfo ScannerInputTextMethodInfo Scanner signature where
overloadedMethod _ = scannerInputText
#endif
foreign import ccall "g_scanner_lookup_symbol" g_scanner_lookup_symbol ::
Ptr Scanner ->
CString ->
IO (Ptr ())
scannerLookupSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> T.Text
-> m (Ptr ())
scannerLookupSymbol scanner symbol = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
symbol' <- textToCString symbol
result <- g_scanner_lookup_symbol scanner' symbol'
touchManagedPtr scanner
freeMem symbol'
return result
#if ENABLE_OVERLOADING
data ScannerLookupSymbolMethodInfo
instance (signature ~ (T.Text -> m (Ptr ())), MonadIO m) => O.MethodInfo ScannerLookupSymbolMethodInfo Scanner signature where
overloadedMethod _ = scannerLookupSymbol
#endif
foreign import ccall "g_scanner_peek_next_token" g_scanner_peek_next_token ::
Ptr Scanner ->
IO CUInt
scannerPeekNextToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m GLib.Enums.TokenType
scannerPeekNextToken scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_peek_next_token scanner'
let result' = (toEnum . fromIntegral) result
touchManagedPtr scanner
return result'
#if ENABLE_OVERLOADING
data ScannerPeekNextTokenMethodInfo
instance (signature ~ (m GLib.Enums.TokenType), MonadIO m) => O.MethodInfo ScannerPeekNextTokenMethodInfo Scanner signature where
overloadedMethod _ = scannerPeekNextToken
#endif
foreign import ccall "g_scanner_scope_add_symbol" g_scanner_scope_add_symbol ::
Ptr Scanner ->
Word32 ->
CString ->
Ptr () ->
IO ()
scannerScopeAddSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> T.Text
-> Ptr ()
-> m ()
scannerScopeAddSymbol scanner scopeId symbol value = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
symbol' <- textToCString symbol
g_scanner_scope_add_symbol scanner' scopeId symbol' value
touchManagedPtr scanner
freeMem symbol'
return ()
#if ENABLE_OVERLOADING
data ScannerScopeAddSymbolMethodInfo
instance (signature ~ (Word32 -> T.Text -> Ptr () -> m ()), MonadIO m) => O.MethodInfo ScannerScopeAddSymbolMethodInfo Scanner signature where
overloadedMethod _ = scannerScopeAddSymbol
#endif
foreign import ccall "g_scanner_scope_lookup_symbol" g_scanner_scope_lookup_symbol ::
Ptr Scanner ->
Word32 ->
CString ->
IO (Ptr ())
scannerScopeLookupSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> T.Text
-> m (Ptr ())
scannerScopeLookupSymbol scanner scopeId symbol = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
symbol' <- textToCString symbol
result <- g_scanner_scope_lookup_symbol scanner' scopeId symbol'
touchManagedPtr scanner
freeMem symbol'
return result
#if ENABLE_OVERLOADING
data ScannerScopeLookupSymbolMethodInfo
instance (signature ~ (Word32 -> T.Text -> m (Ptr ())), MonadIO m) => O.MethodInfo ScannerScopeLookupSymbolMethodInfo Scanner signature where
overloadedMethod _ = scannerScopeLookupSymbol
#endif
foreign import ccall "g_scanner_scope_remove_symbol" g_scanner_scope_remove_symbol ::
Ptr Scanner ->
Word32 ->
CString ->
IO ()
scannerScopeRemoveSymbol ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> T.Text
-> m ()
scannerScopeRemoveSymbol scanner scopeId symbol = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
symbol' <- textToCString symbol
g_scanner_scope_remove_symbol scanner' scopeId symbol'
touchManagedPtr scanner
freeMem symbol'
return ()
#if ENABLE_OVERLOADING
data ScannerScopeRemoveSymbolMethodInfo
instance (signature ~ (Word32 -> T.Text -> m ()), MonadIO m) => O.MethodInfo ScannerScopeRemoveSymbolMethodInfo Scanner signature where
overloadedMethod _ = scannerScopeRemoveSymbol
#endif
foreign import ccall "g_scanner_set_scope" g_scanner_set_scope ::
Ptr Scanner ->
Word32 ->
IO Word32
scannerSetScope ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> Word32
-> m Word32
scannerSetScope scanner scopeId = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
result <- g_scanner_set_scope scanner' scopeId
touchManagedPtr scanner
return result
#if ENABLE_OVERLOADING
data ScannerSetScopeMethodInfo
instance (signature ~ (Word32 -> m Word32), MonadIO m) => O.MethodInfo ScannerSetScopeMethodInfo Scanner signature where
overloadedMethod _ = scannerSetScope
#endif
foreign import ccall "g_scanner_sync_file_offset" g_scanner_sync_file_offset ::
Ptr Scanner ->
IO ()
scannerSyncFileOffset ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> m ()
scannerSyncFileOffset scanner = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
g_scanner_sync_file_offset scanner'
touchManagedPtr scanner
return ()
#if ENABLE_OVERLOADING
data ScannerSyncFileOffsetMethodInfo
instance (signature ~ (m ()), MonadIO m) => O.MethodInfo ScannerSyncFileOffsetMethodInfo Scanner signature where
overloadedMethod _ = scannerSyncFileOffset
#endif
foreign import ccall "g_scanner_unexp_token" g_scanner_unexp_token ::
Ptr Scanner ->
CUInt ->
CString ->
CString ->
CString ->
CString ->
Int32 ->
IO ()
scannerUnexpToken ::
(B.CallStack.HasCallStack, MonadIO m) =>
Scanner
-> GLib.Enums.TokenType
-> T.Text
-> T.Text
-> T.Text
-> T.Text
-> Int32
-> m ()
scannerUnexpToken scanner expectedToken identifierSpec symbolSpec symbolName message isError = liftIO $ do
scanner' <- unsafeManagedPtrGetPtr scanner
let expectedToken' = (fromIntegral . fromEnum) expectedToken
identifierSpec' <- textToCString identifierSpec
symbolSpec' <- textToCString symbolSpec
symbolName' <- textToCString symbolName
message' <- textToCString message
g_scanner_unexp_token scanner' expectedToken' identifierSpec' symbolSpec' symbolName' message' isError
touchManagedPtr scanner
freeMem identifierSpec'
freeMem symbolSpec'
freeMem symbolName'
freeMem message'
return ()
#if 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 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) => O.IsLabelProxy t (Scanner -> p) where
fromLabelProxy _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#if MIN_VERSION_base(4,9,0)
instance (info ~ ResolveScannerMethod t Scanner, O.MethodInfo info Scanner p) => O.IsLabel t (Scanner -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#else
fromLabel _ = O.overloadedMethod (O.MethodProxy :: O.MethodProxy info)
#endif
#endif
#endif