#ifndef CONTACT_LIST_H #define CONTACT_LIST_H #include #include #include #include "basic_curses.h" typedef struct conversation conversation; typedef struct contact { char name[100]; char display_name[100]; char number[50]; int hasNewMessage; conversation* conversation; } contact ; #define DEFAULT_CONTACT_FILENAME "/var/spool/sms/contacts.csv" // Params: The CSV filename (separator ';', unexcaped string, so ';' is forbiden in value) // Return: 0 if success, >0 if error int fillContactList(const char* cvs_file_in); // Params: A valide filename // Return: 0 if success, >0 if error int writeContactList(const char* cvs_file_in); // Find a contact // Params: A SIM Number // Return: 0 if success, >0 otherwise int findContact(const char*, contact**); // Find a contact // Params: A name // Return: 0 if success, >0 otherwise int findContactFromName(const char*, contact**,contact*); // Add a contact // Params: A contact struct // Return: 0 if success, >0 otherwise int addContact(const contact*); // Delete a contact // Params: A String which is a valide contact SIM number // Return: 0 if success, >0 otherwise int deleteContact(contact*); // Sort the contact list // Params : Nothing // Return : Nothing void sortContacts(void); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // Window contact #endif