meanwhile  1.1.0
Macros | Enumerations | Functions
mw_st_list.h File Reference

Parse and compose buddy lists in the format commonly used by Sametime Connect clients. More...

#include <glib.h>
#include "mw_common.h"

Go to the source code of this file.

Macros

#define ST_LIST_MAJOR   3
 
#define ST_LIST_MICRO   3
 
#define ST_LIST_MINOR   1
 

Enumerations

enum  mwSametimeGroupType {
  mwSametimeGroup_NORMAL = 1,
  mwSametimeGroup_DYNAMIC = 2,
  mwSametimeGroup_UNKNOWN = 0
}
 
enum  mwSametimeUserType {
  mwSametimeUser_NORMAL = 1,
  mwSametimeUser_EXTERNAL = 2,
  mwSametimeUser_UNKNOWN = 0
}
 

Functions

struct mwSametimeUsermwSametimeGroup_findUser (struct mwSametimeGroup *g, struct mwIdBlock *user)
 
void mwSametimeGroup_free (struct mwSametimeGroup *g)
 Remove a group from its list, and free it. More...
 
const char * mwSametimeGroup_getAlias (struct mwSametimeGroup *g)
 
struct mwSametimeListmwSametimeGroup_getList (struct mwSametimeGroup *g)
 
const char * mwSametimeGroup_getName (struct mwSametimeGroup *g)
 
enum mwSametimeGroupType mwSametimeGroup_getType (struct mwSametimeGroup *g)
 
GList * mwSametimeGroup_getUsers (struct mwSametimeGroup *g)
 Get a GList snapshot of the users in a list. More...
 
gboolean mwSametimeGroup_isOpen (struct mwSametimeGroup *g)
 
struct mwSametimeGroupmwSametimeGroup_new (struct mwSametimeList *l, enum mwSametimeGroupType type, const char *name)
 Create a new group in a list. More...
 
void mwSametimeGroup_setAlias (struct mwSametimeGroup *g, const char *alias)
 
void mwSametimeGroup_setOpen (struct mwSametimeGroup *g, gboolean open)
 
struct mwSametimeGroupmwSametimeList_findGroup (struct mwSametimeList *l, const char *name)
 
void mwSametimeList_free (struct mwSametimeList *l)
 Free the list, all of its groups, and all of the groups' members. More...
 
void mwSametimeList_get (struct mwGetBuffer *b, struct mwSametimeList *l)
 Load a sametime list from a buffer. More...
 
GList * mwSametimeList_getGroups (struct mwSametimeList *l)
 Get a GList snapshot of the groups in a list. More...
 
guint mwSametimeList_getMajor (struct mwSametimeList *l)
 
guint mwSametimeList_getMicro (struct mwSametimeList *l)
 
guint mwSametimeList_getMinor (struct mwSametimeList *l)
 
struct mwSametimeListmwSametimeList_load (const char *str)
 convert a plain string into a sametime list More...
 
struct mwSametimeListmwSametimeList_new (void)
 Create a new list. More...
 
void mwSametimeList_put (struct mwPutBuffer *b, struct mwSametimeList *l)
 Write a sametime list onto a buffer. More...
 
void mwSametimeList_setMajor (struct mwSametimeList *l, guint v)
 
void mwSametimeList_setMicro (struct mwSametimeList *l, guint v)
 
void mwSametimeList_setMinor (struct mwSametimeList *l, guint v)
 
char * mwSametimeList_store (struct mwSametimeList *l)
 convert a sametime list into a string More...
 
void mwSametimeUser_free (struct mwSametimeUser *u)
 Remove user from its group, and free it. More...
 
const char * mwSametimeUser_getAlias (struct mwSametimeUser *u)
 
const char * mwSametimeUser_getCommunity (struct mwSametimeUser *u)
 
struct mwSametimeGroupmwSametimeUser_getGroup (struct mwSametimeUser *u)
 
const char * mwSametimeUser_getShortName (struct mwSametimeUser *u)
 
enum mwSametimeUserType mwSametimeUser_getType (struct mwSametimeUser *u)
 
const char * mwSametimeUser_getUser (struct mwSametimeUser *u)
 
struct mwSametimeUsermwSametimeUser_new (struct mwSametimeGroup *g, enum mwSametimeUserType type, struct mwIdBlock *user)
 Create a user in a group. More...
 
void mwSametimeUser_setAlias (struct mwSametimeUser *u, const char *alias)
 
void mwSametimeUser_setShortName (struct mwSametimeUser *u, const char *name)
 

Detailed Description

Parse and compose buddy lists in the format commonly used by Sametime Connect clients.

Macro Definition Documentation

#define ST_LIST_MAJOR   3
#define ST_LIST_MICRO   3
#define ST_LIST_MINOR   1

Enumeration Type Documentation

Enumerator
mwSametimeGroup_NORMAL 

a normal group of users

mwSametimeGroup_DYNAMIC 

a server-side group

mwSametimeGroup_UNKNOWN 

error determining group type

Enumerator
mwSametimeUser_NORMAL 

user on same community

mwSametimeUser_EXTERNAL 

external user

mwSametimeUser_UNKNOWN 

error determining user type

Function Documentation

struct mwSametimeUser* mwSametimeGroup_findUser ( struct mwSametimeGroup g,
struct mwIdBlock user 
)
void mwSametimeGroup_free ( struct mwSametimeGroup g)

Remove a group from its list, and free it.

Also frees all users contained in the group

const char* mwSametimeGroup_getAlias ( struct mwSametimeGroup g)
struct mwSametimeList* mwSametimeGroup_getList ( struct mwSametimeGroup g)
const char* mwSametimeGroup_getName ( struct mwSametimeGroup g)
enum mwSametimeGroupType mwSametimeGroup_getType ( struct mwSametimeGroup g)
GList* mwSametimeGroup_getUsers ( struct mwSametimeGroup g)

Get a GList snapshot of the users in a list.

gboolean mwSametimeGroup_isOpen ( struct mwSametimeGroup g)
struct mwSametimeGroup* mwSametimeGroup_new ( struct mwSametimeList l,
enum mwSametimeGroupType  type,
const char *  name 
)

Create a new group in a list.

void mwSametimeGroup_setAlias ( struct mwSametimeGroup g,
const char *  alias 
)
void mwSametimeGroup_setOpen ( struct mwSametimeGroup g,
gboolean  open 
)
struct mwSametimeGroup* mwSametimeList_findGroup ( struct mwSametimeList l,
const char *  name 
)
void mwSametimeList_free ( struct mwSametimeList l)

Free the list, all of its groups, and all of the groups' members.

void mwSametimeList_get ( struct mwGetBuffer b,
struct mwSametimeList l 
)

Load a sametime list from a buffer.

The list must be encapsulated as a string (eg, the first two bytes in the buffer should be the length of the string)

GList* mwSametimeList_getGroups ( struct mwSametimeList l)

Get a GList snapshot of the groups in a list.

guint mwSametimeList_getMajor ( struct mwSametimeList l)
guint mwSametimeList_getMicro ( struct mwSametimeList l)
guint mwSametimeList_getMinor ( struct mwSametimeList l)
struct mwSametimeList* mwSametimeList_load ( const char *  str)

convert a plain string into a sametime list

struct mwSametimeList* mwSametimeList_new ( void  )

Create a new list.

void mwSametimeList_put ( struct mwPutBuffer b,
struct mwSametimeList l 
)

Write a sametime list onto a buffer.

The list will be encapsulated in a string (the first two bytes written will be the length of the rest of the written list data)

void mwSametimeList_setMajor ( struct mwSametimeList l,
guint  v 
)
void mwSametimeList_setMicro ( struct mwSametimeList l,
guint  v 
)
void mwSametimeList_setMinor ( struct mwSametimeList l,
guint  v 
)
char* mwSametimeList_store ( struct mwSametimeList l)

convert a sametime list into a string

void mwSametimeUser_free ( struct mwSametimeUser u)

Remove user from its group, and free it.

const char* mwSametimeUser_getAlias ( struct mwSametimeUser u)
const char* mwSametimeUser_getCommunity ( struct mwSametimeUser u)
struct mwSametimeGroup* mwSametimeUser_getGroup ( struct mwSametimeUser u)
const char* mwSametimeUser_getShortName ( struct mwSametimeUser u)
enum mwSametimeUserType mwSametimeUser_getType ( struct mwSametimeUser u)
const char* mwSametimeUser_getUser ( struct mwSametimeUser u)
struct mwSametimeUser* mwSametimeUser_new ( struct mwSametimeGroup g,
enum mwSametimeUserType  type,
struct mwIdBlock user 
)

Create a user in a group.

void mwSametimeUser_setAlias ( struct mwSametimeUser u,
const char *  alias 
)
void mwSametimeUser_setShortName ( struct mwSametimeUser u,
const char *  name 
)