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

GaimMimeDocument* gaim_mime_document_parsen ( const char *  buf,
gsize  len 

Parse a MIME document from a string

buf the string containing the MIME-encoded data
len length of buf
MIME document

Definition at line 417 of file mime.c.


  GaimMimeDocument *doc;

  char *b = (char *) buf;
  gsize n = len;

  g_return_val_if_fail(buf != NULL, NULL);

  doc = gaim_mime_document_new();

  if(! len) return doc;

  fields_load(&doc->fields, &b, &n);

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

  return doc;

Generated by  Doxygen 1.6.0   Back to index