-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.h
47 lines (39 loc) · 1002 Bytes
/
main.h
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
// #include <stdbool.h>
#ifndef CONTACT_H
#define CONTACT_H
#define MAX_NAME_LEN 100
#define MAX_PHONE_LEN 30
#define MAX_ADDRESS_LEN 200
#define MAX_EMAIL_LEN 100
typedef struct
{
char name[MAX_NAME_LEN];
char phone[MAX_PHONE_LEN];
char address[MAX_ADDRESS_LEN];
char email[MAX_EMAIL_LEN];
} Contact;
void addNewContact();
Contact *retrieveContacts(char *filename, int *total);
void updateContact();
void deleteContact();
void printContacts();
void saveContact();
void searchByName();
void searchByNumber();
void deleteAllContact();
void runCommand(int command);
void printCommandsAndUsage();
void runApp();
void runCommand(int command);
void printContacts();
bool fileExists(char *filename);
void clearInputBuffer();
bool numberExists(char *num);
bool isEmpty(const char *str);
bool isDigitsOnly(const char *str);
int getContactIndex(char *str);
void getIntegerFromStdin(int *inputInteger);
void toLowerCase(char *str);
void clearTerminal();
void exitApp();
#endif // CONTACT