]> git.neil.brown.name Git - susman.git/blob - libsus.h
wakealarmd: cope with delta between system time and RTC time.
[susman.git] / libsus.h
1 /* headers for libsus - supporting suspend management.
2  *
3  * Copyright (C) 2011 Neil Brown <neilb@suse.de>
4  *
5  *    This program is free software; you can redistribute it and/or modify
6  *    it under the terms of the GNU General Public License as published by
7  *    the Free Software Foundation; either version 2 of the License, or
8  *    (at your option) any later version.
9  *
10  *    This program is distributed in the hope that it will be useful,
11  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *    GNU General Public License for more details.
14  *
15  *    You should have received a copy of the GNU General Public License along
16  *    with this program; if not, write to the Free Software Foundation, Inc.,
17  *    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18  */
19 int suspend_open();
20 int suspend_block(int handle);
21 void suspend_allow(int handle);
22 int suspend_close(int handle);
23 void suspend_abort(int handle);
24
25 void *suspend_watch(int (*will_suspend)(void *data),
26                     void (*did_resume)(void *data),
27                     void *data);
28 void suspend_ok(void *han);
29 void suspend_unwatch(void *v);
30
31 struct event *wake_set(int fd, void(*fn)(int,short,void*),
32                        void *data, int prio);
33 void wake_destroy(struct event *ev);
34
35 struct event *wakealarm_set(time_t when, void(*fn)(int, short, void*),
36                             void *data);
37 void wakealarm_destroy(struct event *ev);
38
39