about summary refs log tree commit diff stats
path: root/contact.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-05-18 01:33:40 +0100
committerJames Booth <boothj5@gmail.com>2012-05-18 01:33:40 +0100
commiteb5b04df46236d1633f012ef003e08a49b1f18c6 (patch)
tree646bd34a1aec03e26f0d2170d6567bccf910ca66 /contact.c
parent718229d08cf78bd37f9bde916b61661cbbe2828b (diff)
downloadprofani-tty-eb5b04df46236d1633f012ef003e08a49b1f18c6.tar.gz
Autocomplte uses default functions
Diffstat (limited to 'contact.c')
-rw-r--r--contact.c14
1 files changed, 14 insertions, 0 deletions
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);