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 mwSametimeUser * | mwSametimeGroup_findUser (struct mwSametimeGroup *g, struct mwIdBlock *user)
void | mwSametimeGroup_free (struct mwSametimeGroup *g)
| Remove a group from its list, and free it.
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.
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.
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)

## Detailed Description

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

## Macro Definition Documentation

## ST_LIST_MAJOR

#define ST_LIST_MAJOR 3

## ST_LIST_MICRO

#define ST_LIST_MICRO 3

## ST_LIST_MINOR

#define ST_LIST_MINOR 1

## Enumeration Type Documentation

## mwSametimeGroupType

enum mwSametimeGroupType

Enumerator
mwSametimeGroup_NORMAL | a normal group of users
mwSametimeGroup_DYNAMIC | a server-side group
mwSametimeGroup_UNKNOWN | error determining group type

## mwSametimeUserType

enum mwSametimeUserType

Enumerator
mwSametimeUser_NORMAL | user on same community
mwSametimeUser_EXTERNAL | external user
mwSametimeUser_UNKNOWN | error determining user type

## Function Documentation

## mwSametimeGroup_findUser()

struct mwSametimeUser * mwSametimeGroup_findUser | ( | struct mwSametimeGroup * | g,
|  | struct mwIdBlock * | user )

## mwSametimeGroup_free()

void mwSametimeGroup_free | ( | struct mwSametimeGroup * | g | ) |

Remove a group from its list, and free it.

Also frees all users contained in the group

## mwSametimeGroup_getAlias()

const char * mwSametimeGroup_getAlias | ( | struct mwSametimeGroup * | g | ) |

## mwSametimeGroup_getList()

struct mwSametimeList * mwSametimeGroup_getList | ( | struct mwSametimeGroup * | g | ) |

## mwSametimeGroup_getName()

const char * mwSametimeGroup_getName | ( | struct mwSametimeGroup * | g | ) |

## mwSametimeGroup_getType()

enum mwSametimeGroupType mwSametimeGroup_getType | ( | struct mwSametimeGroup * | g | ) |

## mwSametimeGroup_getUsers()

GList * mwSametimeGroup_getUsers | ( | struct mwSametimeGroup * | g | ) |

Get a GList snapshot of the users in a list.

## mwSametimeGroup_isOpen()

gboolean mwSametimeGroup_isOpen | ( | struct mwSametimeGroup * | g | ) |

## mwSametimeGroup_new()

struct mwSametimeGroup * mwSametimeGroup_new | ( | struct mwSametimeList * | l,
|  | enum mwSametimeGroupType | type,
|  | const char * | name )

Create a new group in a list.

## mwSametimeGroup_setAlias()

void mwSametimeGroup_setAlias | ( | struct mwSametimeGroup * | g,
|  | const char * | alias )

## mwSametimeGroup_setOpen()

void mwSametimeGroup_setOpen | ( | struct mwSametimeGroup * | g,
|  | gboolean | open )

## mwSametimeList_findGroup()

struct mwSametimeGroup * mwSametimeList_findGroup | ( | struct mwSametimeList * | l,
|  | const char * | name )

## mwSametimeList_free()

void mwSametimeList_free | ( | struct mwSametimeList * | l | ) |

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

## mwSametimeList_get()

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)

## mwSametimeList_getGroups()

GList * mwSametimeList_getGroups | ( | struct mwSametimeList * | l | ) |

Get a GList snapshot of the groups in a list.

## mwSametimeList_getMajor()

guint mwSametimeList_getMajor | ( | struct mwSametimeList * | l | ) |

## mwSametimeList_getMicro()

guint mwSametimeList_getMicro | ( | struct mwSametimeList * | l | ) |

## mwSametimeList_getMinor()

guint mwSametimeList_getMinor | ( | struct mwSametimeList * | l | ) |

## mwSametimeList_load()

struct mwSametimeList * mwSametimeList_load | ( | const char * | str | ) |

convert a plain string into a sametime list

## mwSametimeList_new()

struct mwSametimeList * mwSametimeList_new | ( | void |  | ) |

Create a new list.

## mwSametimeList_put()

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)

## mwSametimeList_setMajor()

void mwSametimeList_setMajor | ( | struct mwSametimeList * | l,
|  | guint | v )

## mwSametimeList_setMicro()

void mwSametimeList_setMicro | ( | struct mwSametimeList * | l,
|  | guint | v )

## mwSametimeList_setMinor()

void mwSametimeList_setMinor | ( | struct mwSametimeList * | l,
|  | guint | v )

## mwSametimeList_store()

char * mwSametimeList_store | ( | struct mwSametimeList * | l | ) |

convert a sametime list into a string

## mwSametimeUser_free()

void mwSametimeUser_free | ( | struct mwSametimeUser * | u | ) |

Remove user from its group, and free it.

## mwSametimeUser_getAlias()

const char * mwSametimeUser_getAlias | ( | struct mwSametimeUser * | u | ) |

## mwSametimeUser_getCommunity()

const char * mwSametimeUser_getCommunity | ( | struct mwSametimeUser * | u | ) |

## mwSametimeUser_getGroup()

struct mwSametimeGroup * mwSametimeUser_getGroup | ( | struct mwSametimeUser * | u | ) |

## mwSametimeUser_getShortName()

const char * mwSametimeUser_getShortName | ( | struct mwSametimeUser * | u | ) |

## mwSametimeUser_getType()

enum mwSametimeUserType mwSametimeUser_getType | ( | struct mwSametimeUser * | u | ) |

## mwSametimeUser_getUser()

const char * mwSametimeUser_getUser | ( | struct mwSametimeUser * | u | ) |

## mwSametimeUser_new()

struct mwSametimeUser * mwSametimeUser_new | ( | struct mwSametimeGroup * | g,
|  | enum mwSametimeUserType | type,
|  | struct mwIdBlock * | user )

Create a user in a group.

## mwSametimeUser_setAlias()

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

## mwSametimeUser_setShortName()

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