コード例 #1
0
ファイル: gmime-test.c プロジェクト: mbreinhold/mu
static gchar*
get_refs_str (GMimeMessage *msg)
{
    const gchar *str;
    const GMimeReferences *cur;
    GMimeReferences *mime_refs;
    gchar *rv;

    str = g_mime_object_get_header (GMIME_OBJECT(msg), "References");
    if (!str)
        return NULL;

    mime_refs = g_mime_references_decode (str);
    for (rv = NULL, cur = mime_refs; cur;
            cur = g_mime_references_get_next(cur)) {

        const char* msgid;
        msgid = g_mime_references_get_message_id (cur);
        rv = g_strdup_printf ("%s%s%s",
                              rv ? rv : "",
                              rv ? "," : "",
                              msgid);
    }
    g_mime_references_free (mime_refs);

    return rv;
}
コード例 #2
0
ファイル: gmimex.c プロジェクト: swerter/gmimex
static void free_message_data(MessageData *mdata) {
  g_return_if_fail(mdata != NULL);

  if (mdata->message_id)
    g_free(mdata->message_id);

  if (mdata->from)
    free_addresses_list(mdata->from);

  if (mdata->reply_to)
    free_addresses_list(mdata->reply_to);

  if (mdata->to)
    free_addresses_list(mdata->to);

  if (mdata->cc)
    free_addresses_list(mdata->cc);

  if (mdata->bcc)
    free_addresses_list(mdata->bcc);

  if (mdata->subject)
    g_free(mdata->subject);

  if (mdata->date)
    g_free(mdata->date);

  if (mdata->in_reply_to)
     g_mime_references_free(mdata->in_reply_to);

  if (mdata->references)
     g_mime_references_free(mdata->references);

  if (mdata->text)
    free_message_body(mdata->text);

  if (mdata->html)
    free_message_body(mdata->html);

  if (mdata->attachments)
    free_message_attachments_list(mdata->attachments);

  g_free(mdata);
}