mw_srvc_resolve.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_RESOLVE_H
#define _MW_SRVC_RESOLVE_H
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
#define mwService_RESOLVE 0x00000015
#define SEARCH_ERROR 0x00
struct mwServiceResolve;
enum mwResolveFlag {
mwResolveFlag_UNIQUE = 0x00000001,
mwResolveFlag_FIRST = 0x00000002,
mwResolveFlag_ALL_DIRS = 0x00000004,
mwResolveFlag_USERS = 0x00000008,
mwResolveFlag_GROUPS = 0x00000010,
};
enum mwResolveCode {
mwResolveCode_SUCCESS = 0x00000000,
mwResolveCode_PARTIAL = 0x00010000,
mwResolveCode_MULTIPLE = 0x80020000,
mwResolveCode_BAD_FORMAT = 0x80030000,
};
enum mwResolveMatchType {
mwResolveMatch_USER = 0x00000001,
mwResolveMatch_GROUP = 0x00000002,
};
struct mwResolveMatch {
char *id;
char *name;
char *desc;
guint32 type;
};
struct mwResolveResult {
guint32 code;
char *name;
GList *matches;
};
typedef void (*mwResolveHandler)
(struct mwServiceResolve *srvc,
guint32 id, guint32 code, GList *results,
gpointer data);
struct mwServiceResolve *mwServiceResolve_new(struct mwSession *);
guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc,
GList *queries, enum mwResolveFlag flags,
mwResolveHandler handler,
gpointer data, GDestroyNotify cleanup);
void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32);
#ifdef __cplusplus
}
#endif
#endif /* _MW_SRVC_RESOLVE_H */
mwResolveHandler
void(* mwResolveHandler)(struct mwServiceResolve *srvc, guint32 id, guint32 code, GList *results, gpointer data)
Handle the results of a resolve request.
Definition mw_srvc_resolve.h:113
mwServiceResolve_new
struct mwServiceResolve * mwServiceResolve_new(struct mwSession *)
Allocate a new resolve service.
mwResolveFlag
mwResolveFlag
Definition mw_srvc_resolve.h:46
mwResolveFlag_UNIQUE
@ mwResolveFlag_UNIQUE
return unique results or none at all
Definition mw_srvc_resolve.h:48
mwResolveFlag_ALL_DIRS
@ mwResolveFlag_ALL_DIRS
search all directories, not just the first with a match
Definition mw_srvc_resolve.h:54
mwResolveFlag_FIRST
@ mwResolveFlag_FIRST
return only the first result
Definition mw_srvc_resolve.h:51
mwResolveFlag_USERS
@ mwResolveFlag_USERS
search for users
Definition mw_srvc_resolve.h:57
mwResolveFlag_GROUPS
@ mwResolveFlag_GROUPS
search for groups
Definition mw_srvc_resolve.h:60
mwResolveCode
mwResolveCode
Definition mw_srvc_resolve.h:65
mwResolveCode_BAD_FORMAT
@ mwResolveCode_BAD_FORMAT
the name is not resolvable due to its format
Definition mw_srvc_resolve.h:77
mwResolveCode_MULTIPLE
@ mwResolveCode_MULTIPLE
more than one result (occurs when mwResolveFlag_UNIQUE is used and more than one result would have be...
Definition mw_srvc_resolve.h:74
mwResolveCode_SUCCESS
@ mwResolveCode_SUCCESS
successful search
Definition mw_srvc_resolve.h:67
mwResolveCode_PARTIAL
@ mwResolveCode_PARTIAL
only some of the nested searches were successful
Definition mw_srvc_resolve.h:70
mwResolveMatchType
mwResolveMatchType
Definition mw_srvc_resolve.h:81
mwResolveMatch_GROUP
@ mwResolveMatch_GROUP
Definition mw_srvc_resolve.h:83
mwResolveMatch_USER
@ mwResolveMatch_USER
Definition mw_srvc_resolve.h:82
mwServiceResolve_cancelResolve
void mwServiceResolve_cancelResolve(struct mwServiceResolve *, guint32)
Cancel a resolve request by its generated ID.
mwServiceResolve_resolve
guint32 mwServiceResolve_resolve(struct mwServiceResolve *srvc, GList *queries, enum mwResolveFlag flags, mwResolveHandler handler, gpointer data, GDestroyNotify cleanup)
Inisitate a resolve request.
mwResolveMatch
Definition mw_srvc_resolve.h:87
mwResolveMatch::name
char * name
user name
Definition mw_srvc_resolve.h:89
mwResolveMatch::id
char * id
user id
Definition mw_srvc_resolve.h:88
mwResolveMatch::desc
char * desc
description
Definition mw_srvc_resolve.h:90
mwResolveMatch::type
guint32 type
Definition mw_srvc_resolve.h:91
mwResolveResult
Definition mw_srvc_resolve.h:95
mwResolveResult::code
guint32 code
Definition mw_srvc_resolve.h:96
mwResolveResult::matches
GList * matches
list of mwResolveMatch
Definition mw_srvc_resolve.h:98
mwResolveResult::name
char * name
name of the result
Definition mw_srvc_resolve.h:97
mwServiceResolve
User lookup service.
mwSession
Represents a Sametime client session.