From 76f7b2136ba7ed8adec5f343550065e05bb733bc Mon Sep 17 00:00:00 2001 From: ache Date: Sat, 11 Nov 2017 15:11:04 +0100 Subject: Number to contact option --- contactList.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'contactList.c') 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); -- cgit v1.2.3