Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ stdio(3s) — AIX PS/2 1.2.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

close, closex

ctermid

cuserid

fclose, fflush

feof, ferror, clearerr, fileno

fopen, freopen, fdopen

fread, fwrite

fseek, rewind, ftell

getc, fgetc, getchar, getw, getwc, fgetwc, getwchar

gets, fgets, getws, fgetws

lseek

open, openx, creat

pipe

popen, pclose, rpopen

printf, fprintf, sprintf, NLprintf, NLfprintf, NLsprintf, wsprintf

putc, putchar, fputc, putw, putwc, putwchar, fputwc

puts, fputs, putws, fputws

read, readv, readx

scanf, fscanf, sscanf, NLscanf, NLfscanf, NLsscanf, wsscanf

setbuf, setvbuf

system

tmpfile

tmpnam, tempnam

ungetc, ungetwc

write, writex



STDIO(3s,L)                 AIX Technical Reference                 STDIO(3s,L)



-------------------------------------------------------------------------------
stdio



PURPOSE

Performs standard buffered input and output operations.

LIBRARY

Standard I/O Library (libc.a)

SYNTAX

#include <stdio.h>

FILE *stdin, *stdout, *stderr;

DESCRIPTION

These macros and subroutines provide an efficient user-level I/O buffering
scheme.

The in-line macros getc and putc handle characters quickly.  The following
macros and subroutines all use the getc and putc macros:

+-+--------------------------+----------------------------------------------+
| | GETCHAR macro            | FREAD subroutine                             |
| | GETWCHAR macro           | FSCANF subroutine                            |
| | PUTCHAR macro            | FWRITE subroutine                            |
| | PUTWCHAR macro           | GETS subroutine                              |
| | FGETC subroutine         | GETW subroutine                              |
| | FGETS subroutine         | GETWC subroutine                             |
| | FGETWC subroutine        | PRINTF subroutine                            |
| | FPRINTF subroutine       | PUTS subroutine                              |
| | FPUTC subroutine         | PUTW subroutine                              |
| | FPUTWC subroutine        | PUTWC subroutine                             |
| | FPUTS subroutine         | SCANF subroutine                             |
| |                          | WSPRINTF subroutine                          |
| |                          | WSSCANF subroutine                           |
+-+--------------------------+----------------------------------------------+

A file with associated buffering is called a stream and is declared to be a
pointer to the defined type FILE.  The fopen subroutine constructs descriptive
data for a stream and returns a pointer to designate the stream in all further
transactions.  Normally, there are three open streams with constant pointers
declared in the stdio.h header file and associated with the standard open
streams:

   stdin      Standard input stream
   stdout     Standard output stream



Processed November 7, 1990        STDIO(3s,L)                                 1





STDIO(3s,L)                 AIX Technical Reference                 STDIO(3s,L)



   stderr     Standard error output stream.

The constant NULL (0) designates a special pointer value that does not point to
any data structure.

Most integer subroutines that deal with streams return the constant EOF (-1)
upon end-of-file or an error.  See each individual subroutine for detailed
information about the return value.  Programs that use this input/output
package must include the header file of pertinent macro definitions, as
follows:

      #include <stdio.h>

The subroutines and constants in the input/output package are declared in the
header file and do not need any further declaration.  The constants and the
following routines are implemented as macros.  Redeclaration of these names is
not allowed.

+-+--------------------------+----------------------------------------------+
| | GETC                     | FEOF                                         |
| | GETCHAR                  | FERROR                                       |
| | PUTC                     | CLEARERR                                     |
| | PUTCHAR                  | FILENO                                       |
+-+--------------------------+----------------------------------------------+

Warning:  Invalid stream pointers usually cause errors, possibly including
program termination.  Individual subroutine descriptions describe the possible
error conditions.

RELATED INFORMATION

In this book:  "close, closex," "ctermid," "cuserid," "fclose, fflush," "feof,
ferror, clearerr, fileno," "fopen, freopen, fdopen," "fread, fwrite," "fseek,
rewind, ftell," "getc, fgetc, getchar, getw, getwc, fgetwc, getwchar," "gets,
fgets, getws, fgetws," "lseek," "open, openx, creat," "pipe," "popen, pclose,
rpopen," "printf, fprintf, sprintf, NLprintf, NLfprintf, NLsprintf, wsprintf,"
"putc, putchar, fputc, putw, putwc, putwchar, fputwc," "puts, fputs, putws,
fputws," "read, readv, readx," "scanf, fscanf, sscanf, NLscanf, NLfscanf,
NLsscanf, wsscanf," "setbuf, setvbuf," "system," "tmpfile," "tmpnam, tempnam,"
"ungetc, ungetwc," and "write, writex."

AIX Guide to Multibyte Character Set (MBCS) Support.













Processed November 7, 1990        STDIO(3s,L)                                 2



Typewritten Software • bear@typewritten.org • Edmonds, WA 98026