2010-01-14 16:24:16 +01:00
|
|
|
#ifndef _DS_STORE_H_
|
|
|
|
#define _DS_STORE_H_
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Type definitions for the Data Store Server. */
|
2006-07-13 16:50:23 +02:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <minix/sys_config.h>
|
|
|
|
#include <minix/ds.h>
|
|
|
|
#include <minix/bitmap.h>
|
|
|
|
#include <regex.h>
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
#define NR_DS_KEYS 64 /* number of entries */
|
|
|
|
#define NR_DS_SUBS (4*_NR_SYS_PROCS) /* number of subscriptions */
|
|
|
|
#define NR_DS_SNAPSHOT 5 /* number of snapshots */
|
2006-07-13 16:50:23 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
/* Base 'class' for the following 3 structs. */
|
2006-07-13 16:50:23 +02:00
|
|
|
struct data_store {
|
2010-01-14 16:24:16 +01:00
|
|
|
int flags;
|
|
|
|
char key[DS_MAX_KEYLEN]; /* key to lookup information */
|
|
|
|
char owner[DS_MAX_KEYLEN];
|
|
|
|
|
|
|
|
union {
|
|
|
|
unsigned u32;
|
|
|
|
char string[DS_MAX_STRLEN];
|
|
|
|
struct {
|
|
|
|
void *data;
|
|
|
|
size_t length;
|
|
|
|
size_t reallen;
|
|
|
|
} mem;
|
|
|
|
struct dsi_map {
|
|
|
|
void *data;
|
|
|
|
size_t length;
|
|
|
|
void *realpointer;
|
|
|
|
void *snapshots[NR_DS_SNAPSHOT];
|
|
|
|
int sindex;
|
|
|
|
} map;
|
|
|
|
} u;
|
2006-07-13 16:50:23 +02:00
|
|
|
};
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2006-07-13 16:50:23 +02:00
|
|
|
struct subscription {
|
2010-01-14 16:24:16 +01:00
|
|
|
int flags;
|
|
|
|
char owner[DS_MAX_KEYLEN];
|
|
|
|
regex_t regex;
|
|
|
|
bitchunk_t old_subs[BITMAP_CHUNKS(NR_DS_KEYS)];
|
2006-07-13 16:50:23 +02:00
|
|
|
};
|
2005-10-20 22:29:52 +02:00
|
|
|
|
2010-01-14 16:24:16 +01:00
|
|
|
#endif /* _DS_STORE_H_ */
|