aboutsummaryrefslogtreecommitdiff
path: root/contactList.h
diff options
context:
space:
mode:
authorache <ache@ache.one>2017-11-11 03:57:47 +0000
committerache <ache@ache.one>2017-11-11 03:57:47 +0000
commit65087f82753a12e330fa0e6fc0c0e4b70c6a6c63 (patch)
tree00c4f4a5a022ab5a631ff738315eb830a039922b /contactList.h
parentInit commit (diff)
PoC menu Contact
Diffstat (limited to 'contactList.h')
-rw-r--r--contactList.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/contactList.h b/contactList.h
new file mode 100644
index 0000000..12d69ed
--- /dev/null
+++ b/contactList.h
@@ -0,0 +1,58 @@
+#ifndef CONTACT_LIST_H
+#define CONTACT_LIST_H
+
+#include <ncurses.h>
+#include <stdio.h>
+#include "basic_curses.h"
+
+typedef struct contact {
+ char name[100];
+ char display_name[100];
+ char number[50];
+ int hasNewMessage;
+} contact ;
+
+
+
+
+// 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);
+
+// 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