summaryrefslogtreecommitdiff
path: root/include/hotplug.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2014-02-02 15:28:31 +0100
committerHans de Goede <hdegoede@redhat.com>2014-03-03 08:13:55 +0100
commitbc9d17fb566d57eabe4a3372773654fcf6ae5b44 (patch)
treec6ef15f558f5c0582e3b87bcdf4c564036711a99 /include/hotplug.h
parent350559dcdcd8b0de57801302e385e25debcb91f1 (diff)
OdevAttribute: Add support for integer attributes
Add a couple of new functions for dealing with storing integer values into OdevAttributes. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'include/hotplug.h')
-rw-r--r--include/hotplug.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/hotplug.h b/include/hotplug.h
index ee7b7d7d5..46576697f 100644
--- a/include/hotplug.h
+++ b/include/hotplug.h
@@ -32,10 +32,16 @@ extern _X_EXPORT void config_pre_init(void);
extern _X_EXPORT void config_init(void);
extern _X_EXPORT void config_fini(void);
+enum { ODEV_ATTRIB_STRING, ODEV_ATTRIB_INT };
+
struct OdevAttribute {
struct xorg_list member;
int attrib_id;
- char *attrib_name;
+ union {
+ char *attrib_name;
+ int attrib_value;
+ };
+ int attrib_type;
};
struct OdevAttributes {
@@ -56,6 +62,14 @@ config_odev_add_attribute(struct OdevAttributes *attribs, int attrib,
char *
config_odev_get_attribute(struct OdevAttributes *attribs, int attrib_id);
+Bool
+config_odev_add_int_attribute(struct OdevAttributes *attribs, int attrib,
+ int attrib_value);
+
+int
+config_odev_get_int_attribute(struct OdevAttributes *attribs, int attrib,
+ int def);
+
void
config_odev_free_attributes(struct OdevAttributes *attribs);