message.texi
6.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
@smallexample
@code{/* Prefix @emph{mu_message_} is reserved. */}
@code{#include <mailutils/message.h>}
@end smallexample
The @code{mu_message_t} object is a convenient way to manipulate messages. It
encapsulates the @code{envelope_t}, the @code{header_t} and the @code{body_t}.
@smallexample
@group
mailbox_t
---------- mu_message_t
(message[1]) +------>+--------------------+
---------- | | mu_envelope_t |
(message[2]) | |--------------------|
---------- | | mu_header_t |
(message[3])--------+ |--------------------|
---------- | mu_body_t |
(message[n]) |--------------------|
---------- | mu_attribute_t |
|--------------------|
| mu_stream_t |
+--------------------+
@end group
@end smallexample
@c
@c Basic.
@c
@deftypefun void mu_message_create (mu_message_t *@var{msg}, void *@var{owner})
@end deftypefun
@deftypefun void mu_message_destroy (mu_message_t *@var{msg}, void *@var{owner})
The resources allocate for @var{msg} are freed.
@end deftypefun
@deftypefun int mu_message_create_copy (mu_message_t *@var{to}, mu_message_t *@var{from})
@end deftypefun
@deftypefun void* mu_message_get_owner (mu_message_t @var{msg})
@end deftypefun
@deftypefun int mu_message_is_modified (mu_message_t @var{msg})
@end deftypefun
@deftypefun int mu_message_clear_modified (mu_message_t @var{msg})
@end deftypefun
@deftypefun int mu_message_get_mailbox (mu_message_t @var{msg}, mu_mailbox_t *@var{mbox})
@end deftypefun
@deftypefun int mu_message_set_mailbox (mu_message_t @var{msg}, mu_mailbox_t @var{mbox}, void *@var{owner})
@end deftypefun
@c
@c ------------
@c
@deftypefun int mu_message_ref (mu_message_t @var{msg})
@end deftypefun
@deftypefun int mu_message_get_envelope (mu_message_t @var{msg}, mu_envelope_t *@var{envelope})
@end deftypefun
@deftypefun int mu_message_set_envelope (mu_message_t @var{msg}, mu_envelope_t @var{envelope}, void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_header (mu_message_t @var{msg}, mu_header_t *@var{header})
Retrieve @var{msg} header.
@end deftypefun
@deftypefun int mu_message_set_header (mu_message_t @var{msg}, mu_header_t @var{header}, void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_body (mu_message_t @var{msg}, mu_body_t *@var{body})
@end deftypefun
@deftypefun int mu_message_set_body (mu_message_t @var{msg}, mu_body_t @var{body}, void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_stream (mu_message_t @var{msg}, mu_stream_t *@var{stream})
@end deftypefun
@deftypefun int mu_message_set_stream (mu_message_t @var{msg}, mu_stream_t @var{stream}, void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_attribute (mu_message_t @var{msg}, mu_attribute_t *@var{attribute})
@end deftypefun
@deftypefun int mu_message_set_attribute (mu_message_t @var{msg}, mu_attribute_t @var{attribute}, void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_observable (mu_message_t @var{msg}, mu_observable_t *@var{observable})
@end deftypefun
@c
@c ------------
@c
@deftypefun int mu_message_is_multipart (mu_message_t @var{msg}, int *@var{multi})
Set *@var{multi} to non-zero value if @var{msg} is multi-part.
@end deftypefun
@deftypefun int mu_message_set_is_multipart (mu_message_t @var{msg}, int (*@var{_is_multipart}) (mu_message_t, int *), void *);
@end deftypefun
@deftypefun int mu_message_size (mu_message_t @var{msg}, size_t *@var{size})
@end deftypefun
@deftypefun int mu_message_set_size (mu_message_t @var{msg}, int (*@var{_size}) (mu_message_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int mu_message_lines (mu_message_t @var{msg}, size_t *@var{size})
@end deftypefun
@deftypefun int mu_message_set_lines (mu_message_t @var{msg}, int (*@var{_lines}) (mu_message_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_num_parts (mu_message_t @var{msg}, size_t *@var{nparts})
@end deftypefun
@deftypefun int mu_message_set_get_num_parts (mu_message_t @var{msg}, int (*@var{_get_num_parts}) (mu_message_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_part (mu_message_t @var{msg}, size_t @var{part}, mu_message_t *@var{msg})
@end deftypefun
@deftypefun int mu_message_set_get_part (mu_message_t @var{msg}, int (*@var{_get_part}) (mu_message_t, size_t, mu_message_t *), void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_uidl (mu_message_t @var{msg}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
@end deftypefun
@deftypefun int mu_message_set_uidl (mu_message_t @var{msg}, int (*@var{_get_uidl}) (mu_message_t, char *, size_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int mu_message_get_uid (mu_message_t @var{msg}, size_t *@var{uid})
@end deftypefun
@deftypefun int mu_message_set_uid (mu_message_t @var{msg}, int (*@var{_get_uid}) (mu_message_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int mu_message_create_attachment (const char *@var{content_type}, const char *@var{encoding}, const char *@var{filename}, mu_message_t *@var{newmsg})
@end deftypefun
@deftypefun int mu_message_save_attachment (mu_message_t @var{msg}, const char *@var{filename}, void **@var{data})
@end deftypefun
@deftypefun int mu_message_encapsulate (mu_message_t @var{msg}, mu_message_t *@var{newmsg}, void **@var{data})
@end deftypefun
@deftypefun int mu_message_unencapsulate (mu_message_t @var{msg}, mu_message_t *@var{newmsg}, void **@var{data});
@end deftypefun
@deftypefun int mu_message_get_attachment_name (mu_message_t @var{msg}, char *@var{name}, size_t @var{bufsize}, size_t *@var{size});
@end deftypefun
@deftypefun int mu_message_aget_attachment_name (mu_message_t @var{msg}, char **@var{name});
@end deftypefun
@deftypefun int mu_message_save_to_mailbox (mu_message_t @var{msg}, mu_ticket_t @var{ticket}, mu_debug_t @var{debug}, const char *@var{toname});
@end deftypefun