From 0f423c54e4dc7348b551508fbcb3b479420a196f Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Tue, 8 Mar 2011 16:04:56 +0100 Subject: Change io.xml so that html anchors gets generated for all arities --- lib/stdlib/doc/src/io.xml | 53 +++++++++++++++++++++++++++++++---------------- 1 file changed, 35 insertions(+), 18 deletions(-) (limited to 'lib/stdlib/doc/src/io.xml') diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml index efbb1fc078..9d5bea0c2a 100644 --- a/lib/stdlib/doc/src/io.xml +++ b/lib/stdlib/doc/src/io.xml @@ -4,7 +4,7 @@
- 19962010 + 19962011 Ericsson AB. All Rights Reserved. @@ -81,7 +81,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - columns([IoDevice]) -> {ok,int()} | {error, enotsup} + columns() -> {ok,int()} | {error, enotsup} + columns(IoDevice) -> {ok,int()} | {error, enotsup} Get the number of columns of a device IoDevice = io_device() @@ -94,7 +95,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - put_chars([IoDevice,] IoData) -> ok + put_chars(IoData) -> ok + put_chars(IoDevice, IoData) -> ok Write a list of characters IoDevice = io_device() @@ -106,7 +108,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - nl([IoDevice]) -> ok + nl() -> ok + nl(IoDevice) -> ok Write a newline IoDevice = io_device() @@ -116,7 +119,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - get_chars([IoDevice,] Prompt, Count) -> Data | eof + get_chars(Prompt, Count) -> Data | eof + get_chars(IoDevice, Prompt, Count) -> Data | eof Read a specified number of characters IoDevice = io_device() @@ -150,7 +154,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - get_line([IoDevice,] Prompt) -> Data | eof | {error,Reason} + get_line(Prompt) -> Data | eof | {error,Reason} + get_line(IoDevice, Prompt) -> Data | eof | {error,Reason} Read a line IoDevice = io_device() @@ -183,7 +188,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - getopts([IoDevice]) -> Opts + getopts() -> Opts + getopts(IoDevice) -> Opts Get the supported options and values from an I/O-server IoDevice = io_device() @@ -210,7 +216,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - setopts([IoDevice,] Opts) -> ok | {error, Reason} + setopts(Opts) -> ok | {error, Reason} + setopts(IoDevice, Opts) -> ok | {error, Reason} Set options IoDevice = io_device() @@ -281,7 +288,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - write([IoDevice,] Term) -> ok + write(Term) -> ok + write(IoDevice, Term) -> ok Write a term IoDevice = io_device() @@ -293,7 +301,8 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] - read([IoDevice,] Prompt) -> Result + read(Prompt) -> Result + read(IoDevice, Prompt) -> Result Read a term IoDevice = io_device() @@ -356,9 +365,11 @@ charlist() = [unicode_char() | unicode_binary() | charlist()] fwrite(Format) -> - fwrite([IoDevice,] Format, Data) -> ok + fwrite(Format, Data) -> ok + fwrite(IoDevice, Format, Data) -> ok format(Format) -> - format([IoDevice,] Format, Data) -> ok + format(Format, Data) -> ok + format(IoDevice, Format, Data) -> ok Write formatted output IoDevice = io_device() @@ -660,7 +671,8 @@ ok - fread([IoDevice,] Prompt, Format) -> Result + fread(Prompt, Format) -> Result + fread(IoDevice, Prompt, Format) -> Result Read formatted input IoDevice = io_device() @@ -820,7 +832,8 @@ enter>: alan : joe - rows([IoDevice]) -> {ok,int()} | {error, enotsup} + rows() -> {ok,int()} | {error, enotsup} + rows(IoDevice) -> {ok,int()} | {error, enotsup} Get the number of rows of a device IoDevice = io_device() @@ -834,7 +847,8 @@ enter>: alan : joe scan_erl_exprs(Prompt) -> - scan_erl_exprs([IoDevice,] Prompt, StartLine) -> Result + scan_erl_exprs(Prompt, StartLine) -> Result + scan_erl_exprs(IoDevice, Prompt, StartLine) -> Result Read and tokenize Erlang expressions IoDevice = io_device() @@ -877,7 +891,8 @@ enter>1.0er. scan_erl_form(Prompt) -> - scan_erl_form([IoDevice,] Prompt, StartLine) -> Result + scan_erl_form(Prompt, StartLine) -> Result + scan_erl_form(IoDevice, Prompt, StartLine) -> Result Read and tokenize an Erlang form IoDevice = io_device() @@ -900,7 +915,8 @@ enter>1.0er. parse_erl_exprs(Prompt) -> - parse_erl_exprs([IoDevice,] Prompt, StartLine) -> Result + parse_erl_exprs(Prompt, StartLine) -> Result + parse_erl_exprs(IoDevice, Prompt, StartLine) -> Result Read, tokenize and parse Erlang expressions IoDevice = io_device() @@ -943,7 +959,8 @@ enter>abc("hey". parse_erl_form(Prompt) -> - parse_erl_form([IoDevice,] Prompt, StartLine) -> Result + parse_erl_form(Prompt, StartLine) -> Result + parse_erl_form(IoDevice, Prompt, StartLine) -> Result Read, tokenize and parse an Erlang form IoDevice = io_device() -- cgit v1.2.3 From d16aa7f83af727f5495dd4883efb603dc8b941bb Mon Sep 17 00:00:00 2001 From: Raimo Niskanen Date: Thu, 9 Dec 2010 16:28:11 +0100 Subject: Fix ~F.Fs bug, add testcase and improve documentation --- lib/stdlib/doc/src/io.xml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'lib/stdlib/doc/src/io.xml') diff --git a/lib/stdlib/doc/src/io.xml b/lib/stdlib/doc/src/io.xml index efbb1fc078..81fb5cad3d 100644 --- a/lib/stdlib/doc/src/io.xml +++ b/lib/stdlib/doc/src/io.xml @@ -464,9 +464,9 @@ ok

Prints the argument with the string syntax. The argument is, if no Unicode translation modifier is present, an I/O list, a binary, or an atom. If the Unicode translation modifier ('t') is in effect, the argument is chardata(), meaning that binaries are in UTF-8. The characters - are printed without quotes. In this format, the printed - argument is truncated to the given precision and field - width.

+ are printed without quotes. The string is first truncated + by the given precision and then padded and justified + to the given field width. The default precision is the field width.

This format can be used for printing any object and truncating the output so it fits a specified field:

@@ -475,6 +475,8 @@ ok
ok 4> io:fwrite("|~10s|~n", [io_lib:write({hey, hey, hey})]). |{hey,hey,h| +5> io:fwrite("|~-10.8s|~n", [io_lib:write({hey, hey, hey})]). +|{hey,hey | ok

A list with integers larger than 255 is considered an error if the Unicode translation modifier is not given:

-- 
cgit v1.2.3