Topic : The ATARI Compendium
Author : Scott Sanders / JAY Software
Version : 1.25 (20/6/2003)
Subject : Documentation
Nodes : 1117
Index Size : 32614
HCP-Version : 6
Compiled on : Atari
@charset : UTF-8
@lang : en
@default :
@help : %About
@options : +g -i -t4 +y +z
@width : 100
View Ref-FileCconin()Cconws()Cconrs() GEMDOSSyntaxVOID Cconrs( str )
char *str;
Function Cconrs() reads a string from the standard input stream
(GEMDOS handle 0) and echoes it to the standard output stream
(GEMDOS handle 1).
Opcode 10 (0x0A)
Availability All GEMDOSversions.
Parameters str should be a character pointer large enough to hold the
inputted string. On function entry, str[0] should be equal to
the maximum number of characters to read.
Binding pea str
move.w #$0A,-(sp)
trap #1
addq.l #6,sp
Return Value On return, the string buffer passed as a parameter will be
filled in with the inputted characters. str[1] will contain
the actual number of characters in the buffer. (char *)
&str[2] is the pointer to the start of the actual string in
memory. Cconrs() will not terminate unless ctrl-c is pressed,
the buffer is full or either return or ctrl-j is pressed.
Caveats GEMDOSversions below 0.15 echoes the input to the console
even if output has been redirected elsewhere.
Comments The string Cconrs() creates is not null-terminated. The
following keys are processed by the function:
Key Translation
return End of input. Do not place RETURN in in buffer.
ctrl-j End of line. Do not place CTRL-J in buffer.
ctrl-h Kill last character.
delete Kill last character.
ctrl-u Echo input line and start over.
ctrl-x Kill input line and start over.
ctrl-r Echo input line and continue.
ctrl-c Exit program.
When the input stream is redirected, Cconrs() returns 0 in
str[1] when the end-of-file marker is reached.
See Also Cconin(), Cconws()