root / libsylph / procheader.h @ 999
History | View | Annotate | Download (2.8 kB)
| 1 | /*
|
|---|---|
| 2 | * LibSylph -- E-Mail client library |
| 3 | * Copyright (C) 1999-2005 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 | |
| 29 | typedef struct _HeaderEntry HeaderEntry; |
| 30 | typedef struct _Header Header; |
| 31 | |
| 32 | struct _HeaderEntry
|
| 33 | {
|
| 34 | gchar *name; |
| 35 | gchar *body; |
| 36 | gboolean unfold; |
| 37 | }; |
| 38 | |
| 39 | struct _Header
|
| 40 | {
|
| 41 | gchar *name; |
| 42 | gchar *body; |
| 43 | }; |
| 44 | |
| 45 | gint procheader_get_one_field (gchar *buf, |
| 46 | size_t len, |
| 47 | FILE *fp, |
| 48 | HeaderEntry hentry[]); |
| 49 | gchar *procheader_get_unfolded_line (gchar *buf, |
| 50 | size_t len, |
| 51 | FILE *fp); |
| 52 | |
| 53 | GSList *procheader_get_header_list_from_file (const gchar *file);
|
| 54 | GSList *procheader_get_header_list (FILE *fp); |
| 55 | GSList *procheader_get_header_list_from_msginfo (MsgInfo *msginfo); |
| 56 | GSList *procheader_add_header_list (GSList *hlist, |
| 57 | const gchar *header_name,
|
| 58 | const gchar *body);
|
| 59 | GSList *procheader_merge_header_list (GSList *hlist1, |
| 60 | GSList *hlist2); |
| 61 | gint procheader_find_header_list (GSList *hlist, |
| 62 | const gchar *header_name);
|
| 63 | void procheader_header_list_destroy (GSList *hlist);
|
| 64 | |
| 65 | GPtrArray *procheader_get_header_array (FILE *fp, |
| 66 | const gchar *encoding);
|
| 67 | GPtrArray *procheader_get_header_array_asis (FILE *fp, |
| 68 | const gchar *encoding);
|
| 69 | GPtrArray *procheader_get_header_array_for_display |
| 70 | (FILE *fp, |
| 71 | const gchar *encoding);
|
| 72 | void procheader_header_array_destroy (GPtrArray *harray);
|
| 73 | |
| 74 | void procheader_header_free (Header *header);
|
| 75 | |
| 76 | void procheader_get_header_fields (FILE *fp,
|
| 77 | HeaderEntry hentry[]); |
| 78 | MsgInfo *procheader_parse_file (const gchar *file,
|
| 79 | MsgFlags flags, |
| 80 | gboolean full); |
| 81 | MsgInfo *procheader_parse_str (const gchar *str,
|
| 82 | MsgFlags flags, |
| 83 | gboolean full); |
| 84 | MsgInfo *procheader_parse_stream (FILE *fp, |
| 85 | MsgFlags flags, |
| 86 | gboolean full); |
| 87 | |
| 88 | gchar *procheader_get_fromname (const gchar *str);
|
| 89 | |
| 90 | time_t procheader_date_parse (gchar *dest, |
| 91 | const gchar *src,
|
| 92 | gint len); |
| 93 | void procheader_date_get_localtime (gchar *dest,
|
| 94 | gint len, |
| 95 | const time_t timer);
|
| 96 | |
| 97 | #endif /* __PROCHEADER_H__ */ |