Added jmessage_new_copy_without_dests() to copy messages without copying the list of recipients.

This commit is contained in:
David Capello 2010-05-03 22:40:01 -03:00
parent ea56481314
commit 8b4c4f6a5a
2 changed files with 19 additions and 0 deletions

View File

@ -107,6 +107,24 @@ JMessage jmessage_new_copy(const JMessage msg)
return copy;
}
JMessage jmessage_new_copy_without_dests(const JMessage msg)
{
JMessage copy;
assert(msg != NULL);
copy = jnew(union jmessage, 1);
if (!copy)
return NULL;
memcpy(copy, msg, sizeof(union jmessage));
copy->any.widgets = jlist_new();
copy->any.used = false;
return copy;
}
void jmessage_free(JMessage msg)
{
assert(msg != NULL);

View File

@ -146,6 +146,7 @@ int ji_register_message_type();
JMessage jmessage_new(int type);
JMessage jmessage_new_key_related(int type, int readkey_value);
JMessage jmessage_new_copy(const JMessage msg);
JMessage jmessage_new_copy_without_dests(const JMessage msg);
void jmessage_free(JMessage msg);
void jmessage_add_dest(JMessage msg, JWidget widget);