Logo Search packages:      
Sourcecode: calibre version File versions  Download package

mspack_system Struct Reference

#include <mspack.h>

List of all members.


Detailed Description

A structure which abstracts file I/O and memory management.

The library always uses the mspack_system structure for interaction with the file system and to allocate, free and copy all memory. It also uses it to send literal messages to the library user.

When the library is compiled normally, passing NULL to a compressor or decompressor constructor will result in a default mspack_system being used, where all methods are implemented with the standard C library. However, all constructors support being given a custom created mspack_system structure, with the library user's own methods. This allows for more abstract interaction, such as reading and writing files directly to memory, or from a network socket or pipe.

Implementors of an mspack_system structure should read all documentation entries for every structure member, and write methods which conform to those standards.

Definition at line 241 of file mspack.h.


Public Attributes

void *(* alloc )(struct mspack_system *this, size_t bytes)
void(* close )(struct mspack_file *file)
void(* copy )(void *src, void *dest, size_t bytes)
void(* free )(void *ptr)
void(* message )(struct mspack_file *file, char *format,...)
void * null_ptr
struct mspack_file *(* open )(struct mspack_system *this, char *filename, int mode)
int(* read )(struct mspack_file *file, void *buffer, int bytes)
int(* seek )(struct mspack_file *file, off_t offset, int mode)
off_t(* tell )(struct mspack_file *file)
int(* write )(struct mspack_file *file, void *buffer, int bytes)

The documentation for this struct was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index