103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
# File 'ext/libarchive-0.1.1/ext/libarchive_reader.c', line 103
static VALUE rb_libarchive_reader_s_open_filename(int argc, VALUE *argv, VALUE self) {
VALUE v_filename, v_compression, v_format;
const char *filename = NULL;
int compression = -1, format = -1;
const char *cmd = NULL;
rb_scan_args(argc, argv, "12", &v_filename, &v_compression, &v_format);
Check_Type(v_filename, T_STRING);
filename = RSTRING_PTR(v_filename);
if (T_STRING == TYPE(v_compression)) {
compression = -1;
cmd = RSTRING_PTR(v_compression);
} else if (!NIL_P(v_compression)) {
compression = NUM2INT(v_compression);
}
if (!NIL_P(v_format)) {
format = NUM2INT(v_format);
}
return rb_libarchive_reader_s_open0(rb_libarchive_reader_s_open_filename0, (void *) filename, compression, format, cmd);
}
|