mw_srvc_store.h
Go to the documentation of this file.
/*
Meanwhile - Unofficial Lotus Sametime Community Client Library
Copyright (C) 2004 Christopher (siege) O'Brien
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with this library; if not, write to the Free
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef _MW_SRVC_STORE_H
#define _MW_SRVC_STORE_H
#include <glib.h>
#include "mw_common.h"
#ifdef __cplusplus
extern "C" {
#endif
#define mwService_STORAGE 0x00000018
struct mwServiceStorage;
struct mwStorageUnit;
#define LOTUS_RESERVED_LIMIT 0x186a0
#define KEY_IS_LOTUS_RESERVED(key) \
(((guint32) key) <= (LOTUS_RESERVED_LIMIT))
enum mwStorageKey {
mwStore_AWARE_LIST = 0x00000000,
mwStore_INVITE_CHAT = 0x00000006,
mwStore_INVITE_MEETING = 0x0000000e,
mwStore_AWAY_MESSAGES = 0x00000050,
mwStore_BUSY_MESSAGES = 0x0000005a,
mwStore_ACTIVE_MESSAGES = 0x00000064,
};
typedef void (*mwStorageCallback)
(struct mwServiceStorage *srvc,
guint32 result, struct mwStorageUnit *item,
gpointer data);
struct mwServiceStorage *mwServiceStorage_new(struct mwSession *);
struct mwStorageUnit *mwStorageUnit_new(guint32 key);
struct mwStorageUnit *mwStorageUnit_newOpaque(guint32 key,
struct mwOpaque *data);
struct mwStorageUnit *mwStorageUnit_newBoolean(guint32 key,
gboolean val);
struct mwStorageUnit *mwStorageUnit_newInteger(guint32 key,
guint32 val);
struct mwStorageUnit *mwStorageUnit_newString(guint32 key,
const char *str);
guint32 mwStorageUnit_getKey(struct mwStorageUnit *);
gboolean mwStorageUnit_asBoolean(struct mwStorageUnit *, gboolean val);
guint32 mwStorageUnit_asInteger(struct mwStorageUnit *, guint32 val);
char *mwStorageUnit_asString(struct mwStorageUnit *);
struct mwOpaque *mwStorageUnit_asOpaque(struct mwStorageUnit *);
void mwStorageUnit_free(struct mwStorageUnit *);
void mwServiceStorage_load(struct mwServiceStorage *srvc,
struct mwStorageUnit *item,
mwStorageCallback cb,
gpointer data, GDestroyNotify data_free);
void mwServiceStorage_save(struct mwServiceStorage *srvc,
struct mwStorageUnit *item,
mwStorageCallback cb,
gpointer data, GDestroyNotify data_free);
#ifdef __cplusplus
}
#endif
#endif /* _MW_SRVC_STORE_H */
mw_common.h
Common data types and functions for handling those types.
mwServiceStorage_new
struct mwServiceStorage * mwServiceStorage_new(struct mwSession *)
Allocates and initializes a storage service instance for use on the passed session.
mwStorageUnit_newInteger
struct mwStorageUnit * mwStorageUnit_newInteger(guint32 key, guint32 val)
mwStorageUnit_asInteger
guint32 mwStorageUnit_asInteger(struct mwStorageUnit *, guint32 val)
attempts to obtain a guint32 value from a storage unit.
mwStorageUnit_getKey
guint32 mwStorageUnit_getKey(struct mwStorageUnit *)
get the key for the given storage unit
mwServiceStorage_save
void mwServiceStorage_save(struct mwServiceStorage *srvc, struct mwStorageUnit *item, mwStorageCallback cb, gpointer data, GDestroyNotify data_free)
Initiates a store call to the storage service.
mwStorageUnit_newString
struct mwStorageUnit * mwStorageUnit_newString(guint32 key, const char *str)
creates a storage unit with the passed key, and an encapsulated string value.
mwStorageUnit_newOpaque
struct mwStorageUnit * mwStorageUnit_newOpaque(guint32 key, struct mwOpaque *data)
creates a storage unit with the passed key, and a copy of data.
mwStorageCallback
void(* mwStorageCallback)(struct mwServiceStorage *srvc, guint32 result, struct mwStorageUnit *item, gpointer data)
Appropriate function type for load and store callbacks.
Definition mw_srvc_store.h:93
mwServiceStorage_load
void mwServiceStorage_load(struct mwServiceStorage *srvc, struct mwStorageUnit *item, mwStorageCallback cb, gpointer data, GDestroyNotify data_free)
Initiates a load call to the storage service.
mwStorageUnit_newBoolean
struct mwStorageUnit * mwStorageUnit_newBoolean(guint32 key, gboolean val)
creates a storage unit with the passed key, and an encapsulated boolean value
mwStorageKey
mwStorageKey
Some common keys storage keys.
Definition mw_srvc_store.h:64
mwStore_BUSY_MESSAGES
@ mwStore_BUSY_MESSAGES
Last five Busy (DND) messages, separated by semicolon.
Definition mw_srvc_store.h:79
mwStore_INVITE_CHAT
@ mwStore_INVITE_CHAT
Default text for chat invitations.
Definition mw_srvc_store.h:70
mwStore_AWAY_MESSAGES
@ mwStore_AWAY_MESSAGES
Last five Away messages, separated by semicolon.
Definition mw_srvc_store.h:76
mwStore_AWARE_LIST
@ mwStore_AWARE_LIST
The buddy list, in the Sametime .dat file format.
Definition mw_srvc_store.h:67
mwStore_ACTIVE_MESSAGES
@ mwStore_ACTIVE_MESSAGES
Last five Active messages, separated by semicolon.
Definition mw_srvc_store.h:82
mwStore_INVITE_MEETING
@ mwStore_INVITE_MEETING
Default text for meeting invitations.
Definition mw_srvc_store.h:73
mwStorageUnit_asString
char * mwStorageUnit_asString(struct mwStorageUnit *)
attempts to obtain a string value from a storage unit.
mwStorageUnit_asOpaque
struct mwOpaque * mwStorageUnit_asOpaque(struct mwStorageUnit *)
direct access to the opaque data backing the storage unit
mwStorageUnit_free
void mwStorageUnit_free(struct mwStorageUnit *)
clears and frees a storage unit
mwStorageUnit_asBoolean
gboolean mwStorageUnit_asBoolean(struct mwStorageUnit *, gboolean val)
attempts to obtain a boolean value from a storage unit.
mwStorageUnit_new
struct mwStorageUnit * mwStorageUnit_new(guint32 key)
create an empty storage unit
mwOpaque
A length of binary data, not null-terminated.
Definition mw_common.h:79
mwOpaque::data
guchar * data
data, normally with no NULL termination
Definition mw_common.h:81
mwServiceStorage
mwSession
Represents a Sametime client session.