#ifndef CONTACT_LIST_H #define CONTACT_LIST_H #include #include #include "basic_curses.h" typedef struct contact { char name[100]; char display_name[100]; char number[50]; int hasNewMessage; } contact ; #define DEFAULT_CONTACT_FILENAME "/usr/share/sms/contact.csv" // Params: The CSV filename (separator ';', unexcaped string, so ';' is forbiden in value) // Return: 0 if success, >0 if error int fillContactList(char* cvs_file_in); // Params: A valide filename // Return: 0 if success, >0 if error int writeContactList(char* cvs_file_in); // Find a contact // Params: A SIM Number // Return: 0 if success, >0 otherwise int findContact(const char*, 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 deleteContactFromNumber(const char*); // Delete a contact from his name // Params: A String which is a valide contact SIM number // Return: 0 if success, >0 otherwise int deleteContactFromName(const char*); /////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// // Window contact void clearContactListW(void); void showContactListW(void); void refreshContactListW(void); void selectNextContact(void); void selectPreviousContact(void); #endif