// Copyright (C) 2021 Russell King. // Licensed under GPL version 2. See COPYING. #ifndef RESOURCE_H #define RESOURCE_h struct client; struct resource; struct resource_ops { int (*get)(struct client *c, struct resource *r); void (*close)(struct client *c, struct resource *r); void (*update_open)(struct client *c, struct resource *r); int (*update)(struct client *c, struct resource *r, const char *m); void (*update_close)(struct client *c, struct resource *r); }; struct resource { const struct resource_ops *ops; struct client *updater; time_t updater_time; void *data; }; void resource_init(GHashTable *hash); #endif