From: Raphaƫl Droz Date: Tue, 30 Aug 2011 10:25:49 +0000 (+0200) Subject: mutt-query (1/3): moved muttq_print_item() from abook.c to filter.c X-Git-Tag: upstream/0.6.1~2^2~55 X-Git-Url: https://git.deb.at/?a=commitdiff_plain;h=5b294375faaa96e4c8e724de274e8badccf3395c;p=pkg%2Fabook.git mutt-query (1/3): moved muttq_print_item() from abook.c to filter.c --- diff --git a/abook.c b/abook.c index 42c04c1..866d71d 100644 --- a/abook.c +++ b/abook.c @@ -446,25 +446,6 @@ quit_mutt_query(int status) exit(status); } -static void -muttq_print_item(FILE *file, int item) -{ - abook_list *emails, *e; - char *tmp = db_email_get(item); - - emails = csv_to_abook_list(tmp); - free(tmp); - - for(e = emails; e; e = e->next) { - fprintf(file, "%s\t%s\t%s\n", e->data, db_name_get(item), - !db_fget(item, NOTES) ?" " :db_fget(item, NOTES) - ); - if(!opt_get_bool(BOOL_MUTT_RETURN_ALL_EMAILS)) - break; - } - abook_list_free(&emails); -} - static void mutt_query(char *str) { diff --git a/filter.c b/filter.c index 51445ee..ff4d116 100644 --- a/filter.c +++ b/filter.c @@ -2038,6 +2038,24 @@ mutt_alias_export(FILE *out, struct db_enumerator e) return 0; } +void muttq_print_item(FILE *file, int item) +{ + abook_list *emails, *e; + char *tmp = db_email_get(item); + + emails = csv_to_abook_list(tmp); + free(tmp); + + for(e = emails; e; e = e->next) { + fprintf(file, "%s\t%s\t%s\n", e->data, db_name_get(item), + !db_fget(item, NOTES) ?" " :db_fget(item, NOTES) + ); + if(!opt_get_bool(BOOL_MUTT_RETURN_ALL_EMAILS)) + break; + } + abook_list_free(&emails); +} + /* * end of mutt alias export filter */ diff --git a/filter.h b/filter.h index 290725f..c31c76f 100644 --- a/filter.h +++ b/filter.h @@ -35,6 +35,7 @@ struct abook_output_item_filter select_output_item_filter(char filtname[FILTNAME_LEN]); void e_write_item(FILE *out, int item, void (*func) (FILE *in, int item)); +void muttq_print_item(FILE *file, int item); int fexport(char filtname[FILTNAME_LEN], FILE *handle, int enum_mode);