--- file-io.cc.orig 2004-12-03 14:14:38.000000000 +0200 +++ file-io.cc 2004-12-03 15:16:14.000000000 +0200 @@ -182,7 +182,8 @@ @deftypefn {Built-in Function} {} fclose (@var{fid})\n\ Closes the specified file. If successful, @code{fclose} returns 0,\n\ otherwise, it returns -1.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fseek, ftell}") { octave_value retval = -1; @@ -198,12 +199,16 @@ DEFUN (fflush, args, , "-*- texinfo -*-\n\ address@hidden {Built-in Function} {} fflush (@var{fid})\n\ address@hidden {Built-in Function} {} @var{status} = fflush (@var{fid})\n\ Flush output to @var{fid}. This is useful for ensuring that all\n\ pending output makes it to the screen before some other event occurs.\n\ For example, it is always a good idea to flush the standard output\n\ stream before calling @code{input}.\n\ address@hidden deftypefn") +\n\ address@hidden returns 0 on success and an OS dependent error value\n\ +(@minus{}1 on unix) on error.\n\ address@hidden deftypefn\n\ address@hidden, fclose}") { octave_value retval = -1; @@ -246,7 +251,8 @@ character.\n\ \n\ If there are no more characters to read, @code{fgetl} returns @minus{}1.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fscanf}") { static std::string who = "fgetl"; @@ -294,7 +300,8 @@ character.\n\ \n\ If there are no more characters to read, @code{fgets} returns @minus{}1.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fscanf}") { static std::string who = "fgets"; @@ -490,7 +497,8 @@ @noindent\n\ however, conversions are currently only supported for @samp{native}\n\ @samp{ieee-be}, and @samp{ieee-le} formats.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fread, fseek}") { octave_value_list retval; @@ -625,15 +633,19 @@ DEFUN (fseek, args, , "-*- texinfo -*-\n\ address@hidden {Built-in Function} {} fseek (@var{fid}, @var{offset}, @var{origin})\n\ -Set the file pointer to any location within the file @var{fid}. The\n\ -pointer is positioned @var{offset} characters from the @var{origin},\n\ address@hidden {Built-in Function} {} @var{status} = fseek (@var{fid}, @var{offset}, @var{origin})\n\ +Set the file pointer to any location within the file @var{fid}.\n\ +\n\ +The pointer is positioned @var{offset} characters from the @var{origin},\n\ which may be one of the predefined variables @code{SEEK_CUR} (current\n\ position), @code{SEEK_SET} (beginning), or @code{SEEK_END} (end of\n\ -file). If @var{origin} is omitted, @code{SEEK_SET} is assumed. The\n\ -offset must be zero, or a value returned by @code{ftell} (in which case\n\ address@hidden must be @code{SEEK_SET}.\n\ address@hidden deftypefn") +file) or strings \"cof\", \"bof\" or \"eof\". If @var{origin} is omitted,\n\ address@hidden is assumed. The offset must be zero, or a value returned\n\ +by @code{ftell} (in which case @var{origin} must be @code{SEEK_SET}.\n\ +\n\ +Return value @var{status} is 0 on success and -1 on error.\n\ address@hidden deftypefn\n\ address@hidden, fopen, fclose}") { octave_value retval = -1; @@ -662,7 +674,8 @@ @deftypefn {Built-in Function} {} ftell (@var{fid})\n\ Return the position of the file pointer as the number of characters\n\ from the beginning of the file @var{fid}.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fopen, fclose}") { octave_value retval = -1; @@ -686,7 +699,8 @@ @deftypefn {Built-in Function} {} fprintf (@var{fid}, @var{template}, @dots{})\n\ This function is just like @code{printf}, except that the output is\n\ written to the stream @var{fid} instead of @code{stdout}.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, sprintf, fread, fscanf, fopen, fclose}") { static std::string who = "fprintf"; @@ -744,11 +758,13 @@ DEFUN (printf, args, nargout, "-*- texinfo -*-\n\ address@hidden {Built-in Function} {} printf (@var{fid}, @var{template}, @dots{})\n\ address@hidden {Built-in Function} {} @var{count} = printf (@var{template}, @dots{})\n\ Print optional arguments under the control of the template string\n\ @var{template} to the stream @code{stdout}.\n\ +\n\ +Returns the number of characters printed.\n\ @end deftypefn\n\ address@hidden and sprintf}") address@hidden, sprintf, scanf}") { static std::string who = "printf"; @@ -790,8 +806,10 @@ DEFUN (fputs, args, , "-*- texinfo -*-\n\ address@hidden {Built-in Function} {} fputs (@var{fid}, @var{string})\n\ address@hidden {Built-in Function} {} @var{status} = fputs (@var{fid}, @var{string})\n\ Write a string to a file with no formatting.\n\ +\n\ +Returns a non-negative number on success and EOF on error.\n\ @end deftypefn") { static std::string who = "fputs"; @@ -817,6 +835,8 @@ "-*- texinfo -*-\n\ @deftypefn {Built-in Function} {} puts (@var{string})\n\ Write a string to the standard output with no formatting.\n\ +\n\ +Returns a non-negative number on success and EOF on error.\n\ @end deftypefn") { static std::string who = "puts"; @@ -839,7 +859,8 @@ suitably sized string as an argument, Octave's @code{sprintf} function\n\ returns the string, automatically sized to hold all of the items\n\ converted.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fprintf, sscanf}") { static std::string who = "sprintf"; @@ -930,7 +951,8 @@ single scalar return value. This form is more `C-like', and also\n\ compatible with previous versions of Octave. The number of successful\n\ conversions is returned in @var{count}\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, sscanf, fread, fprintf}") { static std::string who = "fscanf"; @@ -1001,7 +1023,8 @@ This is like @code{fscanf}, except that the characters are taken from the\n\ string @var{string} instead of from a stream. Reaching the end of the\n\ string is treated as an end-of-file condition.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, scanf, sprintf}") { static std::string who = "sscanf"; @@ -1099,7 +1122,8 @@ \n\ It is currently not useful to call @code{scanf} in interactive\n\ programs.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, sscanf, printf}") { int nargin = args.length (); @@ -1342,7 +1366,8 @@ \n\ The data read from the file is returned in @var{val}, and the number of\n\ values read is returned in @code{count}\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fopen, fclose}") { octave_value_list retval; @@ -1453,7 +1478,8 @@ \n\ The behavior of @code{fwrite} is undefined if the values in @var{data}\n\ are too large to fit in the specified precision.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fopen, fclose}") { octave_value retval = -1; @@ -1494,7 +1520,8 @@ file and 0 otherwise. Note that it will only return 1 if the end of the\n\ file has already been encountered, not if the next read operation will\n\ result in an end-of-file condition.\n\ address@hidden deftypefn") address@hidden deftypefn\n\ address@hidden, fopen, fclose}") { octave_value retval = -1; @@ -1928,7 +1955,7 @@ "-*- texinfo -*-\n\ @defvr {Built-in Variable} P_tmpdir\n\ The default name of the directory for temporary files on this system.\n\ -of this variable is system dependent.\n\ +The value of this variable is system dependent.\n\ @end defvr"); // NOTE: the values of SEEK_SET, SEEK_CUR, and SEEK_END have to be