コード例 #1
0
ファイル: cabd.c プロジェクト: dfiloni/msn-pecan
/***************************************
 * MSPACK_CREATE_CAB_DECOMPRESSOR
 ***************************************
 * constructor
 */
struct mscab_decompressor *
  mspack_create_cab_decompressor(struct mspack_system *sys)
{
  struct mscab_decompressor_p *this = NULL;

  if (!sys) sys = mspack_default_system;
  if (!mspack_valid_system(sys)) return NULL;

  if ((this = sys->alloc(sys, sizeof(struct mscab_decompressor_p)))) {
    this->base.open       = &cabd_open;
    this->base.close      = &cabd_close;
    this->base.search     = &cabd_search;
    this->base.extract    = &cabd_extract;
    this->base.prepend    = &cabd_prepend;
    this->base.append     = &cabd_append;
    this->base.set_param  = &cabd_param;
    this->base.last_error = &cabd_error;
    this->system          = sys;
    this->d               = NULL;
    this->error           = MSPACK_ERR_OK;

    this->param[MSCABD_PARAM_SEARCHBUF] = 32768;
    this->param[MSCABD_PARAM_FIXMSZIP]  = 0;
    this->param[MSCABD_PARAM_DECOMPBUF] = 4096;
  }
  return (struct mscab_decompressor *) this;
}
コード例 #2
0
ファイル: oabd.c プロジェクト: NSGod/libmspack
struct msoab_decompressor *
  mspack_create_oab_decompressor(struct mspack_system *sys)
{
  struct msoab_decompressor_p *self = NULL;

  if (!sys) sys = mspack_default_system;
  if (!mspack_valid_system(sys)) return NULL;

  if ((self = (struct msoab_decompressor_p *) sys->alloc(sys, sizeof(struct msoab_decompressor_p)))) {
    self->base.decompress             = &oabd_decompress;
    self->base.decompress_incremental = &oabd_decompress_incremental;
    self->system                      = sys;
  }
  return (struct msoab_decompressor *) self;
}
コード例 #3
0
ファイル: kwajd.c プロジェクト: Brandon7357/rockbox
/***************************************
 * MSPACK_CREATE_KWAJ_DECOMPRESSOR
 ***************************************
 * constructor
 */
struct mskwaj_decompressor *
    mspack_create_kwaj_decompressor(struct mspack_system *sys)
{
  struct mskwaj_decompressor_p *self = NULL;

  if (!sys) sys = mspack_default_system;
  if (!mspack_valid_system(sys)) return NULL;

  if ((self = (struct mskwaj_decompressor_p *) sys->alloc(sys, sizeof(struct mskwaj_decompressor_p)))) {
    self->base.open       = &kwajd_open;
    self->base.close      = &kwajd_close;
    self->base.extract    = &kwajd_extract;
    self->base.decompress = &kwajd_decompress;
    self->base.last_error = &kwajd_error;
    self->system          = sys;
    self->error           = MSPACK_ERR_OK;
  }
  return (struct mskwaj_decompressor *) self;
}
コード例 #4
0
ファイル: szddd.c プロジェクト: hilarycheng/ring3k
/***************************************
 * MSPACK_CREATE_SZDD_DECOMPRESSOR
 ***************************************
 * constructor
 */
struct msszdd_decompressor *
  mspack_create_szdd_decompressor(struct mspack_system *sys)
{
  struct msszdd_decompressor_p *this = NULL;

  if (!sys) sys = mspack_default_system;
  if (!mspack_valid_system(sys)) return NULL;

  if ((this = sys->alloc(sys, sizeof(struct msszdd_decompressor_p)))) {
    this->base.open       = &szddd_open;
    this->base.close      = &szddd_close;
    this->base.extract    = &szddd_extract;
    this->base.decompress = &szddd_decompress;
    this->base.last_error = &szddd_error;
    this->system          = sys;
    this->error           = MSPACK_ERR_OK;
  }
  return (struct msszdd_decompressor *) this;
}