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>
This commit is contained in:
Hans de Goede
2014-02-02 15:28:31 +01:00
parent 350559dcdc
commit bc9d17fb56
4 changed files with 82 additions and 1 deletions

View File

@@ -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);