Data Structures | Typedefs | Functions

lha_input_stream.h File Reference

LHA input stream structure. More...

Data Structures

struct  LHAInputStreamType
 Structure containing pointers to callback functions to read data from the input stream. More...

Typedefs

typedef struct _LHAInputStream LHAInputStream
 Opaque structure, representing an input stream used to read data from an LZH file.

Functions

LHAInputStreamlha_input_stream_new (const LHAInputStreamType *type, void *handle)
 Create new LHAInputStream structure, using a set of generic functions to provide LHA data.
LHAInputStreamlha_input_stream_from (char *filename)
 Create new LHAInputStream, reading from the specified filename.
LHAInputStreamlha_input_stream_from_FILE (FILE *stream)
 Create new LHAInputStream, to read from an already-open FILE pointer.
void lha_input_stream_free (LHAInputStream *stream)
 Free an LHAInputStream structure.

Detailed Description

LHA input stream structure.

This file defines the functions relating to the LHAInputStream structure, used to read data from an LZH file.


Function Documentation

void lha_input_stream_free ( LHAInputStream stream  ) 

Free an LHAInputStream structure.

Parameters:
stream The input stream.
LHAInputStream* lha_input_stream_from ( char *  filename  ) 

Create new LHAInputStream, reading from the specified filename.

The file is automatically closed when the input stream is freed.

Parameters:
filename Name of the file to read from.
Returns:
Pointer to a new LHAInputStream or NULL for error.
LHAInputStream* lha_input_stream_from_FILE ( FILE *  stream  ) 

Create new LHAInputStream, to read from an already-open FILE pointer.

The FILE is not closed when the input stream is freed; the calling code must close it.

Parameters:
stream The open FILE structure from which to read data.
Returns:
Pointer to a new LHAInputStream or NULL for error.
LHAInputStream* lha_input_stream_new ( const LHAInputStreamType type,
void *  handle 
)

Create new LHAInputStream structure, using a set of generic functions to provide LHA data.

Parameters:
type Pointer to a LHAInputStreamType structure containing callback functions to read data.
handle Handle pointer to be passed to callback functions.
Returns:
Pointer to a new LHAInputStream or NULL for error.