meanwhile 1.1.1
mw_common.h File Reference

Common data types and functions for handling those types. More...

#include <glib.h>

Go to the source code of this file.

Data Structures

struct  mwAwareIdBlock
struct  mwAwareSnapshot
struct  mwEncryptItem
 encryption blocks More...
struct  mwIdBlock
struct  mwLoginInfo
struct  mwOpaque
 A length of binary data, not null-terminated. More...
struct  mwPrivacyInfo
struct  mwUserItem
struct  mwUserStatus

Enumerations

enum  mwAwareType {
  mwAware_USER = 0x0002 ,
  mwAware_GROUP = 0x0003 ,
  mwAware_SERVER = 0x0008
}
 type codes for mwAwareIdBlock More...
enum  mwLoginType {
  mwLogin_LIB = 0x1000 ,
  mwLogin_JAVA_WEB = 0x1001 ,
  mwLogin_BINARY = 0x1002 ,
  mwLogin_JAVA_APP = 0x1003 ,
  mwLogin_LINKS = 0x100a ,
  mwLogin_NOTES_6_5 = 0x1200 ,
  mwLogin_NOTES_6_5_3 = 0x1203 ,
  mwLogin_NOTES_7_0_beta = 0x1210 ,
  mwLogin_NOTES_7_0 = 0x1214 ,
  mwLogin_ICT = 0x1300 ,
  mwLogin_ICT_1_7_8_2 = 0x1302 ,
  mwLogin_ICT_SIP = 0x1303 ,
  mwLogin_NOTESBUDDY_4_14 = 0x1400 ,
  mwLogin_NOTESBUDDY_4_15 = 0x1405 ,
  mwLogin_NOTESBUDDY_4_16 = 0x1406 ,
  mwLogin_SANITY = 0x1600 ,
  mwLogin_ST_PERL = 0x1625 ,
  mwLogin_PMR_ALERT = 0x1650 ,
  mwLogin_TRILLIAN = 0x16aa ,
  mwLogin_TRILLIAN_IBM = 0x16bb ,
  mwLogin_MEANWHILE = 0x1700
}
 The type of login. More...
enum  mwStatusType {
  mwStatus_OFFLINE = 0x0000 ,
  mwStatus_ACTIVE = 0x0020 ,
  mwStatus_IDLE = 0x0040 ,
  mwStatus_AWAY = 0x0060 ,
  mwStatus_BUSY = 0x0080 ,
  mwStatus_MASK_MOBILE = 0x0200
}

Functions

buffer utility functions
gsize mwGetBuffer_advance (struct mwGetBuffer *b, gsize len)
 skip len bytes in the get buffer.
gboolean mwGetBuffer_error (struct mwGetBuffer *b)
 TRUE if an error occurred while reading a basic type from this buffer.
void mwGetBuffer_free (struct mwGetBuffer *b)
 destroy the buffer
struct mwGetBuffermwGetBuffer_new (struct mwOpaque *data)
 allocate a new buffer with a copy of the given data
gsize mwGetBuffer_read (struct mwGetBuffer *b, gpointer mem, gsize len)
 read len bytes of raw data from the get buffer into mem.
gsize mwGetBuffer_remaining (struct mwGetBuffer *b)
 count of remaining available bytes
void mwGetBuffer_reset (struct mwGetBuffer *b)
 reset the buffer to the very beginning.
struct mwGetBuffermwGetBuffer_wrap (const struct mwOpaque *data)
 allocate a new buffer backed by the given data.
void mwPutBuffer_finalize (struct mwOpaque *to, struct mwPutBuffer *from)
 move the buffer's data into an opaque, destroy the buffer
void mwPutBuffer_free (struct mwPutBuffer *b)
 destroy the buffer
struct mwPutBuffermwPutBuffer_new (void)
 allocate a new empty buffer
void mwPutBuffer_write (struct mwPutBuffer *b, gpointer data, gsize len)
 write raw data to the put buffer
Basic Data Types

The basic types are combined to construct the compound types.

void gboolean_get (struct mwGetBuffer *b, gboolean *val)
gboolean gboolean_peek (struct mwGetBuffer *b)
void gboolean_put (struct mwPutBuffer *b, gboolean val)
void guint16_get (struct mwGetBuffer *b, guint16 *val)
guint16 guint16_peek (struct mwGetBuffer *b)
void guint16_put (struct mwPutBuffer *b, guint16 val)
void guint32_get (struct mwGetBuffer *b, guint32 *val)
guint32 guint32_peek (struct mwGetBuffer *b)
void guint32_put (struct mwPutBuffer *b, guint32 val)
void mwOpaque_clear (struct mwOpaque *o)
void mwOpaque_clone (struct mwOpaque *to, const struct mwOpaque *from)
void mwOpaque_free (struct mwOpaque *o)
void mwOpaque_get (struct mwGetBuffer *b, struct mwOpaque *o)
void mwOpaque_put (struct mwPutBuffer *b, const struct mwOpaque *o)
void mwString_get (struct mwGetBuffer *b, char **str)
void mwString_put (struct mwPutBuffer *b, const char *str)
Compound Data Types
void mwAwareIdBlock_clear (struct mwAwareIdBlock *idb)
void mwAwareIdBlock_clone (struct mwAwareIdBlock *to, const struct mwAwareIdBlock *from)
gboolean mwAwareIdBlock_equal (const struct mwAwareIdBlock *a, const struct mwAwareIdBlock *b)
void mwAwareIdBlock_get (struct mwGetBuffer *b, struct mwAwareIdBlock *idb)
guint mwAwareIdBlock_hash (const struct mwAwareIdBlock *a)
void mwAwareIdBlock_put (struct mwPutBuffer *b, const struct mwAwareIdBlock *idb)
void mwAwareSnapshot_clear (struct mwAwareSnapshot *idb)
void mwAwareSnapshot_clone (struct mwAwareSnapshot *to, const struct mwAwareSnapshot *from)
void mwAwareSnapshot_get (struct mwGetBuffer *b, struct mwAwareSnapshot *idb)
void mwEncryptItem_clear (struct mwEncryptItem *item)
void mwEncryptItem_free (struct mwEncryptItem *item)
void mwEncryptItem_get (struct mwGetBuffer *b, struct mwEncryptItem *item)
void mwEncryptItem_put (struct mwPutBuffer *b, const struct mwEncryptItem *item)
void mwIdBlock_clear (struct mwIdBlock *id)
void mwIdBlock_clone (struct mwIdBlock *to, const struct mwIdBlock *from)
gboolean mwIdBlock_equal (const struct mwIdBlock *a, const struct mwIdBlock *b)
void mwIdBlock_get (struct mwGetBuffer *b, struct mwIdBlock *id)
guint mwIdBlock_hash (const struct mwIdBlock *idb)
void mwIdBlock_put (struct mwPutBuffer *b, const struct mwIdBlock *id)
void mwLoginInfo_clear (struct mwLoginInfo *info)
void mwLoginInfo_clone (struct mwLoginInfo *to, const struct mwLoginInfo *from)
void mwLoginInfo_get (struct mwGetBuffer *b, struct mwLoginInfo *info)
void mwLoginInfo_put (struct mwPutBuffer *b, const struct mwLoginInfo *info)
void mwPrivacyInfo_clear (struct mwPrivacyInfo *info)
void mwPrivacyInfo_clone (struct mwPrivacyInfo *to, const struct mwPrivacyInfo *from)
void mwPrivacyInfo_get (struct mwGetBuffer *b, struct mwPrivacyInfo *info)
void mwPrivacyInfo_put (struct mwPutBuffer *b, const struct mwPrivacyInfo *info)
void mwUserItem_clear (struct mwUserItem *user)
void mwUserItem_clone (struct mwUserItem *to, const struct mwUserItem *from)
void mwUserItem_get (struct mwGetBuffer *b, struct mwUserItem *user)
void mwUserItem_put (struct mwPutBuffer *b, const struct mwUserItem *user)
void mwUserStatus_clear (struct mwUserStatus *stat)
void mwUserStatus_clone (struct mwUserStatus *to, const struct mwUserStatus *from)
void mwUserStatus_get (struct mwGetBuffer *b, struct mwUserStatus *stat)
void mwUserStatus_put (struct mwPutBuffer *b, const struct mwUserStatus *stat)

Detailed Description

Common data types and functions for handling those types.

Functions in this file all fit into similar naming conventions of TYPE_ACTION as per the activity they perform. The following actions are available:

void TYPE_put(struct mwPutBuffer *b, TYPE *val)

  • marshalls val onto the buffer b. The buffer will grow as necessary to fit all the data put into it. For guint16, guint32, and gboolean, TYPE val is used instead of TYPE *val.

void TYPE_get(struct mwGetBuffer *b, TYPE *val)

  • unmarshals val from the buffer b. Failure (due to lack of insufficient remaining buffer) is indicated in the buffer's error field. A call to a _get function with a buffer in an error state has to effect.

void TYPE_clear(TYPE *val)

  • zeros and frees internal members of val, but does not free val itself. Needs to be called before free-ing any complex types which have been unmarshalled from a TYPE_get or populated from a TYPE_clone call to prevent memory leaks.

void TYPE_clone(TYPE *to, TYPE *from)

  • copies/clones members of from into to. May result in memory allocation for some types. Note that to is not cleared before-hand, it must already be in a pristine condition.

gboolean TYPE_equal(TYPE *y, TYPE *z)

  • simple equality test.

Enumeration Type Documentation

◆ mwAwareType

type codes for mwAwareIdBlock

Enumerator
mwAware_USER 

a single user

mwAware_GROUP 

a group

mwAware_SERVER 

a server

◆ mwLoginType

The type of login.

Normally meaning the type of client code being used to login with.

If you know of any additional client identifiers, please add them below or submit an RFE to the meanwhile tracker.

Enumerator
mwLogin_LIB 

official Lotus binary library

mwLogin_JAVA_WEB 

official Lotus Java applet

mwLogin_BINARY 

official Lotus binary application

mwLogin_JAVA_APP 

official Lotus Java application

mwLogin_LINKS 

official Sametime Links toolkit

mwLogin_NOTES_6_5 
mwLogin_NOTES_6_5_3 
mwLogin_NOTES_7_0_beta 
mwLogin_NOTES_7_0 
mwLogin_ICT 
mwLogin_ICT_1_7_8_2 
mwLogin_ICT_SIP 
mwLogin_NOTESBUDDY_4_14 

0xff00 mask?

mwLogin_NOTESBUDDY_4_15 
mwLogin_NOTESBUDDY_4_16 
mwLogin_SANITY 
mwLogin_ST_PERL 
mwLogin_PMR_ALERT 
mwLogin_TRILLIAN 

http://sf.net/st-plugin/

mwLogin_TRILLIAN_IBM 
mwLogin_MEANWHILE 

Meanwhile library.

◆ mwStatusType

Enumerator
mwStatus_OFFLINE 
mwStatus_ACTIVE 
mwStatus_IDLE 
mwStatus_AWAY 
mwStatus_BUSY 
mwStatus_MASK_MOBILE 

Function Documentation

◆ gboolean_get()

void gboolean_get ( struct mwGetBuffer * b,
gboolean * val )

References gboolean_get().

Referenced by gboolean_get().

◆ gboolean_peek()

gboolean gboolean_peek ( struct mwGetBuffer * b)

References gboolean_peek().

Referenced by gboolean_peek().

◆ gboolean_put()

void gboolean_put ( struct mwPutBuffer * b,
gboolean val )

References gboolean_put().

Referenced by gboolean_put().

◆ guint16_get()

void guint16_get ( struct mwGetBuffer * b,
guint16 * val )

References guint16_get().

Referenced by guint16_get().

◆ guint16_peek()

guint16 guint16_peek ( struct mwGetBuffer * b)

References guint16_peek().

Referenced by guint16_peek().

◆ guint16_put()

void guint16_put ( struct mwPutBuffer * b,
guint16 val )

References guint16_put().

Referenced by guint16_put().

◆ guint32_get()

void guint32_get ( struct mwGetBuffer * b,
guint32 * val )

References guint32_get().

Referenced by guint32_get().

◆ guint32_peek()

guint32 guint32_peek ( struct mwGetBuffer * b)

References guint32_peek().

Referenced by guint32_peek().

◆ guint32_put()

void guint32_put ( struct mwPutBuffer * b,
guint32 val )

References guint32_put().

Referenced by guint32_put().

◆ mwAwareIdBlock_clear()

void mwAwareIdBlock_clear ( struct mwAwareIdBlock * idb)

References mwAwareIdBlock_clear().

Referenced by mwAwareIdBlock_clear().

◆ mwAwareIdBlock_clone()

void mwAwareIdBlock_clone ( struct mwAwareIdBlock * to,
const struct mwAwareIdBlock * from )

References mwAwareIdBlock_clone().

Referenced by mwAwareIdBlock_clone().

◆ mwAwareIdBlock_equal()

gboolean mwAwareIdBlock_equal ( const struct mwAwareIdBlock * a,
const struct mwAwareIdBlock * b )

References mwAwareIdBlock_equal().

Referenced by mwAwareIdBlock_equal().

◆ mwAwareIdBlock_get()

void mwAwareIdBlock_get ( struct mwGetBuffer * b,
struct mwAwareIdBlock * idb )

References mwAwareIdBlock_get().

Referenced by mwAwareIdBlock_get().

◆ mwAwareIdBlock_hash()

guint mwAwareIdBlock_hash ( const struct mwAwareIdBlock * a)

References mwAwareIdBlock_hash().

Referenced by mwAwareIdBlock_hash().

◆ mwAwareIdBlock_put()

void mwAwareIdBlock_put ( struct mwPutBuffer * b,
const struct mwAwareIdBlock * idb )

References mwAwareIdBlock_put().

Referenced by mwAwareIdBlock_put().

◆ mwAwareSnapshot_clear()

void mwAwareSnapshot_clear ( struct mwAwareSnapshot * idb)

◆ mwAwareSnapshot_clone()

void mwAwareSnapshot_clone ( struct mwAwareSnapshot * to,
const struct mwAwareSnapshot * from )

◆ mwAwareSnapshot_get()

void mwAwareSnapshot_get ( struct mwGetBuffer * b,
struct mwAwareSnapshot * idb )

References mwAwareSnapshot_get().

Referenced by mwAwareSnapshot_get().

◆ mwEncryptItem_clear()

void mwEncryptItem_clear ( struct mwEncryptItem * item)

References mwEncryptItem_clear().

Referenced by mwEncryptItem_clear().

◆ mwEncryptItem_free()

void mwEncryptItem_free ( struct mwEncryptItem * item)

References mwEncryptItem_free().

Referenced by mwEncryptItem_free().

◆ mwEncryptItem_get()

void mwEncryptItem_get ( struct mwGetBuffer * b,
struct mwEncryptItem * item )

References mwEncryptItem_get().

Referenced by mwEncryptItem_get().

◆ mwEncryptItem_put()

void mwEncryptItem_put ( struct mwPutBuffer * b,
const struct mwEncryptItem * item )

References mwEncryptItem_put().

Referenced by mwEncryptItem_put().

◆ mwGetBuffer_advance()

gsize mwGetBuffer_advance ( struct mwGetBuffer * b,
gsize len )

skip len bytes in the get buffer.

If len is greater than the count of bytes remaining in the buffer, the buffer's error flag will NOT be set.

Returns
count of bytes successfully skipped

References mwGetBuffer_advance().

Referenced by mwGetBuffer_advance().

◆ mwGetBuffer_error()

gboolean mwGetBuffer_error ( struct mwGetBuffer * b)

TRUE if an error occurred while reading a basic type from this buffer.

References mwGetBuffer_error().

Referenced by mwGetBuffer_error().

◆ mwGetBuffer_free()

void mwGetBuffer_free ( struct mwGetBuffer * b)

destroy the buffer

References mwGetBuffer_free().

Referenced by mwGetBuffer_free().

◆ mwGetBuffer_new()

struct mwGetBuffer * mwGetBuffer_new ( struct mwOpaque * data)

allocate a new buffer with a copy of the given data

References mwGetBuffer_new().

Referenced by mwGetBuffer_new().

◆ mwGetBuffer_read()

gsize mwGetBuffer_read ( struct mwGetBuffer * b,
gpointer mem,
gsize len )

read len bytes of raw data from the get buffer into mem.

If len is greater than the count of bytes remaining in the buffer, the buffer's error flag will NOT be set.

Returns
count of bytes successfully copied to mem

References mwGetBuffer_read().

Referenced by mwGetBuffer_read().

◆ mwGetBuffer_remaining()

gsize mwGetBuffer_remaining ( struct mwGetBuffer * b)

count of remaining available bytes

References mwGetBuffer_remaining().

Referenced by mwGetBuffer_remaining().

◆ mwGetBuffer_reset()

void mwGetBuffer_reset ( struct mwGetBuffer * b)

reset the buffer to the very beginning.

Also clears the buffer's error flag.

References mwGetBuffer_reset().

Referenced by mwGetBuffer_reset().

◆ mwGetBuffer_wrap()

struct mwGetBuffer * mwGetBuffer_wrap ( const struct mwOpaque * data)

allocate a new buffer backed by the given data.

Calling mwGetBuffer_free will not result in the underlying data being freed

References mwGetBuffer_wrap().

Referenced by mwGetBuffer_wrap().

◆ mwIdBlock_clear()

void mwIdBlock_clear ( struct mwIdBlock * id)

References mwIdBlock_clear().

Referenced by mwIdBlock_clear().

◆ mwIdBlock_clone()

void mwIdBlock_clone ( struct mwIdBlock * to,
const struct mwIdBlock * from )

References mwIdBlock_clone().

Referenced by mwIdBlock_clone().

◆ mwIdBlock_equal()

gboolean mwIdBlock_equal ( const struct mwIdBlock * a,
const struct mwIdBlock * b )

References mwIdBlock_equal().

Referenced by mwIdBlock_equal().

◆ mwIdBlock_get()

void mwIdBlock_get ( struct mwGetBuffer * b,
struct mwIdBlock * id )

References mwIdBlock_get().

Referenced by mwIdBlock_get().

◆ mwIdBlock_hash()

guint mwIdBlock_hash ( const struct mwIdBlock * idb)

References mwIdBlock_hash().

Referenced by mwIdBlock_hash().

◆ mwIdBlock_put()

void mwIdBlock_put ( struct mwPutBuffer * b,
const struct mwIdBlock * id )

References mwIdBlock_put().

Referenced by mwIdBlock_put().

◆ mwLoginInfo_clear()

void mwLoginInfo_clear ( struct mwLoginInfo * info)

References mwLoginInfo_clear().

Referenced by mwLoginInfo_clear().

◆ mwLoginInfo_clone()

void mwLoginInfo_clone ( struct mwLoginInfo * to,
const struct mwLoginInfo * from )

References mwLoginInfo_clone().

Referenced by mwLoginInfo_clone().

◆ mwLoginInfo_get()

void mwLoginInfo_get ( struct mwGetBuffer * b,
struct mwLoginInfo * info )

References mwLoginInfo_get().

Referenced by mwLoginInfo_get().

◆ mwLoginInfo_put()

void mwLoginInfo_put ( struct mwPutBuffer * b,
const struct mwLoginInfo * info )

References mwLoginInfo_put().

Referenced by mwLoginInfo_put().

◆ mwOpaque_clear()

void mwOpaque_clear ( struct mwOpaque * o)

References mwOpaque_clear().

Referenced by mwOpaque_clear().

◆ mwOpaque_clone()

void mwOpaque_clone ( struct mwOpaque * to,
const struct mwOpaque * from )

References mwOpaque_clone().

Referenced by mwOpaque_clone().

◆ mwOpaque_free()

void mwOpaque_free ( struct mwOpaque * o)

References mwOpaque_free().

Referenced by mwOpaque_free().

◆ mwOpaque_get()

void mwOpaque_get ( struct mwGetBuffer * b,
struct mwOpaque * o )

References mwOpaque_get().

Referenced by mwOpaque_get().

◆ mwOpaque_put()

void mwOpaque_put ( struct mwPutBuffer * b,
const struct mwOpaque * o )

References mwOpaque_put().

Referenced by mwOpaque_put().

◆ mwPrivacyInfo_clear()

void mwPrivacyInfo_clear ( struct mwPrivacyInfo * info)

References mwPrivacyInfo_clear().

Referenced by mwPrivacyInfo_clear().

◆ mwPrivacyInfo_clone()

void mwPrivacyInfo_clone ( struct mwPrivacyInfo * to,
const struct mwPrivacyInfo * from )

References mwPrivacyInfo_clone().

Referenced by mwPrivacyInfo_clone().

◆ mwPrivacyInfo_get()

void mwPrivacyInfo_get ( struct mwGetBuffer * b,
struct mwPrivacyInfo * info )

References mwPrivacyInfo_get().

Referenced by mwPrivacyInfo_get().

◆ mwPrivacyInfo_put()

void mwPrivacyInfo_put ( struct mwPutBuffer * b,
const struct mwPrivacyInfo * info )

References mwPrivacyInfo_put().

Referenced by mwPrivacyInfo_put().

◆ mwPutBuffer_finalize()

void mwPutBuffer_finalize ( struct mwOpaque * to,
struct mwPutBuffer * from )

move the buffer's data into an opaque, destroy the buffer

References mwPutBuffer_finalize().

Referenced by mwPutBuffer_finalize().

◆ mwPutBuffer_free()

void mwPutBuffer_free ( struct mwPutBuffer * b)

destroy the buffer

References mwPutBuffer_free().

Referenced by mwPutBuffer_free().

◆ mwPutBuffer_new()

struct mwPutBuffer * mwPutBuffer_new ( void )

allocate a new empty buffer

References mwPutBuffer_new().

Referenced by mwPutBuffer_new().

◆ mwPutBuffer_write()

void mwPutBuffer_write ( struct mwPutBuffer * b,
gpointer data,
gsize len )

write raw data to the put buffer

References mwPutBuffer_write().

Referenced by mwPutBuffer_write().

◆ mwString_get()

void mwString_get ( struct mwGetBuffer * b,
char ** str )

References mwString_get().

Referenced by mwString_get().

◆ mwString_put()

void mwString_put ( struct mwPutBuffer * b,
const char * str )

References mwString_put().

Referenced by mwString_put().

◆ mwUserItem_clear()

void mwUserItem_clear ( struct mwUserItem * user)

References mwUserItem_clear().

Referenced by mwUserItem_clear().

◆ mwUserItem_clone()

void mwUserItem_clone ( struct mwUserItem * to,
const struct mwUserItem * from )

References mwUserItem_clone().

Referenced by mwUserItem_clone().

◆ mwUserItem_get()

void mwUserItem_get ( struct mwGetBuffer * b,
struct mwUserItem * user )

References mwUserItem_get().

Referenced by mwUserItem_get().

◆ mwUserItem_put()

void mwUserItem_put ( struct mwPutBuffer * b,
const struct mwUserItem * user )

References mwUserItem_put().

Referenced by mwUserItem_put().

◆ mwUserStatus_clear()

void mwUserStatus_clear ( struct mwUserStatus * stat)

References mwUserStatus_clear().

Referenced by mwUserStatus_clear().

◆ mwUserStatus_clone()

void mwUserStatus_clone ( struct mwUserStatus * to,
const struct mwUserStatus * from )

References mwUserStatus_clone().

Referenced by mwUserStatus_clone().

◆ mwUserStatus_get()

void mwUserStatus_get ( struct mwGetBuffer * b,
struct mwUserStatus * stat )

References mwUserStatus_get().

Referenced by mwUserStatus_get().

◆ mwUserStatus_put()

void mwUserStatus_put ( struct mwPutBuffer * b,
const struct mwUserStatus * stat )

References mwUserStatus_put().

Referenced by mwUserStatus_put().