|
|
| gsize | mwGetBuffer_advance (struct mwGetBuffer *b, gsize len) |
| | skip len bytes in the get buffer. More...
|
| |
| gboolean | mwGetBuffer_error (struct mwGetBuffer *b) |
| | TRUE if an error occurred while reading a basic type from this buffer. More...
|
| |
| void | mwGetBuffer_free (struct mwGetBuffer *b) |
| | destroy the buffer More...
|
| |
| struct mwGetBuffer * | mwGetBuffer_new (struct mwOpaque *data) |
| | allocate a new buffer with a copy of the given data More...
|
| |
| gsize | mwGetBuffer_read (struct mwGetBuffer *b, gpointer mem, gsize len) |
| | read len bytes of raw data from the get buffer into mem. More...
|
| |
| gsize | mwGetBuffer_remaining (struct mwGetBuffer *b) |
| | count of remaining available bytes More...
|
| |
| void | mwGetBuffer_reset (struct mwGetBuffer *b) |
| | reset the buffer to the very beginning. More...
|
| |
| struct mwGetBuffer * | mwGetBuffer_wrap (const struct mwOpaque *data) |
| | allocate a new buffer backed by the given data. More...
|
| |
| void | mwPutBuffer_finalize (struct mwOpaque *to, struct mwPutBuffer *from) |
| | move the buffer's data into an opaque, destroy the buffer More...
|
| |
| void | mwPutBuffer_free (struct mwPutBuffer *b) |
| | destroy the buffer More...
|
| |
| struct mwPutBuffer * | mwPutBuffer_new () |
| | allocate a new empty buffer More...
|
| |
| void | mwPutBuffer_write (struct mwPutBuffer *b, gpointer data, gsize len) |
| | write raw data to the put buffer More...
|
| |
|
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) |
| |
|
| 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) |
| |
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)