From eb5b04df46236d1633f012ef003e08a49b1f18c6 Mon Sep 17 00:00:00 2001 From: James Booth Date: Fri, 18 May 2012 01:33:40 +0100 Subject: Autocomplte uses default functions --- contact.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'contact.c') diff --git a/contact.c b/contact.c index bc0f8344..79950e80 100644 --- a/contact.c +++ b/contact.c @@ -50,6 +50,20 @@ PContact p_contact_new(const char * const name, const char * const show, return contact; } +PContact p_contact_copy(PContact contact) +{ + PContact copy = malloc(sizeof(struct p_contact_t)); + copy->name = strdup(contact->name); + copy->show = strdup(contact->show); + + if (contact->status != NULL) + copy->status = strdup(contact->status); + else + copy->status = NULL; + + return copy; +} + void p_contact_free(PContact contact) { free(contact->name); -- cgit 1.4.1-2-gfad0