Ubuntu Platform API  3.0.0
A library helping with tight integration into the Ubuntu platform
alarm.h
Go to the documentation of this file.
1 /*
2  * Copyright © 2014 Canonical Ltd.
3  *
4  * This program is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser General Public License version 3 as
6  * published by the Free Software Foundation.
7  *
8  * This program is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authored by: Thomas Voß <thomas.voss@canonical.com>
17  */
18 #ifndef UBUNTU_HARDWARE_ALARM_H_
19 #define UBUNTU_HARDWARE_ALARM_H_
20 
21 #include <ubuntu/status.h>
22 #include <ubuntu/visibility.h>
23 
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27 
29 typedef enum
30 {
34 
35 typedef UbuntuHardwareAlarmTimeReference UHardwareAlarmTimeReference;
36 
38 typedef enum
39 {
45 
46 typedef UbuntuHardwareAlarmSleepBehavior UHardwareAlarmSleepBehavior;
47 
49 typedef struct
50 {
51  UHardwareAlarmTimeReference reference;
52  UHardwareAlarmSleepBehavior sleep_behavior;
54 
56 
58 typedef struct UbuntuHardwareAlarm* UHardwareAlarm;
59 
61 UBUNTU_DLL_PUBLIC UHardwareAlarm
63 
67  UHardwareAlarm alarm);
68 
72  UHardwareAlarm alarm);
73 
77  UHardwareAlarm alarm,
78  struct timespec *tz);
79 
83  UHardwareAlarm alarm,
84  const struct timezone *tz);
85 
89  UHardwareAlarm alarm,
90  UHardwareAlarmTimeReference time_reference,
91  UHardwareAlarmSleepBehavior behavior,
92  const struct timespec *ts);
93 
97  UHardwareAlarm alarm,
98  UHardwareAlarmWaitResult *result);
99 
100 #ifdef __cplusplus
101 }
102 #endif
103 
104 #endif
UbuntuHardwareAlarmSleepBehavior
Definition: alarm.h:38
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_relative_to_with_behavior(UHardwareAlarm alarm, UHardwareAlarmTimeReference time_reference, UHardwareAlarmSleepBehavior behavior, const struct timespec *ts)
UbuntuHardwareAlarmTimeReference UHardwareAlarmTimeReference
Definition: alarm.h:35
UbuntuStatus
Indicates the status of an operation.
Definition: status.h:26
UbuntuHardwareAlarmSleepBehavior UHardwareAlarmSleepBehavior
Definition: alarm.h:46
UBUNTU_DLL_PUBLIC void u_hardware_alarm_unref(UHardwareAlarm alarm)
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_wait_for_next_alarm(UHardwareAlarm alarm, UHardwareAlarmWaitResult *result)
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_get_elapsed_real_time(UHardwareAlarm alarm, struct timespec *tz)
UHardwareAlarmTimeReference reference
Definition: alarm.h:51
UBUNTU_DLL_PUBLIC UHardwareAlarm u_hardware_alarm_create()
UBUNTU_DLL_PUBLIC UStatus u_hardware_alarm_set_timezone(UHardwareAlarm alarm, const struct timezone *tz)
UbuntuHardwareAlarmWaitResult UHardwareAlarmWaitResult
Definition: alarm.h:55
#define UBUNTU_DLL_PUBLIC
Definition: visibility.h:26
UHardwareAlarmSleepBehavior sleep_behavior
Definition: alarm.h:52
struct UbuntuHardwareAlarm * UHardwareAlarm
Definition: alarm.h:58
UbuntuHardwareAlarmTimeReference
Definition: alarm.h:29
UBUNTU_DLL_PUBLIC void u_hardware_alarm_ref(UHardwareAlarm alarm)