Loading...
Searching...
No Matches
mime.h
Go to the documentation of this file.
/*
* Purple
*
* Purple is the legal property of its developers, whose names are too
* numerous to list here. Please refer to the COPYRIGHT file distributed
* with this source distribution
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or (at
* your option) any later version.
*
* This program is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301,
* USA.
*/
#ifndef _PURPLE_MIME_H
#define _PURPLE_MIME_H
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _PurpleMimeDocument PurpleMimeDocument;
typedef struct _PurpleMimePart PurpleMimePart;
PurpleMimeDocument *purple_mime_document_new(void);
void purple_mime_document_free(PurpleMimeDocument *doc);
PurpleMimeDocument *purple_mime_document_parse(const char *buf);
PurpleMimeDocument *purple_mime_document_parsen(const char *buf, gsize len);
void purple_mime_document_write(PurpleMimeDocument *doc, GString *str);
GList *purple_mime_document_get_fields(PurpleMimeDocument *doc);
const char *purple_mime_document_get_field(PurpleMimeDocument *doc,
const char *field);
void purple_mime_document_set_field(PurpleMimeDocument *doc,
const char *field,
const char *value);
GList *purple_mime_document_get_parts(PurpleMimeDocument *doc);
PurpleMimePart *purple_mime_part_new(PurpleMimeDocument *doc);
GList *purple_mime_part_get_fields(PurpleMimePart *part);
const char *purple_mime_part_get_field(PurpleMimePart *part,
const char *field);
char *purple_mime_part_get_field_decoded(PurpleMimePart *part,
const char *field);
void purple_mime_part_set_field(PurpleMimePart *part,
const char *field,
const char *value);
const char *purple_mime_part_get_data(PurpleMimePart *part);
void purple_mime_part_get_data_decoded(PurpleMimePart *part,
guchar **data, gsize *len);
gsize purple_mime_part_get_length(PurpleMimePart *part);
void purple_mime_part_set_data(PurpleMimePart *part, const char *data);
#ifdef __cplusplus
}
#endif
#endif
purple_mime_part_set_field
void purple_mime_part_set_field(PurpleMimePart *part, const char *field, const char *value)
Set or replace the value of a specific field in the header of a document.
purple_mime_part_get_field
const char * purple_mime_part_get_field(PurpleMimePart *part, const char *field)
Get the value of a specific field in the header of a document part.
purple_mime_part_get_length
gsize purple_mime_part_get_length(PurpleMimePart *part)
Get the length of the data portion of a MIME document part.
purple_mime_document_get_fields
GList * purple_mime_document_get_fields(PurpleMimeDocument *doc)
The list of fields in the header of a document.
purple_mime_part_get_data
const char * purple_mime_part_get_data(PurpleMimePart *part)
Get the (possibly encoded) data portion of a MIME document part.
purple_mime_part_new
PurpleMimePart * purple_mime_part_new(PurpleMimeDocument *doc)
Create and insert a new part into a MIME document.
purple_mime_document_free
void purple_mime_document_free(PurpleMimeDocument *doc)
Frees memory used in a MIME document and all of its parts and fields.
purple_mime_document_new
PurpleMimeDocument * purple_mime_document_new(void)
Allocate an empty MIME document.
purple_mime_document_get_field
const char * purple_mime_document_get_field(PurpleMimeDocument *doc, const char *field)
Get the value of a specific field in the header of a document.
purple_mime_part_get_fields
GList * purple_mime_part_get_fields(PurpleMimePart *part)
The list of fields in the header of a document part.
purple_mime_document_set_field
void purple_mime_document_set_field(PurpleMimeDocument *doc, const char *field, const char *value)
Set or replace the value of a specific field in the header of a document.
purple_mime_document_parse
PurpleMimeDocument * purple_mime_document_parse(const char *buf)
Parse a MIME document from a NUL-terminated string.
purple_mime_part_get_field_decoded
char * purple_mime_part_get_field_decoded(PurpleMimePart *part, const char *field)
Get the decoded value of a specific field in the header of a document part.
PurpleMimeDocument
struct _PurpleMimeDocument PurpleMimeDocument
A MIME document.
Definition mime.h:44
purple_mime_part_get_data_decoded
void purple_mime_part_get_data_decoded(PurpleMimePart *part, guchar **data, gsize *len)
Get the data portion of a MIME document part, after attempting to decode it according to the content-...
purple_mime_document_write
void purple_mime_document_write(PurpleMimeDocument *doc, GString *str)
Write (append) a MIME document onto a GString.
purple_mime_document_get_parts
GList * purple_mime_document_get_parts(PurpleMimeDocument *doc)
The list of parts in a multipart document.
purple_mime_document_parsen
PurpleMimeDocument * purple_mime_document_parsen(const char *buf, gsize len)
Parse a MIME document from a string.
PurpleMimePart
struct _PurpleMimePart PurpleMimePart
A part of a multipart MIME document.
Definition mime.h:49