]> git.deb.at Git - pkg/abook.git/commitdiff
mutt-query (1/3): moved muttq_print_item() from abook.c to filter.c
authorRaphaël Droz <raphael.droz+floss@gmail.com>
Tue, 30 Aug 2011 10:25:49 +0000 (12:25 +0200)
committerRaphaël Droz <raphael.droz+floss@gmail.com>
Wed, 24 Oct 2012 16:23:51 +0000 (18:23 +0200)
abook.c
filter.c
filter.h

diff --git a/abook.c b/abook.c
index 42c04c1f37022eceb632739fd38098673867c4a5..866d71db4f38f9367c6ecc56cd115c4ea9654775 100644 (file)
--- 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)
 {
index 51445ee1f1bf9947c323bc478a4f7fcafb22f9da..ff4d116b1ac652afd816e41efe8ee6c93f9bb95d 100644 (file)
--- 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
  */
index 290725fde89981b6ba1b983108a6f82644889620..c31c76fa7d8105bc5d47e1d42cfe33d0515a1d4b 100644 (file)
--- 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);