summaryrefslogtreecommitdiff
path: root/resource.h
blob: c3a1907464367009f3ad48c68e772ffa56f205a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// 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);
	int (*update)(struct client *c, struct resource *r, const char *m);
};

struct resource {
	const struct resource_ops *ops;
	void *data;
};

void resource_init(GHashTable *hash);

#endif