Statistics
| Revision:

root / libsylph / procheader.h @ 3043

History | View | Annotate | Download (3 kB)

1 1 hiro
/*
2 578 hiro
 * LibSylph -- E-Mail client library
3 1532 hiro
 * Copyright (C) 1999-2007 Hiroyuki Yamamoto
4 1 hiro
 *
5 578 hiro
 * This library is free software; you can redistribute it and/or
6 578 hiro
 * modify it under the terms of the GNU Lesser General Public
7 578 hiro
 * License as published by the Free Software Foundation; either
8 578 hiro
 * version 2.1 of the License, or (at your option) any later version.
9 1 hiro
 *
10 578 hiro
 * This library is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 578 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
13 578 hiro
 * Lesser General Public License for more details.
14 1 hiro
 *
15 578 hiro
 * You should have received a copy of the GNU Lesser General Public
16 578 hiro
 * License along with this library; if not, write to the Free Software
17 578 hiro
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
18 1 hiro
 */
19 1 hiro
20 1 hiro
#ifndef __PROCHEADER_H__
21 1 hiro
#define __PROCHEADER_H__
22 1 hiro
23 1 hiro
#include <glib.h>
24 1 hiro
#include <stdio.h>
25 1 hiro
#include <time.h>
26 1 hiro
27 1 hiro
#include "procmsg.h"
28 1 hiro
29 1 hiro
typedef struct _HeaderEntry        HeaderEntry;
30 1 hiro
typedef struct _Header                Header;
31 1 hiro
32 1 hiro
struct _HeaderEntry
33 1 hiro
{
34 1 hiro
        gchar         *name;
35 1 hiro
        gchar         *body;
36 1 hiro
        gboolean  unfold;
37 1 hiro
};
38 1 hiro
39 1 hiro
struct _Header
40 1 hiro
{
41 1 hiro
        gchar *name;
42 1 hiro
        gchar *body;
43 1 hiro
};
44 1 hiro
45 1 hiro
gint procheader_get_one_field                (gchar                *buf,
46 132 hiro
                                         size_t                 len,
47 1 hiro
                                         FILE                *fp,
48 1 hiro
                                         HeaderEntry         hentry[]);
49 1 hiro
gchar *procheader_get_unfolded_line        (gchar                *buf,
50 132 hiro
                                         size_t                 len,
51 1 hiro
                                         FILE                *fp);
52 1 hiro
53 1 hiro
GSList *procheader_get_header_list_from_file        (const gchar        *file);
54 1 hiro
GSList *procheader_get_header_list                (FILE                *fp);
55 814 hiro
GSList *procheader_get_header_list_from_msginfo        (MsgInfo        *msginfo);
56 1 hiro
GSList *procheader_add_header_list                (GSList                *hlist,
57 1 hiro
                                                 const gchar        *header_name,
58 1 hiro
                                                 const gchar        *body);
59 1532 hiro
GSList *procheader_copy_header_list                (GSList                *hlist);
60 1 hiro
GSList *procheader_merge_header_list                (GSList                *hlist1,
61 1 hiro
                                                 GSList                *hlist2);
62 1532 hiro
GSList *procheader_merge_header_list_dup        (GSList                *hlist1,
63 1532 hiro
                                                 GSList                *hlist2);
64 1 hiro
gint procheader_find_header_list                (GSList                *hlist,
65 1 hiro
                                                 const gchar        *header_name);
66 1 hiro
void procheader_header_list_destroy                (GSList                *hlist);
67 1 hiro
68 144 hiro
GPtrArray *procheader_get_header_array                (FILE                *fp,
69 144 hiro
                                                 const gchar        *encoding);
70 144 hiro
GPtrArray *procheader_get_header_array_asis        (FILE                *fp,
71 144 hiro
                                                 const gchar        *encoding);
72 679 hiro
GPtrArray *procheader_get_header_array_for_display
73 679 hiro
                                                (FILE                *fp,
74 679 hiro
                                                 const gchar        *encoding);
75 1 hiro
void procheader_header_array_destroy                (GPtrArray        *harray);
76 1 hiro
77 1 hiro
void procheader_header_free                        (Header                *header);
78 1 hiro
79 1 hiro
void procheader_get_header_fields        (FILE                *fp,
80 1 hiro
                                         HeaderEntry         hentry[]);
81 1 hiro
MsgInfo *procheader_parse_file                (const gchar        *file,
82 1 hiro
                                         MsgFlags         flags,
83 1 hiro
                                         gboolean         full);
84 1 hiro
MsgInfo *procheader_parse_str                (const gchar        *str,
85 1 hiro
                                         MsgFlags         flags,
86 1 hiro
                                         gboolean         full);
87 1 hiro
MsgInfo *procheader_parse_stream        (FILE                *fp,
88 1 hiro
                                         MsgFlags         flags,
89 1 hiro
                                         gboolean         full);
90 1 hiro
91 1 hiro
gchar *procheader_get_fromname                (const gchar        *str);
92 1897 hiro
gchar *procheader_get_toname                (const gchar        *str);
93 1 hiro
94 1 hiro
time_t procheader_date_parse                (gchar                *dest,
95 1 hiro
                                         const gchar        *src,
96 1 hiro
                                         gint                 len);
97 1 hiro
void procheader_date_get_localtime        (gchar                *dest,
98 1 hiro
                                         gint                 len,
99 1 hiro
                                         const time_t         timer);
100 1 hiro
101 1 hiro
#endif /* __PROCHEADER_H__ */