1 /*
2  * attr.h -- Functions for handling tnef attributes
3  *
4  * Copyright (C)1999-2006 Mark Simpson <damned@theworld.com>
5  *
6  * This program is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2, or (at your option)
9  * any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program; if not, you can either send email to this
18  * program's maintainer or write to: The Free Software Foundation,
19  * Inc.; 59 Temple Place, Suite 330; Boston, MA 02111-1307, USA.
20  *
21  */
22 #ifndef ATTR_H
23 #define ATTR_H
24 
25 #if HAVE_CONFIG_H
26 #  include "config.h"
27 #endif /* HAVE_CONFIG_H */
28 
29 #include "common.h"
30 #include "date.h"
31 #include "tnef_types.h"
32 #include "tnef_names.h"
33 
34 #define MINIMUM_ATTR_LENGTH 8
35 
36 /* Object types */
37 enum _lvl_type
38 {
39     LVL_MESSAGE		= 0x1,
40     LVL_ATTACHMENT	= 0x2,
41 };
42 typedef enum _lvl_type level_type;
43 
44 /* Attr -- storing a structure, formated according to file specification */
45 typedef struct
46 {
47     level_type lvl_type;
48     tnef_type type;
49     tnef_name name;
50     size_t len;
51     unsigned char* buf;
52 } Attr;
53 
54 typedef struct
55 {
56     uint16 id;
57     uint16 chbgtrp;
58     uint16 cch;
59     uint16 cb;
60 } TRP;
61 
62 typedef struct
63 {
64     TRP trp;
65     char* sender_display_name;
66     char* sender_address;
67 } TRIPLE;
68 
69 extern void attr_dump (Attr* attr);
70 extern void attr_free (Attr* attr);
71 extern void copy_date_from_attr (Attr* attr, struct date* dt);
72 extern Attr* attr_read ();
73 
74 #endif /* ATTR_H */
75