Statistics
| Branch: | Tag: | Revision:

root / libsylph / procheader.h @ aebfd4cc

History | View | Annotate | Download (2.18 KB)

1
/*
2
 * LibSylph -- E-Mail client library
3
 * Copyright (C) 1999-2011 Hiroyuki Yamamoto
4
 */
5

    
6
#ifndef __PROCHEADER_H__
7
#define __PROCHEADER_H__
8

    
9
#include <glib.h>
10
#include <stdio.h>
11
#include <time.h>
12

    
13
#include "procmsg.h"
14

    
15
typedef struct _HeaderEntry        HeaderEntry;
16
typedef struct _Header                Header;
17

    
18
struct _HeaderEntry
19
{
20
        gchar         *name;
21
        gchar         *body;
22
        gboolean  unfold;
23
};
24

    
25
struct _Header
26
{
27
        gchar *name;
28
        gchar *body;
29
};
30

    
31
gint procheader_get_one_field                (gchar                *buf,
32
                                         size_t                 len,
33
                                         FILE                *fp,
34
                                         HeaderEntry         hentry[]);
35
gchar *procheader_get_unfolded_line        (gchar                *buf,
36
                                         size_t                 len,
37
                                         FILE                *fp);
38

    
39
GSList *procheader_get_header_list_from_file        (const gchar        *file);
40
GSList *procheader_get_header_list                (FILE                *fp);
41
GSList *procheader_get_header_list_from_msginfo        (MsgInfo        *msginfo);
42
GSList *procheader_add_header_list                (GSList                *hlist,
43
                                                 const gchar        *header_name,
44
                                                 const gchar        *body);
45
GSList *procheader_copy_header_list                (GSList                *hlist);
46
GSList *procheader_merge_header_list                (GSList                *hlist1,
47
                                                 GSList                *hlist2);
48
GSList *procheader_merge_header_list_dup        (GSList                *hlist1,
49
                                                 GSList                *hlist2);
50
gint procheader_find_header_list                (GSList                *hlist,
51
                                                 const gchar        *header_name);
52
void procheader_header_list_destroy                (GSList                *hlist);
53

    
54
GPtrArray *procheader_get_header_array                (FILE                *fp,
55
                                                 const gchar        *encoding);
56
GPtrArray *procheader_get_header_array_asis        (FILE                *fp,
57
                                                 const gchar        *encoding);
58
void procheader_header_array_destroy                (GPtrArray        *harray);
59

    
60
void procheader_header_free                        (Header                *header);
61

    
62
void procheader_get_header_fields        (FILE                *fp,
63
                                         HeaderEntry         hentry[]);
64
MsgInfo *procheader_parse_file                (const gchar        *file,
65
                                         MsgFlags         flags,
66
                                         gboolean         full);
67
MsgInfo *procheader_parse_str                (const gchar        *str,
68
                                         MsgFlags         flags,
69
                                         gboolean         full);
70
MsgInfo *procheader_parse_stream        (FILE                *fp,
71
                                         MsgFlags         flags,
72
                                         gboolean         full);
73

    
74
gchar *procheader_get_fromname                (const gchar        *str);
75
gchar *procheader_get_toname                (const gchar        *str);
76

    
77
time_t procheader_date_parse                (gchar                *dest,
78
                                         const gchar        *src,
79
                                         gint                 len);
80
void procheader_date_get_localtime        (gchar                *dest,
81
                                         gint                 len,
82
                                         const time_t         timer);
83

    
84
#endif /* __PROCHEADER_H__ */