home *** CD-ROM | disk | FTP | other *** search
/ Frozen Fish 1: Amiga / FrozenFish-Apr94.iso / bbs / gnu / ixemul-39.47-env-bin.lha / man / cat3 / stdio.0 < prev    next >
Text File  |  1993-12-07  |  8KB  |  199 lines

  1.  
  2. STDIO(3)                   UNIX Programmer's Manual                   STDIO(3)
  3.  
  4. NNAAMMEE
  5.      ssttddiioo - standard input/output library functions
  6.  
  7. SSYYNNOOPPSSIISS
  8.      ##iinncclluuddee <<ssttddiioo..hh>>
  9.      FFIILLEE **ssttddiinn;;
  10.      FFIILLEE **ssttddoouutt;;
  11.      FFIILLEE **ssttddeerrrr;;
  12.  
  13. DDEESSCCRRIIPPTTIIOONN
  14.      The standard I/O library provides a simple and efficient buffered stream
  15.      I/O interface.  Input and ouput is mapped into logical data streams and
  16.      the physical I/O characteristics are concealed. The functions and macros
  17.      are listed below; more information is available from the individual man
  18.      pages.
  19.  
  20.      A stream is associated with an external file (which may be a physical de­
  21.      vice) by _o_p_e_n_i_n_g a file, which may involve creating a new file. Creating
  22.      an existing file causes its former contents to be discarded.  If a file
  23.      can support positioning requests (such as a disk file, as opposed to a
  24.      terminal) then a _f_i_l_e _p_o_s_i_t_i_o_n _i_n_d_i_c_a_t_o_r associated with the stream is
  25.      positioned at the start of the file (byte zero), unless the file is
  26.      opened with appened mode. If append mode is used, the position indicator
  27.      will be placed the end­of­file.  The position indicator is maintained by
  28.      subsequent reads, writes and positioning requests. All input occurs as if
  29.      the characters were read by successive calls to the fgetc(3) function;
  30.      all ouput takes place as if all characters were read by successive calls
  31.      to the fputc(3) function.
  32.  
  33.      A file is disassociated from a stream by _c_l_o_s_i_n_g the file.  Ouput streams
  34.      are flushed (any unwritten buffer contents are transfered to the host en­
  35.      vironment) before the stream is disassociated from the file.  The value
  36.      of a pointer to a FILE object is indeterminate after a file is closed
  37.      (garbage).
  38.  
  39.      A file may be subsequently reopened, by the same or another program exe­
  40.      cution, and its contents reclaimed or modified (if it can be repositioned
  41.      at the start).  If the main function returns to its original caller, or
  42.      the exit(3) function is called, all open files are closed (hence all out­
  43.      put streams are flushed) before program termination.  Other methods of
  44.      program termination, such as abort(3) do not bother about closing files
  45.      properly.
  46.  
  47.      At program startup, three text streams are predefined and need not be
  48.      opened explicitly ­­ _s_t_a_n_d_a_r_d _i_n_p_u_t (for reading converntional input), ­­
  49.      _s_t_a_n_d_a_r_d _o_u_t_p_u_t (for writing converntional input), and _s_t_a_n_d_a_r_d _e_r_r_o_r
  50.      (for writing diagnostic output).  These streams are abbreviated _s_t_d_i_n,
  51.      _s_t_d_o_u_t and _s_t_d_e_r_r. When opened, the standard error stream is not fully
  52.      buffered; the standard input and output streams are fully buffered if and
  53.      only if the streams do not to refer to an interactive device.
  54.  
  55.      Output streams that refer to terminal devices are always line buffered by
  56.      default; pending output to such streams is written automatically whenever
  57.      an input stream that refers to a terminal device is read.  In cases where
  58.      a large amount of computation is done after printing part of a line on an
  59.      output terminal, it is necessary to fflush(3) the standard output before
  60.      going off and computing so that the output will appear.
  61.  
  62.      The ssttddiioo library is a part of the library libc and routines are automat­
  63.      ically loaded as needed by the compilers cc(1) and pc(1).  The SYNOPSIS
  64.      sections of the following manual pages indicate which include files are
  65.      to be used, what the compiler declaration for the function looks like and
  66.      which external variables are of interest.
  67.  
  68.      The following are defined as macros; these names may not be re­used with­
  69.      out first removing their current definitions with #undef: BUFSIZ, EOF,
  70.      FILENAME_MAX, L_cuserid, L_ctermid, L_tmpnam, NULL, SEEK_END, SEEK_SET,
  71.      SEE_CUR, TMP_MAX, clearerr, feof, ferror, fileno, fropen, fwopen, getc,
  72.      getchar, putc, putchar, stderr, stdin, stdout. Function versions of the
  73.      macro functions feof,  ferror,  clearerr,  fileno,  getc,  getchar,
  74.      putc,  and putchar exist and will be used if the macros definitions are
  75.      explicitly removed.
  76.  
  77. SSEEEE AALLSSOO
  78.      open(2),  close(2),  read(2),  write(2)
  79.  
  80. BBUUGGSS
  81.      The standard buffered functions do not interact well with certain other
  82.      library and system functions, especially vfork and abort.
  83.  
  84. SSTTAANNDDAARRDDSS
  85.      The ssttddiioo library conforms to ANSI C3.159­1989 (``ANSI C'').
  86.  
  87. LLIISSTT OOFF FFUUNNCCTTIIOONNSS
  88.      FFuunnccttiioonn       DDeessccrriippttiioonn
  89.      clearerr       check and reset stream status
  90.      fclose         close a stream
  91.      fdopen         stream open functions
  92.      feof           check and reset stream status
  93.      ferror         check and reset stream status
  94.      fflush         flush a stream
  95.      fgetc          get next character or word from input stream
  96.      fgetline       get a line from a stream
  97.      fgetpos        reposition a stream
  98.      fgets          get a line from a stream
  99.      fileno         check and reset stream status
  100.      fopen          stream open functions
  101.      fprintf        formatted output conversion
  102.      fpurge         flush a stream
  103.      fputc          output a character or word to a stream
  104.      fputs          output a line to a stream
  105.      fread          binary stream input/output
  106.      freopen        stream open functions
  107.      fropen         open a stream
  108.      fscanf         input format conversion
  109.      fseek          reposition a stream
  110.      fsetpos        reposition a stream
  111.      ftell          reposition a stream
  112.      funopen        open a stream
  113.      fwopen         open a stream
  114.      fwrite         binary stream input/output
  115.      getc           get next character or word from input stream
  116.      getchar        get next character or word from input stream
  117.      gets           get a line from a stream
  118.      getw           get next character or word from input stream
  119.      mktemp         make temporary file name (unique)
  120.      perror         system error messages
  121.      printf         formatted output conversion
  122.      putc           output a character or word to a stream
  123.      putchar        output a character or word to a stream
  124.      puts           output a line to a stream
  125.      putw           output a character or word to a stream
  126.      remove         remove directory entry
  127.      rewind         reposition a stream
  128.      scanf          input format conversion
  129.      setbuf         stream buffering operations
  130.      setbuffer      stream buffering operations
  131.      setlinebuf     stream buffering operations
  132.      setvbuf        stream buffering operations
  133.      snprintf       formatted output conversion
  134.      sprintf        formatted output conversion
  135.      sscanf         input format conversion
  136.      strerror       system error messages
  137.      sys_errlist    system error messages
  138.      sys_nerr       system error messages
  139.      tempnam        temporary file routines
  140.      tmpfile        temporary file routines
  141.      tmpnam         temporary file routines
  142.      ungetc         un­get character from input stream
  143.      vfprintf       formatted output conversion
  144.      vfscanf        input format conversion
  145.      vprintf        formatted output conversion
  146.      vscanf         input format conversion
  147.      vsnprintf      formatted output conversion
  148.      vsprintf       formatted output conversion
  149.      vsscanf        input format conversion
  150.  
  151. 4th Berkeley Distribution         May 6, 1991                                3
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168.  
  169.  
  170.  
  171.  
  172.  
  173.  
  174.  
  175.  
  176.  
  177.  
  178.  
  179.  
  180.  
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189.  
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.