diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-04-02 13:39:45 +0000 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2008-04-02 13:39:45 +0000 |
commit | 0cb27f811cb663f8f50c154e1ce58401b7c2c508 (patch) | |
tree | d4b89a52d27278242da8a14f9f9d79403cce199e /doc/mailfromd.texi | |
parent | 5541273d8447e78f975927bd318724e8c3af00a0 (diff) | |
download | mailfromd-0cb27f811cb663f8f50c154e1ce58401b7c2c508.tar.gz mailfromd-0cb27f811cb663f8f50c154e1ce58401b7c2c508.tar.bz2 |
* doc/mailfromd.texi: Document changes to prog body.
git-svn-id: file:///svnroot/mailfromd/trunk@1649 7a8a7f39-df28-0410-adc6-e0d955640f24
Diffstat (limited to 'doc/mailfromd.texi')
-rw-r--r-- | doc/mailfromd.texi | 44 |
1 files changed, 29 insertions, 15 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index dcf75115..216a4d53 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -230,6 +230,7 @@ Built-in and Library Functions * Envelope modification functions:: * Header modification functions:: * Mail header functions:: +* Mail body functions:: * Quarantine functions:: * Polling functions:: * Internet address manipulation functions:: @@ -5134,34 +5135,32 @@ None. @end table @end deffn -@deffn {Handler} body (string $1, number $2) +@anchor{body handler} +@deffn {Handler} body (pointer $1, number $2) @table @b @item Invocation: This header is called zero or more times, for each piece of the message body obtained from the remote host. @item Arguments: @enumerate 1 -@item @code{string}; Piece of body text. See @samp{Notes} below. -@item @code{number}; Length of @code{$1}, in bytes. +@item @code{pointer}; Piece of body text. See @samp{Notes} below. +@item @code{number}; Length of data pointed to by @code{$1}, in bytes. @end enumerate @item Notes: -As of version @value{VERSION}, @code{$1} cannot be processed with -usual string functions, because it is not null-terminated. This -limitation will be removed in future versions. - -It is possible, however, to pass it to an external program, using -@code{write} with three arguments (@pxref{I/O functions, write}), e.g.: +The first argument is a @dfn{generic pointer} that can be used to +access the body chunk. To convert it to a regular string, use the +@code{body_string} function (@pxref{Mail body functions}). For example, +the following code fragment collects all body text into a single +global variable: @smallexample -number fd; +string text prog body do - write(fd, $1, $2); - @dots{} + set text %text body_string($1,$2) +done @end smallexample - - This example assumes that @code{fd} is opened using @code{open}. @end table @end deffn @@ -5194,7 +5193,7 @@ For your reference, the following table shows each handler with its arguments: @item envrcpt @tab Recipient email address @tab Rest of arguments @tab @acronym{N/A} @tab @acronym{N/A} @item header @tab Header name @tab Header value @tab @acronym{N/A} @tab @acronym{N/A} @item eoh @tab @acronym{N/A} @tab @acronym{N/A} @tab @acronym{N/A} @tab @acronym{N/A} -@item body @tab Body segment (string) @tab Length of the segment +@item body @tab Body segment (pointer) @tab Length of the segment (numeric) @tab @acronym{N/A} @tab @acronym{N/A} @item eom @tab @acronym{N/A} @tab @acronym{N/A} @tab @acronym{N/A} @tab @acronym{N/A} @end multitable @@ -5420,6 +5419,7 @@ in version @value{VERSION}. * Envelope modification functions:: * Header modification functions:: * Mail header functions:: +* Mail body functions:: * Quarantine functions:: * Polling functions:: * Internet address manipulation functions:: @@ -5943,6 +5943,20 @@ Sent bugreports to <some-address@@some.net> @end smallexample @end deftypefn +@node Mail body functions +@subsubsection Mail Body Functions +@UNREVISED{} + +@deftypefn {Built-in Function} string body_string (pointer @var{text}, @ + number @var{count}) +Convert first @var{count} bytes from the memory location pointed to by +@var{text} into a regular string. +@end deftypefn + +This function is intended to convert the @code{$1} argument passed to +a @code{body} handler to a regular @acronym{MFL} string. For more +information about its use, see @ref{body handler}. + @node Quarantine functions @subsubsection Quarantine Functions |