summaryrefslogtreecommitdiff
path: root/resource.h
diff options
context:
space:
mode:
authorRussell King <rmk@armlinux.org.uk>2021-09-11 12:25:36 +0100
committerRussell King <rmk@armlinux.org.uk>2021-09-11 12:25:36 +0100
commitacc52e700121120726b42a6dadd8c12f030ba349 (patch)
tree6310eccc6ac9dfad9f060670c9efc7c0420bdc5b /resource.h
parent6201a11f03fe988a599a54f73c76640cac7e006e (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.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/resource.h b/resource.h
index 44d0d74..c3a1907 100644
--- a/resource.h
+++ b/resource.h
@@ -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;
};