meanwhile  1.0.2
mw_srvc_store.h
Go to the documentation of this file.
1 
2 /*
3  Meanwhile - Unofficial Lotus Sametime Community Client Library
4  Copyright (C) 2004 Christopher (siege) O'Brien
5 
6  This library is free software; you can redistribute it and/or
7  modify it under the terms of the GNU Library General Public
8  License as published by the Free Software Foundation; either
9  version 2 of the License, or (at your option) any later version.
10 
11  This library is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  Library General Public License for more details.
15 
16  You should have received a copy of the GNU Library General Public
17  License along with this library; if not, write to the Free
18  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20 
21 #ifndef _MW_SRVC_STORE_H
22 #define _MW_SRVC_STORE_H
23 
24 
25 #include <glib.h>
26 #include "mw_common.h"
27 
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 
35 #define mwService_STORAGE 0x00000018
36 
37 
43 
44 
49 struct mwStorageUnit;
50 
51 
53 #define LOTUS_RESERVED_LIMIT 0x186a0
54 
55 
57 #define KEY_IS_LOTUS_RESERVED(key) \
58  (((guint32) key) <= (LOTUS_RESERVED_LIMIT))
59 
60 
65 
67  mwStore_AWARE_LIST = 0x00000000,
68 
70  mwStore_INVITE_CHAT = 0x00000006,
71 
73  mwStore_INVITE_MEETING = 0x0000000e,
74 
76  mwStore_AWAY_MESSAGES = 0x00000050,
77 
79  mwStore_BUSY_MESSAGES = 0x0000005a,
80 
83 };
84 
85 
92 typedef void (*mwStorageCallback)
93  (struct mwServiceStorage *srvc,
94  guint32 result, struct mwStorageUnit *item,
95  gpointer data);
96 
97 
101 
102 
104 struct mwStorageUnit *mwStorageUnit_new(guint32 key);
105 
106 
108 struct mwStorageUnit *mwStorageUnit_newOpaque(guint32 key,
109  struct mwOpaque *data);
110 
111 
114 struct mwStorageUnit *mwStorageUnit_newBoolean(guint32 key,
115  gboolean val);
116 
117 
118 struct mwStorageUnit *mwStorageUnit_newInteger(guint32 key,
119  guint32 val);
120 
121 
124 struct mwStorageUnit *mwStorageUnit_newString(guint32 key,
125  const char *str);
126 
127 
129 guint32 mwStorageUnit_getKey(struct mwStorageUnit *);
130 
131 
135 gboolean mwStorageUnit_asBoolean(struct mwStorageUnit *, gboolean val);
136 
137 
141 guint32 mwStorageUnit_asInteger(struct mwStorageUnit *, guint32 val);
142 
143 
148 char *mwStorageUnit_asString(struct mwStorageUnit *);
149 
150 
152 struct mwOpaque *mwStorageUnit_asOpaque(struct mwStorageUnit *);
153 
154 
156 void mwStorageUnit_free(struct mwStorageUnit *);
157 
158 
169 void mwServiceStorage_load(struct mwServiceStorage *srvc,
170  struct mwStorageUnit *item,
172  gpointer data, GDestroyNotify data_free);
173 
174 
185 void mwServiceStorage_save(struct mwServiceStorage *srvc,
186  struct mwStorageUnit *item,
188  gpointer data, GDestroyNotify data_free);
189 
190 
191 #ifdef __cplusplus
192 }
193 #endif
194 
195 
196 #endif /* _MW_SRVC_STORE_H */