sig
type error = Null | Errno of int
val string_of_error : Libudev.error -> string
exception Error of Libudev.error
module Context : sig type t val create : unit -> Libudev.Context.t end
module Device :
sig
type t
type descr =
Syspath of string
| Subsystem_sysname of string * string
| Device_id of string
| Environment
val create :
Libudev.Context.t -> Libudev.Device.descr -> Libudev.Device.t
val context : Libudev.Device.t -> Libudev.Context.t
val syspath : Libudev.Device.t -> string
val sysname : Libudev.Device.t -> string
val sysnum : Libudev.Device.t -> string option
val devpath : Libudev.Device.t -> string
val tags : Libudev.Device.t -> string list
val has_tag : Libudev.Device.t -> string -> bool
val subsystem : Libudev.Device.t -> string
val driver : Libudev.Device.t -> string option
val devtype : Libudev.Device.t -> string option
val devnode : Libudev.Device.t -> string option
val devlinks : Libudev.Device.t -> string list
val is_initialized : Libudev.Device.t -> bool
val usec_since_initialized : Libudev.Device.t -> Stdint.Uint64.t
val parent : Libudev.Device.t -> Libudev.Device.t option
val find_parent :
Libudev.Device.t ->
?devtype:string -> subsystem:string -> Libudev.Device.t option
type action =
Add
| Remove
| Change
| Online
| Offline
| Other of string
val string_of_action : Libudev.Device.action -> string
val action : Libudev.Device.t -> Libudev.Device.action option
val seqnum : Libudev.Device.t -> Stdint.Uint64.t
val properties : Libudev.Device.t -> (string * string) list
val property : Libudev.Device.t -> string -> string option
val int_property : Libudev.Device.t -> string -> int option
val bool_property : Libudev.Device.t -> string -> bool option
val sysattrs : Libudev.Device.t -> (string * string) list
val sysattr : Libudev.Device.t -> string -> string option
val int_sysattr : Libudev.Device.t -> string -> int option
val bool_sysattr : Libudev.Device.t -> string -> bool option
val set_sysattr : Libudev.Device.t -> string -> string -> unit
end
module Monitor :
sig
type t
type filter =
Tag of string
| Subsystem_devtype of string * string option
type netlink_source = Udev | Kernel
val create :
?source:Libudev.Monitor.netlink_source ->
Libudev.Context.t -> Libudev.Monitor.t
val set_filter :
Libudev.Monitor.t -> Libudev.Monitor.filter list -> unit
val start : Libudev.Monitor.t -> unit
exception Timeout
val receive_device :
?timeout:float -> Libudev.Monitor.t -> Libudev.Device.t
val context : Libudev.Monitor.t -> Libudev.Context.t
val set_receive_buffer_size : Libudev.Monitor.t -> int -> unit
val fd : Libudev.Monitor.t -> Unix.file_descr
end
module Enumerate :
sig
type filter =
Subsystem of string
| NoSubsystem of string
| Sysattr of string * string
| NoSysattr of string * string
| Property of string * string
| Sysname of string
| Tag of string
| Parent of Libudev.Device.t
| Is_initialized
val devices :
Libudev.Context.t ->
Libudev.Enumerate.filter list -> Libudev.Device.t list
val subsystems :
Libudev.Context.t ->
Libudev.Enumerate.filter list -> Libudev.Device.t list
end
end