JasPer  4.1.0
jas_stream.h File Reference

I/O Stream Class. More...

#include <jasper/jas_config.h>
#include <stdio.h>
#include <jasper/jas_types.h>

Go to the source code of this file.

Classes

struct  jas_stream_t
 I/O stream object. More...
 

Macros

#define jas_stream_eof(stream)    (((stream)->flags_ & JAS_STREAM_EOF) != 0)
 Get the EOF indicator for a stream. More...
 
#define jas_stream_error(stream)    (((stream)->flags_ & JAS_STREAM_ERR) != 0)
 Get the error indicator for a stream. More...
 
#define jas_stream_clearerr(stream)    ((stream)->flags_ &= ~(JAS_STREAM_ERR | JAS_STREAM_EOF))
 Clear the error indicator for a stream. More...
 
#define jas_stream_getrwlimit(stream)    (((const jas_stream_t *)(stream))->rwlimit_)
 Get the read/write limit for a stream. More...
 
#define jas_stream_getrwcount(stream)    (((const jas_stream_t *)(stream))->rwcnt_)
 Get the read/write count for a stream. More...
 
#define jas_stream_getc(stream)   jas_stream_getc_func(stream)
 jas_stream_getc Read a character from a stream. More...
 
#define jas_stream_putc(stream, c)   jas_stream_putc_func(stream, c)
 jas_stream_putc Write a character to a stream. More...
 
#define jas_stream_peekc(stream)
 Look at the next character to be read from a stream without actually removing the character from the stream. More...
 

Functions

JAS_EXPORT jas_stream_tjas_stream_fopen (const char *filename, const char *mode)
 Open a file as a stream. More...
 
JAS_EXPORT jas_stream_tjas_stream_memopen (char *buffer, size_t buffer_size)
 Open a memory buffer as a stream. More...
 
JAS_DEPRECATED JAS_EXPORT jas_stream_tjas_stream_memopen2 (char *buffer, size_t buffer_size)
 Do not use. More...
 
JAS_EXPORT jas_stream_tjas_stream_fdopen (int fd, const char *mode)
 Open a file descriptor as a stream. More...
 
JAS_EXPORT jas_stream_tjas_stream_freopen (const char *path, const char *mode, FILE *fp)
 Open a stdio (i.e., C standard library) stream as a stream. More...
 
JAS_EXPORT jas_stream_tjas_stream_tmpfile (void)
 Open a temporary file as a stream. More...
 
JAS_EXPORT int jas_stream_close (jas_stream_t *stream)
 Close a stream. More...
 
JAS_EXPORT long jas_stream_setrwlimit (jas_stream_t *stream, long rwlimit)
 Set the read/write limit for a stream. More...
 
JAS_EXPORT long jas_stream_setrwcount (jas_stream_t *stream, long rw_count)
 Set the read/write count for a stream. More...
 
JAS_EXPORT size_t jas_stream_read (jas_stream_t *stream, void *buffer, size_t count)
 Read characters from a stream into a buffer. More...
 
JAS_EXPORT unsigned jas_stream_peek (jas_stream_t *stream, void *buffer, size_t count)
 Attempt to retrieve one or more pending characters of input from a stream into a buffer without actually removing the characters from the stream. More...
 
JAS_EXPORT size_t jas_stream_write (jas_stream_t *stream, const void *buffer, size_t count)
 Write characters from a buffer to a stream. More...
 
JAS_EXPORT int jas_stream_printf (jas_stream_t *stream, const char *format,...)
 Write formatted output to a stream. More...
 
JAS_EXPORT int jas_stream_puts (jas_stream_t *stream, const char *s)
 Write a string to a stream. More...
 
JAS_EXPORT char * jas_stream_gets (jas_stream_t *stream, char *buffer, int buffer_size)
 Read a line of input from a stream. More...
 
JAS_EXPORT int jas_stream_ungetc (jas_stream_t *stream, int c)
 Put a character back on a stream. More...
 
JAS_EXPORT JAS_ATTRIBUTE_PURE int jas_stream_isseekable (jas_stream_t *stream)
 Determine if stream supports seeking. More...
 
JAS_EXPORT long jas_stream_seek (jas_stream_t *stream, long offset, int origin)
 Set the current position within the stream. More...
 
JAS_EXPORT long jas_stream_tell (jas_stream_t *stream)
 Get the current position within the stream. More...
 
JAS_EXPORT int jas_stream_rewind (jas_stream_t *stream)
 Seek to the beginning of a stream. More...
 
JAS_EXPORT int jas_stream_flush (jas_stream_t *stream)
 Flush any pending output to a stream. More...
 
JAS_EXPORT int jas_stream_copy (jas_stream_t *destination, jas_stream_t *source, ssize_t count)
 Copy data from one stream to another. More...
 
JAS_EXPORT int jas_stream_display (jas_stream_t *stream, FILE *fp, int count)
 Print a hex dump of data read from a stream. More...
 
JAS_EXPORT ssize_t jas_stream_gobble (jas_stream_t *stream, size_t count)
 Consume (i.e., discard) characters from stream. More...
 
JAS_EXPORT ssize_t jas_stream_pad (jas_stream_t *stream, size_t count, int value)
 Write a fill character multiple times to a stream. More...
 
JAS_EXPORT long jas_stream_length (jas_stream_t *stream)
 Get the size of the file associated with the specified stream. More...
 

Detailed Description

I/O Stream Class.