00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef __SYSINTERF_PROP_H__
00011 #define __SYSINTERF_PROP_H__ 1
00012
00013 #define SYSPROP_STORE 1
00014 #define SYSPROP_FETCH 2
00015 #define SYSPROP_UPDATE 3
00016 #define SYSPROP_DELETE 4
00017 #define SYSPROP_ATTACH 5
00018 #define SYSPROP_DETACH 6
00019 #define SYSPROP_DUMP 10
00020
00021 typedef struct
00022 {
00023 int ktype;
00024 #define PROPKTYPE_UNDEF 0
00025 #define PROPKTYPE_RESID 1
00026 #define PROPKTYPE_STRING 2
00027 const char *kbuf;
00028 int klen;
00029 const char *vbuf;
00030 int vlen;
00031 u_int32_t opts;
00032 #define PROPSTORE_GENKEY (1<<0u)
00033 #define PROPSTORE_PERMANENT (1<<1u)
00035 #define PROPSTORE_SHARED_SECTION (1<<2u)
00036 mode_t perm;
00037 } t_sys_prop_store_args;
00038
00039 typedef struct
00040 {
00041 int ktype;
00042 const char *kbuf;
00043 int klen;
00044 u_int32_t prop_trust;
00045 #define PROPTRUST_ROOT (1<<0u)
00046 #define PROPTRUST_ME (1<<1u)
00047 #define PROPTRUST_ANY (1<<2u)
00048 const char *vbuf;
00049 int *refcnt;
00050 } t_sys_prop_fetch_args;
00051
00052
00053
00054 int prop_store(int ktype, const char *kbuf, int klen, const char *vbuf, int vlen, u_int32_t opts, mode_t perm);
00055 int prop_update(int ktype, const char *kbuf, int klen, u_int32_t prop_trust, const char *vbuf);
00056 int prop_fetch(int ktype, const char *kbuf, int klen, u_int32_t prop_trust, char *vbuf, int *refcnt);
00057 int prop_delete(int ktype, const char *kbuf, int klen);
00058 int prop_attach(pid_t pid, int ktype, const char *kbuf, int klen);
00059 int prop_detach(pid_t pid, int ktype, const char *kbuf, int klen);
00060 int prop_dump(void);
00061 #endif