diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-26 20:57:16 +0300 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2009-06-26 20:57:16 +0300 |
commit | 7d4dcfe66b232a852a2eb8dd56b2a79e1a8b7094 (patch) | |
tree | 972dd2b29798e31586a1c818308d8947e9a91eed /doc/mailfromd.texi | |
parent | 98622244518c1cf94784aa17390cb18c72a888c1 (diff) | |
download | mailfromd-7d4dcfe66b232a852a2eb8dd56b2a79e1a8b7094.tar.gz mailfromd-7d4dcfe66b232a852a2eb8dd56b2a79e1a8b7094.tar.bz2 |
Implement e_eof exception code (based on patch by Jan Rafaj).
* doc/mailfromd.texi: Document e_eof.
* mfd/Makefile.am (status.mfh): Define dependencies.
* mfd/bi_io.m4 (read_stream_delim): Return number of
bytes read.
(read, getdelim, getline): Raise e_eof on EOF.
* mfd/mailfromd.h (mfe_eof): New exception code.
* tests/eof.at: New testcase.
* tests/Makefile.am (TESTSUITE_AT): Add eof.at
* tests/testsuite.at (MF_RUN_TEXT): New define.
Include eof.at.
Diffstat (limited to 'doc/mailfromd.texi')
-rw-r--r-- | doc/mailfromd.texi | 43 |
1 files changed, 37 insertions, 6 deletions
diff --git a/doc/mailfromd.texi b/doc/mailfromd.texi index 2ab5bb13..46a3a88a 100644 --- a/doc/mailfromd.texi +++ b/doc/mailfromd.texi @@ -7813,6 +7813,17 @@ exception if an @acronym{I/O} error occurs. @deftypefn {Built-in Function} string read (number @var{rd}, number @var{n}) Read and return @var{n} bytes from the resource descriptor @var{rd}. + + The function may signal the following exceptions: + +@table @asis +@item e_range +@var{rd} lies outside of allowed range of resource descriptors. +@item e_eof +End of file encountered. +@item e_io +An @acronym{I/O} error occured. +@end table @end deftypefn @deftypefn {Built-in Function} string getdelim (number @var{rd}, string @var{delim}) @@ -7821,9 +7832,17 @@ must be a string of length 1) from the resource descriptor @var{rd}. The terminating @var{delim} character will be removed from the return value. - The function will signal @code{e_range} exception if @var{rd} lies -outside of allowed range of resource descriptors, and @code{e_io} -exception if an @acronym{I/O} error occurs. + The function may signal the following exceptions: + +@table @asis +@item e_range +@var{rd} lies outside of allowed range of resource descriptors. +@item e_eof +End of file encountered. +@item e_io +An @acronym{I/O} error occured. +@end table + @end deftypefn @deftypefn {Built-in Function} string getline (number @var{rd}) @@ -7837,9 +7856,16 @@ removed from the return value. getdelim(@var{rd}, "\n") @end smallexample - The @code{getline} function will signal @code{e_range} exception if -@var{rd} lies outside of allowed range of resource descriptors, and -@code{e_io} exception if an @acronym{I/O} error occurs. + The function may signal the following exceptions: + +@table @asis +@item e_range +@var{rd} lies outside of allowed range of resource descriptors. +@item e_eof +End of file encountered. +@item e_io +An @acronym{I/O} error occured. +@end table @end deftypefn The following example shows how @command{mailfromd} @acronym{I/O} functions can @@ -11103,6 +11129,11 @@ any @acronym{DBM} database. @item e_divzero Division by zero. +@cindex e_eof, exception type +@item e_eof + Function reached end of file while reading. @xref{I/O functions}, +for a description of functions that can signal this exception. + @cindex e_failure, exception type @cindex failure, exception type @item e_failure |