]> git.deb.at Git - pkg/abook.git/blob - filter.h
custom output format (1/4): created a parser for {placeholders}
[pkg/abook.git] / filter.h
1 #ifndef _FILTER_H
2 #define _FILTER_H
3
4 #include "database.h"
5
6 #define         FILTNAME_LEN    8
7 #define         FORMAT_STRING_LEN       128
8
9
10 struct abook_output_filter {
11         char filtname[FILTNAME_LEN];
12         char *desc;
13         int (*func) (FILE *handle, struct db_enumerator e);
14 };
15
16 struct abook_output_item_filter {
17         char filtname[FILTNAME_LEN];
18         char *desc;
19         void (*func) (FILE *handle, int item);
20 };
21
22 struct abook_input_filter {
23         char filtname[FILTNAME_LEN];
24         char *desc;
25         int (*func) (FILE *handle);
26 };
27
28
29 int             import_database();
30 int             import_file(char filtname[FILTNAME_LEN], char *filename);
31
32 int             export_database();
33 int             export_file(char filtname[FILTNAME_LEN], char *filename);
34
35 struct abook_output_item_filter
36                 select_output_item_filter(char filtname[FILTNAME_LEN]);
37
38 void            e_write_item(FILE *out, int item, void (*func) (FILE *in, int item));
39 void            muttq_print_item(FILE *file, int item);
40
41 void            parse_custom_format(char *s, char *fmt_string, enum field_types *ft);
42
43 int             fexport(char filtname[FILTNAME_LEN], FILE *handle,
44                 int enum_mode);
45
46 void            print_filters();
47
48 #endif