about summary refs log tree commit diff stats
path: root/contact.c
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2012-05-23 23:53:10 +0100
committerJames Booth <boothj5@gmail.com>2012-05-23 23:53:10 +0100
commit140deeb566fa1c3bf5832b830950f67ff1b95fae (patch)
tree94f124ca2513fecf6560581b334432e8b17459c4 /contact.c
parentcac0ea07424c86e276a6c1d91993abe4b37545d9 (diff)
downloadprofani-tty-140deeb566fa1c3bf5832b830950f67ff1b95fae.tar.gz
Added equality functions to contact
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 79950e80..cfe805b0 100644
--- a/contact.c
+++ b/contact.c
@@ -95,3 +95,17 @@ const char * p_contact_status(const PContact contact)
 {
     return contact->status;
 }
+
+int p_contact_names_equal(const PContact c1, const PContact c2)
+{
+    return strcmp(c1->name, c2->name);
+}
+
+int p_contacts_equal_deep(const PContact c1, const PContact c2)
+{
+    int name_eq = strcmp(c1->name, c2->name);
+    int show_eq = strcmp(c1->show, c2->show);
+    int status_eq = strcmp(c1->status, c2->status);
+
+    return (name_eq && show_eq && status_eq);
+}