From 229d0d8ca88bc344bed89e46541b325c1d267996 Mon Sep 17 00:00:00 2001 From: Hans Bolinder Date: Fri, 6 May 2011 15:58:09 +0200 Subject: r Use Erlang specs and types for documentation --- lib/stdlib/doc/src/c.xml | 127 +++++++++++++++++------------------------------ 1 file changed, 46 insertions(+), 81 deletions(-) (limited to 'lib/stdlib/doc/src/c.xml') diff --git a/lib/stdlib/doc/src/c.xml b/lib/stdlib/doc/src/c.xml index 19e3ac1f08..ddae388a1b 100644 --- a/lib/stdlib/doc/src/c.xml +++ b/lib/stdlib/doc/src/c.xml @@ -4,7 +4,7 @@
- 19962009 + 19962011 Ericsson AB. All Rights Reserved. @@ -39,43 +39,33 @@ - bt(Pid) -> void() + Stack backtrace for a process - - Pid = pid() -

Stack backtrace for a process. Equivalent to - erlang:process_display(Pid, backtrace).

+ erlang:process_display(Pid, backtrace).

- c(File) -> {ok, Module} | error - c(File, Options) -> {ok, Module} | error + + Compile and load code in a file - - File = name() -- see filename(3) - Options = [Opt] -- see compile:file/2 -

c/1,2 compiles and then purges and loads the code for - a file. Options defaults to []. Compilation is + a file. Options defaults to []. Compilation is equivalent to:

-compile:file(File, Options ++ [report_errors, report_warnings]) +compile:file(File, Options ++ [report_errors, report_warnings])

Note that purging the code means that any processes lingering in old code for the module are killed without warning. See code/3 for more information.

- cd(Dir) -> void() + Change working directory - - Dir = name() -- see filename(3) - -

Changes working directory to Dir, which may be a +

Changes working directory to Dir, which may be a relative name, and then prints the name of the new working directory.

@@ -84,14 +74,14 @@ compile:file(File, Options ++ [report_errors, report_warnings])
       
     
     
-      flush() -> void()
+      
       Flush any messages sent to the shell
       
         

Flushes any messages sent to the shell.

- help() -> void() + Help information

Displays help information: all valid shell internal commands, @@ -99,8 +89,8 @@ compile:file(File, Options ++ [report_errors, report_warnings]) - i() -> void() - ni() -> void() + + Information about the system

i/0 displays information about the system, listing @@ -109,26 +99,20 @@ compile:file(File, Options ++ [report_errors, report_warnings]) - i(X, Y, Z) -> void() + Information about pid <X.Y.Z> - - X = Y = Z = int() -

Displays information about a process, Equivalent to - process_info(pid(X, Y, Z)), but location transparent.

+ process_info(pid(X, Y, Z)), but location transparent.

- l(Module) -> void() + Load or reload module - - Module = atom() -

Purges and loads, or reloads, a module by calling - code:purge(Module) followed by - code:load_file(Module).

+ code:purge(Module) followed by + code:load_file(Module).

Note that purging the code means that any processes lingering in old code for the module are killed without warning. See code/3 for more information.

@@ -136,35 +120,33 @@ compile:file(File, Options ++ [report_errors, report_warnings])
lc(Files) -> ok - Compile a list of files Files = [File] -  File = name() -- see filename(3) + File = file:filename() + + Compile a list of files

Compiles a list of files by calling compile:file(File, [report_errors, report_warnings]) for each File in Files.

- ls() -> void() + List files in the current directory

Lists files in the current directory.

- ls(Dir) -> void() + List files in a directory - - Dir = name() -- see filename(3) - -

Lists files in directory Dir.

+

Lists files in directory Dir.

- m() -> void() + Which modules are loaded

Displays information about the loaded modules, including @@ -172,84 +154,67 @@ compile:file(File, Options ++ [report_errors, report_warnings]) - m(Module) -> void() + Information about a module - - Module = atom() - -

Displays information about Module.

+

Displays information about Module.

- memory() -> [{Type, Size}] + Memory allocation information - - Type, Size -- see erlang:memory/0 -

Memory allocation information. Equivalent to - erlang:memory/0.

+ erlang:memory/0 + .

- memory(Type) -> Size - memory([Type]) -> [{Type, Size}] + + Memory allocation information - - Type, Size -- see erlang:memory/0 -

Memory allocation information. Equivalent to - erlang:memory/1.

+ erlang:memory/1 + .

- nc(File) -> {ok, Module} | error - nc(File, Options) -> {ok, Module} | error + + Compile and load code in a file on all nodes - - File = name() -- see filename(3) - Options = [Opt] -- see compile:file/2 -

Compiles and then loads the code for a file on all nodes. - Options defaults to []. Compilation is equivalent to:

+ Options defaults to []. Compilation is equivalent to:

-compile:file(File, Opts ++ [report_errors, report_warnings]) +compile:file(File, Options ++ [report_errors, report_warnings])
- nl(Module) -> void() + Load module on all nodes - - Module = atom() - -

Loads Module on all nodes.

+

Loads Module on all nodes.

- pid(X, Y, Z) -> pid() + Convert X,Y,Z to a pid - - X = Y = Z = int() - -

Converts X, Y, Z to the pid +

Converts X, Y, Z to the pid ]]>. This function should only be used when debugging.

- pwd() -> void() + Print working directory

Prints the name of the working directory.

- q() -> void() + Quit - shorthand for init:stop()

This function is shorthand for init:stop(), that is, @@ -257,8 +222,8 @@ compile:file(File, Opts ++ [report_errors, report_warnings]) - regs() -> void() - nregs() -> void() + + Information about registered processes

regs/0 displays information about all registered -- cgit v1.2.3