~rdoering/ubuntu/karmic/erlang/fix-535090

« back to all changes in this revision

Viewing changes to lib/stdlib/doc/src/c.xml

  • Committer: Bazaar Package Importer
  • Author(s): Sergei Golovan
  • Date: 2009-02-15 16:42:52 UTC
  • mfrom: (3.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090215164252-q5x4rcf8a5pbesb1
Tags: 1:12.b.5-dfsg-2
Upload to unstable after lenny is released.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="latin1" ?>
 
2
<!DOCTYPE erlref SYSTEM "erlref.dtd">
 
3
 
 
4
<erlref>
 
5
  <header>
 
6
    <copyright>
 
7
      <year>1996</year>
 
8
      <year>2007</year>
 
9
      <holder>Ericsson AB, All Rights Reserved</holder>
 
10
    </copyright>
 
11
    <legalnotice>
 
12
  The contents of this file are subject to the Erlang Public License,
 
13
  Version 1.1, (the "License"); you may not use this file except in
 
14
  compliance with the License. You should have received a copy of the
 
15
  Erlang Public License along with this software. If not, it can be
 
16
  retrieved online at http://www.erlang.org/.
 
17
 
 
18
  Software distributed under the License is distributed on an "AS IS"
 
19
  basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
 
20
  the License for the specific language governing rights and limitations
 
21
  under the License.
 
22
 
 
23
  The Initial Developer of the Original Code is Ericsson AB.
 
24
    </legalnotice>
 
25
 
 
26
    <title>c</title>
 
27
    <prepared>Joe Armstrong</prepared>
 
28
    <docno>1</docno>
 
29
    <date>96-10-30</date>
 
30
    <rev>B</rev>
 
31
  </header>
 
32
  <module>c</module>
 
33
  <modulesummary>Command Interface Module</modulesummary>
 
34
  <description>
 
35
    <p>The <c>c</c> module enables users to enter the short form of
 
36
      some commonly used commands.</p>
 
37
    <note>
 
38
      <p>These functions are are intended for interactive use in
 
39
        the Erlang shell only. The module prefix may be omitted.</p>
 
40
    </note>
 
41
  </description>
 
42
  <funcs>
 
43
    <func>
 
44
      <name>bt(Pid) -> void()</name>
 
45
      <fsummary>Stack backtrace for a process</fsummary>
 
46
      <type>
 
47
        <v>Pid = pid()</v>
 
48
      </type>
 
49
      <desc>
 
50
        <p>Stack backtrace for a process. Equivalent to
 
51
          <c>erlang:process_display(Pid, backtrace)</c>.</p>
 
52
      </desc>
 
53
    </func>
 
54
    <func>
 
55
      <name>c(File) -> {ok, Module} | error</name>
 
56
      <name>c(File, Options) -> {ok, Module} | error</name>
 
57
      <fsummary>Compile and load code in a file</fsummary>
 
58
      <type>
 
59
        <v>File = name() -- see filename(3)</v>
 
60
        <v>Options = [Opt] -- see compile:file/2</v>
 
61
      </type>
 
62
      <desc>
 
63
        <p><c>c/1,2</c> compiles and then purges and loads the code for
 
64
          a file. <c>Options</c> defaults to []. Compilation is
 
65
          equivalent to:</p>
 
66
        <code type="none">
 
67
compile:file(File, Options ++ [report_errors, report_warnings])</code>
 
68
        <p>Note that purging the code means that any processes
 
69
          lingering in old code for the module are killed without
 
70
          warning. See <c>code/3</c> for more information.</p>
 
71
      </desc>
 
72
    </func>
 
73
    <func>
 
74
      <name>cd(Dir) -> void()</name>
 
75
      <fsummary>Change working directory</fsummary>
 
76
      <type>
 
77
        <v>Dir = name() -- see filename(3)</v>
 
78
      </type>
 
79
      <desc>
 
80
        <p>Changes working directory to <c>Dir</c>, which may be a
 
81
          relative name, and then prints the name of the new working
 
82
          directory.</p>
 
83
        <pre>
 
84
2> <input>cd("../erlang").</input>
 
85
/home/ron/erlang</pre>
 
86
      </desc>
 
87
    </func>
 
88
    <func>
 
89
      <name>flush() -> void()</name>
 
90
      <fsummary>Flush any messages sent to the shell</fsummary>
 
91
      <desc>
 
92
        <p>Flushes any messages sent to the shell.</p>
 
93
      </desc>
 
94
    </func>
 
95
    <func>
 
96
      <name>help() -> void()</name>
 
97
      <fsummary>Help information</fsummary>
 
98
      <desc>
 
99
        <p>Displays help information: all valid shell internal commands,
 
100
          and commands in this module.</p>
 
101
      </desc>
 
102
    </func>
 
103
    <func>
 
104
      <name>i() -> void()</name>
 
105
      <name>ni() -> void()</name>
 
106
      <fsummary>Information about the system</fsummary>
 
107
      <desc>
 
108
        <p><c>i/0</c> displays information about the system, listing
 
109
          information about all processes. <c>ni/0</c> does the same,
 
110
          but for all nodes the network.</p>
 
111
      </desc>
 
112
    </func>
 
113
    <func>
 
114
      <name>i(X, Y, Z) -> void()</name>
 
115
      <fsummary>Information about pid &lt;X.Y.Z&gt;</fsummary>
 
116
      <type>
 
117
        <v>X = Y = Z = int()</v>
 
118
      </type>
 
119
      <desc>
 
120
        <p>Displays information about a process, Equivalent to
 
121
          <c>process_info(pid(X, Y, Z))</c>, but location transparent.</p>
 
122
      </desc>
 
123
    </func>
 
124
    <func>
 
125
      <name>l(Module) -> void()</name>
 
126
      <fsummary>Load or reload module</fsummary>
 
127
      <type>
 
128
        <v>Module = atom()</v>
 
129
      </type>
 
130
      <desc>
 
131
        <p>Purges and loads, or reloads, a module by calling
 
132
          <c>code:purge(Module)</c> followed by
 
133
          <c>code:load_file(Module)</c>.</p>
 
134
        <p>Note that purging the code means that any processes
 
135
          lingering in old code for the module are killed without
 
136
          warning. See <c>code/3</c> for more information.</p>
 
137
      </desc>
 
138
    </func>
 
139
    <func>
 
140
      <name>lc(Files) -> ok</name>
 
141
      <fsummary>Compile a list of files</fsummary>
 
142
      <type>
 
143
        <v>Files = [File]</v>
 
144
        <v>&nbsp;File = name() -- see filename(3)</v>
 
145
      </type>
 
146
      <desc>
 
147
        <p>Compiles a list of files by calling <c>compile:file(File, [report_errors, report_warnings])</c> for each <c>File</c>
 
148
          in <c>Files</c>.</p>
 
149
      </desc>
 
150
    </func>
 
151
    <func>
 
152
      <name>ls() -> void()</name>
 
153
      <fsummary>List files in the current directory</fsummary>
 
154
      <desc>
 
155
        <p>Lists files in the current directory.</p>
 
156
      </desc>
 
157
    </func>
 
158
    <func>
 
159
      <name>ls(Dir) -> void()</name>
 
160
      <fsummary>List files in a directory</fsummary>
 
161
      <type>
 
162
        <v>Dir = name() -- see filename(3)</v>
 
163
      </type>
 
164
      <desc>
 
165
        <p>Lists files in directory <c>Dir</c>.</p>
 
166
      </desc>
 
167
    </func>
 
168
    <func>
 
169
      <name>m() -> void()</name>
 
170
      <fsummary>Which modules are loaded</fsummary>
 
171
      <desc>
 
172
        <p>Displays information about the loaded modules, including
 
173
          the files from which they have been loaded.</p>
 
174
      </desc>
 
175
    </func>
 
176
    <func>
 
177
      <name>m(Module) -> void()</name>
 
178
      <fsummary>Information about a module</fsummary>
 
179
      <type>
 
180
        <v>Module = atom()</v>
 
181
      </type>
 
182
      <desc>
 
183
        <p>Displays information about <c>Module</c>.</p>
 
184
      </desc>
 
185
    </func>
 
186
    <func>
 
187
      <name>memory() -> [{Type, Size}]</name>
 
188
      <fsummary>Memory allocation information</fsummary>
 
189
      <type>
 
190
        <v>Type, Size -- see erlang:memory/0</v>
 
191
      </type>
 
192
      <desc>
 
193
        <p>Memory allocation information. Equivalent to
 
194
          <c>erlang:memory/0</c>.</p>
 
195
      </desc>
 
196
    </func>
 
197
    <func>
 
198
      <name>memory(Type) -> Size</name>
 
199
      <name>memory([Type]) -> [{Type, Size}]</name>
 
200
      <fsummary>Memory allocation information</fsummary>
 
201
      <type>
 
202
        <v>Type, Size -- see erlang:memory/0</v>
 
203
      </type>
 
204
      <desc>
 
205
        <p>Memory allocation information. Equivalent to
 
206
          <c>erlang:memory/1</c>.</p>
 
207
      </desc>
 
208
    </func>
 
209
    <func>
 
210
      <name>nc(File) -> {ok, Module} | error</name>
 
211
      <name>nc(File, Options) -> {ok, Module} | error</name>
 
212
      <fsummary>Compile and load code in a file on all nodes</fsummary>
 
213
      <type>
 
214
        <v>File = name() -- see filename(3)</v>
 
215
        <v>Options = [Opt] -- see compile:file/2</v>
 
216
      </type>
 
217
      <desc>
 
218
        <p>Compiles and then loads the code for a file on all nodes.
 
219
          <c>Options</c> defaults to []. Compilation is equivalent to:</p>
 
220
        <code type="none">
 
221
compile:file(File, Opts ++ [report_errors, report_warnings])</code>
 
222
      </desc>
 
223
    </func>
 
224
    <func>
 
225
      <name>nl(Module) -> void()</name>
 
226
      <fsummary>Load module on all nodes</fsummary>
 
227
      <type>
 
228
        <v>Module = atom()</v>
 
229
      </type>
 
230
      <desc>
 
231
        <p>Loads <c>Module</c> on all nodes.</p>
 
232
      </desc>
 
233
    </func>
 
234
    <func>
 
235
      <name>pid(X, Y, Z) -> pid()</name>
 
236
      <fsummary>Convert X,Y,Z to a pid</fsummary>
 
237
      <type>
 
238
        <v>X = Y = Z = int()</v>
 
239
      </type>
 
240
      <desc>
 
241
        <p>Converts <c>X</c>, <c>Y</c>, <c>Z</c> to the pid
 
242
          <c><![CDATA[<X.Y.Z>]]></c>. This function should only be used when
 
243
          debugging.</p>
 
244
      </desc>
 
245
    </func>
 
246
    <func>
 
247
      <name>pwd() -> void()</name>
 
248
      <fsummary>Print working directory</fsummary>
 
249
      <desc>
 
250
        <p>Prints the name of the working directory.</p>
 
251
      </desc>
 
252
    </func>
 
253
    <func>
 
254
      <name>q() -> void()</name>
 
255
      <fsummary>Quit - shorthand for <c>init:stop()</c></fsummary>
 
256
      <desc>
 
257
        <p>This function is shorthand for <c>init:stop()</c>, that is,
 
258
          it causes the node to stop in a controlled fashion.</p>
 
259
      </desc>
 
260
    </func>
 
261
    <func>
 
262
      <name>regs() -> void()</name>
 
263
      <name>nregs() -> void()</name>
 
264
      <fsummary>Information about registered processes</fsummary>
 
265
      <desc>
 
266
        <p><c>regs/0</c> displays information about all registered
 
267
          processes. <c>nregs/0</c> does the same, but for all nodes
 
268
          in the network.</p>
 
269
      </desc>
 
270
    </func>
 
271
    <func>
 
272
      <name>xm(ModSpec) -> void()</name>
 
273
      <fsummary>Cross reference check a module</fsummary>
 
274
      <type>
 
275
        <v>ModSpec = Module | Filename</v>
 
276
        <v>&nbsp;Module = atom()</v>
 
277
        <v>&nbsp;Filename = string()</v>
 
278
      </type>
 
279
      <desc>
 
280
        <p>This function finds undefined functions, unused functions,
 
281
          and calls to deprecated functions in a module by calling
 
282
          <c>xref:m/1</c>.</p>
 
283
      </desc>
 
284
    </func>
 
285
    <func>
 
286
      <name>y(File) -> YeccRet</name>
 
287
      <fsummary>Generate an LALR-1 parser</fsummary>
 
288
      <type>
 
289
        <v>File = name() -- see filename(3)</v>
 
290
        <v>YeccRet = -- see yecc:file/2</v>
 
291
      </type>
 
292
      <desc>
 
293
        <p>Generates an LALR-1 parser. Equivalent to:</p>
 
294
        <code type="none">
 
295
yecc:file(File)</code>
 
296
      </desc>
 
297
    </func>
 
298
    <func>
 
299
      <name>y(File, Options) -> YeccRet</name>
 
300
      <fsummary>Generate an LALR-1 parser</fsummary>
 
301
      <type>
 
302
        <v>File = name() -- see filename(3)</v>
 
303
        <v>Options, YeccRet = -- see yecc:file/2</v>
 
304
      </type>
 
305
      <desc>
 
306
        <p>Generates an LALR-1 parser. Equivalent to:</p>
 
307
        <code type="none">
 
308
yecc:file(File, Options)</code>
 
309
      </desc>
 
310
    </func>
 
311
  </funcs>
 
312
 
 
313
  <section>
 
314
    <title>See Also</title>
 
315
    <p><seealso marker="compiler:compile">compile(3)</seealso>,
 
316
      <seealso marker="filename">filename(3)</seealso>, 
 
317
      <seealso marker="kernel:erlang">erlang(3)</seealso>, 
 
318
      <seealso marker="parsetools:yecc">yecc(3)</seealso>,
 
319
      <seealso marker="tools:xref">xref(3)</seealso></p>
 
320
  </section>
 
321
</erlref>
 
322