Commit 2aeeeff8 2aeeeff8dd895a10d89a25b961acdce44fb0b436 by Sergey Poznyakoff

Reflect namespace changes

1 parent 5d383c02
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -70,8 +71,8 @@ The index @var{no} is outside of the range of available addresses.
Invalid usage, usually a required argument was @code{NULL}.
@end macro
@deftp {Data Type} address_t
The @code{address_t} object is used to hold information about a parsed
@deftp {Data Type} mu_address_t
The @code{mu_address_t} object is used to hold information about a parsed
RFC822 address list, and is an opaque
data structure to the user. Functions are provided to retrieve information
about an address in the address list.
......@@ -81,7 +82,7 @@ about an address in the address list.
@c Functions.
@c
@deftypefun int address_create (address_t *@var{addr}, const char *@var{string})
@deftypefun int mu_address_create (mu_address_t *@var{addr}, const char *@var{string})
This function allocates and initializes @var{addr} by parsing the
RFC822 address-list @var{string}.
......@@ -93,7 +94,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_createv (address_t *@var{addr}, const char *@var{sv}, size_t @var{len})
@deftypefun int mu_address_createv (mu_address_t *@var{addr}, const char *@var{sv}, size_t @var{len})
This function allocates and initializes @var{addr} by parsing the
array of pointers to RFC822 address-lists in @var{sv}. If @var{len} is
@code{-1}, then @var{sv} must be @code{NULL} terminated in the fashion of @var{argv},
......@@ -107,7 +108,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun void address_destroy (address_t *@var{addr})
@deftypefun void mu_address_destroy (mu_address_t *@var{addr})
The @var{addr} is destroyed.
@end deftypefun
......@@ -115,10 +116,10 @@ The @var{addr} is destroyed.
@c address_get_
@c
@deftypefun int address_get_nth (address_t @var{addr}, size_t @var{no}, address_t *@var{ret})
@deftypefun int mu_address_get_nth (mu_address_t @var{addr}, size_t @var{no}, mu_address_t *@var{ret})
@end deftypefun
@deftypefun int address_get_email (address_t @var{addr}, size_t @var{no}, char* @var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_get_email (mu_address_t @var{addr}, size_t @var{no}, char* @var{buf}, size_t @var{len}, size_t *@var{n})
Accesses the @var{no}th email address component of the address list. This
address is the plain email address, correctly quoted, suitable for
using in an smtp dialog, for example, or as the address part of
......@@ -134,7 +135,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_get_local_part (address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_get_local_part (mu_address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
Accesses the local-part of an email addr-spec extracted while
parsing the @var{no}th email address.
......@@ -145,7 +146,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_get_domain (address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_get_domain (mu_address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
Accesses the domain of an email addr-spec extracted while
parsing the @var{no}th email address. This will be @code{0}
length for a unix-mbox.
......@@ -157,7 +158,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_get_personal (address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_get_personal (mu_address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
Accesses the display-name describing the @var{no}th email address. This
display-name is optional, so may not be present. If it is not present, but
there is an RFC822 comment after the address, that comment will be
......@@ -168,7 +169,7 @@ A group is a kind of a special case. It has a display-name, followed
by an optional mailbox-list. The display-name will be allocated an address
all it's own, but all the other elements (local-part, domain, etc.) will
be zero-length. So "a group: ;" is valid, will have a count of 1, but
@code{address_get_email()}, and all the rest, will return zero-length output.
@code{mu_address_get_email()}, and all the rest, will return zero-length output.
The return value is @code{0} on success and a code number on error conditions:
@table @code
......@@ -177,7 +178,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_get_comments (address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_get_comments (mu_address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
Accesses the comments extracted while parsing the @var{no}th email address.
These comments have no defined meaning, and are not currently collected.
......@@ -188,7 +189,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_get_route (address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_get_route (mu_address_t @var{addr}, size_t @var{no}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
Accesses the route of an email addr-spec extracted while
parsing the @var{no}th email address. This is a rarely used RFC822 address
syntax, but is legal in SMTP as well. The entire route is returned as
......@@ -205,7 +206,7 @@ The return value is @code{0} on success and a code number on error conditions:
@c address_aget_
@c
@deftypefun int address_aget_email (address_t @var{addr}, size_t @var{no}, char **@var{bufp})
@deftypefun int mu_address_aget_email (mu_address_t @var{addr}, size_t @var{no}, char **@var{bufp})
As above, but mallocs the email address, if present,
and write a pointer to it into @var{bufp}. @var{bufp} will be @code{NULL}
if there is no email address to return.
......@@ -217,20 +218,20 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_aget_local_part (address_t @var{addr}, size_t @var{no}, char **@var{buf})
@deftypefun int mu_address_aget_local_part (mu_address_t @var{addr}, size_t @var{no}, char **@var{buf})
@end deftypefun
@deftypefun int address_aget_domain (address_t @var{addr}, size_t @var{no}, char **@var{buf})
@deftypefun int mu_address_aget_domain (mu_address_t @var{addr}, size_t @var{no}, char **@var{buf})
@end deftypefun
@deftypefun int address_aget_personal (address_t @var{addr}, size_t @var{no}, char **@var{buf})
@deftypefun int mu_address_aget_personal (mu_address_t @var{addr}, size_t @var{no}, char **@var{buf})
@end deftypefun
@c
@c -----------
@c
@deftypefun int address_is_group (address_t @var{addr}, size_t @var{no}, int *@var{yes})
@deftypefun int mu_address_is_group (mu_address_t @var{addr}, size_t @var{no}, int *@var{yes})
Sets *@var{yes} to @code{1} if this address is just the name of a group,
@code{0} otherwise. This is faster than checking if the address has
a non-zero length personal, and a zero-length local_part and domain.
......@@ -247,7 +248,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_to_string (address_t *@var{addr}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_address_to_string (mu_address_t *@var{addr}, char *@var{buf}, size_t @var{len}, size_t *@var{n})
Returns the entire address list as a single RFC822 formatted address list.
The return value is @code{0} on success and a code number on error conditions:
......@@ -257,7 +258,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int address_get_count (address_t @var{addr}, size_t *@var{count})
@deftypefun int mu_address_get_count (mu_address_t @var{addr}, size_t *@var{count})
Returns a count of the addresses in the address list.
If @var{addr} is @code{NULL}, the count is @code{0}. If @var{count} is
......@@ -266,22 +267,22 @@ not @code{NULL}, the count will be written to *@var{count}.
The return value is @code{0}.
@end deftypefun
@deftypefun int address_get_group_count (address_t @var{addr}, size_t *)
@deftypefun int mu_address_get_group_count (mu_address_t @var{addr}, size_t *)
@end deftypefun
@deftypefun int address_get_email_count (address_t @var{addr}, size_t *)
@deftypefun int mu_address_get_email_count (mu_address_t @var{addr}, size_t *)
@end deftypefun
@deftypefun int address_get_unix_mailbox_count (address_t @var{addr}, size_t *)
@deftypefun int mu_address_get_unix_mailbox_count (mu_address_t @var{addr}, size_t *)
@end deftypefun
@deftypefun int address_contains_email (address_t @var{addr}, const char *@var{email})
@deftypefun int mu_address_contains_email (mu_address_t @var{addr}, const char *@var{email})
@end deftypefun
@deftypefun int address_union (address_t *@var{a}, address_t @var{b})
@deftypefun int mu_address_union (mu_address_t *@var{a}, mu_address_t @var{b})
@end deftypefun
@deftypefun size_t address_format_string (address_t @var{addr}, char *@var{buf}, size_t @var{buflen})
@deftypefun size_t mu_address_format_string (mu_address_t @var{addr}, char *@var{buf}, size_t @var{buflen})
@end deftypefun
@subheading Example
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
@smallexample
@code{/* Prefix @emph{attribute_} is reserved. */}
@code{/* Prefix @emph{mu_attribute_} is reserved. */}
@code{#include <mailutils/attribute.h>}
@end smallexample
@deftypefun int attribute_create (attribute_t *@var{attr}, void *)
@deftypefun int mu_attribute_create (mu_attribute_t *@var{attr}, void *)
@end deftypefun
@deftypefun void attribute_destroy (attribute_t *@var{attr}, void *)
@deftypefun void mu_attribute_destroy (mu_attribute_t *@var{attr}, void *)
@end deftypefun
@deftypefun void* attribute_get_owner (attribute_t @var{attr})
@deftypefun void* mu_attribute_get_owner (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_modified (attribute_t @var{attr})
@deftypefun int mu_attribute_is_modified (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_clear_modified (attribute_t @var{attr})
@deftypefun int mu_attribute_clear_modified (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_modified (attribute_t @var{attr})
@deftypefun int mu_attribute_set_modified (mu_attribute_t @var{attr})
@end deftypefun
@c
@c _is_
@c
@deftypefun int attribute_is_userflag (attribute_t @var{attr})
@deftypefun int mu_attribute_is_userflag (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_seen (attribute_t @var{attr})
@deftypefun int mu_attribute_is_seen (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_answered (attribute_t @var{attr})
@deftypefun int mu_attribute_is_answered (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_flagged (attribute_t @var{attr})
@deftypefun int mu_attribute_is_flagged (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_deleted (attribute_t @var{attr})
@deftypefun int mu_attribute_is_deleted (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_draft (attribute_t @var{attr})
@deftypefun int mu_attribute_is_draft (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_recent (attribute_t @var{attr})
@deftypefun int mu_attribute_is_recent (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_is_read (attribute_t @var{attr})
@deftypefun int mu_attribute_is_read (mu_attribute_t @var{attr})
@end deftypefun
@c
@c _set_
@c
@deftypefun int attribute_set_userflag (attribute_t @var{attr}, int)
@deftypefun int mu_attribute_set_userflag (mu_attribute_t @var{attr}, int)
@end deftypefun
@deftypefun int attribute_set_seen (attribute_t @var{attr})
@deftypefun int mu_attribute_set_seen (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_answered (attribute_t @var{attr})
@deftypefun int mu_attribute_set_answered (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_flagged (attribute_t @var{attr})
@deftypefun int mu_attribute_set_flagged (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_deleted (attribute_t @var{attr})
@deftypefun int mu_attribute_set_deleted (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_draft (attribute_t @var{attr})
@deftypefun int mu_attribute_set_draft (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_recent (attribute_t @var{attr})
@deftypefun int mu_attribute_set_recent (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_set_read (attribute_t @var{attr})
@deftypefun int mu_attribute_set_read (mu_attribute_t @var{attr})
@end deftypefun
@c
@c _unset_
@c
@deftypefun int attribute_unset_userflag (attribute_t @var{attr}, int)
@deftypefun int mu_attribute_unset_userflag (mu_attribute_t @var{attr}, int)
@end deftypefun
@deftypefun int attribute_unset_seen (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_seen (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_unset_answered (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_answered (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_unset_flagged (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_flagged (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_unset_deleted (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_deleted (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_unset_draft (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_draft (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_unset_recent (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_recent (mu_attribute_t @var{attr})
@end deftypefun
@deftypefun int attribute_unset_read (attribute_t @var{attr})
@deftypefun int mu_attribute_unset_read (mu_attribute_t @var{attr})
@end deftypefun
@c
@c ----------
@c
@deftypefun int attribute_get_flags (attribute_t @var{attr}, int *)
@deftypefun int mu_attribute_get_flags (mu_attribute_t @var{attr}, int *)
@end deftypefun
@deftypefun int attribute_set_flags (attribute_t @var{attr}, int)
@deftypefun int mu_attribute_set_flags (mu_attribute_t @var{attr}, int)
@end deftypefun
@deftypefun int attribute_unset_flags (attribute_t @var{attr}, int)
@deftypefun int mu_attribute_unset_flags (mu_attribute_t @var{attr}, int)
@end deftypefun
@deftypefun int attribute_set_set_flags (attribute_t @var{attr}, int (*@var{_set_flags}) (attribute_t, int), void *)
@deftypefun int mu_attribute_set_set_flags (mu_attribute_t @var{attr}, int (*@var{_set_flags}) (mu_attribute_t, int), void *)
@end deftypefun
@deftypefun int attribute_set_unset_flags (attribute_t @var{attr}, int (*@var{_unset_flags}) (attribute_t, int), void *)
@deftypefun int mu_attribute_set_unset_flags (mu_attribute_t @var{attr}, int (*@var{_unset_flags}) (mu_attribute_t, int), void *)
@end deftypefun
@deftypefun int attribute_set_get_flags (attribute_t @var{attr}, int (*@var{_get_flags}) (attribute_t, int *), void *)
@deftypefun int mu_attribute_set_get_flags (mu_attribute_t @var{attr}, int (*@var{_get_flags}) (mu_attribute_t, int *), void *)
@end deftypefun
@c
@c ----------
@c
@deftypefun int attribute_is_equal (attribute_t @var{attr1}, attribute_t @var{attr2})
@deftypefun int mu_attribute_is_equal (mu_attribute_t @var{attr1}, mu_attribute_t @var{attr2})
@end deftypefun
@deftypefun int attribute_copy (attribute_t @var{dst}, attribute_t @var{src})
@deftypefun int mu_attribute_copy (mu_attribute_t @var{dst}, mu_attribute_t @var{src})
@end deftypefun
@deftypefun int attribute_to_string (attribute_t @var{attr}, char *@var{buf}, size_t @var{len}, size_t *@var{writen})
@deftypefun int mu_attribute_to_string (mu_attribute_t @var{attr}, char *@var{buf}, size_t @var{len}, size_t *@var{writen})
@end deftypefun
@deftypefun int string_to_flags (const char *@var{buf}, int *)
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{/* Prefixes @emph{authority_}, @emph{ticket_}, and @emph{wicket_} are reserved. */}
@code{/* Prefixes @emph{mu_authority_}, @emph{mu_ticket_}, and @emph{mu_wicket_} are reserved. */}
@code{#include <mailutils/auth.h>}
@end smallexample
There are many ways to authenticate to a server. To be flexible the
authentication process is provided by three objects @code{authority_t},
@code{ticket_t}, and @code{wicket_t}. The @code{authority_t} can implement
authentication process is provided by three objects @code{mu_authority_t},
@code{mu_ticket_t}, and @code{mu_wicket_t}. The @code{mu_authority_t} can implement
different protocol like APOP, MD5-AUTH, One Time Passwd, etc. By default
if a mailbox does not understand or know how to authenticate it falls back
to user/passwd authentication. The @code{ticket_t} is a way for
to user/passwd authentication. The @code{mu_ticket_t} is a way for
Mailboxes and Mailers provide a way to authenticate when the URL does not
contain enough information. The default action is to call the function
@code{authority_authenticate()} which will get the @emph{user} and @emph{passwd}
@code{mu_authority_authenticate()} which will get the @emph{user} and @emph{passwd}
if not set, this function can be overridden by a custom method.
@c
@c Ticket
@c
@deftypefun int ticket_create (ticket_t *, void *@var{owner})
@deftypefun int mu_ticket_create (mu_ticket_t *, void *@var{owner})
@end deftypefun
@deftypefun void ticket_destroy (ticket_t *, void *@var{owner})
@deftypefun void mu_ticket_destroy (mu_ticket_t *, void *@var{owner})
@end deftypefun
@deftypefun int ticket_set_destroy (ticket_t, void (*) (ticket_t), void *@var{owner})
@deftypefun int mu_ticket_set_destroy (mu_ticket_t, void (*) (mu_ticket_t), void *@var{owner})
@end deftypefun
@deftypefun void* ticket_get_owner (ticket_t)
@deftypefun void* mu_ticket_get_owner (mu_ticket_t)
@end deftypefun
@deftypefun int ticket_set_pop (ticket_t, int (*@var{_pop}) (ticket_t, url_t, const char *, char **), void *)
@deftypefun int mu_ticket_set_pop (mu_ticket_t, int (*@var{_pop}) (mu_ticket_t, url_t, const char *, char **), void *)
@end deftypefun
@deftypefun int ticket_pop (ticket_t, url_t, const char *, char **)
@deftypefun int mu_ticket_pop (mu_ticket_t, url_t, const char *, char **)
@end deftypefun
@deftypefun int ticket_set_data (ticket_t, void *, void *@var{owner})
@deftypefun int mu_ticket_set_data (mu_ticket_t, void *, void *@var{owner})
@end deftypefun
@deftypefun int ticket_get_data (ticket_t, void **)
@deftypefun int mu_ticket_get_data (mu_ticket_t, void **)
@end deftypefun
@c
......@@ -54,28 +54,28 @@ if not set, this function can be overridden by a custom method.
@sp 1
@deftypefun int authority_create (authority_t *, ticket_t, void *)
@deftypefun int mu_authority_create (mu_authority_t *, mu_ticket_t, void *)
@end deftypefun
@deftypefun void authority_destroy (authority_t *, void *)
@deftypefun void mu_authority_destroy (mu_authority_t *, void *)
@end deftypefun
@deftypefun void* authority_get_owner (authority_t)
@deftypefun void* mu_authority_get_owner (mu_authority_t)
@end deftypefun
@deftypefun int authority_set_ticket (authority_t, ticket_t)
@deftypefun int mu_authority_set_ticket (mu_authority_t, mu_ticket_t)
@end deftypefun
@deftypefun int authority_get_ticket (authority_t, ticket_t *)
@deftypefun int mu_authority_get_ticket (mu_authority_t, mu_ticket_t *)
@end deftypefun
@deftypefun int authority_authenticate (authority_t)
@deftypefun int mu_authority_authenticate (mu_authority_t)
@end deftypefun
@deftypefun int authority_set_authenticate (authority_t, int (*@var{_authenticate}) (authority_t), void *)
@deftypefun int mu_authority_set_authenticate (mu_authority_t, int (*@var{_authenticate}) (mu_authority_t), void *)
@end deftypefun
@deftypefun int authority_create_null (authority_t *@var{authority}, void *@var{owner})
@deftypefun int mu_authority_create_null (mu_authority_t *@var{authority}, void *@var{owner})
@end deftypefun
@c
......@@ -84,22 +84,22 @@ if not set, this function can be overridden by a custom method.
@sp 1
@deftypefun int wicket_create (wicket_t *, const char *)
@deftypefun int mu_wicket_create (mu_wicket_t *, const char *)
@end deftypefun
@deftypefun void wicket_destroy (wicket_t *)
@deftypefun void mu_wicket_destroy (mu_wicket_t *)
@end deftypefun
@deftypefun int wicket_set_filename (wicket_t, const char *)
@deftypefun int mu_wicket_set_filename (mu_wicket_t, const char *)
@end deftypefun
@deftypefun int wicket_get_filename (wicket_t, char *, size_t, size_t *)
@deftypefun int mu_wicket_get_filename (mu_wicket_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int wicket_set_ticket (wicket_t, int (*) (wicket_t, const char *, const char *, ticket_t *))
@deftypefun int mu_wicket_set_ticket (mu_wicket_t, int (*) (mu_wicket_t, const char *, const char *, mu_ticket_t *))
@end deftypefun
@deftypefun int wicket_get_ticket (wicket_t, ticket_t *, const char *, const char *)
@deftypefun int mu_wicket_get_ticket (mu_wicket_t, mu_ticket_t *, const char *, const char *)
@end deftypefun
@c
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{body_} is reserved. */}
@code{/* Prefix @emph{mu_body_} is reserved. */}
@code{#include <mailutils/body.h>}
@end smallexample
@deftypefun int body_create (body_t *@var{body}, void *@var{owner})
@deftypefun int mu_body_create (mu_body_t *@var{body}, void *@var{owner})
Initialize an object @var{body}.
@end deftypefun
@deftypefun void body_destroy (body_t *@var{body})
@deftypefun void mu_body_destroy (mu_body_t *@var{body})
The resources allocated are release.
@end deftypefun
@deftypefun void* body_get_owner (body_t @var{body})
@deftypefun void* mu_body_get_owner (mu_body_t @var{body})
@end deftypefun
@deftypefun int body_is_modified (body_t @var{body})
@deftypefun int mu_body_is_modified (mu_body_t @var{body})
@end deftypefun
@deftypefun int body_clear_modified (body_t @var{body})
@deftypefun int mu_body_clear_modified (mu_body_t @var{body})
@end deftypefun
@c
@c -----------
@c
@deftypefun int body_get_stream (body_t @var{body}, stream_t *@var{stream})
@deftypefun int mu_body_get_stream (mu_body_t @var{body}, stream_t *@var{stream})
@end deftypefun
@deftypefun int body_set_stream (body_t @var{body}, stream_t @var{stream}, void *@var{owner})
@deftypefun int mu_body_set_stream (mu_body_t @var{body}, stream_t @var{stream}, void *@var{owner})
@end deftypefun
@deftypefun int body_get_filename (body_t @var{body}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
@deftypefun int mu_body_get_filename (mu_body_t @var{body}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
@end deftypefun
@deftypefun int body_size (body_t @var{body}, size_t *@var{size})
@deftypefun int mu_body_size (mu_body_t @var{body}, size_t *@var{size})
@end deftypefun
@deftypefun int body_set_size (body_t @var{body}, int (*@var{_size}) (body_t, size_t *), void *@var{owner})
@deftypefun int mu_body_set_size (mu_body_t @var{body}, int (*@var{_size}) (mu_body_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int body_lines (body_t @var{body}, size_t *@var{lines})
@deftypefun int mu_body_lines (mu_body_t @var{body}, size_t *@var{lines})
@end deftypefun
@deftypefun int body_set_lines (body_t @var{body}, int (*@var{_lines}) (body_t, size_t *), void *@var{owner})
@deftypefun int mu_body_set_lines (mu_body_t @var{body}, int (*@var{_lines}) (mu_body_t, size_t *), void *@var{owner})
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{envelope_} is reserved. */}
@code{/* Prefix @emph{mu_envelope_} is reserved. */}
@code{#include <mailutils/envelope.h>}
@end smallexample
@deftypefun int envelope_create (envelope_t *, void *)
@deftypefun int mu_envelope_create (mu_envelope_t *, void *)
Primarily for internal use.
@end deftypefun
@deftypefun void envelope_destroy (envelope_t *, void *)
@deftypefun void mu_envelope_destroy (mu_envelope_t *, void *)
Primarily for internal use.
@end deftypefun
@deftypefun void* envelope_get_owner (envelope_t)
@deftypefun void* mu_envelope_get_owner (mu_envelope_t)
@end deftypefun
@c
@c ----------
@c
@deftypefun int envelope_sender (envelope_t, char *, size_t, size_t *)
@deftypefun int mu_envelope_sender (mu_envelope_t, char *, size_t, size_t *)
Get the address that this message was reportedly received from. This
would be the "mail from" argument if the message was delivered
or received via SMTP, for example.
@end deftypefun
@deftypefun int envelope_set_sender (envelope_t, int (*@var{_sender}) (envelope_t, char *, size_t, size_t *), void *)
Primarily for internal use. The implementation of @code{envelope_t} depends
@deftypefun int mu_envelope_set_sender (mu_envelope_t, int (*@var{_sender}) (mu_envelope_t, char *, size_t, size_t *), void *)
Primarily for internal use. The implementation of @code{mu_envelope_t} depends
on the mailbox type, this allows the function which actually gets
the sender to be set by the creator of an @code{envelope_t}.
the sender to be set by the creator of an @code{mu_envelope_t}.
@end deftypefun
@deftypefun int envelope_date (envelope_t, char *, size_t, size_t *)
@deftypefun int mu_envelope_date (mu_envelope_t, char *, size_t, size_t *)
Get the date that the message was delivered to the mailbox, in
something close to ANSI @code{ctime()} format: Mon Jul 05 13:08:27 1999.
@end deftypefun
@deftypefun int envelope_set_date (envelope_t, int (*@var{_date}) (envelope_t, char *, size_t, size_t *), void *)
Primarily for internal use. The implementation of @code{envelope_t} depends
@deftypefun int mu_envelope_set_date (mu_envelope_t, int (*@var{_date}) (mu_envelope_t, char *, size_t, size_t *), void *)
Primarily for internal use. The implementation of @code{mu_envelope_t} depends
on the mailbox type, this allows the function which actually gets
the date to be set by the creator of an @code{envelope_t}.
the date to be set by the creator of an @code{mu_envelope_t}.
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{folder_} is reserved. */}
@code{/* Prefix @emph{mu_folder_} is reserved. */}
@code{#include <mailutils/folder.h>}
@end smallexample
@smallexample
@group
folder_t url_t
-/var/mail- +---//--->/-----------------\ +-->/-----------\
( alain *-)-+ | | url_t *-|---+ | port |
---------- | | |-----------------+ | hostname |
( jakob *-)-+--+ | observer_t *-| | file |
---------- | |-----------------+ | ... |
( jeff *-)-+ | stream_t | \-----------/
---------- | |-----------------|
( sean *-)-+ | auth_t |
---------- |-----------------|
| mailbox_t(1) |
|-----------------|
| mailbox_t(2) |
mu_folder_t mu_url_t
-/var/mail- +---//--->/-------------------\ +-->/-----------\
( alain *-)-+ | | mu_url_t *-|---+ | port |
---------- | | |-------------------+ | hostname |
( jakob *-)-+--+ | mu_observer_t *-| | file |
---------- | |-------------------+ | ... |
( jeff *-)-+ | mu_stream_t | \-----------/
---------- | |-------------------|
( sean *-)-+ | mu_auth_t |
---------- |-------------------|
| mu_mailbox_t(1) |
|-------------------|
| mu_mailbox_t(2) |
| ...... |
| mailbox_t(n) |
| mu_mailbox_t(n) |
\-----------------/
@end group
@end smallexample
......@@ -34,18 +34,13 @@ Data structures:
@smallexample
@group
struct list_response
struct mu_list_response
@{
int type;
int separator;
char *name;
@};
struct folder_list
@{
struct list_response **element;
size_t num;
@};
@end group
@end smallexample
......@@ -53,85 +48,82 @@ struct folder_list
@c Constructor/Destructor and possible types.
@c
@deftypefun int folder_create (folder_t *, const char *@var{url})
@end deftypefun
@deftypefun void folder_destroy (folder_t *)
@deftypefun int mu_folder_create (mu_folder_t *, const char *@var{url})
@end deftypefun
@deftypefun int folder_open (folder_t, int @var{flag})
@deftypefun void mu_folder_destroy (mu_folder_t *)
@end deftypefun
@deftypefun int folder_close (folder_t)
@deftypefun int mu_folder_open (mu_folder_t, int @var{flag})
@end deftypefun
@deftypefun int folder_delete (folder_t, const char *@var{mailbox})
@deftypefun int mu_folder_close (mu_folder_t)
@end deftypefun
@deftypefun int folder_rename (folder_t, const char *, const char *@var{mailbox})
@deftypefun int mu_folder_delete (mu_folder_t, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_subscribe (folder_t, const char *@var{mailbox})
@deftypefun int mu_folder_rename (mu_folder_t, const char *, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_unsubscribe (folder_t, const char *@var{mailbox})
@deftypefun int mu_folder_subscribe (mu_folder_t, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_list (folder_t, const char *@var{ref}, const char *@var{wcard}, struct folder_list *)
@deftypefun int mu_folder_unsubscribe (mu_folder_t, const char *@var{mailbox})
@end deftypefun
@deftypefun int folder_lsub (folder_t, const char *@var{ref}, const char *@var{wcard}, struct folder_list *)
@deftypefun int mu_folder_list (mu_folder_t, const char *@var{ref}, const char *@var{wcard}, size_t @var{size}, mu_list_t *@var{list})
@end deftypefun
@deftypefun int folder_list_destroy (struct folder_list *)
@deftypefun int mu_folder_lsub (mu_folder_t, const char *@var{ref}, const char *@var{wcard}, mu_list_t *@var{list})
@end deftypefun
@c
@c Stream Settings.
@c
@deftypefun int folder_get_stream (folder_t, stream_t *)
@deftypefun int mu_folder_get_stream (mu_folder_t, mu_stream_t *)
@end deftypefun
@deftypefun int folder_set_stream (folder_t, stream_t)
@deftypefun int mu_folder_set_stream (mu_folder_t, mu_stream_t)
@end deftypefun
@c
@c Notifications.
@c
@deftypefun int folder_get_observable (folder_t, observable_t *)
@deftypefun int mu_folder_get_observable (mu_folder_t, mu_observable_t *)
@end deftypefun
@c
@c Debug.
@c
@deftypefun int folder_has_debug (folder_t)
@deftypefun int mu_folder_has_debug (mu_folder_t)
@end deftypefun
@deftypefun int folder_get_debug (folder_t, mu_debug_t *)
@deftypefun int mu_folder_get_debug (mu_folder_t, mu_debug_t *)
@end deftypefun
@deftypefun int folder_set_debug (folder_t, mu_debug_t)
@deftypefun int mu_folder_set_debug (mu_folder_t, mu_debug_t)
@end deftypefun
@c
@c Authentication.
@c
@deftypefun int folder_get_authority (folder_t, authority_t *)
@deftypefun int mu_folder_get_authority (mu_folder_t, mu_authority_t *)
@end deftypefun
@deftypefun int folder_set_authority (folder_t, authority_t)
@deftypefun int mu_folder_set_authority (mu_folder_t, mu_authority_t)
@end deftypefun
@c
@c URL.
@c
@deftypefun int folder_get_url (folder_t, url_t *)
@deftypefun int mu_folder_get_url (mu_folder_t, mu_url_t *)
@end deftypefun
@deftypefun int folder_set_url (folder_t, url_t)
@deftypefun int mu_folder_set_url (mu_folder_t, mu_url_t)
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -33,39 +33,39 @@ etc ..).
@smallexample
@group
folder_t url_t
-/var/mail- +- .. ->+-----------------+ +-->+------------+
( alain *-)-+ | | url_t *-|---+ | port |
---------- | | |-----------------| | hostname |
( jakob *-)-+--+ | auth_t *-|---+ | file |
---------- | |-----------------| | | ... |
( jeff *-)-+ | stream_t | | +------------+
---------- | |-----------------| |
( shaleh*-)-+ | ..... | | auth_t
---------- |-----------------| +-->+------------+
+---|-* mailbox_t[] | | ticket_t |
mailbox_t | +-----------------+ +------------+
+----------------+<-+
| locker_t *--|-------------+
|----------------| |
| url_t | | locker_t
|----------------| +-------->+---------+
| stream_t | | lock |
|----------------| | unlock |
| message_t[] *-|-------+ +---------+
+----------------+ | envelope_t
mu_folder_t mu_url_t
-/var/mail- +- .. ->+-------------------+ +-->+------------+
( alain *-)-+ | | mu_url_t *-|---+ | port |
---------- | | |-------------------| | hostname |
( jakob *-)-+--+ | mu_auth_t *-|---+ | file |
---------- | |-------------------| | | ... |
( jeff *-)-+ | mu_stream_t | | +------------+
---------- | |-------------------| |
( shaleh*-)-+ | ..... | | mu_auth_t
---------- |-------------------| +-->+-------------+
+---|-* mu_mailbox_t[] | | mu_ticket_t |
mu_mailbox_t | +-------------------+ +-------------+
+-------------------+
| mu_locker_t *--|-------------+
|-------------------| |
| mu_url_t | | mu_locker_t
|-------------------| +-------->+---------+
| mu_stream_t | | lock |
|-------------------| | unlock |
| mu_message_t[] *-|-------+ +---------+
+-------------------+ | mu_envelope_t
| +-------->+-----------+
message_t | | | date |
+----------------+<------+ | | from |
| envelope_t *-|------------------+ | to |
|----------------| header_t +-----------+
| header_t *-|------------>+--------------+
|----------------| | stream_t |
| body_t *-|----+ +--------------+
+----------------+ | body_t
+-->+--------------+
| stream_t |
+--------------+
mu_message_t | | | date |
+-------------------+<------+ | | from |
| mu_envelope_t *-|------------------+ | to |
|-------------------| mu_header_t +-----------+
| mu_header_t *-|------------>+-----------------+
|-------------------| | mu_stream_t |
| mu_body_t *-|----+ +-----------------+
+-------------------+ | mu_body_t
+-->+-----------------+
| mu_stream_t |
+-----------------+
@end group
@end smallexample
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{header_} is reserved. */}
@code{/* Prefix @emph{mu_header_} is reserved. */}
@code{#include <mailutils/header.h>}
@end smallexample
......@@ -12,29 +12,29 @@
So far we plan support for RFC822 and plan for RFC1522. With RFC1522 non-ASCII
characters will be encoded.
@deftypefun int header_create (header_t *@var{hdr}, const char *@var{blurb}, size_t @var{len}, void *@var{owner})
@deftypefun int mu_header_create (mu_header_t *@var{hdr}, const char *@var{blurb}, size_t @var{len}, void *@var{owner})
Initialize a @var{hdr} to a supported type. If @var{blurb} is not @code{NULL},
it is parsed.
@end deftypefun
@deftypefun void header_destroy (header_t *@var{hdr}, void *@var{owner})
@deftypefun void mu_header_destroy (mu_header_t *@var{hdr}, void *@var{owner})
The resources allocated for @var{hdr} are freed.
@end deftypefun
@deftypefun void* header_get_owner (header_t *@var{hdr})
@deftypefun void* mu_header_get_owner (mu_header_t *@var{hdr})
@end deftypefun
@deftypefun int header_is_modified (header_t @var{hdr})
@deftypefun int mu_header_is_modified (mu_header_t @var{hdr})
@end deftypefun
@deftypefun int header_clear_modified (header_t @var{hdr})
@deftypefun int mu_header_clear_modified (mu_header_t @var{hdr})
@end deftypefun
@c
@c Set and get field values by field name.
@c
@deftypefun int header_set_value (header_t @var{hdr}, const char *@var{fn}, const char *@var{fv}, int @var{n})
@deftypefun int mu_header_set_value (mu_header_t @var{hdr}, const char *@var{fn}, const char *@var{fv}, int @var{n})
Some basic macros are already provided for RFC822.
......@@ -128,12 +128,12 @@ Envelope-to
@end table
@end deftypefun
@deftypefun int header_get_value (header_t @var{hdr}, const char *@var{fn}, char *@var{fv}, size_t @var{len}, size_t *@var{n})
@deftypefun int mu_header_get_value (mu_header_t @var{hdr}, const char *@var{fn}, char *@var{fv}, size_t @var{len}, size_t *@var{n})
Value of field-name @var{fn} is returned in buffer @var{fv} of size @var{len}.
The number of bytes written is put in @var{n}.
@end deftypefun
@deftypefun int header_aget_value (header_t @var{hdr}, const char *@var{fn}, char **@var{fv})
@deftypefun int mu_header_aget_value (mu_header_t @var{hdr}, const char *@var{fn}, char **@var{fv})
The value is allocated.
@end deftypefun
......@@ -141,70 +141,70 @@ The value is allocated.
@c Get field values as an address_t.
@c
@deftypefun int header_get_address (header_t @var{hdr}, const char *@var{buf}, address_t *@var{addr})
@deftypefun int mu_header_get_address (mu_header_t @var{hdr}, const char *@var{buf}, address_t *@var{addr})
@end deftypefun
@c
@c Stream
@c
@deftypefun int header_get_stream (header_t @var{hdr}, stream_t *@var{stream})
@deftypefun int mu_header_get_stream (mu_header_t @var{hdr}, stream_t *@var{stream})
@end deftypefun
@deftypefun int header_set_stream (header_t @var{hdr}, stream_t @var{stream}, void *)
@deftypefun int mu_header_set_stream (mu_header_t @var{hdr}, stream_t @var{stream}, void *)
@end deftypefun
@c
@c
@c
@deftypefun int header_get_field_count (header_t @var{hdr}, size_t *@var{count})
@deftypefun int mu_header_get_field_count (mu_header_t @var{hdr}, size_t *@var{count})
@end deftypefun
@deftypefun int header_get_field_value (header_t @var{hdr}, size_t @var{index}, char *, size_t, size_t *)
@deftypefun int mu_header_get_field_value (mu_header_t @var{hdr}, size_t @var{index}, char *, size_t, size_t *)
@end deftypefun
@deftypefun int header_get_field_name (header_t @var{hdr}, size_t @var{index}, char *, size_t, size_t *)
@deftypefun int mu_header_get_field_name (mu_header_t @var{hdr}, size_t @var{index}, char *, size_t, size_t *)
@end deftypefun
@deftypefun int header_aget_field_value (header_t @var{hdr}, size_t @var{index}, char **)
@deftypefun int mu_header_aget_field_value (mu_header_t @var{hdr}, size_t @var{index}, char **)
@end deftypefun
@deftypefun int header_aget_field_name (header_t @var{hdr}, size_t @var{index}, char **)
@deftypefun int mu_header_aget_field_name (mu_header_t @var{hdr}, size_t @var{index}, char **)
@end deftypefun
@deftypefun int header_get_value_unfold (header_t @var{hdr}, const char *@var{name}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{n})
@deftypefun int mu_header_get_value_unfold (mu_header_t @var{hdr}, const char *@var{name}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{n})
@end deftypefun
@deftypefun int header_aget_value_unfold (header_t @var{hdr}, const char *@var{name}, char **@var{value})
@deftypefun int mu_header_aget_value_unfold (mu_header_t @var{hdr}, const char *@var{name}, char **@var{value})
@end deftypefun
@deftypefun int header_get_field_value_unfold (header_t @var{hdr}, size_t @var{num}, char *@var{buf}, size_t @var{buflen}, size_t *@var{nwritten})
@deftypefun int mu_header_get_field_value_unfold (mu_header_t @var{hdr}, size_t @var{num}, char *@var{buf}, size_t @var{buflen}, size_t *@var{nwritten})
@end deftypefun
@deftypefun int header_aget_field_value_unfold (header_t @var{hdr}, size_t @var{num}, char **@var{value});
@deftypefun int mu_header_aget_field_value_unfold (mu_header_t @var{hdr}, size_t @var{num}, char **@var{value});
@end deftypefun
@deftypefun int header_size (header_t @var{hdr}, size_t *);
@deftypefun int mu_header_size (mu_header_t @var{hdr}, size_t *);
@end deftypefun
@deftypefun int header_lines (header_t @var{hdr}, size_t *);
@deftypefun int mu_header_lines (mu_header_t @var{hdr}, size_t *);
@end deftypefun
@deftypefun int header_set_set_value (header_t @var{hdr}, int (*@var{_set_value}) (header_t, const char *, const char *, int), void *);
@deftypefun int mu_header_set_set_value (mu_header_t @var{hdr}, int (*@var{_set_value}) (mu_header_t, const char *, const char *, int), void *);
@end deftypefun
@deftypefun int header_set_get_value (header_t @var{hdr}, int (*@var{_get_value}) (header_t, const char *, char *, size_t, size_t *), void *);
@deftypefun int mu_header_set_get_value (mu_header_t @var{hdr}, int (*@var{_get_value}) (mu_header_t, const char *, char *, size_t, size_t *), void *);
@end deftypefun
@deftypefun int header_set_get_fvalue (header_t @var{hdr}, int (*@var{_get_value}) (header_t, const char *, char *, size_t, size_t *), void *);
@deftypefun int mu_header_set_get_fvalue (mu_header_t @var{hdr}, int (*@var{_get_value}) (mu_header_t, const char *, char *, size_t, size_t *), void *);
@end deftypefun
@deftypefun int header_set_size (header_t @var{hdr}, int (*@var{_size}) (header_t, size_t *), void *);
@deftypefun int mu_header_set_size (mu_header_t @var{hdr}, int (*@var{_size}) (mu_header_t, size_t *), void *);
@end deftypefun
@deftypefun int header_set_lines (header_t @var{hdr}, int (*@var{_lines}) (header_t, size_t *), void *);
@deftypefun int mu_header_set_lines (mu_header_t @var{hdr}, int (*@var{_lines}) (mu_header_t, size_t *), void *);
@end deftypefun
@deftypefun int header_set_fill (header_t @var{hdr}, int (*@var{_fill}) (header_t, char *, size_t, off_t, size_t *), void *@var{owner});
@deftypefun int mu_header_set_fill (mu_header_t @var{hdr}, int (*@var{_fill}) (mu_header_t, char *, size_t, mu_off_t, size_t *), void *@var{owner});
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
@smallexample
@code{/* Prefix @emph{imap4_} is reserved */}
@code{/* Prefix @emph{mu_imap4_} is reserved */}
@code{#include <mailutils/imap4.h>}
@end smallexample
......@@ -20,155 +21,155 @@ request. Untagged responses, for historical reasons are also call
@subsubsection Initialization
@cindex IMAP4 Initialization
@deftypefun int imap4_create (imap4_t *)
@deftypefun int mu_imap4_create (mu_imap4_t *)
@end deftypefun
@deftypefun int imap4_open (imap4_t, const char *@var{hostname}, unsigned int @var{port}, int @var{flags})
@deftypefun int mu_imap4_open (mu_imap4_t, const char *@var{hostname}, unsigned int @var{port}, int @var{flags})
@end deftypefun
@deftypefun int imap4d_set_timeout (imap4_t, unsigned int @var{seconds})
@deftypefun int imap4d_set_timeout (mu_imap4_t, unsigned int @var{seconds})
@end deftypefun
@subsubsection Append
@cindex IMAP4 Append
@deftypefun int imap4_append (imap4_t)
@deftypefun int mu_imap4_append (mu_imap4_t)
@end deftypefun
@subsubsection Capability
@cindex IMAP4 Capability
@deftypefun int imap4_capability (imap4_t)
@deftypefun int mu_imap4_capability (mu_imap4_t)
@end deftypefun
@subsubsection Create
@cindex IMAP4 Create
@deftypefun int imap4_create_mailbox (imap4_t, const char *@var{mbox})
@deftypefun int mu_imap4_create_mailbox (mu_imap4_t, const char *@var{mbox})
@end deftypefun
@subsubsection Check
@cindex IMAP4 Check
@deftypefun int imap4_check (imap4_t)
@deftypefun int mu_imap4_check (mu_imap4_t)
@end deftypefun
@subsubsection Close
@cindex IMAP4 Close
@deftypefun int imap4_close (imap4_t)
@deftypefun int mu_imap4_close (mu_imap4_t)
@end deftypefun
@subsubsection Copy
@cindex IMAP4 Copy
@deftypefun int imap4_copy (imap4_t)
@deftypefun int mu_imap4_copy (mu_imap4_t)
@end deftypefun
@subsubsection UID Copy
@cindex IMAP4 UID Copy
@deftypefun int imap4_uid_copy (imap4_t)
@deftypefun int mu_imap4_uid_copy (mu_imap4_t)
@end deftypefun
@subsubsection Delete
@cindex IMAP4 Delete
@deftypefun int imap4_delete (imap4_t)
@deftypefun int mu_imap4_delete (mu_imap4_t)
@end deftypefun
@subsubsection Fetch
@cindex IMAP4 Fetch
@deftypefun int imap4_fetch (imap4_t)
@deftypefun int mu_imap4_fetch (mu_imap4_t)
@end deftypefun
@subsubsection UID Fetch
@cindex IMAP4 UID Fetch
@deftypefun int imap4_uid_fetch (imap4_t)
@deftypefun int mu_imap4_uid_fetch (mu_imap4_t)
@end deftypefun
@subsubsection Examine
@cindex IMAP4 Examine
@deftypefun int imap4_examine (imap4_t)
@deftypefun int mu_imap4_examine (mu_imap4_t)
@end deftypefun
@subsubsection Expunge
@cindex IMAP4 Expunge
@deftypefun int imap4_expunge (imap4_t)
@deftypefun int mu_imap4_expunge (mu_imap4_t)
@end deftypefun
@subsubsection List
@cindex IMAP4 List
@deftypefun int imap4_list (imap4_t)
@deftypefun int mu_imap4_list (mu_imap4_t)
@end deftypefun
@subsubsection Lsub
@cindex IMAP4 Lsub
@deftypefun int imap4_lsub (imap4_t)
@deftypefun int mu_imap4_lsub (mu_imap4_t)
@end deftypefun
@subsubsection Namespace
@cindex IMAP4 Namespace
@deftypefun int imap4_namespace (imap4_t)
@deftypefun int mu_imap4_namespace (mu_imap4_t)
@end deftypefun
@subsubsection Rename
@cindex IMAP4 Rename
@deftypefun int imap4_rename (imap4_t)
@deftypefun int mu_imap4_rename (mu_imap4_t)
@end deftypefun
@subsubsection Search
@cindex IMAP4 Search
@deftypefun int imap4_search (imap4_t)
@deftypefun int mu_imap4_search (mu_imap4_t)
@end deftypefun
@subsubsection UID Search
@cindex IMAP4 UID Search
@deftypefun int imap4_uid_search (imap4_t)
@deftypefun int mu_imap4_uid_search (mu_imap4_t)
@end deftypefun
@subsubsection Select
@cindex IMAP4 Select
@deftypefun int imap4_select (imap4_t)
@deftypefun int mu_imap4_select (mu_imap4_t)
@end deftypefun
@subsubsection Status
@cindex IMAP4 Status
@deftypefun int imap4_status (imap4_t)
@deftypefun int mu_imap4_status (mu_imap4_t)
@end deftypefun
@subsubsection Store
@cindex IMAP4 Store
@deftypefun int imap4_store (imap4_t)
@deftypefun int mu_imap4_store (mu_imap4_t)
@end deftypefun
@subsubsection UID Store
@cindex IMAP4 UID Store
@deftypefun int imap4_uid_store (imap4_t)
@deftypefun int mu_imap4_uid_store (mu_imap4_t)
@end deftypefun
@subsubsection Subscribe
@cindex IMAP4 Subscribe
@deftypefun int imap4_subscribe (imap4_t)
@deftypefun int mu_imap4_subscribe (mu_imap4_t)
@end deftypefun
@subsubsection Unsubscribe
@cindex IMAP4 Unsubscribe
@deftypefun int imap4_unsubscribe (imap4_t)
@deftypefun int mu_imap4_unsubscribe (mu_imap4_t)
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
@smallexample
@code{/* Prefix @emph{iterator_} is reserved. */}
@code{/* Prefix @emph{mu_iterator_} is reserved. */}
@code{#include <mailutils/iterator.h>}
@end smallexample
@deftypefun int iterator_create (iterator_t *@var{iterator}, list_t)
@deftypefun int mu_iterator_create (mu_iterator_t *@var{iterator}, void *@var{obj})
@end deftypefun
@deftypefun int iterator_dup (iterator_t *@var{iterator}, iterator_t @var{orig})
@deftypefun int mu_iterator_dup (mu_iterator_t *@var{iterator}, mu_iterator_t @var{orig})
@end deftypefun
@deftypefun void iterator_destroy (iterator_t *)
@deftypefun void mu_iterator_destroy (mu_iterator_t *)
@end deftypefun
@deftypefun int iterator_first (iterator_t)
@deftypefun int mu_iterator_first (mu_iterator_t)
@end deftypefun
@deftypefun int iterator_next (iterator_t)
@deftypefun int mu_iterator_next (mu_iterator_t)
@end deftypefun
@deftypefun int iterator_current (iterator_t, void **@var{item})
@deftypefun int mu_iterator_current (mu_iterator_t, void **@var{item})
@end deftypefun
@deftypefun int iterator_is_done (iterator_t)
@deftypefun int mu_iterator_is_done (mu_iterator_t)
@end deftypefun
@deftypefun int iterator_get_list (iterator_t @var{iterator}, list_t *@var{list})
@deftypefun int mu_iterator_attach (mu_iterator_t *@var{root}, mu_iterator_t @var{iterator})
@end deftypefun
@deftypefun int mu_iterator_detach (mu_iterator_t *@var{root}, mu_iterator_t @var{iterator})
@end deftypefun
@deftypefun void mu_iterator_advance (mu_iterator_t @var{iterator}, void *@var{item})
@end deftypefun
@deftypefun int mu_iterator_set_first (mu_iterator_t @var{iterator}, int (*@var{first}) (void *))
@end deftypefun
@deftypefun int mu_iterator_set_next (mu_iterator_t @var{iterator}, int (*@var{next}) (void *))
@end deftypefun
@deftypefun int mu_iterator_set_getitem (mu_iterator_t @var{iterator}, int (*@var{getitem}) (void *, void **))
@end deftypefun
@deftypefun int mu_iterator_set_finished_p (mu_iterator_t @var{iterator}, int (*@var{finished_p}) (void *))
@end deftypefun
@deftypefun int mu_iterator_set_dup (mu_iterator_t @var{itr}, int (*@var{dup}) (void **@var{ptr}, void *@var{data}))
@end deftypefun
@deftypefun int mu_iterator_set_destroy (mu_iterator_t @var{itr}, int (*@var{destroy}) (mu_iterator_t @var{itr}, void *@var{data}))
@end deftypefun
@deftypefun int mu_iterator_set_curitem_p (mu_iterator_t @var{itr}, int (*@var{curitem_p}) (void *, void *))
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -17,7 +17,7 @@ The following is a typical scenario of using @code{libsieve}:
@enumerate
@item Application program creates the instance of sieve machine.
@item Then @code{sieve_compile} function is called to translate
@item Then @code{mu_sieve_compile} function is called to translate
the Sieve source into an equivalent program executable by the
Machine
......@@ -62,7 +62,7 @@ It is created by @code{sieve_machine_create()} and destroyed by
type are described in @ref{Manipulating the Sieve Machine}.
@end deftp
@deftp {Data Type} sieve_data_type
@deftp {Data Type} mu_sieve_data_type
This enumeration keeps the possible types of sieve data. These are:
@table @code
......@@ -76,38 +76,40 @@ Numeric type.
Character string.
@item SVT_STRING_LIST
A @code{list_t}. Each item in this list represents a character string.
A @code{mu_list_t}. Each item in this list represents a character string.
@item SVT_TAG
A sieve tag. See @code{sieve_runtime_tag_t} below.
A sieve tag. See @code{mu_sieve_runtime_tag_t} below.
@item SVT_IDENT
A character string representing an identifier.
@item SVT_VALUE_LIST
A @code{list_t}. Each item in this list is of @code{sieve_value_t}.
A @code{mu_list_t}. Each item in this list is of @code{mu_sieve_value_t} type.
@item SVT_POINTER
An opaque pointer.
@end table
@end deftp
@deftp {Data Type} sieve_value_t
The @code{sieve_value_t} keeps an instance of sieve data. It is defined
@deftp {Data Type} mu_sieve_value_t
The @code{mu_sieve_value_t} keeps an instance of sieve data. It is defined
as follows:
@smallexample
@group
typedef struct @{
sieve_data_type type; /* Type of the data */
typedef struct
@{
mu_sieve_data_type type; /* Type of the data */
union @{
char *string; /* String value or identifier */
size_t number; /* Numeric value */
list_t list; /* List value */
sieve_runtime_tag_t *tag; /* Tag value */
mu_list_t list; /* List value */
mu_sieve_runtime_tag_t *tag; /* Tag value */
void *ptr; /* Pointer value */
@} v;
@} sieve_value_t;
@}
mu_sieve_value_t;
@end group
@end smallexample
......@@ -140,16 +142,18 @@ The data are pointed to by @code{ptr} member.
@end deftp
@deftp {Data Type} sieve_tag_def_t
@deftp {Data Type} mu_sieve_tag_def_t
This structure represents a definition of a tagged (optional) argument
to a sieve action or test. It is defined as follows:
@smallexample
@group
typedef struct @{
typedef struct
@{
char *name; /* Tag name */
sieve_data_type argtype; /* Type of tag argument. */
@} sieve_tag_def_t;
mu_sieve_data_type argtype; /* Type of tag argument. */
@}
mu_sieve_tag_def_t;
@end group
@end smallexample
......@@ -158,15 +162,16 @@ colon}. The @code{argtype} is set to @code{SVT_VOID} if the tag does
not take argument, or to the type of the argument otherwise.
@end deftp
@deftp {Data Type} sieve_runtime_tag_t
@deftp {Data Type} mu_sieve_runtime_tag_t
This structure represents the tagged (optional) argument at a runtime.
It is defined as:
@smallexample
@group
struct sieve_runtime_tag @{
struct mu_sieve_runtime_tag
@{
char *tag; /* Tag name */
sieve_value_t *arg; /* Tag argument (if any) */
mu_sieve_value_t *arg; /* Tag argument (if any) */
@};
@end group
@end smallexample
......@@ -174,13 +179,29 @@ struct sieve_runtime_tag @{
The @code{arg} member is @code{NULL} if the tag does not take an argument.
@end deftp
@deftp {Data Type} sieve_handler_t
@deftp {Data Type} mu_sieve_locus_t
Objects of this type represent a location in the Sieve source file:
@smallexample
@group
typedef struct
@{
const char *source_file;
size_t source_line;
@}
mu_sieve_locus_t;
@end group
@end smallexample
@end deftp
@deftp {Data Type} mu_sieve_handler_t
This is a pointer to function handler for a sieve action or test.
It is defined as follows:
@smallexample
typedef int (*sieve_handler_t) (sieve_machine_t @var{mach},
list_t @var{args}, list_t @var{tags});
typedef int (*mu_sieve_handler_t) (mu_sieve_machine_t @var{mach},
mu_list_t @var{args},
mu_list_t @var{tags});
@end smallexample
The arguments to the handler have the following meaning:
......@@ -195,16 +216,17 @@ A list of optional arguments (tags).
@end table
@end deftp
@deftp {Data Type} sieve_printf_t
@deftp {Data Type} mu_sieve_printf_t
A pointer to a diagnostic output function. It is defined as follows:
@smallexample
typedef int (*sieve_printf_t) (void *@var{data}, const char *@var{fmt}, va_list @var{ap});
typedef int (*mu_sieve_printf_t) (void *@var{data},
const char *@var{fmt}, va_list @var{ap});
@end smallexample
@table @var
@item data
A pointer to application specific data. These data are passed as
second argument to @code{sieve_machine_init()}.
second argument to @code{mu_sieve_machine_init()}.
@item fmt
Printf-like format string.
@item ap
......@@ -212,12 +234,14 @@ Other arguments.
@end table
@end deftp
@deftp {Data Type} sieve_parse_error_t
@deftp {Data Type} mu_sieve_parse_error_t
This data type is declared as follows:
@smallexample
typedef int (*sieve_parse_error_t) (void *@var{data},
const char *@var{filename}, int @var{lineno},
const char *@var{fmt}, va_list @var{ap});
typedef int (*mu_sieve_parse_error_t) (void *@var{data},
const char *@var{filename},
int @var{lineno},
const char *@var{fmt},
va_list @var{ap});
@end smallexample
It is used to declare error handlers for parsing errors. The
......@@ -227,21 +251,26 @@ of the error in the source text, while @var{fmt} and @var{ap} give
verbose description of the error.
@end deftp
@deftp {Data Type} sieve_action_log_t
@deftp {Data Type} mu_sieve_action_log_t
A pointer to the application-specific logging function:
@smallexample
typedef void (*sieve_action_log_t) (void *@var{data},
const char *@var{script},
size_t @var{msgno}, message_t @var{msg},
typedef void (*mu_sieve_action_log_t) (void *@var{data},
const mu_sieve_locus_t *@var{locus},
size_t @var{msgno},
mu_message_t @var{msg},
const char *@var{action},
const char *@var{fmt}, va_list @var{ap});
const char *@var{fmt},
va_list @var{ap});
@end smallexample
@table @var
@item data
Application-specific data.
@item locus
Location in the Sieve source file.
@item script
Name of the sieve script being executed.
......@@ -261,17 +290,17 @@ These two arguments give the detailed description of the action.
@end table
@end deftp
@deftp {Data Type} sieve_relcmp_t
@deftpx {Data Type} sieve_relcmpn_t
@deftp {Data Type} mu_sieve_relcmp_t
@deftpx {Data Type} mu_sieve_relcmpn_t
@smallexample
typedef int (*sieve_relcmp_t) (int, int);
typedef int (*sieve_relcmpn_t) (size_t, size_t);
typedef int (*mu_sieve_relcmp_t) (int, int);
typedef int (*mu_sieve_relcmpn_t) (size_t, size_t);
@end smallexample
@end deftp
@deftp {Data Type} sieve_comparator_t
@deftp {Data Type} mu_sieve_comparator_t
@smallexample
typedef int (*sieve_comparator_t) (const char *, const char *);
typedef int (*mu_sieve_comparator_t) (const char *, const char *);
@end smallexample
A pointer to the comparator handler function. The function compares
......@@ -281,31 +310,31 @@ in comparison with most standard libc functions like @code{stcmp()}, etc.
@end deftp
@deftp {Data Type} sieve_retrieve_t
@deftp {Data Type} mu_sieve_retrieve_t
@smallexample
typedef int (*sieve_retrieve_t) (void *item, void *data, int idx,
typedef int (*mu_sieve_retrieve_t) (void *item, void *data, int idx,
char **pval);
@end smallexample
A pointer to generic retriever function. See description of
@code{sieve_vlist_compare()} for details of its usage.
@code{mu_sieve_vlist_compare()} for details of its usage.
@end deftp
@deftp {Data Type} sieve_destructor_t
@deftp {Data Type} mu_sieve_destructor_t
@smallexample
typedef void (*sieve_destructor_t) (void *data);
typedef void (*mu_sieve_destructor_t) (void *data);
@end smallexample
A pointer to destructor function. The function frees any resources
associated with @code{data}. See the description of
@code{sieve_machine_add_destructor()} for more information.
@code{mu_sieve_machine_add_destructor()} for more information.
@end deftp
@deftp {Data Type} sieve_tag_checker_t
@deftp {Data Type} mu_sieve_tag_checker_t
@smallexample
typedef int (*sieve_tag_checker_t) (const char *@var{name},
list_t @var{tags},
list_t @var{args})
typedef int (*mu_sieve_tag_checker_t) (const char *@var{name},
mu_list_t @var{tags},
mu_list_t @var{args})
@end smallexample
A pointer to tag checker function. The purpose of the function is to
......@@ -316,10 +345,10 @@ perform compilation-time consistency test on tags. Its arguments are:
Name of the test or action whose tags are being checked.
@item tags
A list of @code{sieve_runtime_tag_t} representing tags.
A list of @code{mu_sieve_runtime_tag_t} representing tags.
@item args
A list of @code{sieve_value_t} representing required arguments to
A list of @code{mu_sieve_value_t} representing required arguments to
@var{name}.
@end table
......@@ -336,32 +365,32 @@ case. [FIXME: describe how to do that]
This subsection describes functions used to create an instance of the
sieve machine, read or alter its internal fields and destroy it.
@deftypefun int sieve_machine_init (sieve_machine_t *@var{mach}, void *@var{data})
@deftypefun int mu_sieve_machine_init (mu_sieve_machine_t *@var{mach}, void *@var{data})
The @code{sieve_machine_init()} function creates an instance of a sieve
The @code{mu_sieve_machine_init()} function creates an instance of a sieve
machine. A pointer to the instance itself is returned in the argument
@var{mach}. The user-specific data to be associated with the new machine
are passed in @var{data} argument. The function returns 0 on success,
non-zero error code otherwise,
@end deftypefun
@deftypefun void sieve_machine_destroy (sieve_machine_t *@var{pmach})
@deftypefun void mu_sieve_machine_destroy (mu_sieve_machine_t *@var{pmach})
This function destroys the instance of sieve machine pointed to by
@var{mach} parameter. After execution of @code{sieve_machine_destroy()}
@var{mach} parameter. After execution of @code{mu_sieve_machine_destroy()}
@var{pmach} contains @code{NULL}. The destructors registered with
@code{sieve_machine_add_destructor()} are executed in @sc{lifo}
@code{mu_sieve_machine_add_destructor()} are executed in @sc{lifo}
order.
@end deftypefun
@deftypefun int sieve_machine_add_destructor (sieve_machine_t @var{mach}, sieve_destructor_t @var{destr}, void *@var{ptr});
@deftypefun int mu_sieve_machine_add_destructor (mu_sieve_machine_t @var{mach}, mu_sieve_destructor_t @var{destr}, void *@var{ptr});
This function registers a destructor function @var{dest}. The purpose
of the destructor is to free any resources associated with the item
@var{ptr}. The destructor function takes a single argument --- a
pointer to the data being destroyed. All registered destructors are
called in reverse order upon execution of
@code{sieve_machine_destroy()}. Here's a short example of the use
@code{mu_sieve_machine_destroy()}. Here's a short example of the use
of this function:
@smallexample
......@@ -378,9 +407,9 @@ match_part_checker (const char *name, list_t tags, list_t args)
regex_t *regex;
/* Initialise the regex: */
regex = sieve_malloc (mach, sizeof (*regex));
regex = mu_sieve_malloc (mach, sizeof (*regex));
/* Make sure it will be freed when necessary */
sieve_machine_add_destructor (sieve_machine, free_regex, regex);
mu_sieve_machine_add_destructor (sieve_machine, free_regex, regex);
.
.
.
......@@ -389,34 +418,39 @@ match_part_checker (const char *name, list_t tags, list_t args)
@end smallexample
@end deftypefun
@deftypefun void* sieve_get_data (sieve_machine_t @var{mach})
@deftypefun {void *} mu_sieve_get_data (mu_sieve_machine_t @var{mach})
This function returns the application-specific data associated with
the instance of sieve machine. See @code{sieve_machine_init()}.
the instance of sieve machine. See @code{mu_sieve_machine_init()}.
@end deftypefun
@deftypefun message_t sieve_get_message (sieve_machine_t @var{mach})
@deftypefun mu_message_t mu_sieve_get_message (mu_sieve_machine_t @var{mach})
This function returns the current message.
@end deftypefun
@deftypefun size_t sieve_get_message_num (sieve_machine_t @var{mach})
@deftypefun size_t mu_sieve_get_message_num (mu_sieve_machine_t @var{mach})
This function returns the current message number in the mailbox.
If there are no mailbox, i.e. the execution of the sieve code is started
with @code{sieve_message}, this function returns 1.
with @code{mu_sieve_message}, this function returns 1.
@end deftypefun
@deftypefun int sieve_get_debug_level (sieve_machine_t @var{mach})
@deftypefun int mu_sieve_get_debug_level (mu_sieve_machine_t @var{mach})
Returns the debug level set for this instance of sieve machine.
@end deftypefun
@deftypefun ticket_t sieve_get_ticket (sieve_machine_t @var{mach})
@deftypefun mu_ticket_t mu_sieve_get_ticket (mu_sieve_machine_t @var{mach})
Returns the authentication ticket for this machine.
@end deftypefun
@deftypefun mailer_t sieve_get_mailer (sieve_machine_t @var{mach})
@deftypefun mu_mailer_t mu_sieve_get_mailer (mu_sieve_machine_t @var{mach})
Returns the mailer.
@end deftypefun
@deftypefun {char *} sieve_get_daemon_email (sieve_machine_t @var{mach})
@deftypefun int mu_sieve_get_locus (mu_sieve_machine_t @var{mach}, mu_sieve_locus_t *@var{locus})
Returns the locus in the Sieve source file corresponding to the code pointer
where the Sieve machine currently is.
@end deftypefun
@deftypefun {char *} mu_sieve_get_daemon_email (mu_sieve_machine_t @var{mach})
This function returns the @dfn{daemon email} associated with this
instance of sieve machine. The daemon email is an email address used in
envelope from addresses of automatic reply messages. By default its local
......@@ -424,7 +458,7 @@ part is @samp{<MAILER-DAEMON>} and the domain part is the machine name.
@end deftypefun
@deftypefun void sieve_set_error (sieve_machine_t @var{mach}, sieve_printf_t @var{error_printer})
@deftypefun void mu_sieve_set_error (mu_sieve_machine_t @var{mach}, mu_sieve_printf_t @var{error_printer})
This function sets the error printer function for the machine. If it is
not set, the default error printer will be used. It is defined as
follows:
......@@ -439,7 +473,7 @@ _sieve_default_error_printer (void *unused, const char *fmt,
@end smallexample
@end deftypefun
@deftypefun void sieve_set_parse_error (sieve_machine_t @var{mach}, sieve_parse_error_t @var{p})
@deftypefun void mu_sieve_set_parse_error (mu_sieve_machine_t @var{mach}, mu_sieve_parse_error_t @var{p})
This function sets the parse error printer function for the machine. If it is
not set, the default parse error printer will be used. It is defined as
follows:
......@@ -461,13 +495,13 @@ _sieve_default_parse_error (void *unused,
@end smallexample
@end deftypefun
@deftypefun void sieve_set_debug (sieve_machine_t @var{mach}, sieve_printf_t @var{debug});
@deftypefun void mu_sieve_set_debug (mu_sieve_machine_t @var{mach}, mu_sieve_printf_t @var{debug});
This function sets the debug printer function for the machine. If it is
not set, the default debug printer is @code{NULL} which means no
debugging information will be displayed.
@end deftypefun
@deftypefun void sieve_set_debug_level (sieve_machine_t @var{mach}, mu_debug_t @var{dbg}, int @var{level})
@deftypefun void mu_sieve_set_debug_level (mu_sieve_machine_t @var{mach}, mu_debug_t @var{dbg}, int @var{level})
This function sets the debug level for the given instance of sieve
machine. The @var{dbg} argument is the @code{mu_debug_t} object to be
used with mailutils library, the @var{level} argument specifies the
......@@ -489,33 +523,33 @@ Do not executed the actions, only show what would have been done.
@end table
@end deftypefun
@deftypefun void sieve_set_logger (sieve_machine_t @var{mach}, sieve_action_log_t @var{logger})
@deftypefun void mu_sieve_set_logger (mu_sieve_machine_t @var{mach}, mu_sieve_action_log_t @var{logger})
This function sets the logger function. By default the logger function
is @code{NULL}, which means that the executed actions are not logged.
@end deftypefun
@deftypefun void sieve_set_ticket (sieve_machine_t @var{mach}, ticket_t @var{ticket})
@deftypefun void mu_sieve_set_ticket (mu_sieve_machine_t @var{mach}, mu_ticket_t @var{ticket})
This function sets the authentication ticket to be used with this machine.
@end deftypefun
@deftypefun void sieve_set_mailer (sieve_machine_t @var{mach}, mailer_t @var{mailer})
@deftypefun void mu_sieve_set_mailer (mu_sieve_machine_t @var{mach}, mu_mailer_t @var{mailer})
This function sets the mailer. The default mailer is @code{"sendmail:"}.
@end deftypefun
@deftypefun void sieve_set_daemon_email (sieve_machine_t @var{mach}, const char *@var{email})
@deftypefun void mu_sieve_set_daemon_email (mu_sieve_machine_t @var{mach}, const char *@var{email})
This functions sets the @dfn{daemon email} for @code{reject} and
@code{redirect} actions.
@end deftypefun
@deftypefun int sieve_is_dry_run (sieve_machine_t @var{mach})
The @code{sieve_is_dry_run()} returns 1 if the machine is in @dfn{dry
@deftypefun int mu_sieve_is_dry_run (mu_sieve_machine_t @var{mach})
The @code{mu_sieve_is_dry_run()} returns 1 if the machine is in @dfn{dry
run} state, i.e. it will only log the actions that would have been
executed without actually executing them. The dry run state is set
by calling @code{sieve_set_debug_level()} if its last argument has
by calling @code{mu_sieve_set_debug_level()} if its last argument has
the @code{MU_SIEVE_DRY_RUN} bit set.
@end deftypefun
@deftypefun {const char *} sieve_type_str (sieve_data_type @var{type})
@deftypefun {const char *} mu_sieve_type_str (mu_sieve_data_type @var{type})
Returns the string representation for the given sieve data type. The
return value is a pointer to a static constant string.
@end deftypefun
......@@ -523,48 +557,48 @@ return value is a pointer to a static constant string.
@node Logging and Diagnostic Functions
@subsection Logging and Diagnostic Functions
@deftypefun void sieve_error (sieve_machine_t @var{mach}, const char *@var{fmt}, @dots{})
@deftypefun void mu_sieve_error (mu_sieve_machine_t @var{mach}, const char *@var{fmt}, @dots{})
Format and output an error message using error printer of the machine @var{mach}.
@end deftypefun
@deftypefun void sieve_debug (sieve_machine_t @var{mach}, const char *@var{fmt}, @dots{})
@deftypefun void mu_sieve_debug (mu_sieve_machine_t @var{mach}, const char *@var{fmt}, @dots{})
Format and output a debug message using debug printer of the machine @var{mach}.
@end deftypefun
@deftypefun void sieve_log_action (sieve_machine_t @var{mach}, const char *@var{action}, const char *@var{fmt}, @dots{})
@deftypefun void mu_sieve_log_action (mu_sieve_machine_t @var{mach}, const char *@var{action}, const char *@var{fmt}, @dots{})
Log a sieve action using logger function associated with the machine @var{mach}.
@end deftypefun
@deftypefun void sieve_abort (sieve_machine_t @var{mach})
@deftypefun void mu_sieve_abort (mu_sieve_machine_t @var{mach})
Immediately abort the execution of the script.
@end deftypefun
@node Symbol Space Functions
@subsection Symbol Space Functions
@deftypefun {sieve_register_t *} sieve_test_lookup (sieve_machine_t @var{mach}, const char *@var{name})
@deftypefun {mu_sieve_register_t *} mu_sieve_test_lookup (mu_sieve_machine_t @var{mach}, const char *@var{name})
Find a register object describing the test @var{name}. Returns
@code{NULL} if no such test exists.
@end deftypefun
@deftypefun {sieve_register_t *} sieve_action_lookup (sieve_machine_t @var{mach}, const char *@var{name})
@deftypefun {mu_sieve_register_t *} mu_sieve_action_lookup (mu_sieve_machine_t @var{mach}, const char *@var{name})
Find a register object describing the action @var{name}. Returns
@code{NULL} if no such action exists.
@end deftypefun
@deftypefun int sieve_register_test (sieve_machine_t @var{mach}, const char *@var{name}, sieve_handler_t @var{handler}, sieve_data_type *@var{arg_types}, sieve_tag_group_t *@var{tags}, int @var{required})
@deftypefun int mu_sieve_register_test (mu_sieve_machine_t @var{mach}, const char *@var{name}, mu_sieve_handler_t @var{handler}, mu_sieve_data_type *@var{arg_types}, mu_sieve_tag_group_t *@var{tags}, int @var{required})
@end deftypefun
@deftypefun int sieve_register_action (sieve_machine_t @var{mach}, const char *@var{name}, sieve_handler_t @var{handler}, sieve_data_type *@var{arg_types}, sieve_tag_group_t *@var{tags}, int @var{required})
@deftypefun int mu_sieve_register_action (mu_sieve_machine_t @var{mach}, const char *@var{name}, mu_sieve_handler_t @var{handler}, mu_sieve_data_type *@var{arg_types}, mu_sieve_tag_group_t *@var{tags}, int @var{required})
@end deftypefun
@deftypefun int sieve_register_comparator (sieve_machine_t @var{mach}, const char *@var{name}, int @var{required}, sieve_comparator_t @var{is}, sieve_comparator_t @var{contains}, sieve_comparator_t @var{matches}, sieve_comparator_t @var{regex}, sieve_comparator_t @var{eq})
@deftypefun int mu_sieve_register_comparator (mu_sieve_machine_t @var{mach}, const char *@var{name}, int @var{required}, mu_sieve_comparator_t @var{is}, mu_sieve_comparator_t @var{contains}, mu_sieve_comparator_t @var{matches}, mu_sieve_comparator_t @var{regex}, mu_sieve_comparator_t @var{eq})
@end deftypefun
@deftypefun int sieve_tag_lookup (list_t @var{taglist}, char *@var{name}, sieve_value_t **@var{arg})
@deftypefun int mu_sieve_tag_lookup (mu_list_t @var{taglist}, char *@var{name}, mu_sieve_value_t **@var{arg})
@end deftypefun
@deftypefun int sieve_load_ext (sieve_machine_t @var{mach}, const char *@var{name})
@deftypefun int mu_sieve_load_ext (mu_sieve_machine_t @var{mach}, const char *@var{name})
@end deftypefun
@node Memory Allocation
......@@ -572,33 +606,33 @@ Find a register object describing the action @var{name}. Returns
The following functions act as their libc counterparts. The allocated
memory is associated with the @var{mach} argument and is automatically
freed upon the call to @code{sieve_machine_destroy (@var{mach})}.
freed upon the call to @code{mu_sieve_machine_destroy (@var{mach})}.
@deftypefun {void *} sieve_malloc (sieve_machine_t @var{mach}, size_t @var{size})
@deftypefun {void *} mu_sieve_malloc (mu_sieve_machine_t @var{mach}, size_t @var{size})
Allocates @var{size} bytes and returns a pointer to the allocated memory.
@end deftypefun
@deftypefun {char *} sieve_mstrdup (sieve_machine_t @var{mach}, const char *@var{str})
@deftypefun {char *} mu_sieve_mstrdup (mu_sieve_machine_t @var{mach}, const char *@var{str})
This function returns a pointer to a new string which is a duplicate of the
string @var{str}.
@end deftypefun
@deftypefun {void *} sieve_mrealloc (sieve_machine_t @var{mach}, void *@var{ptr}, size_t @var{size})
@deftypefun {void *} mu_sieve_mrealloc (mu_sieve_machine_t @var{mach}, void *@var{ptr}, size_t @var{size})
Changes the size of the memory block pointed to by @var{ptr} to
@var{size} bytes. The contents will be unchanged to the minimum of the
old and new sizes; newly allocated memory will be uninitialized. If
@var{ptr} is @code{NULL}, the call is equivalent to
@code{sieve_malloc(@var{mach}, @var{size})}; if @var{size} is equal to
zero, the call is equivalent to @code{sieve_mfree(@var{ptr})}. Unless
@code{mu_sieve_malloc(@var{mach}, @var{size})}; if @var{size} is equal to
zero, the call is equivalent to @code{mu_sieve_mfree(@var{ptr})}. Unless
@var{ptr} is @code{NULL}, it must have been returned by an earlier
call to @code{sieve_malloc()} or @code{sieve_mrealloc()}.
call to @code{mu_sieve_malloc()} or @code{mu_sieve_mrealloc()}.
@end deftypefun
@deftypefun void sieve_mfree (sieve_machine_t @var{mach}, void *@var{ptr})
@code{sieve_mfree()} frees the memory space pointed to by @var{ptr} and
@deftypefun void mu_sieve_mfree (mu_sieve_machine_t @var{mach}, void *@var{ptr})
@code{mu_sieve_mfree()} frees the memory space pointed to by @var{ptr} and
detaches it from the destructor list of @var{mach}. The @var{ptr} must
have been returned by a previous call to @code{sieve_malloc()} or
@code{sieve_mrealloc()}. Otherwise, or if @code{sieve_mfree(@var{ptr})}
have been returned by a previous call to @code{mu_sieve_malloc()} or
@code{mu_sieve_mrealloc()}. Otherwise, or if @code{mu_sieve_mfree(@var{ptr})}
has already been called before, undefined behaviour occurs.
If @var{ptr} is @code{NULL}, no operation is performed.
......@@ -607,21 +641,21 @@ If @var{ptr} is @code{NULL}, no operation is performed.
@node Compiling and Executing the Script
@subsection Compiling and Executing the Script
@deftypefun int sieve_compile (sieve_machine_t @var{mach}, const char *@var{name})
@deftypefun int mu_sieve_compile (mu_sieve_machine_t @var{mach}, const char *@var{name})
Compile the sieve script from the file @var{name}.
@end deftypefun
@deftypefun int sieve_mailbox (sieve_machine_t @var{mach}, mailbox_t @var{mbox})
@deftypefun int mu_sieve_mailbox (mu_sieve_machine_t @var{mach}, mu_mailbox_t @var{mbox})
Execute the code from the given instance of sieve machine @var{mach}
over each message in the mailbox @var{mbox}.
@end deftypefun
@deftypefun int sieve_message (sieve_machine_t @var{mach}, message_t @var{message})
@deftypefun int mu_sieve_message (mu_sieve_machine_t @var{mach}, mu_message_t @var{message})
Execute the code from the given instance of sieve machine @var{mach}
over the @var{message}.
@end deftypefun
@deftypefun int sieve_disass (sieve_machine_t @var{mach})
@deftypefun int mu_sieve_disass (mu_sieve_machine_t @var{mach})
Dump the disassembled code of the sieve machine @var{mach}.
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{locker_} is reserved. */}
@code{/* Prefix @emph{mu_locker_} is reserved. */}
@code{#include <mailutils/locker.h>}
@end smallexample
@deftypefun int locker_set_default_flags (int @var{flags}, enum mu_locker_set_mode @var{mode})
@deftypefun int mu_locker_set_default_flags (int @var{flags}, enum mu_locker_set_mode @var{mode})
@end deftypefun
@deftypefun void locker_set_default_retry_timeout (time_t @var{to})
@deftypefun void mu_locker_set_default_retry_timeout (time_t @var{to})
@end deftypefun
@deftypefun void locker_set_default_retry_count (size_t @var{n})
@deftypefun void mu_locker_set_default_retry_count (size_t @var{n})
@end deftypefun
@deftypefun void locker_set_default_expire_timeout (time_t @var{t})
@deftypefun void mu_locker_set_default_expire_timeout (time_t @var{t})
@end deftypefun
@deftypefun void locker_set_default_external_program (char *@var{path})
@deftypefun void mu_locker_set_default_external_program (char *@var{path})
@end deftypefun
A flags of 0 means that the default will be used.
@deftypefun int locker_create (locker_t *, const char *@var{filename}, int @var{flags})
@deftypefun int mu_locker_create (mu_locker_t *, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun void locker_destroy (locker_t *)
@deftypefun void mu_locker_destroy (mu_locker_t *)
@end deftypefun
Time is measured in seconds.
@deftypefun int locker_set_flags (locker_t, int)
@deftypefun int mu_locker_set_flags (mu_locker_t, int)
@end deftypefun
@deftypefun int locker_set_expire_time (locker_t, int)
@deftypefun int mu_locker_set_expire_time (mu_locker_t, int)
@end deftypefun
@deftypefun int locker_set_retries (locker_t, int)
@deftypefun int mu_locker_set_retries (mu_locker_t, int)
@end deftypefun
@deftypefun int locker_set_retry_sleep (locker_t, int)
@deftypefun int mu_locker_set_retry_sleep (mu_locker_t, int)
@end deftypefun
@deftypefun int locker_set_external (locker_t, const char *@var{program})
@deftypefun int mu_locker_set_external (mu_locker_t, const char *@var{program})
@end deftypefun
@deftypefun int locker_get_flags (locker_t, int *)
@deftypefun int mu_locker_get_flags (mu_locker_t, int *)
@end deftypefun
@deftypefun int locker_get_expire_time (locker_t, int*)
@deftypefun int mu_locker_get_expire_time (mu_locker_t, int*)
@end deftypefun
@deftypefun int locker_get_retries (locker_t, int *)
@deftypefun int mu_locker_get_retries (mu_locker_t, int *)
@end deftypefun
@deftypefun int locker_get_retry_sleep (locker_t, int *)
@deftypefun int mu_locker_get_retry_sleep (mu_locker_t, int *)
@end deftypefun
@deftypefun int locker_get_external (locker_t, char **)
@deftypefun int mu_locker_get_external (mu_locker_t, char **)
@end deftypefun
@deftypefun int locker_lock (locker_t)
@deftypefun int mu_locker_lock (mu_locker_t)
@end deftypefun
@deftypefun int locker_touchlock (locker_t)
@deftypefun int mu_locker_touchlock (mu_locker_t)
@end deftypefun
@deftypefun int locker_unlock (locker_t)
@deftypefun int mu_locker_unlock (mu_locker_t)
@end deftypefun
@deftypefun int locker_remove_lock (locker_t)
@deftypefun int mu_locker_remove_lock (mu_locker_t)
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{mailbox_} is reserved. */}
@code{/* Prefix @emph{mu_mailbox_} is reserved. */}
@code{#include <mailutils/mailbox.h>}
@end smallexample
@deftp {Data Type} mailbox_t
The @code{mailbox_t} object is used to hold information and it is an opaque
@deftp {Data Type} mu_mailbox_t
The @code{mu_mailbox_t} object is used to hold information and it is an opaque
data structure to the user. Functions are provided to retrieve information
from the data structure.
@end deftp
@smallexample
@group
mailbox_t url_t
-/var/mail- +---//--->/-----------------\ +-->/-----------\
( alain ) | | url_t *-|---+ | port |
---------- | |-----------------+ | hostname |
( jakob *-)----+ | observer_t *-| | file |
---------- |-----------------+ | ... |
( jeff ) | stream_t | \-----------/
---------- |-----------------|
( sean ) | locker_t |
---------- |-----------------|
| message_t(1) |
|-----------------|
| message_t(2) |
mu_mailbox_t mu_url_t
-/var/mail- +---//--->/------------------\ +-->/-----------\
( alain ) | | mu_url_t *-|---+ | port |
---------- | |------------------+ | hostname |
( jakob *-)----+ | mu_observer_t *-| | file |
---------- |------------------+ | ... |
( jeff ) | mu_stream_t | \-----------/
---------- |------------------|
( sean ) | mu_locker_t |
---------- |------------------|
| mu_message_t(1) |
|------------------|
| mu_message_t(2) |
| ...... |
| message_t(n) |
\-----------------/
| mu_message_t(n) |
\------------------/
@end group
@end smallexample
......@@ -39,8 +39,8 @@ from the data structure.
@c Constructor/destructor and possible types.
@c
@deftypefun int mailbox_create (mailbox_t *@var{mbox}, const char *@var{name})
The function @code{mailbox_create} allocates and initializes @var{mbox}.
@deftypefun int mu_mailbox_create (mu_mailbox_t *@var{mbox}, const char *@var{name})
The function @code{mu_mailbox_create} allocates and initializes @var{mbox}.
The concrete mailbox type instantiate is based on the scheme of the url @var{name}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -56,17 +56,17 @@ Not enough memory to allocate resources.
@end table
@end deftypefun
@deftypefun int mailbox_create_default (mailbox_t *@var{mbox}, const char *@var{name})
Create a mailbox with @code{mailbox_create()} based on the environment
@deftypefun int mu_mailbox_create_default (mu_mailbox_t *@var{mbox}, const char *@var{name})
Create a mailbox with @code{mu_mailbox_create()} based on the environment
variable @env{MAIL} or the string formed by
@emph{_PATH_MAILDIR}/@var{user}" or @env{LOGNAME} if @var{user} is null,
@end deftypefun
@deftypefun void mailbox_destroy (mailbox_t *@var{mbox})
@deftypefun void mu_mailbox_destroy (mu_mailbox_t *@var{mbox})
Destroys and releases resources held by @var{mbox}.
@end deftypefun
@deftypefun int mailbox_open (mailbox_t @var{mbox}, int @var{flag})
@deftypefun int mu_mailbox_open (mu_mailbox_t @var{mbox}, int @var{flag})
A connection is open, if no stream was provided, a stream
is created based on the @var{mbox} type. The @var{flag} can be OR'ed.
See @code{stream_create()} for @var{flag}'s description.
......@@ -85,7 +85,7 @@ Not enough memory.
@end table
@end deftypefun
@deftypefun int mailbox_close (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_close (mu_mailbox_t @var{mbox})
The stream attach to @var{mbox} is closed.
The return value is @code{0} on success and a code number on error conditions:
......@@ -95,10 +95,10 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_flush (mailbox_t @var{mbox}, int @var{expunge})
@deftypefun int mu_mailbox_flush (mu_mailbox_t @var{mbox}, int @var{expunge})
@end deftypefun
@deftypefun int mailbox_get_folder (mailbox_t @var{mbox}, folder_t *@var{folder})
@deftypefun int mu_mailbox_get_folder (mu_mailbox_t @var{mbox}, folder_t *@var{folder})
Get the @var{folder}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -108,10 +108,10 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_set_folder (mailbox_t @var{mbox}, folder_t @var{folder})
@deftypefun int mu_mailbox_set_folder (mu_mailbox_t @var{mbox}, mu_folder_t @var{folder})
@end deftypefun
@deftypefun int mailbox_uidvalidity (mailbox_t @var{mbox}, unsigned long *@var{number});
@deftypefun int mu_mailbox_uidvalidity (mu_mailbox_t @var{mbox}, unsigned long *@var{number});
Give the uid validity of @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -121,7 +121,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_uidnext (mailbox_t @var{mbox}, size_t *@var{number});
@deftypefun int mu_mailbox_uidnext (mu_mailbox_t @var{mbox}, size_t *@var{number});
Give the next predicted uid for @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -135,7 +135,7 @@ The return value is @code{0} on success and a code number on error conditions:
@c Messages.
@c
@deftypefun int mailbox_get_message (mailbox_t @var{mbox}, size_t @var{msgno}, message_t *@var{message})
@deftypefun int mu_mailbox_get_message (mu_mailbox_t @var{mbox}, size_t @var{msgno}, mu_message_t *@var{message})
Retrieve message number @var{msgno}, @var{message} is allocated and
initialized.
......@@ -148,7 +148,7 @@ Not enough memory.
@end table
@end deftypefun
@deftypefun int mailbox_append_message (mailbox_t @var{mbox}, message_t @var{message})
@deftypefun int mu_mailbox_append_message (mu_mailbox_t @var{mbox}, mu_message_t @var{message})
The @var{message} is appended to the mailbox @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -158,7 +158,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_messages_count (mailbox_t @var{mbox}, size_t *@var{number});
@deftypefun int mu_mailbox_messages_count (mu_mailbox_t @var{mbox}, size_t *@var{number});
Give the number of messages in @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -168,7 +168,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_messages_recent (mailbox_t @var{mbox}, size_t *@var{number});
@deftypefun int mu_mailbox_messages_recent (mu_mailbox_t @var{mbox}, size_t *@var{number});
Give the number of recent messages in @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -178,7 +178,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_message_unseen (mailbox_t @var{mbox}, size_t *@var{number});
@deftypefun int mu_mailbox_message_unseen (mu_mailbox_t @var{mbox}, size_t *@var{number});
Give the number of first unseen message in @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -188,7 +188,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_expunge (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_expunge (mu_mailbox_t @var{mbox})
All messages marked for deletion are removed.
The return value is @code{0} on success and a code number on error conditions:
......@@ -198,14 +198,14 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_save_attributes (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_save_attributes (mu_mailbox_t @var{mbox})
@end deftypefun
@c
@c Update and Scanning.
@c
@deftypefun int mailbox_get_size (mailbox_t @var{mbox}, off_t *@var{size})
@deftypefun int mu_mailbox_get_size (mu_mailbox_t @var{mbox}, mu_off_t *@var{size})
Gives the @var{mbox} size.
The return value is @code{0} on success and a code number on error conditions:
......@@ -215,10 +215,10 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_is_updated (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_is_updated (mu_mailbox_t @var{mbox})
@end deftypefun
@deftypefun int mailbox_scan (mailbox_t @var{mbox}, size_t @var{msgno}, size_t *@var{count});
@deftypefun int mu_mailbox_scan (mu_mailbox_t @var{mbox}, size_t @var{msgno}, size_t *@var{count});
Scan the mailbox for new messages starting at message @var{msgno}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -234,7 +234,7 @@ Not enough memory.
@c Mailbox Stream.
@c
@deftypefun int mailbox_get_stream (mailbox_t @var{mbox}, stream_t *@var{stream})
@deftypefun int mu_mailbox_get_stream (mu_mailbox_t @var{mbox}, mu_stream_t *@var{stream})
The mailbox stream is put in @var{stream}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -244,7 +244,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_set_stream (mailbox_t @var{mbox}, stream_t @var{stream})
@deftypefun int mu_mailbox_set_stream (mu_mailbox_t @var{mbox}, mu_stream_t @var{stream})
Set the @var{stream} connection to use for the mailbox.
The return value is @code{0} on success and a code number on error conditions:
......@@ -258,8 +258,8 @@ The return value is @code{0} on success and a code number on error conditions:
@c Lock Settings.
@c
@deftypefun int mailbox_get_locker (mailbox_t @var{mbox}, locker_t *@var{locker})
Get the @var{locker_t} object.
@deftypefun int mu_mailbox_get_locker (mu_mailbox_t @var{mbox}, mu_locker_t *@var{locker})
Get the @var{mu_locker_t} object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
......@@ -268,7 +268,7 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_set_locker (mailbox_t @var{mbox}, locker_t @var{locker})
@deftypefun int mu_mailbox_set_locker (mu_mailbox_t @var{mbox}, mu_locker_t @var{locker})
Set the type of locking done by the @var{mbox}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -282,7 +282,7 @@ The return value is @code{0} on success and a code number on error conditions:
@c Property.
@c
@deftypefun int mailbox_get_property (mailbox_t @var{mbox}, property_t *@var{property})
@deftypefun int mu_mailbox_get_property (mu_mailbox_t @var{mbox}, mu_property_t *@var{property})
Get the property object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
......@@ -296,7 +296,7 @@ The return value is @code{0} on success and a code number on error conditions:
@c URL.
@c
@deftypefun int mailbox_get_url (mailbox_t @var{mbox}, url_t *@var{url})
@deftypefun int mu_mailbox_get_url (mu_mailbox_t @var{mbox}, mu_url_t *@var{url})
Gives the constructed @var{url}.
The return value is @code{0} on success and a code number on error conditions:
......@@ -310,10 +310,10 @@ The return value is @code{0} on success and a code number on error conditions:
@c Debug.
@c
@deftypefun int mailbox_has_debug (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_has_debug (mu_mailbox_t @var{mbox})
@end deftypefun
@deftypefun int mailbox_get_debug (mailbox_t @var{mbox}, mu_debug_t *@var{debug})
@deftypefun int mu_mailbox_get_debug (mu_mailbox_t @var{mbox}, mu_debug_t *@var{debug})
Get a debug object.
The return value is @code{0} on success and a code number on error conditions:
@table @code
......@@ -323,14 +323,14 @@ The return value is @code{0} on success and a code number on error conditions:
@end table
@end deftypefun
@deftypefun int mailbox_set_debug (mailbox_t @var{mbox}, mu_debug_t @var{debug})
@deftypefun int mu_mailbox_set_debug (mu_mailbox_t @var{mbox}, mu_debug_t @var{debug})
@end deftypefun
@c
@c Events.
@c
@deftypefun int mailbox_get_observable (mailbox_t mbox @var{mbox}, observable_t *@var{observable})
@deftypefun int mu_mailbox_get_observable (mu_mailbox_t mbox @var{mbox}, mu_observable_t *@var{observable})
Get the observable object.
The return value is @code{0} on success and a code number on error conditions:
......@@ -346,8 +346,8 @@ Not enough memory.
@c Locking
@c
@deftypefun int mailbox_lock (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_lock (mu_mailbox_t @var{mbox})
@end deftypefun
@deftypefun int mailbox_unlock (mailbox_t @var{mbox})
@deftypefun int mu_mailbox_unlock (mu_mailbox_t @var{mbox})
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006 Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -70,7 +70,7 @@ from the data structure.
@include mailcap.inc
@end smallexample
@deftypefun int mu_mailcap_create (mu_mailcap_t *@var{mailcap}, stream_t @var{stream})
@deftypefun int mu_mailcap_create (mu_mailcap_t *@var{mailcap}, mu_stream_t @var{stream})
The function allocates, parses the buffer from the @var{stream} and initializes @var{mailcap}.
The return value is @code{0} on success and a code number on error conditions:
@table @code
......@@ -156,9 +156,9 @@ Helper function saving in buffer, the argument of "notes" field.
@end deftypefun
@deftypefun int mu_mailcap_entry_needsterminal (mu_mailcap_entry_t @var{entry}, int *@var{on})
Helper function. Returns *@var{on} != 0 if the flag "needsterminal" is in the record.
Helper function. Returns *@var{on} != 0 if the flag @code{needsterminal} is in the record.
@end deftypefun
@deftypefun int mu_mailcap_entry_copiousoutput (mu_mailcap_entry_t @var{entry}, int *@var{on})
Helper function. Returns *@var{on} != 0 if the flag "copiousoutput" is in the record.
Helper function. Returns *@var{on} != 0 if the flag @var{copiousoutput} is in the record.
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{mailer_} is reserved. */}
@code{/* Prefix @emph{mu_mailer_} is reserved. */}
@code{#include <mailutils/mailer.h>}
@end smallexample
......@@ -13,19 +13,19 @@
@c Constructor/Destructor.
@c
@deftypefun int mailer_create (mailer_t *, const char *@var{url})
@deftypefun int mu_mailer_create (mu_mailer_t *, const char *@var{url})
@end deftypefun
@deftypefun void mailer_destroy (mailer_t *)
@deftypefun void mu_mailer_destroy (mu_mailer_t *)
@end deftypefun
@deftypefun int mailer_open (mailer_t, int @var{flags})
@deftypefun int mu_mailer_open (mu_mailer_t, int @var{flags})
@end deftypefun
@deftypefun int mailer_close (mailer_t)
@deftypefun int mu_mailer_close (mu_mailer_t)
@end deftypefun
@deftypefun int mailer_send_message (mailer_t @var{mailer}, message_t @var{msg}, address_t @var{from}, address_t @var{to});
@deftypefun int mu_mailer_send_message (mu_mailer_t @var{mailer}, mu_message_t @var{msg}, mu_address_t @var{from}, mu_address_t @var{to});
If @var{from} is not @code{NULL}, it must contain a single fully qualified
RFC2822 email address which will be used as the envelope from
......@@ -42,31 +42,31 @@ The default for @var{to} is to use the contents of the standard "To:", "Cc:",
and "Bcc:" fields, this is equivalent to Sendmail's @option{-t} flag.
@end deftypefun
@deftypefun int mailer_get_property (mailer_t, property_t *)
@deftypefun int mu_mailer_get_property (mu_mailer_t, mu_property_t *)
@end deftypefun
@deftypefun int mailer_get_stream (mailer_t, stream_t *)
@deftypefun int mu_mailer_get_stream (mu_mailer_t, mu_stream_t *)
@end deftypefun
@deftypefun int mailer_set_stream (mailer_t, stream_t)
@deftypefun int mu_mailer_set_stream (mu_mailer_t, mu_stream_t)
@end deftypefun
@deftypefun int mailer_get_debug (mailer_t, mu_debug_t *)
@deftypefun int mu_mailer_get_debug (mu_mailer_t, mu_debug_t *)
@end deftypefun
@deftypefun int mailer_set_debug (mailer_t, mu_debug_t)
@deftypefun int mu_mailer_set_debug (mu_mailer_t, mu_debug_t)
@end deftypefun
@deftypefun int mailer_get_observable (mailer_t, observable_t *)
@deftypefun int mu_mailer_get_observable (mu_mailer_t, observable_t *)
@end deftypefun
@deftypefun int mailer_get_url (mailer_t, url_t *)
@deftypefun int mu_mailer_get_url (mu_mailer_t, url_t *)
@end deftypefun
@deftypefun int mailer_check_from (address_t @var{from})
@deftypefun int mu_mailer_check_from (mu_address_t @var{from})
@end deftypefun
@deftypefun int mailer_check_to (address_t @var{to})
@deftypefun int mu_mailer_check_to (mu_address_t @var{to})
@end deftypefun
@sp 1
......@@ -74,41 +74,53 @@ and "Bcc:" fields, this is equivalent to Sendmail's @option{-t} flag.
Some possible use cases the API must support are:
- original submission
@itemize @bullet{}
@item original submission
1 - fill in header addresses
@enumerate 0
@item fill in header addresses
2 - @code{mailer_send_message(mailer, msg, NULL, NULL)}
@item @code{mu_mailer_send_message(mailer, msg, NULL, NULL)}
- from will be filled in if missing,
@itemize @minus{}
@item from will be filled in if missing,
- Bcc's will be deleted before delivery to a non-bcc address,
@item Bcc's will be deleted before delivery to a non-bcc address,
- message-id and date will be added, if missing,
@item message-id and date will be added, if missing,
- a To: or Apparently-To: will be added if non is present (for RFC
compliance)
@item a @code{To:} or @code{Apparently-To:} header will be added if non is present (for RFC compliance)
@end itemize
- MTA-style @file{.forward} (and Sieve-style redirect)
@end enumerate
1 - get the envelope from of the message to be forwarded
@item MTA-style @file{.forward} (and Sieve-style redirect)
2 - @code{mailer_send_message(mailer, msg, from, to)}
@enumerate 1
@item get the envelope from of the message to be forwarded
- MUA-style bounce
@item @code{mu_mailer_send_message(mailer, msg, from, to)}
@end enumerate
1 - add Resent-[To,From,...]
@item MUA-style bounce
2 - @code{mailer_send_message(mailer, msg, NULL, to)}
@enumerate 1
@item add @code{Resent-[To,From,...]}
- DSN "bounce"
@item @code{mu_mailer_send_message(mailer, msg, NULL, to)}
@end enumerate
1 - compose DSN
@item DSN "bounce"
2 - @code{mailer_deliver(mailer, msg, address_t("<>"), to)}
@enumerate 1
@item compose DSN
@item @code{mu_mailer_deliver(mailer, msg, address_t("<>"), to)}
Don't want mail loops, so the null but valid SMTP address of @samp{<>}
is the envelope From.
@end enumerate
@end itemize
@subheading The Sendmail Mailer
......@@ -124,7 +136,7 @@ contents for the recipients).
@strong{Caution:} since the @code{stdout} and @code{stderr} of Sendmail
is closed, we have no way of ever giving feedback on failure. Also, what
should the return code be from @code{mailer_send_message()} when Sendmail
should the return code be from @code{mu_mailer_send_message()} when Sendmail
returns @samp{1}? @samp{1} maps to @code{EPERM}, which is less than
descriptive!
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{mbox_} is reserved */}
@code{/* Prefix @emph{mu_mbox_} is reserved */}
@code{#include <mailutils/mbox.h>}
@end smallexample
......@@ -27,25 +27,25 @@ From SP envelope-sender SP date [SP moreinfo]
are optional values that are seldom used.
@end table
A @var{mbox_t} is created, initialized and destroyed by @code{mbox_create ()}
and @code{mbox_destroy ()}. When opening, @code{mbox_open ()} will do a quick
A @var{mu_mbox_t} is created, initialized and destroyed by @code{mu_mbox_create ()}
and @code{mu_mbox_destroy ()}. When opening, @code{mu_mbox_open ()} will do a quick
check to see if the format is a valid format or an empty file. The scanning
of the mailbox is done by @code{mbox_scan ()}, the function, takes callback
of the mailbox is done by @code{mu_mbox_scan ()}, the function, takes callback
functions called during the scanning to provide information on progress and
new messages found. The scanning will cache some of the headers fields for
speed, new fields could be add with @code{mbox_add_hcache ()}. On Closing
the @var{mbox_t}, @code{mbox_close ()} will free any resources like, headers
speed, new fields could be add with @code{mu_mbox_add_hcache ()}. On Closing
the @var{mu_mbox_t}, @code{mu_mbox_close ()} will free any resources like, headers
cache, locks etc ... The messages with attributes marked deleted will only
be removed on @code{mbox_expunge ()}, if there is a need to save the
modification without purging @code{mbox_save ()} is more appropriate.
New messages are added to the mbox with @code{mbox_append ()}.
be removed on @code{mu_mbox_expunge ()}, if there is a need to save the
modification without purging @code{mu_mbox_save ()} is more appropriate.
New messages are added to the mbox with @code{mu_mbox_append ()}.
Attributes are saved in the @emph{Status:} header
field, Read is 'R', Seen is 'O', Deleted is 'd' and Reply is 'r'.
@subsubsection Initialization
@cindex Mbox Initialization
@deftypefun int mbox_create (mbox_t *@var{mbox})
@deftypefun int mu_mbox_create (mu_mbox_t *@var{mbox})
Allocate and initialize a @var{mbox} handle.
......@@ -55,7 +55,7 @@ Allocate and initialize a @var{mbox} handle.
@end table
@end deftypefun
@deftypefun void mbox_destroy (mbox_t @var{mbox})
@deftypefun void mu_mbox_destroy (mu_mbox_t @var{mbox})
When a POP3 session is finished, the structure must be @code{free ()}'ed to
reclaim memory.
......@@ -64,10 +64,10 @@ reclaim memory.
@subsubsection Carrier
@cindex Mbox channel
@deftypefun int mbox_set_carrier (mbox_t, stream_t @var{carrier});
@deftypefun int mu_mbox_set_carrier (mu_mbox_t, stream_t @var{carrier});
Another type of stream can be provided, the @var{carrier}
is set in the @var{mbox_t} handle. Any previous @var{carrier} stream in
is set in the @var{mu_mbox_t} handle. Any previous @var{carrier} stream in
the handle, will be close and destroy. Since the parsing code
maintain only the offsets off the message the @var{carrier} stream must be
seekable.
......@@ -77,9 +77,9 @@ seekable.
@end table
@end deftypefun
@deftypefun int mbox_get_carrier (mbox_t, stream_t *@var{carrier});
@deftypefun int mu_mbox_get_carrier (mu_mbox_t, stream_t *@var{carrier});
Return the @var{mbox_t} carrier. If none was set, a new file stream will be
Return the @var{mu_mbox_t} carrier. If none was set, a new file stream will be
created.
@table @code
......@@ -88,7 +88,7 @@ created.
@end table
@end deftypefun
@deftypefun int mbox_open (mbox_t, const char *@var{filename}, int @var{flags})
@deftypefun int mu_mbox_open (mu_mbox_t, const char *@var{filename}, int @var{flags})
Open carrier stream with @var{filename} and @var{flags}. The stream will be
quickly examine to see if it is a mbox format.
......@@ -102,7 +102,7 @@ quickly examine to see if it is a mbox format.
@end table
@end deftypefun
@deftypefun int mbox_close (mbox_t)
@deftypefun int mu_mbox_close (mu_mbox_t)
Close the carrier stream and resources particular to the mailbox.
......@@ -112,29 +112,29 @@ Close the carrier stream and resources particular to the mailbox.
@end table
@end deftypefun
@deftypefun int mbox_uidnext (mbox_t, unsigned long *@var{uidnext})
@deftypefun int mu_mbox_uidnext (mu_mbox_t, unsigned long *@var{uidnext})
Return the uidnext, if the @var{mbox_t} was not scan @code{mbox_scan ()}
Return the uidnext, if the @var{mu_mbox_t} was not scan @code{mu_mbox_scan ()}
is called first.
@table @code
@item MU_ERROR_INVALID_PARAMETER
@item same as @code{mbox_scan ()}
@item same as @code{mu_mbox_scan ()}
@end table
@end deftypefun
@deftypefun int mbox_uidvalidity (mbox_t, unsigned long *@var{uidvalidity})
@deftypefun int mu_mbox_uidvalidity (mu_mbox_t, unsigned long *@var{uidvalidity})
Return the uidvalidity, if the @var{mbox_t} was not scan @code{mbox_scan ()}
Return the uidvalidity, if the @var{mu_mbox_t} was not scan @code{mu_mbox_scan ()}
is called first.
@table @code
@item MU_ERROR_INVALID_PARAMETER
@item same as @code{mbox_scan ()}
@item same as @code{mu_mbox_scan ()}
@end table
@end deftypefun
@deftypefun int mbox_get_uid (mbox_t, unsigned int @var{msgno}, unsigned long *@var{uid})
@deftypefun int mu_mbox_get_uid (mu_mbox_t, unsigned int @var{msgno}, unsigned long *@var{uid})
Return the @var{uid} of the message @var{msgno}.
......@@ -143,7 +143,7 @@ Return the @var{uid} of the message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_get_attribute (mbox_t, unsigned int @var{msgno}, attribute_t *@var{attribute})
@deftypefun int mu_mbox_get_attribute (mu_mbox_t, unsigned int @var{msgno}, attribute_t *@var{attribute})
Return an @var{attribute} to indicate the status of message number @var{msgno}.
......@@ -153,7 +153,7 @@ Return an @var{attribute} to indicate the status of message number @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_get_separator (mbox_t, unsigned int @var{msgno}, char **@var{sep})
@deftypefun int mu_mbox_get_separator (mu_mbox_t, unsigned int @var{msgno}, char **@var{sep})
Return an allocated string in @var{sep} containing the value "From " separating
each message in Unix mbox format. The string should be @code{free ()}ed by
......@@ -165,7 +165,7 @@ the caller.
@end table
@end deftypefun
@deftypefun int mbox_set_separator (mbox_t, unsigned int @var{msgno}, const char *@var{sep})
@deftypefun int mu_mbox_set_separator (mu_mbox_t, unsigned int @var{msgno}, const char *@var{sep})
The variable @var{sep} should contain a valid "From " separator that will be use
when the expunging.
......@@ -176,7 +176,7 @@ when the expunging.
@end table
@end deftypefun
@deftypefun int mbox_get_hstream (mbox_t, unsigned int @var{msgno}, stream_t *@var{stream})
@deftypefun int mu_mbox_get_hstream (mu_mbox_t, unsigned int @var{msgno}, stream_t *@var{stream})
Return a @var{stream} to read the header of message @var{msgno}. The
@var{stream} should be destroy after usage.
......@@ -187,7 +187,7 @@ Return a @var{stream} to read the header of message @var{msgno}. The
@end table
@end deftypefun
@deftypefun int mbox_set_hstream (mbox_t, unsigned int @var{msgno}, stream_t @var{stream})
@deftypefun int mu_mbox_set_hstream (mu_mbox_t, unsigned int @var{msgno}, stream_t @var{stream})
Use @var{stream} when expunging for message @var{msgno}.
......@@ -196,7 +196,7 @@ Use @var{stream} when expunging for message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_set_hsize (mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
@deftypefun int mu_mbox_set_hsize (mu_mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
Return the @var{size} of message @var{msgno}.
......@@ -205,7 +205,7 @@ Return the @var{size} of message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_set_hlines (mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
@deftypefun int mu_mbox_set_hlines (mu_mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
Return the number of @var{lines} of message @var{msgno}.
......@@ -214,7 +214,7 @@ Return the number of @var{lines} of message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_get_bstream (mbox_t, unsigned int @var{msgno}, stream_t *@var{stream})
@deftypefun int mu_mbox_get_bstream (mu_mbox_t, unsigned int @var{msgno}, stream_t *@var{stream})
Return a @var{stream} to read the body of message @var{msgno}. The
@var{stream} should be destroy after usage.
......@@ -225,7 +225,7 @@ Return a @var{stream} to read the body of message @var{msgno}. The
@end table
@end deftypefun
@deftypefun int mbox_set_bstream (mbox_t, unsigned int @var{msgno}, stream_t @var{stream})
@deftypefun int mu_mbox_set_bstream (mu_mbox_t, unsigned int @var{msgno}, stream_t @var{stream})
Use @var{stream} when expunging for message @var{msgno}.
......@@ -234,7 +234,7 @@ Use @var{stream} when expunging for message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_set_bsize (mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
@deftypefun int mu_mbox_set_bsize (mu_mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
Return the @var{size} of message @var{msgno}.
......@@ -243,7 +243,7 @@ Return the @var{size} of message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_set_blines (mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
@deftypefun int mu_mbox_set_blines (mu_mbox_t, unsigned int @var{msgno}, unsigned int *@var{size})
Return the number of @var{lines} of message @var{msgno}.
......@@ -252,7 +252,7 @@ Return the number of @var{lines} of message @var{msgno}.
@end table
@end deftypefun
@deftypefun int mbox_get_size (mbox_t, unsigned int *@var{size})
@deftypefun int mu_mbox_get_size (mu_mbox_t, unsigned int *@var{size})
Return the @var{size} of mailbox.
......@@ -261,7 +261,7 @@ Return the @var{size} of mailbox.
@end table
@end deftypefun
@deftypefun int mbox_set_hcache (mbox_t, const char **@var{array}, size_t @var{len})
@deftypefun int mu_mbox_set_hcache (mu_mbox_t, const char **@var{array}, size_t @var{len})
Set the @var{array} of fields as the header to cache when doing the scanning.
If @var{array} is NULL the header cache is emptied.
......@@ -272,7 +272,7 @@ If @var{array} is NULL the header cache is emptied.
@end table
@end deftypefun
@deftypefun int mbox_add_hcache (mbox_t, const char **@var{array}, size_t @var{len})
@deftypefun int mu_mbox_add_hcache (mu_mbox_t, const char **@var{array}, size_t @var{len})
Add to the current cache for the scan, the fields in @var{array}.
......@@ -282,7 +282,7 @@ Add to the current cache for the scan, the fields in @var{array}.
@end table
@end deftypefun
@deftypefun int mbox_value_hcache (mbox_t, unsigned int @var{msgno}, const char *@var{field}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
@deftypefun int mu_mbox_value_hcache (mu_mbox_t, unsigned int @var{msgno}, const char *@var{field}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
Get the value of @var{field} in the header cache for @var{msgno}. The
result is copied in a @var{buffer} of @var{buflen} and @var{writen} is set
......@@ -294,7 +294,7 @@ to the number of byte put in @var{buffer}.
@end table
@end deftypefun
@deftypefun int mbox_save (mbox_t)
@deftypefun int mu_mbox_save (mu_mbox_t)
Save the changes to the messages back to the mailbox, but do not
remove messages mark for deletion in the process.
......@@ -304,7 +304,7 @@ remove messages mark for deletion in the process.
@end table
@end deftypefun
@deftypefun int mbox_expunge (mbox_t)
@deftypefun int mu_mbox_expunge (mu_mbox_t)
Save the changes to the mailbox and in the process remove all messages
marked for deletion.
......@@ -314,7 +314,7 @@ marked for deletion.
@end table
@end deftypefun
@deftypefun int mbox_append (mbox_t, const char *@var{sep}, stream_t @var{stream})
@deftypefun int mu_mbox_append (mu_mbox_t, const char *@var{sep}, stream_t @var{stream})
Append to the mailbox an rfc822 message represented by @var{stream}.
The variable @var{sep} should contain a valid "From " separator or
......@@ -325,7 +325,7 @@ NULL to get the default.
@end table
@end deftypefun
@deftypefun int mbox_append_hb (mbox_t, const char *@var{sep}, stream_t @var{hstream}, stream_t @var{bstream})
@deftypefun int mu_mbox_append_hb (mu_mbox_t, const char *@var{sep}, stream_t @var{hstream}, stream_t @var{bstream})
Append to the mailbox an rfc822 message represented by a header, @var{hstream},
and a body, @var{bstream}. The variable @var{sep} should contain a valid
......@@ -336,12 +336,12 @@ and a body, @var{bstream}. The variable @var{sep} should contain a valid
@end table
@end deftypefun
@deftypefun int mbox_scan (mbox_t, unsigned int @var{start}, unsigned int *@var{count})
@deftypefun int mu_mbox_scan (mu_mbox_t, unsigned int @var{start}, unsigned int *@var{count})
Start scanning the mailbox for new messages. The variable @var{start} can be
a message number starting point. The result of the scanning will be in
@var{count}. The scanning will trigger the @code{mbox_newmsg_cb()} callback
for each new message and @code{mbox_progress_cb ()} at different interval
@var{count}. The scanning will trigger the @code{mu_mbox_newmsg_cb()} callback
for each new message and @code{mu_mbox_progress_cb ()} at different interval
to notify progression. The return values of the those callback should be
0 is different then 0 the scanning will be stop an the function returns
MU_ERROR_INTERRUPTED.
......@@ -353,12 +353,12 @@ MU_ERROR_INTERRUPTED.
@end table
@end deftypefun
@deftypefun int mbox_count (mbox_t, unsigned int *@var{count})
@deftypefun int mu_mbox_count (mu_mbox_t, unsigned int *@var{count})
Same as @code{mbox_scan ()} but does not call the callbacks.
Same as @code{mu_mbox_scan ()} but does not call the callbacks.
@end deftypefun
@deftypefun int mbox_set_progress_cb (mbox_t, int (*@var{callback}) (int @var{percentage}, void *)), void *@var{arg})
@deftypefun int mu_mbox_set_progress_cb (mu_mbox_t, int (*@var{callback}) (int @var{percentage}, void *)), void *@var{arg})
Set the callback function for progress. The variable @var{arg} will be pass
back in the callback as the second argument. The first argument of the
......@@ -369,7 +369,7 @@ callback represents a @var{percentage} of the scanning progress.
@end table
@end deftypefun
@deftypefun int mbox_set_newmsg_cb (mbox_t, int (*@var{callback}) (int @var{count}, void *)), void *@var{arg})
@deftypefun int mu_mbox_set_newmsg_cb (mu_mbox_t, int (*@var{callback}) (int @var{count}, void *)), void *@var{arg})
Set the callback function for new messages. The variable @var{arg} will be
pass back in the callback as the second argument. The first argument
......@@ -380,7 +380,7 @@ is the total of messages found.
@end table
@end deftypefun
@deftypefun int mbox_set_error_cb (mbox_t, int (*@var{callback}) (int, void *)), void *@var{arg})
@deftypefun int mu_mbox_set_error_cb (mu_mbox_t, int (*@var{callback}) (int, void *)), void *@var{arg})
Set the callback function for errors. The variable @var{arg} will be
pass back in the callback as the second argument.
......@@ -389,7 +389,7 @@ pass back in the callback as the second argument.
@item MU_ERROR_INVALID_PARAMETER
@end table
@end deftypefun
@deftypefun int mbox_has_newmail (mbox_t)
@deftypefun int mu_mbox_has_newmail (mu_mbox_t)
Return nonzero if there is new mail append to the mbox_t.
Return nonzero if there is new mail append to the mu_mbox_t.
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{message_} is reserved. */}
@code{/* Prefix @emph{mu_message_} is reserved. */}
@code{#include <mailutils/message.h>}
@end smallexample
The @code{message_t} object is a convenient way to manipulate messages. It
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
---------- message_t
---------- mu_message_t
(message[1]) +------>+--------------------+
---------- | | envelope_t |
---------- | | mu_envelope_t |
(message[2]) | |--------------------|
---------- | | header_t |
---------- | | mu_header_t |
(message[3])--------+ |--------------------|
---------- | body_t |
---------- | mu_body_t |
(message[n]) |--------------------|
---------- | attribute_t |
---------- | mu_attribute_t |
|--------------------|
| stream_t |
| mu_stream_t |
+--------------------+
@end group
@end smallexample
......@@ -34,136 +34,136 @@ encapsulates the @code{envelope_t}, the @code{header_t} and the @code{body_t}.
@c Basic.
@c
@deftypefun void message_create (message_t *@var{msg}, void *@var{owner})
@deftypefun void mu_message_create (mu_message_t *@var{msg}, void *@var{owner})
@end deftypefun
@deftypefun void message_destroy (message_t *@var{msg}, void *@var{owner})
@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 message_create_copy (message_t *@var{to}, message_t *@var{from})
@deftypefun int mu_message_create_copy (mu_message_t *@var{to}, mu_message_t *@var{from})
@end deftypefun
@deftypefun void* message_get_owner (message_t @var{msg})
@deftypefun void* mu_message_get_owner (mu_message_t @var{msg})
@end deftypefun
@deftypefun int message_is_modified (message_t @var{msg})
@deftypefun int mu_message_is_modified (mu_message_t @var{msg})
@end deftypefun
@deftypefun int message_clear_modified (message_t @var{msg})
@deftypefun int mu_message_clear_modified (mu_message_t @var{msg})
@end deftypefun
@deftypefun int message_get_mailbox (message_t @var{msg}, mailbox_t *@var{mbox})
@deftypefun int mu_message_get_mailbox (mu_message_t @var{msg}, mu_mailbox_t *@var{mbox})
@end deftypefun
@deftypefun int message_set_mailbox (message_t @var{msg}, mailbox_t @var{mbox}, void *@var{owner})
@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 message_ref (message_t @var{msg})
@deftypefun int mu_message_ref (mu_message_t @var{msg})
@end deftypefun
@deftypefun int message_get_envelope (message_t @var{msg}, envelope_t *@var{envelope})
@deftypefun int mu_message_get_envelope (mu_message_t @var{msg}, mu_envelope_t *@var{envelope})
@end deftypefun
@deftypefun int message_set_envelope (message_t @var{msg}, envelope_t @var{envelope}, void *@var{owner})
@deftypefun int mu_message_set_envelope (mu_message_t @var{msg}, mu_envelope_t @var{envelope}, void *@var{owner})
@end deftypefun
@deftypefun int message_get_header (message_t @var{msg}, header_t *@var{header})
@deftypefun int mu_message_get_header (mu_message_t @var{msg}, mu_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})
@deftypefun int mu_message_set_header (mu_message_t @var{msg}, mu_header_t @var{header}, void *@var{owner})
@end deftypefun
@deftypefun int message_get_body (message_t @var{msg}, body_t *@var{body})
@deftypefun int mu_message_get_body (mu_message_t @var{msg}, mu_body_t *@var{body})
@end deftypefun
@deftypefun int message_set_body (message_t @var{msg}, body_t @var{body}, void *@var{owner})
@deftypefun int mu_message_set_body (mu_message_t @var{msg}, mu_body_t @var{body}, void *@var{owner})
@end deftypefun
@deftypefun int message_get_stream (message_t @var{msg}, stream_t *@var{stream})
@deftypefun int mu_message_get_stream (mu_message_t @var{msg}, mu_stream_t *@var{stream})
@end deftypefun
@deftypefun int message_set_stream (message_t @var{msg}, stream_t @var{stream}, void *@var{owner})
@deftypefun int mu_message_set_stream (mu_message_t @var{msg}, mu_stream_t @var{stream}, void *@var{owner})
@end deftypefun
@deftypefun int message_get_attribute (message_t @var{msg}, attribute_t *@var{attribute})
@deftypefun int mu_message_get_attribute (mu_message_t @var{msg}, mu_attribute_t *@var{attribute})
@end deftypefun
@deftypefun int message_set_attribute (message_t @var{msg}, attribute_t @var{attribute}, void *@var{owner})
@deftypefun int mu_message_set_attribute (mu_message_t @var{msg}, mu_attribute_t @var{attribute}, void *@var{owner})
@end deftypefun
@deftypefun int message_get_observable (message_t @var{msg}, observable_t *@var{observable})
@deftypefun int mu_message_get_observable (mu_message_t @var{msg}, mu_observable_t *@var{observable})
@end deftypefun
@c
@c ------------
@c
@deftypefun int message_is_multipart (message_t @var{msg}, int *@var{multi})
@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 message_set_is_multipart (message_t @var{msg}, int (*@var{_is_multipart}) (message_t, int *), void *);
@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 message_size (message_t @var{msg}, size_t *@var{size})
@deftypefun int mu_message_size (mu_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})
@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 message_lines (message_t @var{msg}, size_t *@var{size})
@deftypefun int mu_message_lines (mu_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})
@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 message_get_num_parts (message_t @var{msg}, size_t *@var{nparts})
@deftypefun int mu_message_get_num_parts (mu_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})
@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 message_get_part (message_t @var{msg}, size_t @var{part}, message_t *@var{msg})
@deftypefun int mu_message_get_part (mu_message_t @var{msg}, size_t @var{part}, mu_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})
@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 message_get_uidl (message_t @var{msg}, char *@var{buffer}, size_t @var{buflen}, size_t *@var{writen})
@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 message_set_uidl (message_t @var{msg}, int (*@var{_get_uidl}) (message_t, char *, size_t, size_t *), void *@var{owner})
@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 message_get_uid (message_t @var{msg}, size_t *@var{uid})
@deftypefun int mu_message_get_uid (mu_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})
@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 message_create_attachment (const char *@var{content_type}, const char *@var{encoding}, const char *@var{filename}, message_t *@var{newmsg})
@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 message_save_attachment (message_t @var{msg}, const char *@var{filename}, void **@var{data})
@deftypefun int mu_message_save_attachment (mu_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})
@deftypefun int mu_message_encapsulate (mu_message_t @var{msg}, mu_message_t *@var{newmsg}, void **@var{data})
@end deftypefun
@deftypefun int message_unencapsulate (message_t @var{msg}, message_t *@var{newmsg}, void **@var{data});
@deftypefun int mu_message_unencapsulate (mu_message_t @var{msg}, mu_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});
@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 message_aget_attachment_name (message_t @var{msg}, char **@var{name});
@deftypefun int mu_message_aget_attachment_name (mu_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});
@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
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{pop3_} is reserve */}
@code{#include <mailutils/pop3.h>}
@code{/* Prefix @emph{mu_mime_} is reserved */}
@code{#include <mailutils/mime.h>}
@end smallexample
Multipurpose Internet Mail Extensions (MIME).
@deftypefun int mime_create (mime_t *pmime, message_t msg, int flags)
@deftypefun int mu_mime_create (mu_mime_t *pmime, mu_message_t msg, int flags)
@end deftypefun
@deftypefun void mime_destroy (mime_t *pmime)
@deftypefun void mu_mime_destroy (mu_mime_t *pmime)
@end deftypefun
@deftypefun int mime_is_multipart (mime_t mime)
@deftypefun int mu_mime_is_multipart (mu_mime_t mime)
@end deftypefun
@deftypefun int mime_get_num_parts (mime_t mime, size_t *nparts)
@deftypefun int mu_mime_get_num_parts (mu_mime_t mime, size_t *nparts)
@end deftypefun
@deftypefun int mime_get_part (mime_t mime, size_t part, message_t *msg)
@deftypefun int mu_mime_get_part (mu_mime_t mime, size_t part, mu_message_t *msg)
@end deftypefun
@deftypefun int mime_add_part (mime_t mime, message_t msg)
@deftypefun int mu_mime_add_part (mu_mime_t mime, mu_message_t msg)
@end deftypefun
@deftypefun int mime_get_message (mime_t mime, message_t *msg)
@deftypefun int mu_mime_get_message (mu_mime_t mime, mu_message_t *msg)
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{nntp_} is reserved */}
@code{/* Prefix @emph{mu_nntp_} is reserved */}
@code{#include <mailutils/nntp.h>}
@end smallexample
......@@ -15,86 +15,86 @@ Network News Transfer Protocol. Not implemented.
@subsubsection Initialization
@cindex NNTP Initialization
@deftypefun int nntp_create (nnpt_t *)
@deftypefun int mu_nntp_create (mu_nntp_t *)
@end deftypefun
@deftypefun int nntp_destroy (nnpt_t *)
@deftypefun int mu_nntp_destroy (mu_nntp_t *)
@end deftypefun
@deftypefun int nntp_open (nnpt_t)
@deftypefun int mu_nntp_open (nnpt_t)
@end deftypefun
@subsubsection Article
@cindex NNTP Article
@deftypefun int nntp_article (nnpt_t)
@deftypefun int mu_nntp_article (nnpt_t)
@end deftypefun
@subsubsection Body
@cindex NNTP Body
@deftypefun int nntp_body (nntp_t)
@deftypefun int mu_nntp_body (mu_nntp_t)
@end deftypefun
@subsubsection Group
@cindex NNTP Group
@deftypefun int nntp_group (nntp_t)
@deftypefun int mu_nntp_group (mu_nntp_t)
@end deftypefun
@subsubsection Head
@cindex NNTP Head
@deftypefun int nntp_head (nntp_t)
@deftypefun int mu_nntp_head (mu_nntp_t)
@end deftypefun
@subsubsection Help
@cindex NNTP Help
@deftypefun int nntp_help (nntp_t)
@deftypefun int mu_nntp_help (mu_nntp_t)
@end deftypefun
@subsubsection IHave
@cindex NNTP IHave
@deftypefun int nntp_ihave (nntp_t)
@deftypefun int mu_nntp_ihave (mu_nntp_t)
@end deftypefun
@subsubsection Last
@cindex NNTP Last
@deftypefun int nntp_last (nntp_t)
@deftypefun int mu_nntp_last (mu_nntp_t)
@end deftypefun
@subsubsection List
@cindex NNTP List
@deftypefun int nntp_list (nntp_t)
@deftypefun int mu_nntp_list (mu_nntp_t)
@end deftypefun
@subsubsection NewGroups
@cindex NNTP NewGroups
@deftypefun int nntp_newgroups (nntp_t)
@deftypefun int mu_nntp_newgroups (mu_nntp_t)
@end deftypefun
@subsubsection NewNews
@cindex NNTP NewNews
@deftypefun int nntp_newnews (nntp_t)
@deftypefun int mu_nntp_newnews (mu_nntp_t)
@end deftypefun
@subsubsection Next
@cindex NNTP Next
@deftypefun int nntp_next (nntp_t)
@deftypefun int mu_nntp_next (mu_nntp_t)
@end deftypefun
@subsubsection Post
@cindex NNTP Post
@deftypefun int nntp_post (nntp_t)
@deftypefun int mu_nntp_post (mu_nntp_t)
@end deftypefun
@subsubsection Quit
@cindex NNTP Quit
@deftypefun int nntp_quit (nntp_t)
@deftypefun int mu_nntp_quit (mu_nntp_t)
@end deftypefun
@subsubsection Slave
@cindex NNTP Slave
@deftypefun int nntp_slave (nntp_t)
@deftypefun int mu_nntp_slave (mu_nntp_t)
@end deftypefun
@subsubsection Stat
@cindex NNTP Stat
@deftypefun int nntp_stat (nntp_t)
@deftypefun int mu_nntp_stat (mu_nntp_t)
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@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{parse822_} is reserved. */}
@code{/* Prefix @emph{mu_parse822_} is reserved. */}
@code{#include <mailutils/parse822.h>}
@end smallexample
@deftypefun int parse822_is_char (char @var{c})
@deftypefun int mu_parse822_is_char (char @var{c})
@end deftypefun
@deftypefun int parse822_is_digit (char @var{c})
@deftypefun int mu_parse822_is_digit (char @var{c})
@end deftypefun
@deftypefun int parse822_is_ctl (char @var{c})
@deftypefun int mu_parse822_is_ctl (char @var{c})
@end deftypefun
@deftypefun int parse822_is_space (char @var{c})
@deftypefun int mu_parse822_is_space (char @var{c})
@end deftypefun
@deftypefun int parse822_is_htab (char @var{c})
@deftypefun int mu_parse822_is_htab (char @var{c})
@end deftypefun
@deftypefun int parse822_is_lwsp_char (char @var{c})
@deftypefun int mu_parse822_is_lwsp_char (char @var{c})
@end deftypefun
@deftypefun int parse822_is_special (char @var{c})
@deftypefun int mu_parse822_is_special (char @var{c})
@end deftypefun
@deftypefun int parse822_is_atom_char (char @var{c})
@deftypefun int mu_parse822_is_atom_char (char @var{c})
@end deftypefun
@deftypefun int parse822_is_q_text (char @var{c})
@deftypefun int mu_parse822_is_q_text (char @var{c})
@end deftypefun
@deftypefun int parse822_is_d_text (char @var{c})
@deftypefun int mu_parse822_is_d_text (char @var{c})
@end deftypefun
@deftypefun int parse822_is_smtp_q (char @var{c})
@deftypefun int mu_parse822_is_smtp_q (char @var{c})
@end deftypefun
@deftypefun int parse822_skip_crlf (const char **@var{p}, const char *@var{e})
@deftypefun int mu_parse822_skip_crlf (const char **@var{p}, const char *@var{e})
@end deftypefun
@deftypefun int parse822_skip_lwsp_char (const char **@var{p}, const char *@var{e})
@deftypefun int mu_parse822_skip_lwsp_char (const char **@var{p}, const char *@var{e})
@end deftypefun
@deftypefun int parse822_skip_lwsp (const char **@var{p}, const char *@var{e})
@deftypefun int mu_parse822_skip_lwsp (const char **@var{p}, const char *@var{e})
@end deftypefun
@deftypefun int parse822_skip_comments (const char **@var{p}, const char *@var{e})
@deftypefun int mu_parse822_skip_comments (const char **@var{p}, const char *@var{e})
@end deftypefun
@deftypefun int parse822_skip_nl (const char **@var{p}, const char *@var{e})
@deftypefun int mu_parse822_skip_nl (const char **@var{p}, const char *@var{e})
@end deftypefun
@deftypefun int parse822_digits (const char **@var{p}, const char *@var{e}, int @var{min}, int @var{max}, int *@var{digits})
@deftypefun int mu_parse822_digits (const char **@var{p}, const char *@var{e}, int @var{min}, int @var{max}, int *@var{digits})
@end deftypefun
@deftypefun int parse822_special (const char **@var{p}, const char *@var{e}, char @var{c})
@deftypefun int mu_parse822_special (const char **@var{p}, const char *@var{e}, char @var{c})
@end deftypefun
@deftypefun int parse822_comment (const char **@var{p}, const char *@var{e}, char **@var{comment})
@deftypefun int mu_parse822_comment (const char **@var{p}, const char *@var{e}, char **@var{comment})
@end deftypefun
@deftypefun int parse822_atom (const char **@var{p}, const char *@var{e}, char **@var{atom})
@deftypefun int mu_parse822_atom (const char **@var{p}, const char *@var{e}, char **@var{atom})
@end deftypefun
@deftypefun int parse822_quoted_pair (const char **@var{p}, const char *@var{e}, char **@var{qpair})
@deftypefun int mu_parse822_quoted_pair (const char **@var{p}, const char *@var{e}, char **@var{qpair})
@end deftypefun
@deftypefun int parse822_quoted_string (const char **@var{p}, const char *@var{e}, char **@var{qstr})
@deftypefun int mu_parse822_quoted_string (const char **@var{p}, const char *@var{e}, char **@var{qstr})
@end deftypefun
@deftypefun int parse822_word (const char **@var{p}, const char *@var{e}, char **@var{word})
@deftypefun int mu_parse822_word (const char **@var{p}, const char *@var{e}, char **@var{word})
@end deftypefun
@deftypefun int parse822_phrase (const char **@var{p}, const char *@var{e}, char **@var{phrase})
@deftypefun int mu_parse822_phrase (const char **@var{p}, const char *@var{e}, char **@var{phrase})
@end deftypefun
@deftypefun int parse822_d_text (const char **@var{p}, const char *@var{e}, char **@var{dtext})
@deftypefun int mu_parse822_d_text (const char **@var{p}, const char *@var{e}, char **@var{dtext})
@end deftypefun
@c
@c From RFC 822, 6.1 Address Specification Syntax
@c
@deftypefun int parse822_address_list (address_t *@var{a}, const char *@var{s})
@deftypefun int mu_parse822_address_list (mu_address_t *@var{a}, const char *@var{s})
@end deftypefun
@deftypefun int parse822_mail_box (const char **@var{p}, const char *@var{e}, address_t *@var{a})
@deftypefun int mu_parse822_mail_box (const char **@var{p}, const char *@var{e}, mu_address_t *@var{a})
@end deftypefun
@deftypefun int parse822_group (const char **@var{p}, const char *@var{e}, address_t *@var{a})
@deftypefun int mu_parse822_group (const char **@var{p}, const char *@var{e}, mu_address_t *@var{a})
@end deftypefun
@deftypefun int parse822_address (const char **@var{p}, const char *@var{e}, address_t *@var{a})
@deftypefun int mu_parse822_address (const char **@var{p}, const char *@var{e}, mu_address_t *@var{a})
@end deftypefun
@deftypefun int parse822_route_addr (const char **@var{p}, const char *@var{e}, address_t *@var{a})
@deftypefun int mu_parse822_route_addr (const char **@var{p}, const char *@var{e}, mu_address_t *@var{a})
@end deftypefun
@deftypefun int parse822_route (const char **@var{p}, const char *@var{e}, char **@var{route})
@deftypefun int mu_parse822_route (const char **@var{p}, const char *@var{e}, char **@var{route})
@end deftypefun
@deftypefun int parse822_addr_spec (const char **@var{p}, const char *@var{e}, address_t *@var{a})
@deftypefun int mu_parse822_addr_spec (const char **@var{p}, const char *@var{e}, mu_address_t *@var{a})
@end deftypefun
@deftypefun int parse822_unix_mbox (const char **@var{p}, const char *@var{e}, address_t *@var{a})
@deftypefun int mu_parse822_unix_mbox (const char **@var{p}, const char *@var{e}, mu_address_t *@var{a})
@end deftypefun
@deftypefun int parse822_local_part (const char **@var{p}, const char *@var{e}, char **@var{local_part})
@deftypefun int mu_parse822_local_part (const char **@var{p}, const char *@var{e}, char **@var{local_part})
@end deftypefun
@deftypefun int parse822_domain (const char **@var{p}, const char *@var{e}, char **@var{domain})
@deftypefun int mu_parse822_domain (const char **@var{p}, const char *@var{e}, char **@var{domain})
@end deftypefun
@deftypefun int parse822_sub_domain (const char **@var{p}, const char *@var{e}, char **@var{sub_domain})
@deftypefun int mu_parse822_sub_domain (const char **@var{p}, const char *@var{e}, char **@var{sub_domain})
@end deftypefun
@deftypefun int parse822_domain_ref (const char **@var{p}, const char *@var{e}, char **@var{domain_ref})
@deftypefun int mu_parse822_domain_ref (const char **@var{p}, const char *@var{e}, char **@var{domain_ref})
@end deftypefun
@deftypefun int parse822_domain_literal (const char **@var{p}, const char *@var{e}, char **@var{domain_literal})
@deftypefun int mu_parse822_domain_literal (const char **@var{p}, const char *@var{e}, char **@var{domain_literal})
@end deftypefun
@c
@c RFC 822 Quoting Functions
@c
@deftypefun int parse822_quote_string (char **@var{quoted}, const char *@var{raw})
@deftypefun int mu_parse822_quote_string (char **@var{quoted}, const char *@var{raw})
@end deftypefun
@deftypefun int parse822_quote_local_part (char **@var{quoted}, const char *@var{raw})
@deftypefun int mu_parse822_quote_local_part (char **@var{quoted}, const char *@var{raw})
@end deftypefun
@deftypefun int parse822_field_body (const char **@var{p}, const char *@var{e}, char **@var{fieldbody})
@deftypefun int mu_parse822_field_body (const char **@var{p}, const char *@var{e}, char **@var{fieldbody})
@end deftypefun
@deftypefun int parse822_field_name (const char **@var{p}, const char *@var{e}, char **@var{fieldname})
@deftypefun int mu_parse822_field_name (const char **@var{p}, const char *@var{e}, char **@var{fieldname})
@end deftypefun
@c
@c From RFC 822, 5.1 Date and Time Specification Syntax
@c
@deftypefun int parse822_day (const char **@var{p}, const char *@var{e}, int *@var{day})
@deftypefun int mu_parse822_day (const char **@var{p}, const char *@var{e}, int *@var{day})
@end deftypefun
@deftypefun int parse822_date (const char **@var{p}, const char *@var{e}, int *@var{day}, int *@var{mon}, int *@var{year})
@deftypefun int mu_parse822_date (const char **@var{p}, const char *@var{e}, int *@var{day}, int *@var{mon}, int *@var{year})
@end deftypefun
@deftypefun int parse822_time (const char **@var{p}, const char *@var{e}, int *@var{h}, int *@var{m}, int *@var{s}, int *@var{tz}, const char **@var{tz_name})
@deftypefun int mu_parse822_time (const char **@var{p}, const char *@var{e}, int *@var{h}, int *@var{m}, int *@var{s}, int *@var{tz}, const char **@var{tz_name})
@end deftypefun
@deftypefun int parse822_date_time (const char **@var{p}, const char *@var{e}, struct tm *@var{tm}, mu_timezone *@var{tz})
@deftypefun int mu_parse822_date_time (const char **@var{p}, const char *@var{e}, struct tm *@var{tm}, mu_timezone *@var{tz})
@end deftypefun
......
......@@ -4,7 +4,8 @@
@finalout
@comment This is part of the GNU Mailutils manual.
@comment Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@comment Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@comment Free Software Foundation, Inc.
@comment See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -80,7 +81,7 @@ default timeout to be ten minutes, many servers have shorter idle period, care s
@code{mu_pop3_connect()}, two built-ins authentications are provided @code{mu_pop3_apop ()} or
@code{mu_pop3_user()}/@code{mu_pop3_pass()}. The @code{mu_pop3_stat()} and @code{mu_pop3_list ()} functions can be use to
get the number and size of messages. The functions @code{mu_pop3_list_all()}, @code{mu_pop3_uidl_all ()} and
@code{mu_pop3_capa()} save the information in an @code{iterator_t}. Downloading of messages is done
@code{mu_pop3_capa()} save the information in an @code{mu_iterator_t}. Downloading of messages is done
via a two methods @code{mu_pop3_retr()} or @code{mu_pop3_top()};
@strong{Caution: Some Internet Service Providers do not permit to leave mail on server and the message will be
deleted once downloaded}.
......@@ -174,7 +175,7 @@ Errors:
@cindex POP3 carrier
@deftypefun int mu_pop3_set_carrier (mu_pop3_t @var{pop3}, stream_t @var{carrier})
@deftypefun int mu_pop3_set_carrier (mu_pop3_t @var{pop3}, mu_stream_t @var{carrier})
Set the stream to be use as the carrier to the server , for example tcp_stream.
......@@ -225,7 +226,7 @@ Errors:
@cindex POP3 CAPA
@deftypefun int mu_pop3_capa (mu_pop3_t @var{pop3}, iterator_t *@var{iterator})
@deftypefun int mu_pop3_capa (mu_pop3_t @var{pop3}, mu_iterator_t *@var{iterator})
The CAPA command is send to the server and the list of capabilities is retrieve by going through
the iterator, when done the user should call @code{iterator_destroy()}.
......@@ -287,7 +288,7 @@ Errors:
@cindex POP3 RETR
@deftypefun int mu_pop3_retr (mu_pop3_t @var{pop3}, unsigned @var{msgno}, stream_t *@var{stream})
@deftypefun int mu_pop3_retr (mu_pop3_t @var{pop3}, unsigned @var{msgno}, mu_stream_t *@var{stream})
If successful @code{stream} should be call to download the message, byte-stuff lines or handle internally, CRLFs are
converted to LF. All other operations will fail until the downloaded is complete by the caller.
......@@ -308,13 +309,15 @@ Errors:
int
print_message (mu_pop3_t pop3, unsigned int msgno)
@{
stream_t stream;
mu_stream_t stream;
int status = mu_pop3_retr (pop3, msgno, &stream);
if (status == 0)
@{
size_t n = 0;
char buf[128];
while ((status = stream_readline (stream, buf, sizeof buf, &n)) == 0) && n > 0)
while ((status = mu_stream_readline (stream,
buf, sizeof buf, &n)) == 0)
&& n > 0)
@{
printf ("%s", buf);
@}
......@@ -325,7 +328,7 @@ print_message (mu_pop3_t pop3, unsigned int msgno)
@cindex POP3 TOP
@deftypefun int mu_pop3_top (mu_pop3_t @var{pop3}, unsigned int @var{msgno}, unsigned int @var{lines}, stream_t *@var{stream})
@deftypefun int mu_pop3_top (mu_pop3_t @var{pop3}, unsigned int @var{msgno}, unsigned int @var{lines}, mu_stream_t *@var{stream})
If successful @code{stream} should be call to download the header, byte-stuff lines or handle internally, CRLFs are
converted to LF. All other operations will failed until the operation is completed by the caller.
......@@ -345,13 +348,15 @@ Errors:
int
print_top (mu_pop3_t pop3, unsigned int msgno, unsigned int lines)
@{
stream_t stream;
mu_stream_t stream;
int status = mu_pop3_top (pop3, msgno, lines, &stream);
if (status == 0)
@{
size_t n = 0;
char buf[128];
while ((status = stream_readline (stream, buf, sizeof buf, &n)) == 0) && n > 0)
while ((status = mu_stream_readline (stream, buf,
sizeof buf, &n)) == 0)
&& n > 0)
printf ("%s", buf);
@}
return status;
......@@ -403,7 +408,7 @@ Errors:
@end table
@end deftypefun
@deftypefun int mu_pop3_uidl_all (mu_pop3_t @var{pop3}, iterator_t *@var{iterator})
@deftypefun int mu_pop3_uidl_all (mu_pop3_t @var{pop3}, mu_iterator_t *@var{iterator})
A UIDL command is executed. The call should iterate through the @code{iterator} to fetch the response.
......@@ -422,22 +427,24 @@ Errors:
void print_uidl (mu_pop3_t pop3)
@{
iterator_t itr;
mu_iterator_t itr;
status = mu_pop3_uidl_all (pop3, &itr);
if (status == 0)
@{
int rc;
for (iterator_first (itr); !iterator_is_done (itr); iterator_next (itr))
for (mu_iterator_first (itr);
!mu_iterator_is_done (itr);
mu_iterator_next (itr))
@{
char *text;
rc = iterator_current (itr, (void**) &text);
rc = mu_iterator_current (itr, (void**) &text);
if (rc)
lperror ("iterator_current", rc);
printf ("%s\n", text);
@}
iterator_destroy (&itr);
mu_iterator_destroy (&itr);
@}
@}
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
@smallexample
@code{/* Prefix @emph{smtp_} is reserved */}
@code{/* Prefix @emph{mu_smtp_} is reserved */}
@code{#include <mailutils/smtp.h>}
@end smallexample
......@@ -12,86 +13,86 @@
Simple Mail Transfer Protocol. Not implemented.
@subsection Commands
@cindex smtp_t
@cindex mu_smtp_t
@subsubsection Initialization
@cindex SMTP Initialization
@deftypefun int smtp_create (smtp_t *)
@deftypefun int mu_smtp_create (mu_smtp_t *)
@end deftypefun
@deftypefun void smtp_destroy (smtp_t *)
@deftypefun void mu_smtp_destroy (mu_smtp_t *)
@end deftypefun
@deftypefun int smtp_open (smtp_t, const char *@var{host}, unsigned int @var{port}, int @var{flags})
@deftypefun int mu_smtp_open (mu_smtp_t, const char *@var{host}, unsigned int @var{port}, int @var{flags})
@end deftypefun
@subsubsection Data
@cindex SMTP Data
@deftypefun int smtp_data (smtp_t, stream_t @var{stream})
@deftypefun int mu_smtp_data (mu_smtp_t, stream_t @var{stream})
@end deftypefun
@subsubsection Helo
@cindex SMTP Helo
@deftypefun int smtp_helo (smtp_t, const char *@var{domain})
@deftypefun int mu_smtp_helo (mu_smtp_t, const char *@var{domain})
@end deftypefun
@deftypefun int smtp_ehlo (smtp_t, const char *@var{domain})
@deftypefun int mu_smtp_ehlo (mu_smtp_t, const char *@var{domain})
@end deftypefun
@subsubsection Expn
@cindex SMTP Expn
@deftypefun int smtp_expn (smtp_t, const char *@var{list}, iterator_t *)
@deftypefun int mu_smtp_expn (mu_smtp_t, const char *@var{list}, iterator_t *)
@end deftypefun
@subsubsection Help
@cindex SMTP Help
@deftypefun int smtp_help (smtp_t, const char *@var{help}, iterator_t *)
@deftypefun int mu_smtp_help (mu_smtp_t, const char *@var{help}, iterator_t *)
@end deftypefun
@subsubsection Mail From
@cindex SMTP Mail From
@deftypefun int smtp_mail_from (smtp_t, const char *@var{address}, const char *@var{param})
@deftypefun int mu_smtp_mail_from (mu_smtp_t, const char *@var{address}, const char *@var{param})
@end deftypefun
@subsubsection Noop
@cindex SMTP Noop
@deftypefun int smtp_noop (smtp_t)
@deftypefun int mu_smtp_noop (mu_smtp_t)
@end deftypefun
@subsubsection Quit
@cindex SMTP Quit
@deftypefun int smtp_quit (smtp_t)
@deftypefun int mu_smtp_quit (mu_smtp_t)
@end deftypefun
@subsubsection Recpt To
@cindex SMTP Recpt To
@deftypefun int smtp_rcpt_to (smtp_t, const char *@var{address}, const char *@var{param})
@deftypefun int mu_smtp_rcpt_to (mu_smtp_t, const char *@var{address}, const char *@var{param})
@end deftypefun
@subsubsection Reset
@cindex SMTP Reset
@deftypefun int smtp_reset (smtp_t)
@deftypefun int mu_smtp_reset (mu_smtp_t)
@end deftypefun
@subsubsection Verify
@cindex SMTP Verify
@deftypefun int smtp_verify (smtp_t, const char *@var{user})
@deftypefun int mu_smtp_verify (mu_smtp_t, const char *@var{user})
@end deftypefun
@subsubsection Help functions
@cindex SMTP Help functions
@deftypefun extern int smtp_readline (smtp_t, char *@var{buffer}, size_t @var{len}, size_t *@var{len})
@deftypefun extern int mu_smtp_readline (mu_smtp_t, char *@var{buffer}, size_t @var{len}, size_t *@var{len})
@end deftypefun
@deftypefun extern int smtp_response (smtp_t, char *@var{buffer}, size_t @var{len}, size_t *@var{len})
@deftypefun extern int mu_smtp_response (mu_smtp_t, char *@var{buffer}, size_t @var{len}, size_t *@var{len})
@end deftypefun
@deftypefun extern int smtp_writeline (smtp_t, const char *@var{format}, @var{...})
@deftypefun extern int mu_smtp_writeline (mu_smtp_t, const char *@var{format}, @var{...})
@end deftypefun
@deftypefun extern int smtp_sendline (smtp_t, const char *@var{line})
@deftypefun extern int mu_smtp_sendline (mu_smtp_t, const char *@var{line})
@end deftypefun
@deftypefun extern int smtp_send (smtp_t
@deftypefun extern int mu_smtp_send (mu_smtp_t)
@end deftypefun
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -44,163 +45,163 @@ Stream doesn't close it's underlying resource when it is closed or destroyed.
@end table
@deftypefun int file_stream_create (stream_t *@var{stream}, const char *@var{filename}, int @var{flags})
@deftypefun int mu_file_stream_create (mu_stream_t *@var{stream}, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun int tcp_stream_create (stream_t *@var{stream}, const char *@var{host}, int @var{port}, int @var{flags})
@deftypefun int mu_tcp_stream_create (mu_stream_t *@var{stream}, const char *@var{host}, int @var{port}, int @var{flags})
@end deftypefun
@deftypefun int mapfile_stream_create (stream_t *@var{stream}, const char *@var{filename}, int @var{flags})
@deftypefun int mu_mapfile_stream_create (mu_stream_t *@var{stream}, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun int memory_stream_create (stream_t *@var{stream}, const char *@var{filename}, int @var{flags})
@deftypefun int mu_memory_stream_create (mu_stream_t *@var{stream}, const char *@var{filename}, int @var{flags})
@end deftypefun
@deftypefun int encoder_stream_create (stream_t *@var{stream}, stream_t @var{iostream}, const char *@var{encoding})
@deftypefun int mu_encoder_stream_create (mu_stream_t *@var{stream}, mu_stream_t @var{iostream}, const char *@var{encoding})
@end deftypefun
@deftypefun int decoder_stream_create (stream_t *@var{stream}, stream_t @var{iostream}, const char *@var{encoding})
@deftypefun int mu_decoder_stream_create (mu_stream_t *@var{stream}, mu_stream_t @var{iostream}, const char *@var{encoding})
@end deftypefun
@deftypefun int stdio_stream_create (stream_t *@var{stream}, FILE *@var{stdio}, int @var{flags})
@deftypefun int mu_stdio_stream_create (mu_stream_t *@var{stream}, FILE *@var{stdio}, int @var{flags})
If @code{MU_STREAM_NO_CLOSE} is specified, @code{fclose()} will not be called on
@var{stdio} when the stream is closed.
@end deftypefun
@deftypefun int prog_stream_create (stream_t *@var{stream}, const char *@var{progname}, int @var{flags})
@deftypefun int mu_prog_stream_create (mu_stream_t *@var{stream}, const char *@var{progname}, int @var{flags})
@end deftypefun
@deftypefun int filter_prog_stream_create (stream_t *@var{stream}, const char *@var{progname}, stream_t @var{input})
@deftypefun int mu_filter_prog_stream_create (mu_stream_t *@var{stream}, const char *@var{progname}, mu_stream_t @var{input})
@end deftypefun
@deftypefun void stream_destroy (stream_t *@var{stream}, void *@var{owner})
@deftypefun void mu_stream_destroy (mu_stream_t *@var{stream}, void *@var{owner})
@end deftypefun
@c
@c ---------
@c
@deftypefun int stream_open (stream_t @var{stream})
@deftypefun int mu_stream_open (mu_stream_t @var{stream})
@end deftypefun
@deftypefun int stream_close (stream_t @var{stream})
@deftypefun int mu_stream_close (mu_stream_t @var{stream})
@end deftypefun
@deftypefun int stream_is_seekable (stream_t @var{stream})
@deftypefun int mu_stream_is_seekable (mu_stream_t @var{stream})
@end deftypefun
@deftypefun int stream_get_fd (stream_t @var{stream}, int *@var{fd})
@deftypefun int mu_stream_get_fd (mu_stream_t @var{stream}, int *@var{fd})
@end deftypefun
@deftypefun int stream_get_fd2 (stream_t @var{stream}, int *@var{fd1}, int *@var{fd2})
@deftypefun int mu_stream_get_fd2 (mu_stream_t @var{stream}, int *@var{fd1}, int *@var{fd2})
@end deftypefun
@deftypefun int stream_read (stream_t @var{stream}, char *@var{buffer}, size_t @var{buflen}, off_t @var{offset}, size_t *@var{writen})
@deftypefun int mu_stream_read (mu_stream_t @var{stream}, char *@var{buffer}, size_t @var{buflen}, mu_off_t @var{offset}, size_t *@var{writen})
@end deftypefun
@deftypefun int stream_readline (stream_t @var{stream}, char *@var{buffer}, size_t @var{buflen}, off_t @var{offset}, size_t *@var{writen})
@deftypefun int mu_stream_readline (mu_stream_t @var{stream}, char *@var{buffer}, size_t @var{buflen}, mu_off_t @var{offset}, size_t *@var{writen})
@end deftypefun
@deftypefun int stream_size (stream_t @var{stream}, off_t *@var{size})
@deftypefun int mu_stream_size (mu_stream_t @var{stream}, mu_off_t *@var{size})
@end deftypefun
@deftypefun n int stream_truncate (stream_t @var{stream}, off_t @var{size})
@deftypefun n int mu_stream_truncate (mu_stream_t @var{stream}, mu_off_t @var{size})
@end deftypefun
@deftypefun int stream_write (stream_t @var{stream}, const char *@var{buffer}, size_t @var{buflen}, off_t @var{offset}, size_t *@var{writen})
@deftypefun int mu_stream_write (mu_stream_t @var{stream}, const char *@var{buffer}, size_t @var{buflen}, mu_off_t @var{offset}, size_t *@var{writen})
@end deftypefun
@deftypefun int stream_setbufsiz (stream_t @var{stream}, size_t @var{size})
@deftypefun int mu_stream_setbufsiz (mu_stream_t @var{stream}, size_t @var{size})
@end deftypefun
@deftypefun int stream_flush (stream_t @var{stream})
@deftypefun int mu_stream_flush (mu_stream_t @var{stream})
@end deftypefun
@c
@c These functions will typically only be useful to implementors of streams.
@c
@deftypefun int stream_create (stream_t *@var{stream}, int @var{flags}, void *@var{owner})
@deftypefun int mu_stream_create (mu_stream_t *@var{stream}, int @var{flags}, void *@var{owner})
Used to implement a new kind of stream.
@end deftypefun
@deftypefun void* stream_get_owner (stream_t @var{stream})
@deftypefun void* mu_stream_get_owner (mu_stream_t @var{stream})
@end deftypefun
@deftypefun void stream_set_owner (stream_t @var{stream}, void *@var{owner})
@deftypefun void mu_stream_set_owner (mu_stream_t @var{stream}, void *@var{owner})
@end deftypefun
@deftypefun int stream_get_flags (stream_t @var{stream}, int *@var{flags})
@deftypefun int mu_stream_get_flags (mu_stream_t @var{stream}, int *@var{flags})
@end deftypefun
@deftypefun int stream_set_flags (stream_t @var{stream}, int @var{flags})
@deftypefun int mu_stream_set_flags (mu_stream_t @var{stream}, int @var{flags})
@end deftypefun
@deftypefun int stream_get_property (stream_t @var{stream}, property_t *)
@deftypefun int mu_stream_get_property (mu_stream_t @var{stream}, property_t *)
@end deftypefun
@deftypefun int stream_set_property (stream_t @var{stream}, property_t, void *)
@deftypefun int mu_stream_set_property (mu_stream_t @var{stream}, property_t, void *)
@end deftypefun
@deftypefun int stream_get_state (stream_t @var{stream}, int *@var{state})
@deftypefun int mu_stream_get_state (mu_stream_t @var{stream}, int *@var{state})
@table @code
@item MU_STREAM_STATE_OPEN
Last action was @code{stream_open}.
Last action was @code{mu_stream_open}.
@item MU_STREAM_STATE_READ
Last action was @code{stream_read} or @code{stream_readline}.
Last action was @code{mu_stream_read} or @code{mu_stream_readline}.
@item MU_STREAM_STATE_WRITE
Last action was @code{stream_write}.
Last action was @code{mu_stream_write}.
@item MU_STREAM_STATE_CLOSE
Last action was @code{stream_close}.
Last action was @code{mu_stream_close}.
@end table
@end deftypefun
@deftypefun int stream_set_destroy (stream_t @var{stream}, void (*@var{_destroy}) (stream_t), void *@var{owner})
@deftypefun int mu_stream_set_destroy (mu_stream_t @var{stream}, void (*@var{_destroy}) (mu_stream_t), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_open (stream_t @var{stream}, int (*@var{_open}) (stream_t), void *@var{owner})
@deftypefun int mu_stream_set_open (mu_stream_t @var{stream}, int (*@var{_open}) (mu_stream_t), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_close (stream_t @var{stream}, int (*@var{_close}) (stream_t), void *@var{owner})
@deftypefun int mu_stream_set_close (mu_stream_t @var{stream}, int (*@var{_close}) (mu_stream_t), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_fd (stream_t @var{stream}, int (*@var{_get_fd}) (stream_t, int *, int *), void *@var{owner})
@deftypefun int mu_stream_set_fd (mu_stream_t @var{stream}, int (*@var{_get_fd}) (mu_stream_t, int *, int *), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_read (stream_t @var{stream}, int (*@var{_read}) (stream_t, char *, size_t, off_t, size_t *), void *@var{owner})
@deftypefun int mu_stream_set_read (mu_stream_t @var{stream}, int (*@var{_read}) (mu_stream_t, char *, size_t, mu_off_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_readline (stream_t @var{stream}, int (*@var{_readline}) (stream_t, char *, size_t, off_t, size_t *), void *@var{owner})
@deftypefun int mu_stream_set_readline (mu_stream_t @var{stream}, int (*@var{_readline}) (mu_stream_t, char *, size_t, mu_off_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_size (stream_t @var{stream}, int (*@var{_size}) (stream_t, off_t *), void *@var{owner})
@deftypefun int mu_stream_set_size (mu_stream_t @var{stream}, int (*@var{_size}) (mu_stream_t, mu_off_t *), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_truncate (stream_t @var{stream}, int (*@var{_truncate}) (stream_t, off_t), void *@var{owner})
@deftypefun int mu_stream_set_truncate (mu_stream_t @var{stream}, int (*@var{_truncate}) (mu_stream_t, mu_off_t), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_write (stream_t @var{stream}, int (*@var{_write}) (stream_t, const char *, size_t, off_t, size_t *), void *@var{owner})
@deftypefun int mu_stream_set_write (mu_stream_t @var{stream}, int (*@var{_write}) (mu_stream_t, const char *, size_t, mu_off_t, size_t *), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_flush (stream_t @var{stream}, int (*@var{_flush}) (stream_t), void *@var{owner})
@deftypefun int mu_stream_set_flush (mu_stream_t @var{stream}, int (*@var{_flush}) (mu_stream_t), void *@var{owner})
@end deftypefun
@deftypefun int stream_set_strerror (stream_t @var{stream}, int (*@var{_fp}) (stream_t, char **), void *@var{owner})
@deftypefun int mu_stream_set_strerror (mu_stream_t @var{stream}, int (*@var{_fp}) (mu_stream_t, char **), void *@var{owner})
@end deftypefun
@deftypefun int stream_sequential_readline (stream_ts @var{stream}, char *@var{buf}, size_t @var{size}, size_t *@var{nbytes})
@deftypefun int mu_stream_sequential_readline (mu_stream_ts @var{stream}, char *@var{buf}, size_t @var{size}, size_t *@var{nbytes})
@end deftypefun
@deftypefun int stream_sequential_write (stream_t @var{stream}, char *@var{buf}, size_t @var{size})
@deftypefun int mu_stream_sequential_write (mu_stream_t @var{stream}, char *@var{buf}, size_t @var{size})
@end deftypefun
@deftypefun int stream_seek (stream_t @var{stream}, off_t @var{off}, int @var{whence})
@deftypefun int mu_stream_seek (mu_stream_t @var{stream}, mu_off_t @var{off}, int @var{whence})
@end deftypefun
@deftypefun int stream_strerror (stream_t @var{stream}, char **@var{p})
@deftypefun int mu_stream_strerror (mu_stream_t @var{stream}, char **@var{p})
@end deftypefun
An example using @code{tcp_stream_create()} to make a simple web client:
An example using @code{mu_tcp_stream_create()} to make a simple web client:
@smallexample
@include http.inc
......
@c This is part of the GNU Mailutils manual.
@c Copyright (C) 1999,2000,2001,2002,2003,2004 Free Software Foundation, Inc.
@c Copyright (C) 1999,2000,2001,2002,2003,2004,2006
@c Free Software Foundation, Inc.
@c See file mailutils.texi for copying conditions.
@comment *******************************************************************
......@@ -111,15 +112,15 @@ For more complete information see @cite{RFC 2368}.
Helper functions are provided to retrieve and set the @emph{URL} fields.
@deftypefun int url_create (url_t *@var{url}, const char *@var{name})
@deftypefun int mu_url_create (mu_url_t *@var{url}, const char *@var{name})
Create the url data structure, but do not parse it.
@end deftypefun
@deftypefun void url_destroy (url_t *@var{url})
@deftypefun void mu_url_destroy (mu_url_t *@var{url})
Destroy the url and free its resources.
@end deftypefun
@deftypefun int url_parse (url_t)
@deftypefun int mu_url_parse (mu_url_t)
Parses the url, after calling this the get functions can be called.
The syntax, condensed from @cite{RFC 1738}, and extended with the ;auth=
......@@ -142,58 +143,58 @@ This is a generalized URL syntax, and may not be exactly appropriate
for any particular scheme.
@end deftypefun
@deftypefun int url_get_scheme (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_scheme (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int url_get_user (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_user (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int url_get_passwd (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_passwd (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int url_get_auth (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_auth (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int url_get_host (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_host (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int url_get_port (const url_t, long *)
@deftypefun int mu_url_get_port (const mu_url_t, long *)
@end deftypefun
@deftypefun int url_get_path (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_path (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun int url_get_query (const url_t, char *, size_t, size_t *)
@deftypefun int mu_url_get_query (const mu_url_t, char *, size_t, size_t *)
@end deftypefun
@deftypefun {const char*} url_to_string (const url_t)
@deftypefun {const char*} mu_url_to_string (const mu_url_t)
@end deftypefun
@deftypefun int url_is_scheme (url_t, const char *@var{scheme})
@deftypefun int mu_url_is_scheme (mu_url_t, const char *@var{scheme})
@end deftypefun
@deftypefun int url_is_same_scheme (url_t, url_t)
@deftypefun int mu_url_is_same_scheme (mu_url_t, mu_url_t)
@end deftypefun
@deftypefun int url_is_same_user (url_t, url_t)
@deftypefun int mu_url_is_same_user (mu_url_t, mu_url_t)
@end deftypefun
@deftypefun int url_is_same_path (url_t, url_t)
@deftypefun int mu_url_is_same_path (mu_url_t, mu_url_t)
@end deftypefun
@deftypefun int url_is_same_host (url_t, url_t)
@deftypefun int mu_url_is_same_host (mu_url_t, mu_url_t)
@end deftypefun
@deftypefun int url_is_same_port (url_t, url_t)
@deftypefun int mu_url_is_same_port (mu_url_t, mu_url_t)
@end deftypefun
@deftypefun char* url_decode (const char *@var{string})
@deftypefun {char *} mu_url_decode (const char *@var{string})
Decodes an @cite{RFC 1738} encoded string, returning the decoded string
in allocated memory. If the string is not encoded, this degenerates to
a @code{strdup()}.
@end deftypefun
@deftypefun int url_is_ticket (url_t @var{ticket}, url_t @var{url})
@deftypefun int mu_url_is_ticket (mu_url_t @var{ticket}, mu_url_t @var{url})
@end deftypefun
@subsubheading Example
......