summaryrefslogtreecommitdiff
path: root/minix/servers/ds/store.h
blob: e5fad1e93ee7a491a6963a08b73b405486692c36 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
#ifndef _DS_STORE_H_
#define _DS_STORE_H_

/* Type definitions for the Data Store Server. */
#include <sys/types.h>
#include <minix/config.h>
#include <minix/ds.h>
#include <minix/bitmap.h>
#include <minix/param.h>
#include <regex.h>

#define NR_DS_KEYS	(2*NR_SYS_PROCS)	/* number of entries */
#define NR_DS_SUBS	(4*NR_SYS_PROCS)	/* number of subscriptions */

/* Base 'class' for the following 3 structs. */
struct data_store {
	int	flags;
	char	key[DS_MAX_KEYLEN];	/* key to lookup information */
	char	owner[DS_MAX_KEYLEN];

	union dsi_u {
		unsigned u32;
		struct dsi_mem {
			void *data;
			size_t length;
			size_t reallen;
		} mem;
	} u;
};

struct subscription {
	int		flags;
	char		owner[DS_MAX_KEYLEN];
	regex_t		regex;
	bitchunk_t	old_subs[BITMAP_CHUNKS(NR_DS_KEYS)];	
};

#endif /* _DS_STORE_H_ */