www.delorie.com/gnu/docs/glibc/libc_227.html   search  
 
Buy the book!


The GNU C Library

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

12.21 Other Kinds of Streams

The GNU library provides ways for you to define additional kinds of streams that do not necessarily correspond to an open file.

One such type of stream takes input from or writes output to a string. These kinds of streams are used internally to implement the sprintf and sscanf functions. You can also create such a stream explicitly, using the functions described in 12.21.1 String Streams.

More generally, you can define streams that do input/output to arbitrary objects using functions supplied by your program. This protocol is discussed in 12.21.3 Programming Your Own Custom Streams.

Portability Note: The facilities described in this section are specific to GNU. Other systems or C implementations might or might not provide equivalent functionality.

12.21.1 String Streams  Streams that get data from or put data in a string or memory buffer.
12.21.2 Obstack Streams  Streams that store data in an obstack.
12.21.3 Programming Your Own Custom Streams  Defining your own streams with an arbitrary input data source and/or output data sink.


  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003