Lhasa: lha_input_stream.h File Reference

Lhasa

Loading...
Searching...
No Matches
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
LHAInputStream * | lha_input_stream_new (const LHAInputStreamType *type, void *handle)
| Create new LHAInputStream structure, using a set of generic functions to provide LHA data.
LHAInputStream * | lha_input_stream_from (char *filename)
| Create new LHAInputStream, reading from the specified filename.
LHAInputStream * | lha_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

  stream | The 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

  filename | Name 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

  stream | The 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

  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.