mime.h
Go to the documentation of this file.
1 /*
2 * Purple
3 *
4 * Purple is the legal property of its developers, whose names are too
5 * numerous to list here. Please refer to the COPYRIGHT file distributed
6 * with this source distribution
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02111-1301,
21 * USA.
22 */
23
24 #ifndef _PURPLE_MIME_H
25 #define _PURPLE_MIME_H
26
27 #include <glib.h>
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
44 typedef struct _PurpleMimeDocument PurpleMimeDocument;
45
49 typedef struct _PurpleMimePart PurpleMimePart;
50
54 PurpleMimeDocument *purple_mime_document_new(void);
55
61 void purple_mime_document_free(PurpleMimeDocument *doc);
62
70 PurpleMimeDocument *purple_mime_document_parse(const char *buf);
71
80 PurpleMimeDocument *purple_mime_document_parsen(const char *buf, gsize len);
81
85 void purple_mime_document_write(PurpleMimeDocument *doc, GString *str);
86
95 GList *purple_mime_document_get_fields(PurpleMimeDocument *doc);
96
106 const char *purple_mime_document_get_field(PurpleMimeDocument *doc,
107 const char *field);
108
118 void purple_mime_document_set_field(PurpleMimeDocument *doc,
119 const char *field,
120 const char *value);
121
129 GList *purple_mime_document_get_parts(PurpleMimeDocument *doc);
130
136 PurpleMimePart *purple_mime_part_new(PurpleMimeDocument *doc);
137
138
147 GList *purple_mime_part_get_fields(PurpleMimePart *part);
148
149
159 const char *purple_mime_part_get_field(PurpleMimePart *part,
160 const char *field);
161
166 char *purple_mime_part_get_field_decoded(PurpleMimePart *part,
167 const char *field);
168
178 void purple_mime_part_set_field(PurpleMimePart *part,
179 const char *field,
180 const char *value);
181
189 const char *purple_mime_part_get_data(PurpleMimePart *part);
190
201 void purple_mime_part_get_data_decoded(PurpleMimePart *part,
202 guchar **data, gsize *len);
203
210 gsize purple_mime_part_get_length(PurpleMimePart *part);
211
212 void purple_mime_part_set_data(PurpleMimePart *part, const char *data);
213
214 #ifdef __cplusplus
215 }
216 #endif
217
218 #endif
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_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.
PurpleMimeDocument
struct _PurpleMimeDocument PurpleMimeDocument
A MIME document.
Definition: mime.h:44
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_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_parsen
PurpleMimeDocument * purple_mime_document_parsen(const char *buf, gsize len)
Parse a MIME document from a string.
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_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_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_new
PurpleMimePart * purple_mime_part_new(PurpleMimeDocument *doc)
Create and insert a new part into a MIME document.
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_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.
purple_mime_document_new
PurpleMimeDocument * purple_mime_document_new(void)
Allocate an empty MIME document.
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_length
gsize purple_mime_part_get_length(PurpleMimePart *part)
Get the length of the data portion of a MIME 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.
PurpleMimePart
struct _PurpleMimePart PurpleMimePart
A part of a multipart MIME document.
Definition: mime.h:49