summaryrefslogtreecommitdiff
path: root/static/v10/man3/getchr.3
diff options
context:
space:
mode:
Diffstat (limited to 'static/v10/man3/getchr.3')
-rw-r--r--static/v10/man3/getchr.355
1 files changed, 55 insertions, 0 deletions
diff --git a/static/v10/man3/getchr.3 b/static/v10/man3/getchr.3
new file mode 100644
index 00000000..8a41ae69
--- /dev/null
+++ b/static/v10/man3/getchr.3
@@ -0,0 +1,55 @@
+.th GETCHAR III 4/7/73
+.sh NAME
+getchar \*- read character
+.sh SYNOPSIS
+.ft B
+getchar( )
+.br
+.ft R
+.sh DESCRIPTION
+.it Getchar
+provides the simplest means of reading characters from
+the standard input for C programs.
+It returns successive characters until end-of-file,
+when it returns ``\\0''.
+.s3
+Associated with this routine is an external variable
+called \fIfin\fR, which is a structure containing
+a buffer such as described under \fIgetc\fR (III).
+.s3
+Normally input via \fIgetchar\fR is unbuffered,
+but if the file-descriptor (first) word of
+.it fin
+is non-zero,
+.it getchar
+calls
+.it getc
+with
+.it fin
+as
+argument.
+This means that
+.s3
+ fin = open(...)
+.s3
+makes
+.it getchar
+return (buffered) input from
+the opened file; also
+.s3
+ fin = dup(0);
+.s3
+causes the standard input to be buffered.
+.s3
+Generally speaking,
+.it getchar
+should be used only for the simplest applications;
+.it getc
+is better when there are multiple input files.
+.sh "SEE ALSO"
+getc (III)
+.sh DIAGNOSTICS
+Null character returned on EOF or error.
+.sh BUGS
+\*-1 should be
+returned on EOF; null is a legitimate character.