Lhasa
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

◆ lha_input_stream_free()

void lha_input_stream_free ( LHAInputStream stream)

Free an LHAInputStream structure.

Parameters
streamThe input stream.

◆ lha_input_stream_from()

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
filenameName of the file to read from.
Returns
Pointer to a new LHAInputStream or NULL for error.

◆ lha_input_stream_from_FILE()

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
streamThe open FILE structure from which to read data.
Returns
Pointer to a new LHAInputStream or NULL for error.

◆ lha_input_stream_new()

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
typePointer to a LHAInputStreamType structure containing callback functions to read data.
handleHandle pointer to be passed to callback functions.
Returns
Pointer to a new LHAInputStream or NULL for error.