Logo Search packages:      
Sourcecode: gaim-meanwhile version File versions  Download package

void gaim_mime_document_write ( GaimMimeDocument doc,
GString *  str 
)

Write (append) a MIME document onto a GString

Definition at line 452 of file mime.c.

                                                                   {
  const char *bd = NULL;

  g_return_if_fail(doc != NULL);
  g_return_if_fail(str != NULL);

  {
    const char *ct = fields_get(&doc->fields, "content-type");
    if(ct && g_str_has_prefix(ct, "multipart")) {
      char *b = strrchr(ct, '=');
      if(b++) bd = b;
    }
  }

  fields_write(&doc->fields, str);

  if(bd) {
    GList *l;

    for(l = doc->parts; l; l = l->next) {
      g_string_append_printf(str, "--%s\r\n", bd);

      part_write(l->data, str);

      if(! l->next) {
      g_string_append_printf(str, "--%s--\r\n", bd);
      }
    }
  }
}


Generated by  Doxygen 1.6.0   Back to index