Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

mspack_create_oab_decompressor #2

@retorquere

Description

@retorquere

I need to unpack an OAB file using the python equivalent of the ruby code below. Can someone help me along to get this going?

require 'libmspack'

module LibMsPack
  attach_function :mspack_create_oab_decompressor, [ :pointer ], :pointer
  attach_function :mspack_destroy_oab_decompressor, [ :pointer ], :void

  class OABDecompressor < FFI::Struct
    layout :decompress, callback([:pointer, :string, :string], :int),
           :decompress_incremental, callback([:pointer, :string, :string, :string], :int)
  end

  def LibMsPack.oab_decompress(source, target)
    dec = LibMsPack.mspack_create_oab_decompressor(nil)
    msoab = LibMsPack::OABDecompressor.new(dec)
    msoab[:decompress].call(dec, source, target)
    LibMsPack.mspack_destroy_oab_decompressor(dec)
  end
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions