2 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 * Copyright (C) 1999-2001 Hiroyuki Yamamoto
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 #ifndef __PROCMIME_H__
21 #define __PROCMIME_H__
25 #endif /* __cplusplus */
34 typedef struct _MimeType MimeType;
35 typedef struct _MimeInfo MimeInfo;
56 MIME_APPLICATION_OCTET_STREAM,
73 * An example of MimeInfo structure:
75 * multipart/mixed root <-+ parent
77 * multipart/alternative children <-+ parent
79 * text/plain children --+
83 * message/rfc822 next <-+ main
85 * sub (capsulated message)
94 EncodingType encoding_type;
95 ContentType mime_type;
102 gchar *content_disposition;
118 gchar *plaintextfile;
120 gchar *sigstatus_full;
126 #define IS_BOUNDARY(s, bnd, len) \
127 (bnd && s[0] == '-' && s[1] == '-' && !strncmp(s + 2, bnd, len))
129 /* MimeInfo handling */
131 MimeInfo *procmime_mimeinfo_new (void);
132 void procmime_mimeinfo_free_all (MimeInfo *mimeinfo);
134 MimeInfo *procmime_mimeinfo_insert (MimeInfo *parent,
136 void procmime_mimeinfo_replace (MimeInfo *old_mimeinfo,
137 MimeInfo *new_mimeinfo);
139 MimeInfo *procmime_mimeinfo_next (MimeInfo *mimeinfo);
141 MimeInfo *procmime_scan_message (MsgInfo *msginfo);
142 void procmime_scan_multipart_message (MimeInfo *mimeinfo,
147 void procmime_scan_encoding (MimeInfo *mimeinfo,
148 const gchar *encoding);
149 void procmime_scan_content_type (MimeInfo *mimeinfo,
150 const gchar *content_type);
151 void procmime_scan_content_disposition (MimeInfo *mimeinfo,
152 const gchar *content_disposition);
153 void procmime_scan_content_description (MimeInfo *mimeinfo,
154 const gchar *content_description);
155 void procmime_scan_subject (MimeInfo *mimeinfo,
156 const gchar *subject);
157 MimeInfo *procmime_scan_mime_header (FILE *fp);
159 FILE *procmime_decode_content (FILE *outfp,
162 gint procmime_get_part (const gchar *outfile,
165 FILE *procmime_get_text_content (MimeInfo *mimeinfo,
167 FILE *procmime_get_first_text_content (MsgInfo *msginfo);
169 gboolean procmime_find_string_part (MimeInfo *mimeinfo,
170 const gchar *filename,
173 gboolean procmime_find_string (MsgInfo *msginfo,
177 gchar *procmime_get_tmp_file_name (MimeInfo *mimeinfo);
179 ContentType procmime_scan_mime_type (const gchar *mime_type);
180 gchar *procmime_get_mime_type (const gchar *filename);
182 GList *procmime_get_mime_type_list (void);
184 EncodingType procmime_get_encoding_for_charset (const gchar *charset);
185 EncodingType procmime_get_encoding_for_file (const gchar *file);
186 const gchar *procmime_get_encoding_str (EncodingType encoding);
188 void renderer_read_config(void);
189 void renderer_write_config(void);
193 #endif /* __cplusplus */
195 #endif /* __PROCMIME_H__ */