various coverity-inspired fixes
[minix3.git] / servers / ds / store.h
blob43e6ab12e414fa37244facbf40b3a121f877560a
1 #ifndef _DS_STORE_H_
2 #define _DS_STORE_H_
4 /* Type definitions for the Data Store Server. */
5 #include <sys/types.h>
6 #include <minix/config.h>
7 #include <minix/ds.h>
8 #include <minix/bitmap.h>
9 #include <minix/param.h>
10 #include <regex.h>
12 #define NR_DS_KEYS (2*NR_SYS_PROCS) /* number of entries */
13 #define NR_DS_SUBS (4*NR_SYS_PROCS) /* number of subscriptions */
14 #define NR_DS_SNAPSHOT 5 /* number of snapshots */
16 /* Base 'class' for the following 3 structs. */
17 struct data_store {
18 int flags;
19 char key[DS_MAX_KEYLEN]; /* key to lookup information */
20 char owner[DS_MAX_KEYLEN];
22 union {
23 unsigned u32;
24 struct {
25 void *data;
26 size_t length;
27 size_t reallen;
28 } mem;
29 struct dsi_map {
30 void *data;
31 size_t length;
32 void *realpointer;
33 void *snapshots[NR_DS_SNAPSHOT];
34 int sindex;
35 } map;
36 } u;
39 struct subscription {
40 int flags;
41 char owner[DS_MAX_KEYLEN];
42 regex_t regex;
43 bitchunk_t old_subs[BITMAP_CHUNKS(NR_DS_KEYS)];
46 #endif /* _DS_STORE_H_ */