diff options
author | ache <ache@ache.one> | 2017-11-11 15:11:04 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2017-11-11 15:11:04 +0100 |
commit | 76f7b2136ba7ed8adec5f343550065e05bb733bc (patch) | |
tree | 5ab7ee675146d6d300d622c8d2784aefae89c874 /contactList.c | |
parent | Todo list of the project (diff) |
Number to contact option
Diffstat (limited to 'contactList.c')
-rw-r--r-- | contactList.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/contactList.c b/contactList.c index 85369a9..dd655ca 100644 --- a/contactList.c +++ b/contactList.c @@ -25,6 +25,19 @@ void selectPreviousContact(void) { clearContactListW(); } +int findContact(const char* number, contact** out) { + if( !number || !out ) + return 1; + + for(int i = 0 ; i < nbContacts ; i++) { + if( !strcmp(number, contactList[i].number) ) { + *out = contactList+i; + return 0; + } + } + return 2; +} + void clearContactListW(void) { for(int i = firstConctactShow; i < h_menuContact && i < nbContacts; i++) { move(y_menuContact+i,x_menuContact); |