sig
  type apm_support = Supported | Unsupported | WrongVersion
  external exists : unit -> Apm.apm_support = "camlapm_exists"
  type ac_line_status = OffLine | OnLine | OnBackupPower
  and battery_status = High | Low | Critical | Charging | NoBattery
  and info = {
    driver_version : string;
    version_major : int;
    version_minor : int;
    support_32_bits : bool;
    power_management_disabled : bool;
    power_management_disengaged : bool;
    ac_line_status : Apm.ac_line_status;
    battery_status : Apm.battery_status;
    battery_percentage : int option;
    battery_time : int option;
  } 
  external read : unit -> Apm.info = "camlapm_read"
  external suspend : unit -> unit = "camlapm_suspend"
  external standby : unit -> unit = "camlapm_standby"
  exception Failure of string * string
  val handle_apm_error : ('-> 'b) -> '-> 'b
end