Method: Archive.write_open_memory

Defined in:
ext/libarchive-0.1.1/ext/libarchive_writer.c

.write_open_memory(v_memory, v_compression, v_format) ⇒ Object



114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
# File 'ext/libarchive-0.1.1/ext/libarchive_writer.c', line 114

static VALUE rb_libarchive_writer_s_open_memory(VALUE self, VALUE v_memory, VALUE v_compression, VALUE v_format) {
  int compression, format;
  const char *cmd = NULL;
  Check_Type(v_memory, T_STRING);

  if (T_STRING == TYPE(v_compression)) {
    compression = -1;
    cmd = RSTRING_PTR(v_compression);
  } else {
    compression = NUM2INT(v_compression);
  }

  format = NUM2INT(v_format);
  return rb_libarchive_writer_s_open0(rb_libarchive_writer_s_open_memory0, (void *) v_memory, compression, format, cmd);
}