Museum

Home

Lab Overview

Retrotechnology Articles

⇒ Online Manual

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

cuserid(3)

fclose(3)

ferror(3)

fopen(3)

fread(3)

fseek(3)

open(2)

close(2)

lseek(2)

pipe(2)

read(2)

write(2)

ctermid(3)

getc(3)

gets(3)

popen(3)

printf(3)

putc(3)

puts(3)

scanf(3)

setbuf(3)

system(3)

tmpfile(3)

tmpnam(3)

ungetc(3)



  stdio(3)                            CLIX                            stdio(3)



  NAME

    stdio - A standard buffered input/output package

  SYNOPSIS

    #include <stdio.h>

    FILE *stdin, *stdout, *stderr

  DESCRIPTION

    The functions in this section (3) of this manual are used primarily as
    efficient, user-level buffering schemes.  The in-line macros getc() and
    putc() handle characters quickly.  The macros getchar() and putchar(), and
    the higher-level functions getc(), fgets(), fprintf(), fputc(), fputs(),
    fread(), fscanf(), fwrite(), gets(), getw(), printf(), puts(), putw(), and
    scanf() all use or mimic the use of the getc() and putc() functions.
    These functions can be freely intermixed.

    A file with associated buffering is called a stream and is declared to be
    a pointer to a defined type of file.  The fopen() function creates certain
    descriptive data for a stream then returns a pointer to designate the
    respective stream in all further transactions.  Normally, there can be
    three open streams.  Constant pointers are declared in the <stdio.h>
    header file and are associated with the following standard open files:

    stdin    standard input file

    stdout   standard output file

    stderr   standard error file

    The constant NULL(0) designates a nonexistent pointer.

    An integer constant BUFSIZ specifies the size of the buffers used by the
    particular implementation.

    Any program that uses this package must include the header file of
    pertinent macro definitions, as follows:

    #include <stdio.h>


    The functions and constants mentioned in Section 3 of this manual are
    declared in that header file and need no further declaration.

    Output streams, with the exception of stderr stream, are by default
    buffered if the output refers to a file and line-buffered if the output
    refers to a terminal.  The stderr stream is by default unbuffered, but use
    of freopen() [see fopen()] causes it to become buffered or line-buffered.



  2/94 - Intergraph Corporation                                              1






  stdio(3)                            CLIX                            stdio(3)



    When an output stream is unbuffered, information is queued for writing to
    the destination file or terminal as soon as written.  When it is buffered,
    many characters are saved up and written as a block.  When it is line-
    buffered, each line of output is queued for writing to the destination
    terminal as soon as the line is completed (that is, as soon as a newline
    character is written or terminal input is requested).

    The setvbuf file contained in the setbuf() function may be used to change
    the buffering strategy of the stream.

  FILES

    setvbuf

  CAUTIONS

    The functions and constants mentioned in Section 3 of this manual are
    declared in that header file and need no further declaration.  The
    constants and the following ``functions'' are implemented as macros
    (redeclaration of these names is dangerous): getc(), getchar(), putc(),
    putchar(), ferror(), feof(), clearerr(), and fileno().

    Invalid stream pointers usually cause serious problems, including possible
    program termination.

  RETURN VALUES

    An integer-constant EOF (-1) is returned at the end-of-file or upon an
    error occurrence by most integer functions that deal with streams.  (See
    the individual descriptions for details).

  ERRORS

    Refer to the individual function descriptions for an explanation of
    possible error conditions.

  RELATED INFORMATION

    Functions:  cuserid(3), fclose(3), ferror(3), fopen(3), fread(3),
    fseek(3), open(2), close(2), lseek(2), pipe(2), read(2), write(2),
    ctermid(3), getc(3), gets(3), popen(3), printf(3), putc(3), puts(3),
    scanf(3), setbuf(3), system(3), tmpfile(3), tmpnam(3), ungetc(3)












  2                                              Intergraph Corporation - 2/94




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