diff options
Diffstat (limited to 'src/phonebook.h')
-rw-r--r-- | src/phonebook.h | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/phonebook.h b/src/phonebook.h new file mode 100644 index 0000000..3b4cf79 --- /dev/null +++ b/src/phonebook.h @@ -0,0 +1,41 @@ +#ifndef __PHONEBOOK_H +#define __PHONEBOOK_H + +#include "atcmd.h" +#include "list.h" + +#define PHONEBOOK_ADDR_SIZE 64 +#define PHONEBOOK_TEXT_SIZE 64 + +struct phonebook_entry { + int index; + char addr[PHONEBOOK_ADDR_SIZE]; + int type; + char name[PHONEBOOK_TEXT_SIZE]; + struct list_head list; +}; + +void phonebook_entry_free(struct phonebook_entry *entry); +struct phonebook_entry *phonebook_entry_alloc(void); +struct phonebook_entry *phonebook_find_by_name(struct list_head *head, + const char *name); +struct phonebook_entry *phonebook_search_names_i(struct list_head *head, + const char *name); + +struct phonebook_list_info { + struct phonebook_store store; + char store_select[STORE_NAME_SIZE]; + int state; + + int nr_lines; + int nr_entries; + + struct list_head entry_list; +}; + +void phonebook_list_free(struct phonebook_list_info *list_info); +int phonebook_list_get(int fd, struct phonebook_list_info *list_info); + +int print_phonebook_list(int fd, const char *store); + +#endif /* ~__PHONEBOOK_H */ |