Statistics
| Revision:

root / src / procheader.h @ 291

History | View | Annotate | Download (2.7 kB)

1 1 hiro
/*
2 1 hiro
 * Sylpheed -- a GTK+ based, lightweight, and fast e-mail client
3 132 hiro
 * Copyright (C) 1999-2005 Hiroyuki Yamamoto
4 1 hiro
 *
5 1 hiro
 * This program is free software; you can redistribute it and/or modify
6 1 hiro
 * it under the terms of the GNU General Public License as published by
7 1 hiro
 * the Free Software Foundation; either version 2 of the License, or
8 1 hiro
 * (at your option) any later version.
9 1 hiro
 *
10 1 hiro
 * This program is distributed in the hope that it will be useful,
11 1 hiro
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 1 hiro
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 1 hiro
 * GNU General Public License for more details.
14 1 hiro
 *
15 1 hiro
 * You should have received a copy of the GNU General Public License
16 1 hiro
 * along with this program; if not, write to the Free Software
17 1 hiro
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, 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 1 hiro
GSList *procheader_add_header_list                (GSList                *hlist,
56 1 hiro
                                                 const gchar        *header_name,
57 1 hiro
                                                 const gchar        *body);
58 1 hiro
GSList *procheader_merge_header_list                (GSList                *hlist1,
59 1 hiro
                                                 GSList                *hlist2);
60 1 hiro
gint procheader_find_header_list                (GSList                *hlist,
61 1 hiro
                                                 const gchar        *header_name);
62 1 hiro
void procheader_header_list_destroy                (GSList                *hlist);
63 1 hiro
64 144 hiro
GPtrArray *procheader_get_header_array                (FILE                *fp,
65 144 hiro
                                                 const gchar        *encoding);
66 144 hiro
GPtrArray *procheader_get_header_array_asis        (FILE                *fp,
67 144 hiro
                                                 const gchar        *encoding);
68 1 hiro
void procheader_header_array_destroy                (GPtrArray        *harray);
69 1 hiro
70 1 hiro
void procheader_header_free                        (Header                *header);
71 1 hiro
72 1 hiro
void procheader_get_header_fields        (FILE                *fp,
73 1 hiro
                                         HeaderEntry         hentry[]);
74 1 hiro
MsgInfo *procheader_parse_file                (const gchar        *file,
75 1 hiro
                                         MsgFlags         flags,
76 1 hiro
                                         gboolean         full);
77 1 hiro
MsgInfo *procheader_parse_str                (const gchar        *str,
78 1 hiro
                                         MsgFlags         flags,
79 1 hiro
                                         gboolean         full);
80 1 hiro
MsgInfo *procheader_parse_stream        (FILE                *fp,
81 1 hiro
                                         MsgFlags         flags,
82 1 hiro
                                         gboolean         full);
83 1 hiro
84 1 hiro
gchar *procheader_get_fromname                (const gchar        *str);
85 1 hiro
86 1 hiro
time_t procheader_date_parse                (gchar                *dest,
87 1 hiro
                                         const gchar        *src,
88 1 hiro
                                         gint                 len);
89 1 hiro
void procheader_date_get_localtime        (gchar                *dest,
90 1 hiro
                                         gint                 len,
91 1 hiro
                                         const time_t         timer);
92 1 hiro
93 1 hiro
#endif /* __PROCHEADER_H__ */