Commit fa657bbe authored by Dafydd Harries's avatar Dafydd Harries

add stun_message_init() to allow use of static StunMessage objects

darcs-hash:20070109123507-c9803-fea397b8b65d469ee6eb4ff8a0a0485b96e7bc0f.gz
parent 43a5a05d
...@@ -95,12 +95,18 @@ stun_attribute_dump (StunAttribute *attr) ...@@ -95,12 +95,18 @@ stun_attribute_dump (StunAttribute *attr)
} }
} }
void
stun_message_init (StunMessage *msg, guint type)
{
msg->type = type;
}
StunMessage * StunMessage *
stun_message_new (guint type) stun_message_new (guint type)
{ {
StunMessage *msg = g_slice_alloc0 (sizeof (StunMessage)); StunMessage *msg = g_slice_alloc0 (sizeof (StunMessage));
msg->type = type; stun_message_init (msg, type);
return msg; return msg;
} }
......
...@@ -59,6 +59,8 @@ stun_attribute_dump (StunAttribute *attr); ...@@ -59,6 +59,8 @@ stun_attribute_dump (StunAttribute *attr);
StunAttribute * StunAttribute *
stun_attribute_unpack (guint length, const gchar *s); stun_attribute_unpack (guint length, const gchar *s);
void
stun_message_init (StunMessage *msg, guint type);
StunMessage * StunMessage *
stun_message_new (guint type); stun_message_new (guint type);
StunMessage * StunMessage *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment