~ubuntu-branches/ubuntu/lucid/acpid/lucid-updates

« back to all changes in this revision

Viewing changes to ng/acpid/include/acpid/driver.h

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-11-17 14:50:01 UTC
  • mfrom: (2.1.12 squeeze)
  • Revision ID: james.westby@ubuntu.com-20091117145001-y5hevyg7gcg6uwjk
Tags: 1.0.10-4
Updated netlink patch to version 6.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
#ifndef __ACPID_DRIVER__
 
3
#define __ACPID_DRIVER__
 
4
 
 
5
#include <poll.h>
 
6
#include <lua.h>
 
7
 
 
8
int acpi_dbus_event(const char *hid, unsigned long event, unsigned long data);
 
9
 
 
10
 
 
11
/*
 
12
 *      ACPI Channel
 
13
 */
 
14
struct acpi_channel;
 
15
 
 
16
struct acpi_channel_descriptor {
 
17
        struct acpi_channel *channel;
 
18
        int fd, events;
 
19
};
 
20
 
 
21
struct acpi_channel_ops {
 
22
        int (*setup)(struct acpi_channel *channel, struct acpi_channel_descriptor *cds, unsigned long ncds);
 
23
        int (*handle)(struct acpi_channel *channel, lua_State *L, int fd, int events);
 
24
};
 
25
 
 
26
struct acpi_channel {
 
27
        const struct acpi_channel_ops *ops;
 
28
        void *private;
 
29
};
 
30
 
 
31
int acpi_channel_create(lua_State *L);
 
32
void acpi_channel_register(struct acpi_channel *channel, const struct acpi_channel_ops *ops);
 
33
void acpi_channel_watch(struct acpi_channel *channel, struct acpi_channel_descriptor *cds, int fd, int events);
 
34
int acpi_channel_event(struct acpi_channel *channel, lua_State *L, const char *hid, unsigned long event, unsigned long data);
 
35
 
 
36
 
 
37
/*
 
38
 *      ACPI Driver
 
39
 */
 
40
struct acpi_driver_ops {
 
41
        int (*create)(struct acpi_channel *channel, lua_State *L);
 
42
        void (*destroy)(struct acpi_channel *channnel);
 
43
};
 
44
 
 
45
struct acpi_driver {
 
46
        const char *name;
 
47
        const struct acpi_driver_ops ops;
 
48
};
 
49
 
 
50
void acpi_driver_register(const struct acpi_driver *driver);
 
51
const struct acpi_driver_ops *acpi_driver_find(const char *name);
 
52
 
 
53
#endif /* __ACPID_DRIVER__ */
 
54