blob: 43199a11249c537ec0ada0abc413f285a90fbeb5 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#ifndef CONTACT_LIST_H
#define CONTACT_LIST_H
#include <ncurses.h>
#include <stdio.h>
#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(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**);
// Find a contact
// Params: A name
// Return: 0 if success, >0 otherwise
int findContactFromName(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*);
// Sort the contact list
// Params : Nothing
// Return : Nothing
void sortContacts(void);
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
// Window contact
#endif
|