Fix FSF address (Tobias Mueller, #470445)
[platform/upstream/evolution-data-server.git] / camel / camel-junk-plugin.c
1 /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
2 /*
3  * Author:
4  *  Radek Doulik <rodo@ximian.com>
5  *
6  * Copyright 2003 Ximian, Inc. (www.ximian.com)
7  *
8  * This program is free software; you can redistribute it and/or
9  * modify it under the terms of version 2 of the GNU Lesser General Public
10  * License as published by the Free Software Foundation.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15  * GNU Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22
23 #include <stdio.h>
24
25 #include <glib.h>
26
27 #include "camel-debug.h"
28 #include "camel-junk-plugin.h"
29 #include "camel-mime-message.h"
30
31 #define d(x) (camel_debug("junk")?(x):0)
32
33 const char *
34 camel_junk_plugin_get_name (CamelJunkPlugin *csp)
35 {
36         g_return_val_if_fail (csp->get_name != NULL, NULL);
37
38         d(fprintf (stderr, "camel_junk_plugin_get_namen"));
39
40         return csp->get_name (csp);
41 }
42
43 int
44 camel_junk_plugin_check_junk (CamelJunkPlugin *csp, CamelMimeMessage *message)
45 {
46         g_return_val_if_fail (csp->check_junk != NULL, FALSE);
47
48         d(fprintf (stderr, "camel_junk_plugin_check_junk\n"));
49
50         return csp->check_junk (csp, message);
51 }
52
53 void
54 camel_junk_plugin_report_junk (CamelJunkPlugin *csp, CamelMimeMessage *message)
55 {
56         d(fprintf (stderr, "camel_junk_plugin_report_junk\n"));
57
58         if (csp->report_junk)
59                 csp->report_junk (csp, message);
60 }
61
62 void
63 camel_junk_plugin_report_notjunk (CamelJunkPlugin *csp, CamelMimeMessage *message)
64 {
65         d(fprintf (stderr, "camel_junk_plugin_report_notjunk\n"));
66
67         if (csp->report_notjunk)
68                 csp->report_notjunk (csp, message);
69 }
70
71 void
72 camel_junk_plugin_commit_reports (CamelJunkPlugin *csp)
73 {
74         d(fprintf (stderr, "camel_junk_plugin_commit_reports\n"));
75
76         if (csp->commit_reports)
77                 csp->commit_reports (csp);
78 }
79
80 void
81 camel_junk_plugin_init (CamelJunkPlugin *csp)
82 {
83         d(fprintf (stderr, "camel_junk_plugin_init\n"));
84
85         if (csp->init)
86                 csp->init (csp);
87 }