blob: 657397b6eb73e2bfc021e2cb72007e263f330b6f (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// 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;
void *data;
};
void resource_init(GHashTable *hash);
#endif
|