summaryrefslogtreecommitdiff
path: root/libsylph/procheader.h
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph/procheader.h')
-rw-r--r--libsylph/procheader.h101
1 files changed, 101 insertions, 0 deletions
diff --git a/libsylph/procheader.h b/libsylph/procheader.h
new file mode 100644
index 0000000..fa8095a
--- /dev/null
+++ b/libsylph/procheader.h
@@ -0,0 +1,101 @@
1/*
2 * LibSylph -- E-Mail client library
3 * Copyright (C) 1999-2007 Hiroyuki Yamamoto
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2.1 of the License, or (at your option) any later version.
9 *
10 * This library 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 GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19
20#ifndef __PROCHEADER_H__
21#define __PROCHEADER_H__
22
23#include <glib.h>
24#include <stdio.h>
25#include <time.h>
26
27#include "procmsg.h"
28
29typedef struct _HeaderEntry HeaderEntry;
30typedef struct _Header Header;
31
32struct _HeaderEntry
33{
34 gchar *name;
35 gchar *body;
36 gboolean unfold;
37};
38
39struct _Header
40{
41 gchar *name;
42 gchar *body;
43};
44
45gint procheader_get_one_field (gchar *buf,
46 size_t len,
47 FILE *fp,
48 HeaderEntry hentry[]);
49gchar *procheader_get_unfolded_line (gchar *buf,
50 size_t len,
51 FILE *fp);
52
53GSList *procheader_get_header_list_from_file (const gchar *file);
54GSList *procheader_get_header_list (FILE *fp);
55GSList *procheader_get_header_list_from_msginfo (MsgInfo *msginfo);
56GSList *procheader_add_header_list (GSList *hlist,
57 const gchar *header_name,
58 const gchar *body);
59GSList *procheader_copy_header_list (GSList *hlist);
60GSList *procheader_merge_header_list (GSList *hlist1,
61 GSList *hlist2);
62GSList *procheader_merge_header_list_dup (GSList *hlist1,
63 GSList *hlist2);
64gint procheader_find_header_list (GSList *hlist,
65 const gchar *header_name);
66void procheader_header_list_destroy (GSList *hlist);
67
68GPtrArray *procheader_get_header_array (FILE *fp,
69 const gchar *encoding);
70GPtrArray *procheader_get_header_array_asis (FILE *fp,
71 const gchar *encoding);
72GPtrArray *procheader_get_header_array_for_display
73 (FILE *fp,
74 const gchar *encoding);
75void procheader_header_array_destroy (GPtrArray *harray);
76
77void procheader_header_free (Header *header);
78
79void procheader_get_header_fields (FILE *fp,
80 HeaderEntry hentry[]);
81MsgInfo *procheader_parse_file (const gchar *file,
82 MsgFlags flags,
83 gboolean full);
84MsgInfo *procheader_parse_str (const gchar *str,
85 MsgFlags flags,
86 gboolean full);
87MsgInfo *procheader_parse_stream (FILE *fp,
88 MsgFlags flags,
89 gboolean full);
90
91gchar *procheader_get_fromname (const gchar *str);
92gchar *procheader_get_toname (const gchar *str);
93
94stime_t procheader_date_parse (gchar *dest,
95 const gchar *src,
96 gint len);
97void procheader_date_get_localtime (gchar *dest,
98 gint len,
99 const stime_t timer);
100
101#endif /* __PROCHEADER_H__ */