body.texi
1.63 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
The @code{body_t} type contains a @code{header_t}, a content and
optionally another @code{body_t} part.
@section Init/Destroy
@deftypefun int body_init (body_t *@var{bdy})
Initialize an object @var{bdy}.
@end deftypefun
@deftypefun void body_destroy (body_t *@var{bdy})
The resources allocate are @var{bdy} freed.
@end deftypefun
@section Attributes
The body can carry header attributes if it is a mime. They also come
with the matching "set".
@deftypefun int body_get_header (body_t @var{bdy}, header_t *@var{hdr})
@end deftypefun
@deftypefun int body_get_content_type (body_t @var{bdy}, char *@var{type}, size_t @var{len})
@end deftypefun
@deftypefun int body_get_content_description (body_t @var{bdy}, char *@var{type}, size_t @var{len})
@end deftypefun
@deftypefun int body_get_content_encoding (body_t @var{bdy}, char *@var{type}, size_t @var{len})
@end deftypefun
@section Attachments
@deftypefun int body_set_filename (body_t @var{bdy}, char *file)
Associate the body with a @var{file}.
@end deftypefun
@deftypefun int body_set_FILE (body_t @var{bdy}, FILE *fp)
Associate the body with a FILE *@var{fp}.
@end deftypefun
@deftypefun int body_get_content (body_t @var{bdy}, off_t @var{offset}, char *buffer, size_t len, size_t *n)
@end deftypefun
@section Sub parts
A body may contain another body
@deftypefun int body_is_multipart (body_t @var{bdy})
Return non-zero value if body has a second part.
@end deftypefun
@deftypefun int body_get_body (body_t @var{bdy}, body_t *@var{sub})
Return the sub part in @var{bdy}.
@end deftypefun
@deftypefun int body_set_body (body_t @var{bdy}, body_t *@var{sub})
Set a sub part for @var{bdy}.
@end deftypefun