Module Stdio
- Inherit
_Stdio
inherit _Stdio : _Stdio
- Typedef
close_callback_t
local
typedeffunction
(mixed
|void
:int
)|zero
Stdio.close_callback_t
- Description
The type for close callback functions.
- Typedef
fs_event_callback_t
local
typedeffunction
(mixed
|void
,int
:int
)|zero
Stdio.fs_event_callback_t
- Description
The type for fs_event callback function functions.
- Typedef
read_callback_t
local
typedeffunction
(mixed
|void
,string
:int
|void
)|function
(mixed
|void
,Buffer
:int
|void
)|function
(mixed
|void
:int
|void
)|zero
Stdio.read_callback_t
- Description
The various read_callback signatures.
The string (or void) version is used when buffer mode (see
set_buffer_mode
) has not been enabled for reading.The Buffer version is used when a Buffer has been enabled for reading.
In both cases the data is the newly arrived data, but in buffered mode data you did not fully read in the last read callback is kept in the buffer.
- Typedef
read_oob_callback_t
local
typedeffunction
(mixed
|void
,string
|void
:int
)|zero
Stdio.read_oob_callback_t
- Description
The type for read out of band callback functions.
- Typedef
write_callback_t
local
typedeffunction
(mixed
|void
:int
|void
)|function
(mixed
|void
,Buffer
:int
|void
)|zero
Stdio.write_callback_t
- Description
The various write_callback signatures.
The void version is used when buffer mode (see
set_buffer_mode
) has not been enabled for writing.The Buffer version is used when a Buffer has been enabled for writing, add data to that buffer to send it.
- Typedef
write_oob_callback_t
local
typedeffunction
(mixed
|void
:int
)|zero
Stdio.write_oob_callback_t
- Description
The type for write out of band callback functions.
- Constant
DATA_CHUNK_SIZE
final
constantint
Stdio.DATA_CHUNK_SIZE
- Description
Size used in various places to divide incoming or outgoing data into chunks.
- Constant
TCSADRAIN
constant
string
Stdio.TCSADRAIN
- Description
Argument to
Stdio.File()->tcsetattr()
.Change after all output has been written.
- Constant
TCSAFLUSH
constant
string
Stdio.TCSAFLUSH
- Description
Argument to
Stdio.File()->tcsetattr()
.Change after all output has been written, and empty the input buffers.
- Constant
TCSANOW
constant
string
Stdio.TCSANOW
- Description
Argument to
Stdio.File()->tcsetattr()
.Change immediately.
- Variable
stderr
FILE
Stdio.stderr- Description
An instance of FILE("stderr"), the standard error stream. Use this when you want to output error messages.
- See also
- Variable
stdin
FILE
Stdio.stdin- Description
An instance of FILE("stdin"), the standard input stream. Use this when you want to read anything from the standard input. This example will read lines from standard input for as long as there are more lines to read. Each line will then be written to stdout together with the line number. We could use
Stdio.stdout.write()
instead of just write(), since they are the same function.- Example
int main() { int line; while(string s=Stdio.stdin.gets()) write("%5d: %s\n", line++, s); }