mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
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:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user