[m-dev.] for review: fseek/ftell

Fergus Henderson fjh at cs.mu.oz.au
Mon May 19 13:32:19 AEST 1997


Thomas Charles CONWAY, you wrote:
> 
> +:- type io__whence
> +	--->	set
> +	;	cur
> +	;	end
> +	.
> +

Could you please add some documentation here?

>  % Text input predicates.
> @@ -571,6 +579,16 @@
>  :- mode io__flush_binary_output(in, di, uo) is det.
>  %	Flush the output buffer of the specified binary output stream.
>  
> +:- pred io__seek_binary(io__binary_stream, io__whence, int,
> +		io__state, io__state).
> +:- mode io__seek_binary(in, in, in, di, uo) is det.
> +%	Seek to an offset relative to Whence (see man page for fseek)
> +%	on a specified binary stream

I think it would be best if the documentation is self-contained.
People using Mercury on Windows may not know what a man page is...

> +	static int seek_flags[] = { SEEK_SET, SEEK_CUR, SEEK_END };

You should declare that `const'.

	static const int seek_flags[] = { SEEK_SET, SEEK_CUR, SEEK_END };

-- 
Fergus Henderson <fjh at cs.mu.oz.au>   |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>   |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3         |     -- the last words of T. S. Garp.



More information about the developers mailing list