udev-0.1.1.0: libudev bindings
Copyright(c) Sam Truzjan 2013
LicenseBSD3
Maintainerpxqr.sta@gmail.com
Stabilitystable
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

System.UDev.Context

Description

The context contains the default values read from the udev config file, and is passed to all library operations.

Synopsis

Context

data UDev Source #

Opaque object representing the library context.

Instances

Instances details
UDevChild UDev Source # 
Instance details

Defined in System.UDev.Types

Methods

getUDev :: UDev -> UDev Source #

class UDevChild a where Source #

Family of udev resources.

Methods

getUDev :: a -> UDev Source #

Get the context a resource belong to.

Instances

Instances details
UDevChild Enumerate Source # 
Instance details

Defined in System.UDev.Types

UDevChild Device Source # 
Instance details

Defined in System.UDev.Types

Methods

getUDev :: Device -> UDev Source #

UDevChild UDev Source # 
Instance details

Defined in System.UDev.Types

Methods

getUDev :: UDev -> UDev Source #

UDevChild Monitor Source # 
Instance details

Defined in System.UDev.Monitor

Methods

getUDev :: Monitor -> UDev Source #

newUDev :: IO UDev Source #

Create udev library context. This reads the udev configuration file, and fills in the default values.

withUDev :: (UDev -> IO a) -> IO a Source #

Like newUDev but context will be released at exit.

Logging

data Priority Source #

Log message priority.

Constructors

LogError

error conditions

LogInfo

informational

LogDebug

debug-level messages

type Logger Source #

Arguments

 = UDev 
-> Priority

message priority;

-> ByteString

position: file

-> Int

position: line

-> ByteString

position: function

-> ByteString

message body

-> IO () 

Logger function will called by udev on events.

getLogPriority :: UDev -> IO Priority Source #

The initial logging priority is read from the udev config file at startup.

setLogPriority :: UDev -> Priority -> IO () Source #

Set the current logging priority. The value controls which messages are logged.

setLogger :: UDev -> Logger -> IO () Source #

The built-in logging writes to stderr. It can be overridden by a custom function, to plug log messages into the users' logging functionality.

defaultLogger :: Logger Source #

Default logger will just print %PRIO %FILE:%LINE:n%FN: %FORMAT to stdout.

User data

getUserdata :: UDev -> IO a Source #

Retrieve stored data pointer from library context. This might be useful to access from callbacks like a custom logging function.

setUserdata :: UDev -> a -> IO () Source #

Store custom userdata in the library context.