evolution-3.6.4/em-format/e-mail-parser-source.c

No issues found

Incomplete coverage

Tool Failure ID Location Function Message Data
clang-analyzer no-output-found e-mail-parser-source.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
clang-analyzer no-output-found e-mail-parser-source.c Message(text='Unable to locate XML output from invoke-clang-analyzer') None
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
Failure running clang-analyzer ('no-output-found')
Message
Unable to locate XML output from invoke-clang-analyzer
  1 /*
  2  * e-mail-parser-source.c
  3  *
  4  * This program is free software; you can redistribute it and/or
  5  * modify it under the terms of the GNU Lesser General Public
  6  * License as published by the Free Software Foundation; either
  7  * version 2 of the License, or (at your option) version 3.
  8  *
  9  * This program is distributed in the hope that it will be useful,
 10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
 11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 12  * Lesser General Public License for more details.
 13  *
 14  * You should have received a copy of the GNU Lesser General Public
 15  * License along with the program; if not, see <http://www.gnu.org/licenses/>
 16  *
 17  */
 18 
 19 #ifdef HAVE_CONFIG_H
 20 #include <config.h>
 21 #endif
 22 
 23 #include "e-mail-format-extensions.h"
 24 
 25 #include <em-format/e-mail-parser-extension.h>
 26 #include <em-format/e-mail-parser.h>
 27 #include <e-util/e-util.h>
 28 
 29 #include <glib/gi18n-lib.h>
 30 #include <camel/camel.h>
 31 
 32 typedef struct _EMailParserSource {
 33 	GObject parent;
 34 } EMailParserSource;
 35 
 36 typedef struct _EMailParserSourceClass {
 37 	GObjectClass parent_class;
 38 } EMailParserSourceClass;
 39 
 40 static void e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface);
 41 static void e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface);
 42 
 43 G_DEFINE_TYPE_EXTENDED (
 44 	EMailParserSource,
 45 	e_mail_parser_source,
 46 	G_TYPE_OBJECT,
 47 	0,
 48 	G_IMPLEMENT_INTERFACE (
 49 		E_TYPE_MAIL_EXTENSION,
 50 		e_mail_parser_mail_extension_interface_init)
 51 	G_IMPLEMENT_INTERFACE (
 52 		E_TYPE_MAIL_PARSER_EXTENSION,
 53 		e_mail_parser_parser_extension_interface_init));
 54 
 55 static const gchar *parser_mime_types[] = { "application/vnd.evolution.source", NULL };
 56 
 57 static GSList *
 58 empe_source_parse (EMailParserExtension *extension,
 59                    EMailParser *parser,
 60                    CamelMimePart *part,
 61                    GString *part_id,
 62                    GCancellable *cancellable)
 63 {
 64 	EMailPart *mail_part;
 65 	gint len;
 66 
 67 	if (g_cancellable_is_cancelled (cancellable))
 68 		return NULL;
 69 
 70 	len = part_id->len;
 71 	g_string_append (part_id, ".source");
 72 
 73 	mail_part = e_mail_part_new (part, part_id->str);
 74 	mail_part->mime_type = g_strdup ("application/vnd.evolution.source");
 75 	g_string_truncate (part_id, len);
 76 
 77 	return g_slist_append (NULL, mail_part);
 78 }
 79 
 80 static const gchar **
 81 empe_source_mime_types (EMailExtension *extension)
 82 {
 83 	return parser_mime_types;
 84 }
 85 
 86 static void
 87 e_mail_parser_source_class_init (EMailParserSourceClass *class)
 88 {
 89 }
 90 
 91 static void
 92 e_mail_parser_parser_extension_interface_init (EMailParserExtensionInterface *iface)
 93 {
 94 	iface->parse = empe_source_parse;
 95 }
 96 
 97 static void
 98 e_mail_parser_mail_extension_interface_init (EMailExtensionInterface *iface)
 99 {
100 	iface->mime_types = empe_source_mime_types;
101 }
102 
103 static void
104 e_mail_parser_source_init (EMailParserSource *parser)
105 {
106 
107 }