gi-glib-2.0.17: GLib bindings

Copyright | Will Thompson Iñaki García Etxebarria and Jonas Platte
License | LGPL-2.1
Maintainer | Iñaki García Etxebarria (garetxe@gmail.com)
Safe Haskell | None
Language | Haskell2010

GI.GLib.Structs.PollFD

Contents

- Exported types
- Properties
  - events
  - fd
  - revents

Description

Represents a file descriptor, which events to poll for, and which events occurred.

Synopsis

- newtype PollFD = PollFD (ManagedPtr PollFD)
- newZeroPollFD :: MonadIO m => m PollFD
- noPollFD :: Maybe PollFD
- getPollFDEvents :: MonadIO m => PollFD -> m Word16
- setPollFDEvents :: MonadIO m => PollFD -> Word16 -> m ()
- getPollFDFd :: MonadIO m => PollFD -> m Int32
- setPollFDFd :: MonadIO m => PollFD -> Int32 -> m ()
- getPollFDRevents :: MonadIO m => PollFD -> m Word16
- setPollFDRevents :: MonadIO m => PollFD -> Word16 -> m ()

# Exported types

newtype PollFD Source #

Memory-managed wrapper type.

Constructors

PollFD (ManagedPtr PollFD) |

Instances

BoxedObject PollFD Source # |
Instance details Defined in GI.GLib.Structs.PollFD Methods boxedType :: PollFD -> IO GType Source #
tag ~ AttrSet => Constructible PollFD tag Source # |
Instance details Defined in GI.GLib.Structs.PollFD Methods new :: MonadIO m => (ManagedPtr PollFD -> PollFD) -> [AttrOp PollFD tag] -> m PollFD Source #

newZeroPollFD :: MonadIO m => m PollFD Source #

Construct a `PollFD` struct initialized to zero.

noPollFD :: Maybe PollFD Source #

A convenience alias for `Nothing` :: `Maybe` `PollFD`.

# Properties

## events

a bitwise combination from `IOCondition`, specifying which events should be polled for. Typically for reading from a file descriptor you would use `IOConditionIn` | `IOConditionHup` | `IOConditionErr`, and for writing you would use `IOConditionOut` | `IOConditionErr`.

getPollFDEvents :: MonadIO m => PollFD -> m Word16 Source #

Get the value of the “`events`” field. When overloading is enabled, this is equivalent to

    get pollFD #events

setPollFDEvents :: MonadIO m => PollFD -> Word16 -> m () Source #

Set the value of the “`events`” field. When overloading is enabled, this is equivalent to

    set pollFD [ #events := value ]

## fd

the file descriptor to poll (or a HANDLE on Win32)

getPollFDFd :: MonadIO m => PollFD -> m Int32 Source #

Get the value of the “`fd`” field. When overloading is enabled, this is equivalent to

    get pollFD #fd

setPollFDFd :: MonadIO m => PollFD -> Int32 -> m () Source #

Set the value of the “`fd`” field. When overloading is enabled, this is equivalent to

    set pollFD [ #fd := value ]

## revents

a bitwise combination of flags from `IOCondition`, returned from the `poll()` function to indicate which events occurred.

getPollFDRevents :: MonadIO m => PollFD -> m Word16 Source #

Get the value of the “`revents`” field. When overloading is enabled, this is equivalent to

    get pollFD #revents

setPollFDRevents :: MonadIO m => PollFD -> Word16 -> m () Source #

Set the value of the “`revents`” field. When overloading is enabled, this is equivalent to

    set pollFD [ #revents := value ]