diff options
author | Russell King <rmk@armlinux.org.uk> | 2021-09-11 12:25:36 +0100 |
---|---|---|
committer | Russell King <rmk@armlinux.org.uk> | 2021-09-11 12:25:36 +0100 |
commit | acc52e700121120726b42a6dadd8c12f030ba349 (patch) | |
tree | 6310eccc6ac9dfad9f060670c9efc7c0420bdc5b /resource.h | |
parent | 6201a11f03fe988a599a54f73c76640cac7e006e (diff) |
resource: split resource operations from resource object structure
Move the resource operations out of the resource object structure
and make them const.
Signed-off-by: Russell King <rmk@armlinux.org.uk>
Diffstat (limited to 'resource.h')
-rw-r--r-- | resource.h | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -4,11 +4,16 @@ #define RESOURCE_h struct client; +struct resource; -struct resource { +struct resource_ops { int (*get)(struct client *c, struct resource *r); - int (*update)(struct client *c, struct resource *r, const char *m); void (*close)(struct client *c, struct resource *r); + int (*update)(struct client *c, struct resource *r, const char *m); +}; + +struct resource { + const struct resource_ops *ops; void *data; }; |