From: Ben Gras Date: Fri, 14 Jul 2006 12:40:32 +0000 (+0000) Subject: - ds definitions. X-Git-Tag: v3.1.3~249 X-Git-Url: http://zhaoyanbai.com/repos/icons/debian/static/verify-sign/Bv9ARM.ch08.html?a=commitdiff_plain;h=b0fc01eb823410ec65ad03568a4a723ac5786116;p=minix.git - ds definitions. --- diff --git a/include/minix/ds.h b/include/minix/ds.h new file mode 100755 index 000000000..fc04547b9 --- /dev/null +++ b/include/minix/ds.h @@ -0,0 +1,38 @@ +/* Prototypes and definitions for DS interface. */ + +#ifndef _MINIX_DS_H +#define _MINIX_DS_H + +#include + +/* DS Flag values. */ +#define DS_IN_USE 0x0001 /* Internal use only. */ +#define DS_PUBLIC 0x0002 /* Publically retrievable value. */ +#define DS_INITIAL 0x0004 /* On subscription, send initial contents. */ + +/* These type flags are mutually exclusive. Give as args to ds_subscribe. */ +#define DS_TYPE_U32 0x0100 +#define DS_TYPE_STR 0x0200 +#define DS_TYPE_MASK 0xff00 /* All type info. */ + +/* DS constants. */ +#define DS_MAX_KEYLEN 80 /* Max length for a key, including '\0'. */ +#define DS_MAX_VALLEN 100 /* Max legnth for a str value, incl '\0'. */ + +/* ds.c */ +_PROTOTYPE( int ds_subscribe, (char *name_regexp, int type, int flags)); + +/* publish/update item */ +_PROTOTYPE( int ds_publish_u32, (char *name, u32_t val)); +_PROTOTYPE( int ds_publish_str, (char *name, char *val)); + +/* retrieve item by name + type */ +_PROTOTYPE( int ds_retrieve_u32, (char *name, u32_t *val) ); +_PROTOTYPE( int ds_retrieve_str, (char *name, char *val, size_t len)); + +/* retrieve updates for item */ +_PROTOTYPE( int ds_check_u32, (char *n, size_t namelen, u32_t *val)); +_PROTOTYPE( int ds_check_str, (char *n, size_t namelen, char *v, size_t vlen)); + +#endif /* _MINIX_DS_H */ +