1 /*
2  *  rolo - contact management software
3  *  Copyright (C) 2003  Andrew Hsu
4  *
5  *  This program is free software; you can redistribute it and/or
6  *  modify it under the terms of the GNU General Public License as
7  *  published by the Free Software Foundation; either version 2 of
8  *  the License, or (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
18  *  02111-1307 USA
19  *
20  *  $Id: entry.h,v 1.3 2003/05/20 01:08:52 ahsu Rel $
21  */
22 
23 #include <stdio.h>
24 
25 /*** STRUCTS ***/
26 
27 /* FIXME: move this struct to entry.c and abstract out the manipulation of
28           the struct so that the user of this module does not have to know
29           what is inside of the struct */
30 struct entry_node_tag
31 {
32   char *description;
33   fpos_t *fpos;
34   struct entry_node_tag *next;
35 };
36 
37 typedef struct entry_node_tag entry_node;
38 
39 enum sort_entries_by
40 { SORT_ENTRIES_BY_FAMILY_N, SORT_ENTRIES_BY_GIVEN_N,
41   SORT_ENTRIES_BY_EMAIL, SORT_ENTRIES_BY_TEL
42 };
43 
44 extern entry_node **entries_lltoa (entry_node * entries_ll, int count);
45 extern void sort_entries (entry_node ** entries, int count, int sort_by);
46 extern void free_entry_node (entry_node * e);
47 extern int get_entries (FILE * fp, entry_node * entries_ll);
48 extern entry_node *new_entry_node ();
49 extern int filter_entries (entry_node * entries_ll, const char *filter_string);
50 extern void free_entries_array_but_leave_data (entry_node ** entries_array,
51                                                int count);
52