{-# LANGUAGE TypeApplications #-}
#if (MIN_VERSION_haskell_gi_overloading(1,0,0) && !defined(__HADDOCK_VERSION__))
#define ENABLE_OVERLOADING
#endif
module GI.NM.Objects.SettingEthtool
(
SettingEthtool(..) ,
IsSettingEthtool ,
toSettingEthtool ,
#if defined(ENABLE_OVERLOADING)
ResolveSettingEthtoolMethod ,
#endif
#if defined(ENABLE_OVERLOADING)
SettingEthtoolClearFeaturesMethodInfo ,
#endif
settingEthtoolClearFeatures ,
#if defined(ENABLE_OVERLOADING)
SettingEthtoolGetFeatureMethodInfo ,
#endif
settingEthtoolGetFeature ,
#if defined(ENABLE_OVERLOADING)
SettingEthtoolGetOptnamesMethodInfo ,
#endif
settingEthtoolGetOptnames ,
settingEthtoolNew ,
#if defined(ENABLE_OVERLOADING)
SettingEthtoolSetFeatureMethodInfo ,
#endif
settingEthtoolSetFeature ,
) where
import Data.GI.Base.ShortPrelude
import qualified Data.GI.Base.ShortPrelude as SP
import qualified Data.GI.Base.Overloading as O
import qualified Prelude as P
import qualified Data.GI.Base.Attributes as GI.Attributes
import qualified Data.GI.Base.BasicTypes as B.Types
import qualified Data.GI.Base.ManagedPtr as B.ManagedPtr
import qualified Data.GI.Base.GArray as B.GArray
import qualified Data.GI.Base.GClosure as B.GClosure
import qualified Data.GI.Base.GError as B.GError
import qualified Data.GI.Base.GHashTable as B.GHT
import qualified Data.GI.Base.GVariant as B.GVariant
import qualified Data.GI.Base.GValue as B.GValue
import qualified Data.GI.Base.GParamSpec as B.GParamSpec
import qualified Data.GI.Base.CallStack as B.CallStack
import qualified Data.GI.Base.Properties as B.Properties
import qualified Data.GI.Base.Signals as B.Signals
import qualified Control.Monad.IO.Class as MIO
import qualified Data.Coerce as Coerce
import qualified Data.Text as T
import qualified Data.Kind as DK
import qualified Data.ByteString.Char8 as B
import qualified Data.Map as Map
import qualified Foreign.Ptr as FP
import qualified GHC.OverloadedLabels as OL
import qualified GHC.Records as R
import qualified Data.Word as DW
import qualified Data.Int as DI
import qualified System.Posix.Types as SPT
import qualified Foreign.C.Types as FCT
#if MIN_VERSION_base(4,18,0)
import qualified GI.GLib.Structs.Bytes as GLib.Bytes
import qualified GI.GLib.Structs.VariantType as GLib.VariantType
import qualified GI.GObject.Objects.Object as GObject.Object
import qualified GI.NM.Callbacks as NM.Callbacks
import {-# SOURCE #-} qualified GI.NM.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Flags as NM.Flags
import {-# SOURCE #-} qualified GI.NM.Interfaces.Connection as NM.Connection
import {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting
import {-# SOURCE #-} qualified GI.NM.Objects.Setting8021x as NM.Setting8021x
import {-# SOURCE #-} qualified GI.NM.Objects.SettingAdsl as NM.SettingAdsl
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBluetooth as NM.SettingBluetooth
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBond as NM.SettingBond
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridge as NM.SettingBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingBridgePort as NM.SettingBridgePort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingCdma as NM.SettingCdma
import {-# SOURCE #-} qualified GI.NM.Objects.SettingConnection as NM.SettingConnection
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDcb as NM.SettingDcb
import {-# SOURCE #-} qualified GI.NM.Objects.SettingDummy as NM.SettingDummy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGeneric as NM.SettingGeneric
import {-# SOURCE #-} qualified GI.NM.Objects.SettingGsm as NM.SettingGsm
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP4Config as NM.SettingIP4Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIP6Config as NM.SettingIP6Config
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPConfig as NM.SettingIPConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingIPTunnel as NM.SettingIPTunnel
import {-# SOURCE #-} qualified GI.NM.Objects.SettingInfiniband as NM.SettingInfiniband
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacsec as NM.SettingMacsec
import {-# SOURCE #-} qualified GI.NM.Objects.SettingMacvlan as NM.SettingMacvlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOlpcMesh as NM.SettingOlpcMesh
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsBridge as NM.SettingOvsBridge
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsInterface as NM.SettingOvsInterface
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPatch as NM.SettingOvsPatch
import {-# SOURCE #-} qualified GI.NM.Objects.SettingOvsPort as NM.SettingOvsPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPpp as NM.SettingPpp
import {-# SOURCE #-} qualified GI.NM.Objects.SettingPppoe as NM.SettingPppoe
import {-# SOURCE #-} qualified GI.NM.Objects.SettingProxy as NM.SettingProxy
import {-# SOURCE #-} qualified GI.NM.Objects.SettingSerial as NM.SettingSerial
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTCConfig as NM.SettingTCConfig
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeam as NM.SettingTeam
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTeamPort as NM.SettingTeamPort
import {-# SOURCE #-} qualified GI.NM.Objects.SettingTun as NM.SettingTun
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVlan as NM.SettingVlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVpn as NM.SettingVpn
import {-# SOURCE #-} qualified GI.NM.Objects.SettingVxlan as NM.SettingVxlan
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWimax as NM.SettingWimax
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWired as NM.SettingWired
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWireless as NM.SettingWireless
import {-# SOURCE #-} qualified GI.NM.Objects.SettingWirelessSecurity as NM.SettingWirelessSecurity
import {-# SOURCE #-} qualified GI.NM.Structs.BridgeVlan as NM.BridgeVlan
import {-# SOURCE #-} qualified GI.NM.Structs.IPAddress as NM.IPAddress
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoute as NM.IPRoute
import {-# SOURCE #-} qualified GI.NM.Structs.IPRoutingRule as NM.IPRoutingRule
import {-# SOURCE #-} qualified GI.NM.Structs.Range as NM.Range
import {-# SOURCE #-} qualified GI.NM.Structs.TCAction as NM.TCAction
import {-# SOURCE #-} qualified GI.NM.Structs.TCQdisc as NM.TCQdisc
import {-# SOURCE #-} qualified GI.NM.Structs.TCTfilter as NM.TCTfilter
import {-# SOURCE #-} qualified GI.NM.Structs.TeamLinkWatcher as NM.TeamLinkWatcher
import {-# SOURCE #-} qualified GI.NM.Structs.VariantAttributeSpec as NM.VariantAttributeSpec
#else
import qualified GI.GObject.Objects.Object as GObject.Object
import {-# SOURCE #-} qualified GI.NM.Enums as NM.Enums
import {-# SOURCE #-} qualified GI.NM.Objects.Setting as NM.Setting
#endif
newtype SettingEthtool = SettingEthtool (SP.ManagedPtr SettingEthtool)
deriving (SettingEthtool -> SettingEthtool -> Bool
(SettingEthtool -> SettingEthtool -> Bool)
-> (SettingEthtool -> SettingEthtool -> Bool) -> Eq SettingEthtool
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: SettingEthtool -> SettingEthtool -> Bool
== :: SettingEthtool -> SettingEthtool -> Bool
$c/= :: SettingEthtool -> SettingEthtool -> Bool
/= :: SettingEthtool -> SettingEthtool -> Bool
Eq)
instance SP.ManagedPtrNewtype SettingEthtool where
toManagedPtr :: SettingEthtool -> ManagedPtr SettingEthtool
toManagedPtr (SettingEthtool ManagedPtr SettingEthtool
p) = ManagedPtr SettingEthtool
p
foreign import ccall "nm_setting_ethtool_get_type"
c_nm_setting_ethtool_get_type :: IO B.Types.GType
instance B.Types.TypedObject SettingEthtool where
glibType :: IO GType
glibType = IO GType
c_nm_setting_ethtool_get_type
instance B.Types.GObject SettingEthtool
class (SP.GObject o, O.IsDescendantOf SettingEthtool o) => IsSettingEthtool o
instance (SP.GObject o, O.IsDescendantOf SettingEthtool o) => IsSettingEthtool o
instance O.HasParentTypes SettingEthtool
type instance O.ParentTypes SettingEthtool = '[NM.Setting.Setting, GObject.Object.Object]
toSettingEthtool :: (MIO.MonadIO m, IsSettingEthtool o) => o -> m SettingEthtool
toSettingEthtool :: forall (m :: * -> *) o.
(MonadIO m, IsSettingEthtool o) =>
o -> m SettingEthtool
toSettingEthtool = IO SettingEthtool -> m SettingEthtool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
MIO.liftIO (IO SettingEthtool -> m SettingEthtool)
-> (o -> IO SettingEthtool) -> o -> m SettingEthtool
forall b c a. (b -> c) -> (a -> b) -> a -> c
. (ManagedPtr SettingEthtool -> SettingEthtool)
-> o -> IO SettingEthtool
forall o o'.
(HasCallStack, ManagedPtrNewtype o, TypedObject o,
ManagedPtrNewtype o', TypedObject o') =>
(ManagedPtr o' -> o') -> o -> IO o'
B.ManagedPtr.unsafeCastTo ManagedPtr SettingEthtool -> SettingEthtool
SettingEthtool
instance B.GValue.IsGValue (Maybe SettingEthtool) where
gvalueGType_ :: IO GType
gvalueGType_ = IO GType
c_nm_setting_ethtool_get_type
gvalueSet_ :: Ptr GValue -> Maybe SettingEthtool -> IO ()
gvalueSet_ Ptr GValue
gv Maybe SettingEthtool
P.Nothing = Ptr GValue -> Ptr SettingEthtool -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv (Ptr SettingEthtool
forall a. Ptr a
FP.nullPtr :: FP.Ptr SettingEthtool)
gvalueSet_ Ptr GValue
gv (P.Just SettingEthtool
obj) = SettingEthtool -> (Ptr SettingEthtool -> IO ()) -> IO ()
forall a c.
(HasCallStack, ManagedPtrNewtype a) =>
a -> (Ptr a -> IO c) -> IO c
B.ManagedPtr.withManagedPtr SettingEthtool
obj (Ptr GValue -> Ptr SettingEthtool -> IO ()
forall a. GObject a => Ptr GValue -> Ptr a -> IO ()
B.GValue.set_object Ptr GValue
gv)
gvalueGet_ :: Ptr GValue -> IO (Maybe SettingEthtool)
gvalueGet_ Ptr GValue
gv = do
Ptr SettingEthtool
ptr <- Ptr GValue -> IO (Ptr SettingEthtool)
forall a. GObject a => Ptr GValue -> IO (Ptr a)
B.GValue.get_object Ptr GValue
gv :: IO (FP.Ptr SettingEthtool)
if Ptr SettingEthtool
ptr Ptr SettingEthtool -> Ptr SettingEthtool -> Bool
forall a. Eq a => a -> a -> Bool
/= Ptr SettingEthtool
forall a. Ptr a
FP.nullPtr
then SettingEthtool -> Maybe SettingEthtool
forall a. a -> Maybe a
P.Just (SettingEthtool -> Maybe SettingEthtool)
-> IO SettingEthtool -> IO (Maybe SettingEthtool)
forall (f :: * -> *) a b. Functor f => (a -> b) -> f a -> f b
<$> (ManagedPtr SettingEthtool -> SettingEthtool)
-> Ptr SettingEthtool -> IO SettingEthtool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
B.ManagedPtr.newObject ManagedPtr SettingEthtool -> SettingEthtool
SettingEthtool Ptr SettingEthtool
ptr
else Maybe SettingEthtool -> IO (Maybe SettingEthtool)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Maybe SettingEthtool
forall a. Maybe a
P.Nothing
#if defined(ENABLE_OVERLOADING)
type family ResolveSettingEthtoolMethod (t :: Symbol) (o :: DK.Type) :: DK.Type where
ResolveSettingEthtoolMethod "bindProperty" o = GObject.Object.ObjectBindPropertyMethodInfo
ResolveSettingEthtoolMethod "bindPropertyFull" o = GObject.Object.ObjectBindPropertyFullMethodInfo
ResolveSettingEthtoolMethod "clearFeatures" o = SettingEthtoolClearFeaturesMethodInfo
ResolveSettingEthtoolMethod "compare" o = NM.Setting.SettingCompareMethodInfo
ResolveSettingEthtoolMethod "diff" o = NM.Setting.SettingDiffMethodInfo
ResolveSettingEthtoolMethod "duplicate" o = NM.Setting.SettingDuplicateMethodInfo
ResolveSettingEthtoolMethod "enumerateValues" o = NM.Setting.SettingEnumerateValuesMethodInfo
ResolveSettingEthtoolMethod "forceFloating" o = GObject.Object.ObjectForceFloatingMethodInfo
ResolveSettingEthtoolMethod "freezeNotify" o = GObject.Object.ObjectFreezeNotifyMethodInfo
ResolveSettingEthtoolMethod "getv" o = GObject.Object.ObjectGetvMethodInfo
ResolveSettingEthtoolMethod "isFloating" o = GObject.Object.ObjectIsFloatingMethodInfo
ResolveSettingEthtoolMethod "notify" o = GObject.Object.ObjectNotifyMethodInfo
ResolveSettingEthtoolMethod "notifyByPspec" o = GObject.Object.ObjectNotifyByPspecMethodInfo
ResolveSettingEthtoolMethod "optionClearByName" o = NM.Setting.SettingOptionClearByNameMethodInfo
ResolveSettingEthtoolMethod "optionGet" o = NM.Setting.SettingOptionGetMethodInfo
ResolveSettingEthtoolMethod "optionGetAllNames" o = NM.Setting.SettingOptionGetAllNamesMethodInfo
ResolveSettingEthtoolMethod "optionGetBoolean" o = NM.Setting.SettingOptionGetBooleanMethodInfo
ResolveSettingEthtoolMethod "optionGetUint32" o = NM.Setting.SettingOptionGetUint32MethodInfo
ResolveSettingEthtoolMethod "optionSet" o = NM.Setting.SettingOptionSetMethodInfo
ResolveSettingEthtoolMethod "optionSetBoolean" o = NM.Setting.SettingOptionSetBooleanMethodInfo
ResolveSettingEthtoolMethod "optionSetUint32" o = NM.Setting.SettingOptionSetUint32MethodInfo
ResolveSettingEthtoolMethod "ref" o = GObject.Object.ObjectRefMethodInfo
ResolveSettingEthtoolMethod "refSink" o = GObject.Object.ObjectRefSinkMethodInfo
ResolveSettingEthtoolMethod "runDispose" o = GObject.Object.ObjectRunDisposeMethodInfo
ResolveSettingEthtoolMethod "stealData" o = GObject.Object.ObjectStealDataMethodInfo
ResolveSettingEthtoolMethod "stealQdata" o = GObject.Object.ObjectStealQdataMethodInfo
ResolveSettingEthtoolMethod "thawNotify" o = GObject.Object.ObjectThawNotifyMethodInfo
ResolveSettingEthtoolMethod "toString" o = NM.Setting.SettingToStringMethodInfo
ResolveSettingEthtoolMethod "unref" o = GObject.Object.ObjectUnrefMethodInfo
ResolveSettingEthtoolMethod "verify" o = NM.Setting.SettingVerifyMethodInfo
ResolveSettingEthtoolMethod "verifySecrets" o = NM.Setting.SettingVerifySecretsMethodInfo
ResolveSettingEthtoolMethod "watchClosure" o = GObject.Object.ObjectWatchClosureMethodInfo
ResolveSettingEthtoolMethod "getData" o = GObject.Object.ObjectGetDataMethodInfo
ResolveSettingEthtoolMethod "getDbusPropertyType" o = NM.Setting.SettingGetDbusPropertyTypeMethodInfo
ResolveSettingEthtoolMethod "getFeature" o = SettingEthtoolGetFeatureMethodInfo
ResolveSettingEthtoolMethod "getName" o = NM.Setting.SettingGetNameMethodInfo
ResolveSettingEthtoolMethod "getOptnames" o = SettingEthtoolGetOptnamesMethodInfo
ResolveSettingEthtoolMethod "getProperty" o = GObject.Object.ObjectGetPropertyMethodInfo
ResolveSettingEthtoolMethod "getQdata" o = GObject.Object.ObjectGetQdataMethodInfo
ResolveSettingEthtoolMethod "getSecretFlags" o = NM.Setting.SettingGetSecretFlagsMethodInfo
ResolveSettingEthtoolMethod "setData" o = GObject.Object.ObjectSetDataMethodInfo
ResolveSettingEthtoolMethod "setDataFull" o = GObject.Object.ObjectSetDataFullMethodInfo
ResolveSettingEthtoolMethod "setFeature" o = SettingEthtoolSetFeatureMethodInfo
ResolveSettingEthtoolMethod "setProperty" o = GObject.Object.ObjectSetPropertyMethodInfo
ResolveSettingEthtoolMethod "setSecretFlags" o = NM.Setting.SettingSetSecretFlagsMethodInfo
ResolveSettingEthtoolMethod l o = O.MethodResolutionFailed l o
instance (info ~ ResolveSettingEthtoolMethod t SettingEthtool, O.OverloadedMethod info SettingEthtool p) => OL.IsLabel t (SettingEthtool -> p) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.overloadedMethod @info
#else
fromLabel _ = O.overloadedMethod @info
#endif
#if MIN_VERSION_base(4,13,0)
instance (info ~ ResolveSettingEthtoolMethod t SettingEthtool, O.OverloadedMethod info SettingEthtool p, R.HasField t SettingEthtool p) => R.HasField t SettingEthtool p where
getField = O.overloadedMethod @info
#endif
instance (info ~ ResolveSettingEthtoolMethod t SettingEthtool, O.OverloadedMethodInfo info SettingEthtool) => OL.IsLabel t (O.MethodProxy info SettingEthtool) where
#if MIN_VERSION_base(4,10,0)
fromLabel = O.MethodProxy
#else
fromLabel _ = O.MethodProxy
#endif
#endif
#if defined(ENABLE_OVERLOADING)
instance O.HasAttributeList SettingEthtool
type instance O.AttributeList SettingEthtool = SettingEthtoolAttributeList
type SettingEthtoolAttributeList = ('[ '("name", NM.Setting.SettingNamePropertyInfo)] :: [(Symbol, DK.Type)])
#endif
#if defined(ENABLE_OVERLOADING)
#endif
#if defined(ENABLE_OVERLOADING)
type instance O.SignalList SettingEthtool = SettingEthtoolSignalList
type SettingEthtoolSignalList = ('[ '("notify", GObject.Object.ObjectNotifySignalInfo)] :: [(Symbol, DK.Type)])
#endif
foreign import ccall "nm_setting_ethtool_new" nm_setting_ethtool_new ::
IO (Ptr SettingEthtool)
settingEthtoolNew ::
(B.CallStack.HasCallStack, MonadIO m) =>
m SettingEthtool
settingEthtoolNew :: forall (m :: * -> *). (HasCallStack, MonadIO m) => m SettingEthtool
settingEthtoolNew = IO SettingEthtool -> m SettingEthtool
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO SettingEthtool -> m SettingEthtool)
-> IO SettingEthtool -> m SettingEthtool
forall a b. (a -> b) -> a -> b
$ do
Ptr SettingEthtool
result <- IO (Ptr SettingEthtool)
nm_setting_ethtool_new
Text -> Ptr SettingEthtool -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingEthtoolNew" Ptr SettingEthtool
result
SettingEthtool
result' <- ((ManagedPtr SettingEthtool -> SettingEthtool)
-> Ptr SettingEthtool -> IO SettingEthtool
forall a b.
(HasCallStack, GObject a, GObject b) =>
(ManagedPtr a -> a) -> Ptr b -> IO a
wrapObject ManagedPtr SettingEthtool -> SettingEthtool
SettingEthtool) Ptr SettingEthtool
result
SettingEthtool -> IO SettingEthtool
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return SettingEthtool
result'
#if defined(ENABLE_OVERLOADING)
#endif
foreign import ccall "nm_setting_ethtool_clear_features" nm_setting_ethtool_clear_features ::
Ptr SettingEthtool ->
IO ()
{-# DEPRECATED settingEthtoolClearFeatures ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionClearByName' with 'GI.NM.Functions.ethtoolOptnameIsFeature' predicate instead."] #-}
settingEthtoolClearFeatures ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
a
-> m ()
settingEthtoolClearFeatures :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> m ()
settingEthtoolClearFeatures a
setting = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
Ptr SettingEthtool -> IO ()
nm_setting_ethtool_clear_features Ptr SettingEthtool
setting'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingEthtoolClearFeaturesMethodInfo
instance (signature ~ (m ()), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolClearFeaturesMethodInfo a signature where
overloadedMethod = settingEthtoolClearFeatures
instance O.OverloadedMethodInfo SettingEthtoolClearFeaturesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.SettingEthtool.settingEthtoolClearFeatures",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SettingEthtool.html#v:settingEthtoolClearFeatures"
})
#endif
foreign import ccall "nm_setting_ethtool_get_feature" nm_setting_ethtool_get_feature ::
Ptr SettingEthtool ->
CString ->
IO CInt
{-# DEPRECATED settingEthtoolGetFeature ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionGetBoolean' instead."] #-}
settingEthtoolGetFeature ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
a
-> T.Text
-> m NM.Enums.Ternary
settingEthtoolGetFeature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> Text -> m Ternary
settingEthtoolGetFeature a
setting Text
optname = IO Ternary -> m Ternary
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO Ternary -> m Ternary) -> IO Ternary -> m Ternary
forall a b. (a -> b) -> a -> b
$ do
Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optname' <- Text -> IO CString
textToCString Text
optname
CInt
result <- Ptr SettingEthtool -> CString -> IO CInt
nm_setting_ethtool_get_feature Ptr SettingEthtool
setting' CString
optname'
let result' :: Ternary
result' = (Int -> Ternary
forall a. Enum a => Int -> a
toEnum (Int -> Ternary) -> (CInt -> Int) -> CInt -> Ternary
forall b c a. (b -> c) -> (a -> b) -> a -> c
. CInt -> Int
forall a b. (Integral a, Num b) => a -> b
fromIntegral) CInt
result
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optname'
Ternary -> IO Ternary
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return Ternary
result'
#if defined(ENABLE_OVERLOADING)
data SettingEthtoolGetFeatureMethodInfo
instance (signature ~ (T.Text -> m NM.Enums.Ternary), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolGetFeatureMethodInfo a signature where
overloadedMethod = settingEthtoolGetFeature
instance O.OverloadedMethodInfo SettingEthtoolGetFeatureMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.SettingEthtool.settingEthtoolGetFeature",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SettingEthtool.html#v:settingEthtoolGetFeature"
})
#endif
foreign import ccall "nm_setting_ethtool_get_optnames" nm_setting_ethtool_get_optnames ::
Ptr SettingEthtool ->
Ptr Word32 ->
IO (Ptr CString)
{-# DEPRECATED settingEthtoolGetOptnames ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionGetAllNames' instead."] #-}
settingEthtoolGetOptnames ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
a
-> m (([T.Text], Word32))
settingEthtoolGetOptnames :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> m ([Text], Word32)
settingEthtoolGetOptnames a
setting = IO ([Text], Word32) -> m ([Text], Word32)
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO ([Text], Word32) -> m ([Text], Word32))
-> IO ([Text], Word32) -> m ([Text], Word32)
forall a b. (a -> b) -> a -> b
$ do
Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
Ptr Word32
outLength <- IO (Ptr Word32)
forall a. Storable a => IO (Ptr a)
allocMem :: IO (Ptr Word32)
Ptr CString
result <- Ptr SettingEthtool -> Ptr Word32 -> IO (Ptr CString)
nm_setting_ethtool_get_optnames Ptr SettingEthtool
setting' Ptr Word32
outLength
Text -> Ptr CString -> IO ()
forall a. HasCallStack => Text -> Ptr a -> IO ()
checkUnexpectedReturnNULL Text
"settingEthtoolGetOptnames" Ptr CString
result
[Text]
result' <- HasCallStack => Ptr CString -> IO [Text]
Ptr CString -> IO [Text]
unpackZeroTerminatedUTF8CArray Ptr CString
result
Ptr CString -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr CString
result
Word32
outLength' <- Ptr Word32 -> IO Word32
forall a. Storable a => Ptr a -> IO a
peek Ptr Word32
outLength
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
Ptr Word32 -> IO ()
forall a. Ptr a -> IO ()
freeMem Ptr Word32
outLength
([Text], Word32) -> IO ([Text], Word32)
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ([Text]
result', Word32
outLength')
#if defined(ENABLE_OVERLOADING)
data SettingEthtoolGetOptnamesMethodInfo
instance (signature ~ (m (([T.Text], Word32))), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolGetOptnamesMethodInfo a signature where
overloadedMethod = settingEthtoolGetOptnames
instance O.OverloadedMethodInfo SettingEthtoolGetOptnamesMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.SettingEthtool.settingEthtoolGetOptnames",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SettingEthtool.html#v:settingEthtoolGetOptnames"
})
#endif
foreign import ccall "nm_setting_ethtool_set_feature" nm_setting_ethtool_set_feature ::
Ptr SettingEthtool ->
CString ->
CInt ->
IO ()
{-# DEPRECATED settingEthtoolSetFeature ["(Since version 1.26)","use 'GI.NM.Objects.Setting.settingOptionSet' or 'GI.NM.Objects.Setting.settingOptionSetBoolean' instead."] #-}
settingEthtoolSetFeature ::
(B.CallStack.HasCallStack, MonadIO m, IsSettingEthtool a) =>
a
-> T.Text
-> NM.Enums.Ternary
-> m ()
settingEthtoolSetFeature :: forall (m :: * -> *) a.
(HasCallStack, MonadIO m, IsSettingEthtool a) =>
a -> Text -> Ternary -> m ()
settingEthtoolSetFeature a
setting Text
optname Ternary
value = IO () -> m ()
forall a. IO a -> m a
forall (m :: * -> *) a. MonadIO m => IO a -> m a
liftIO (IO () -> m ()) -> IO () -> m ()
forall a b. (a -> b) -> a -> b
$ do
Ptr SettingEthtool
setting' <- a -> IO (Ptr SettingEthtool)
forall a b. (HasCallStack, ManagedPtrNewtype a) => a -> IO (Ptr b)
unsafeManagedPtrCastPtr a
setting
CString
optname' <- Text -> IO CString
textToCString Text
optname
let value' :: CInt
value' = (Int -> CInt
forall a b. (Integral a, Num b) => a -> b
fromIntegral (Int -> CInt) -> (Ternary -> Int) -> Ternary -> CInt
forall b c a. (b -> c) -> (a -> b) -> a -> c
. Ternary -> Int
forall a. Enum a => a -> Int
fromEnum) Ternary
value
Ptr SettingEthtool -> CString -> CInt -> IO ()
nm_setting_ethtool_set_feature Ptr SettingEthtool
setting' CString
optname' CInt
value'
a -> IO ()
forall a. ManagedPtrNewtype a => a -> IO ()
touchManagedPtr a
setting
CString -> IO ()
forall a. Ptr a -> IO ()
freeMem CString
optname'
() -> IO ()
forall a. a -> IO a
forall (m :: * -> *) a. Monad m => a -> m a
return ()
#if defined(ENABLE_OVERLOADING)
data SettingEthtoolSetFeatureMethodInfo
instance (signature ~ (T.Text -> NM.Enums.Ternary -> m ()), MonadIO m, IsSettingEthtool a) => O.OverloadedMethod SettingEthtoolSetFeatureMethodInfo a signature where
overloadedMethod = settingEthtoolSetFeature
instance O.OverloadedMethodInfo SettingEthtoolSetFeatureMethodInfo a where
overloadedMethodInfo = P.Just (O.ResolvedSymbolInfo {
O.resolvedSymbolName = "GI.NM.Objects.SettingEthtool.settingEthtoolSetFeature",
O.resolvedSymbolURL = "https://hackage.haskell.org/package/gi-nm-1.0.1/docs/GI-NM-Objects-SettingEthtool.html#v:settingEthtoolSetFeature"
})
#endif