message.texi 5.96 KB
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************

@smallexample
@code{/* Prefix @emph{message_} is reserved. */}
@code{#include <mailutils/message.h>}

@end smallexample

The @code{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
    ----------                   message_t
   (message[1])        +------>+--------------------+
    ----------         |       |  envelope_t        |
   (message[2])        |       |--------------------|
    ----------         |       |  header_t          |
   (message[3])--------+       |--------------------|
    ----------                 |  body_t            |
   (message[n])                |--------------------|
    ----------                 |  attribute_t       |
                               |--------------------|
                               |  stream_t          |
                               +--------------------+
@end group
@end smallexample

@c
@c Basic.
@c

@deftypefun void message_create (message_t *@var{msg}, void *@var{owner})
@end deftypefun

@deftypefun void message_destroy (message_t *@var{msg}, void *@var{owner})
The resources allocate for @var{msg} are freed.
@end deftypefun

@deftypefun  int message_create_copy (message_t *@var{to}, message_t *@var{from})
@end deftypefun

@deftypefun  void* message_get_owner (message_t @var{msg})
@end deftypefun

@deftypefun  int message_is_modified (message_t @var{msg})
@end deftypefun

@deftypefun  int message_clear_modified (message_t @var{msg})
@end deftypefun

@deftypefun  int message_get_mailbox (message_t @var{msg}, mailbox_t *@var{mbox})
@end deftypefun

@deftypefun  int message_set_mailbox (message_t @var{msg}, mailbox_t @var{mbox}, void *@var{owner})
@end deftypefun

@c
@c ------------
@c

@deftypefun  int message_ref (message_t @var{msg})
@end deftypefun

@deftypefun  int message_get_envelope (message_t @var{msg}, envelope_t *@var{envelope})
@end deftypefun

@deftypefun  int message_set_envelope (message_t @var{msg}, envelope_t @var{envelope}, void *@var{owner})
@end deftypefun

@deftypefun  int message_get_header (message_t @var{msg}, header_t *@var{header})
Retrieve @var{msg} header.
@end deftypefun

@deftypefun  int message_set_header (message_t @var{msg}, header_t @var{header}, void *@var{owner})
@end deftypefun

@deftypefun  int message_get_body (message_t @var{msg}, body_t *@var{body})
@end deftypefun

@deftypefun  int message_set_body (message_t @var{msg}, body_t @var{body}, void *@var{owner})
@end deftypefun

@deftypefun  int message_get_stream (message_t @var{msg}, stream_t *@var{stream})
@end deftypefun

@deftypefun  int message_set_stream (message_t @var{msg}, stream_t @var{stream}, void *@var{owner})
@end deftypefun

@deftypefun  int message_get_attribute (message_t @var{msg}, attribute_t *@var{attribute})
@end deftypefun

@deftypefun  int message_set_attribute (message_t @var{msg}, attribute_t @var{attribute}, void *@var{owner})
@end deftypefun

@deftypefun  int message_get_observable (message_t @var{msg}, observable_t *@var{observable})
@end deftypefun

@c
@c ------------
@c

@deftypefun  int message_is_multipart (message_t @var{msg}, int *@var{multi})
Set *@var{multi} to non-zero value if @var{msg} is multi-part.
@end deftypefun

@deftypefun  int message_set_is_multipart (message_t @var{msg}, int (*@var{_is_multipart}) (message_t, int *), void *);
@end deftypefun

@deftypefun  int message_size (message_t @var{msg}, size_t *@var{size})
@end deftypefun

@deftypefun  int message_set_size (message_t @var{msg}, int (*@var{_size}) (message_t, size_t *), void *@var{owner})
@end deftypefun

@deftypefun  int message_lines (message_t @var{msg}, size_t *@var{size})
@end deftypefun

@deftypefun  int message_set_lines (message_t @var{msg}, int (*@var{_lines}) (message_t, size_t *), void *@var{owner})
@end deftypefun

@deftypefun  int message_get_num_parts (message_t @var{msg}, size_t *@var{nparts})
@end deftypefun

@deftypefun  int message_set_get_num_parts (message_t @var{msg}, int (*@var{_get_num_parts}) (message_t, size_t *), void *@var{owner})
@end deftypefun

@deftypefun  int message_get_part (message_t @var{msg}, size_t @var{part}, message_t *@var{msg})
@end deftypefun

@deftypefun  int message_set_get_part (message_t @var{msg}, int (*@var{_get_part}) (message_t, size_t, message_t *), void *@var{owner})
@end deftypefun

@deftypefun  int message_get_uidl (message_t @var{msg}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
@end deftypefun

@deftypefun  int message_set_uidl (message_t @var{msg}, int (*@var{_get_uidl}) (message_t, char *, size_t, size_t *), void *@var{owner})
@end deftypefun

@deftypefun  int message_get_uid (message_t @var{msg}, size_t *@var{uid})
@end deftypefun

@deftypefun  int message_set_uid (message_t @var{msg}, int (*@var{_get_uid}) (message_t, size_t *), void *@var{owner})
@end deftypefun

@deftypefun  int message_create_attachment (const char *@var{content_type}, const char *@var{encoding}, const char *@var{filename}, message_t *@var{newmsg})
@end deftypefun

@deftypefun  int message_save_attachment (message_t @var{msg}, const char *@var{filename}, void **@var{data})
@end deftypefun

@deftypefun  int message_encapsulate (message_t @var{msg}, message_t *@var{newmsg}, void **@var{data})
@end deftypefun

@deftypefun  int message_unencapsulate (message_t @var{msg}, message_t *@var{newmsg}, void **@var{data});
@end deftypefun

@deftypefun  int message_get_attachment_name (message_t @var{msg}, char *@var{name}, size_t @var{bufsize}, size_t *@var{size});
@end deftypefun

@deftypefun  int message_aget_attachment_name (message_t @var{msg}, char **@var{name});
@end deftypefun

@deftypefun  int message_save_to_mailbox (message_t @var{msg}, ticket_t @var{ticket}, mu_debug_t @var{debug}, const char *@var{toname});
@end deftypefun