WikiPendium

(beta)

Cconrs()

WikiPendium :: RecentChanges :: RecentlyCommented :: UserSettings :: You are ec2-13-59-218-147.us-east-2.compute.amazonaws.com

Cconrs()

(Char CONsole Read String)

VOID Cconrs( str )

char *str;

Cconrs() reads a string from the standard input stream (GEMDOS handle 0) and echoes it to the standard output stream (GEMDOS handle 1). SystemSpecialKeys like Control-C are processed.

Opcode

10 (0x0A)

Availability

All GEMDOS versions.

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 Control-C is pressed, the buffer is full or either Return or Control-J is pressed.

Caveats

GEMDOS versions 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 SystemSpecialKeys are processed by the function.

When the input stream is redirected, Cconrs() returns 0 in str[1] when the end-of-file marker is reached.

See Also

Cconin(), Cconws()

Il n'y a pas de commentaire sur cette page. [Afficher commentaires/formulaire]