From f1436cca07e8c0db741297e57e4a4e5463c7f48a Mon Sep 17 00:00:00 2001 From: Not Zed Date: Wed, 25 Jun 2003 10:20:09 +0000 Subject: ** See bug #43887 2003-06-20 Not Zed ** See bug #43887 * camel-mime-filter-enriched.c (camel_enriched_to_html): simple wrapper to convert enriched to html in one go. svn path=/trunk/; revision=21529 --- camel/ChangeLog | 7 +++++++ camel/camel-mime-filter-enriched.c | 19 +++++++++++++++++++ camel/camel-mime-filter-enriched.h | 1 + 3 files changed, 27 insertions(+) (limited to 'camel') diff --git a/camel/ChangeLog b/camel/ChangeLog index 439f411cfa..949e97a542 100644 --- a/camel/ChangeLog +++ b/camel/ChangeLog @@ -1,3 +1,10 @@ +2003-06-20 Not Zed + + ** See bug #43887 + + * camel-mime-filter-enriched.c (camel_enriched_to_html): simple + wrapper to convert enriched to html in one go. + 2003-06-18 Not Zed * camel-service.c (get_hostbyaddr, get_hostbyname): if we got diff --git a/camel/camel-mime-filter-enriched.c b/camel/camel-mime-filter-enriched.c index 23ffd73493..e653eea727 100644 --- a/camel/camel-mime-filter-enriched.c +++ b/camel/camel-mime-filter-enriched.c @@ -570,3 +570,22 @@ camel_mime_filter_enriched_new (guint32 flags) return CAMEL_MIME_FILTER (new); } + +char * +camel_enriched_to_html(const char *in, guint32 flags) +{ + CamelMimeFilter *filter; + size_t outlen, outpre; + char *outbuf; + + if (in == NULL) + return NULL; + + filter = camel_mime_filter_enriched_new(flags); + + camel_mime_filter_complete(filter, (char *)in, strlen(in), 0, &outbuf, &outlen, &outpre); + outbuf = g_strndup (outbuf, outlen); + camel_object_unref (filter); + + return outbuf; +} diff --git a/camel/camel-mime-filter-enriched.h b/camel/camel-mime-filter-enriched.h index 13c3ff7a7e..8561bd65a4 100644 --- a/camel/camel-mime-filter-enriched.h +++ b/camel/camel-mime-filter-enriched.h @@ -58,6 +58,7 @@ struct _CamelMimeFilterEnrichedClass { CamelType camel_mime_filter_enriched_get_type (void); CamelMimeFilter *camel_mime_filter_enriched_new (guint32 flags); +char *camel_enriched_to_html(const char *in, guint32 flags); #ifdef __cplusplus } -- cgit v1.2.3