Module: LibMsPack

Extended by:
FFI::Library
Includes:
Constants, MsCab, MsChm, MsHlp, MsKwaj, MsLit, MsOab, MsPack, MsSzdd
Defined in:
lib/libmspack.rb,
lib/libmspack/mscab.rb,
lib/libmspack/mschm.rb,
lib/libmspack/mshlp.rb,
lib/libmspack/mslit.rb,
lib/libmspack/msoab.rb,
lib/libmspack/mskwaj.rb,
lib/libmspack/mspack.rb,
lib/libmspack/msszdd.rb,
lib/libmspack/system.rb,
lib/libmspack/version.rb,
lib/libmspack/constants.rb,
lib/libmspack/exceptions.rb

Defined Under Namespace

Modules: Constants, Exceptions, MsCab, MsChm, MsHlp, MsKwaj, MsLit, MsOab, MsPack, MsSzdd, RubySystem

Constant Summary collapse

VERSION =

Version

'0.11.0'

Constants included from MsPack

MsPack::RubyPackSystem

Constants included from MsSzdd::Constants

MsSzdd::Constants::MSSZDDC_PARAM_MISSINGCHAR, MsSzdd::Constants::MSSZDD_FMT_NORMAL, MsSzdd::Constants::MSSZDD_FMT_QBASIC

Constants included from MsKwaj::Constants

MsKwaj::Constants::MSKWAJC_PARAM_COMP_TYPE, MsKwaj::Constants::MSKWAJC_PARAM_INCLUDE_LENGTH, MsKwaj::Constants::MSKWAJ_COMP_LZH, MsKwaj::Constants::MSKWAJ_COMP_MSZIP, MsKwaj::Constants::MSKWAJ_COMP_NONE, MsKwaj::Constants::MSKWAJ_COMP_SZDD, MsKwaj::Constants::MSKWAJ_COMP_XOR, MsKwaj::Constants::MSKWAJ_HDR_HASEXTRATEXT, MsKwaj::Constants::MSKWAJ_HDR_HASFILEEXT, MsKwaj::Constants::MSKWAJ_HDR_HASFILENAME, MsKwaj::Constants::MSKWAJ_HDR_HASLENGTH, MsKwaj::Constants::MSKWAJ_HDR_HASUNKNOWN1, MsKwaj::Constants::MSKWAJ_HDR_HASUNKNOWN2

Constants included from MsChm::Constants

MsChm::Constants::MSCHMC_ENDLIST, MsChm::Constants::MSCHMC_MSCOMP, MsChm::Constants::MSCHMC_PARAM_DENSITY, MsChm::Constants::MSCHMC_PARAM_INDEX, MsChm::Constants::MSCHMC_PARAM_LANGUAGE, MsChm::Constants::MSCHMC_PARAM_LZXWINDOW, MsChm::Constants::MSCHMC_PARAM_TIMESTAMP, MsChm::Constants::MSCHMC_UNCOMP

Constants included from MsCab::Constants

MsCab::Constants::MSCABD_PARAM_DECOMPBUF, MsCab::Constants::MSCABD_PARAM_FIXMSZIP, MsCab::Constants::MSCABD_PARAM_SEARCHBUF, MsCab::Constants::MSCAB_ATTRIB_ARCH, MsCab::Constants::MSCAB_ATTRIB_EXEC, MsCab::Constants::MSCAB_ATTRIB_HIDDEN, MsCab::Constants::MSCAB_ATTRIB_RDONLY, MsCab::Constants::MSCAB_ATTRIB_SYSTEM, MsCab::Constants::MSCAB_ATTRIB_UTF_NAME, MsCab::Constants::MSCAB_COMP_LZX, MsCab::Constants::MSCAB_COMP_MSZIP, MsCab::Constants::MSCAB_COMP_NONE, MsCab::Constants::MSCAB_COMP_QUANTUM, MsCab::Constants::MSCAB_HDR_NEXTCAB, MsCab::Constants::MSCAB_HDR_PREVCAB, MsCab::Constants::MSCAB_HDR_RESV, MsCab::Constants::MSCAB_HDR_RESV_OFFSET

Constants included from MsPack::Constants

MsPack::Constants::MSPACK_ERR_ARGS, MsPack::Constants::MSPACK_ERR_CHECKSUM, MsPack::Constants::MSPACK_ERR_CRUNCH, MsPack::Constants::MSPACK_ERR_DATAFORMAT, MsPack::Constants::MSPACK_ERR_DECRUNCH, MsPack::Constants::MSPACK_ERR_NOMEMORY, MsPack::Constants::MSPACK_ERR_OK, MsPack::Constants::MSPACK_ERR_OPEN, MsPack::Constants::MSPACK_ERR_READ, MsPack::Constants::MSPACK_ERR_SEEK, MsPack::Constants::MSPACK_ERR_SIGNATURE, MsPack::Constants::MSPACK_ERR_WRITE, MsPack::Constants::MSPACK_SYS_OPEN_APPEND, MsPack::Constants::MSPACK_SYS_OPEN_READ, MsPack::Constants::MSPACK_SYS_OPEN_UPDATE, MsPack::Constants::MSPACK_SYS_OPEN_WRITE, MsPack::Constants::MSPACK_SYS_SEEK_CUR, MsPack::Constants::MSPACK_SYS_SEEK_END, MsPack::Constants::MSPACK_SYS_SEEK_START, MsPack::Constants::MSPACK_VER_LIBRARY, MsPack::Constants::MSPACK_VER_MSCABC, MsPack::Constants::MSPACK_VER_MSCABD, MsPack::Constants::MSPACK_VER_MSCHMC, MsPack::Constants::MSPACK_VER_MSCHMD, MsPack::Constants::MSPACK_VER_MSHLPC, MsPack::Constants::MSPACK_VER_MSHLPD, MsPack::Constants::MSPACK_VER_MSKWAJC, MsPack::Constants::MSPACK_VER_MSKWAJD, MsPack::Constants::MSPACK_VER_MSLITC, MsPack::Constants::MSPACK_VER_MSLITD, MsPack::Constants::MSPACK_VER_MSOABC, MsPack::Constants::MSPACK_VER_MSOABD, MsPack::Constants::MSPACK_VER_MSSZDDC, MsPack::Constants::MSPACK_VER_MSSZDDD, MsPack::Constants::MSPACK_VER_SYSTEM

Class Method Summary collapse

Instance Method Summary collapse

Methods included from MsCab

MsCabdCompLevel, MsCabdCompMethod

Class Method Details

.SysSelfTestFixnum

System self-test function, to ensure both library and calling program can use one another.

A result of MSPACK_ERR_OK means the library and caller are compatible. Any other result indicates that the library and caller are not compatible and should not be used. In particular, a value of MSPACK_ERR_SEEK means the library and caller use different off_t datatypes.

Returns:

  • (Fixnum)

    the result of the self-test



117
118
119
# File 'lib/libmspack.rb', line 117

def self.SysSelfTest
    LibMsPack.SysSelfTestInternal(8)
end

Instance Method Details

#CreateCabCompressor(sys) ⇒ MsCab::MsCabCompressor?

Creates a new CAB compressor.

Parameters:

Returns:



69
# File 'lib/libmspack.rb', line 69

attach_function :CreateCabCompressor, :mspack_create_cab_compressor, [ MsPackSystem.ptr ], MsCabCompressor.ptr

#CreateCabDecompressor(sys) ⇒ MsCab::MsCabDecompressor?

Creates a new CAB decompressor.

Parameters:

Returns:



80
# File 'lib/libmspack.rb', line 80

attach_function :CreateCabDecompressor, :mspack_create_cab_decompressor, [ MsPackSystem.ptr ], MsCabDecompressor.ptr

#DestroyCabCompressor(system) ⇒ Object

Destroys an existing CAB compressor.

Parameters:



74
# File 'lib/libmspack.rb', line 74

attach_function :DestroyCabCompressor, :mspack_destroy_cab_compressor, [ MsCabCompressor.ptr ], :void

#DestroyCabDecompressor(decompressor) ⇒ Object

Destroys an existing CAB decompressor.

Parameters:



85
# File 'lib/libmspack.rb', line 85

attach_function :DestroyCabDecompressor, :mspack_destroy_cab_decompressor, [ MsCabDecompressor.ptr ], :void

#Version(entity) ⇒ Fixnum

Enquire about the binary compatibility version of a specific interface in the library.

Currently, the following interfaces are defined:

  • MSPACK_VER_LIBRARY: the overall library
  • MSPACK_VER_SYSTEM: the MsPackSystem interface
  • MSPACK_VER_MSCABD: the MsCabDecompressor interface
  • MSPACK_VER_MSCABC: the MsCabCompressor interface
  • MSPACK_VER_MSCHMD: the MsChmDecompressor interface
  • MSPACK_VER_MSCHMC: the MsChmCompressor interface
  • MSPACK_VER_MSLITD: the MsLitDecompressor interface
  • MSPACK_VER_MSLITC: the MsLitCompressor interface
  • MSPACK_VER_MSHLPD: the MsHlpDecompressor interface
  • MSPACK_VER_MSHLPC: the MsHlpCompressor interface
  • MSPACK_VER_MSSZDDD: the MsSzddDecompressor interface
  • MSPACK_VER_MSSZDDC: the MsSzddCompressor interface
  • MSPACK_VER_MSKWAJD: the MsKwajDecompressor interface
  • MSPACK_VER_MSKWAJC: the MsKwajCompressor interface
  • MSPACK_VER_MSOABD: the MsOabDecompressor interface
  • MSPACK_VER_MSOABC: the MsOabCompressor interface

The result of the function should be interpreted as follows:

  • -1: this interface is completely unknown to the library
  • 0: this interface is known, but non-functioning
  • 1: this interface has all basic functionality
  • 2, 3, ...: this interface has additional functionality, clearly marked in the documentation as "version 2", "version 3" and so on.

Parameters:

  • entity (Fixnum)

    the interface to request current version of

Returns:

  • (Fixnum)

    the version of the requested interface



63
# File 'lib/libmspack.rb', line 63

attach_function :Version, :mspack_version, [ :int ], :int