457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
|
# File 'ext/rtree/rtree.c', line 457
static VALUE st_json_read(VALUE cls, VALUE io_obj)
{
Check_Type(io_obj, T_FILE);
rb_io_t *io;
GetOpenFile(io_obj, io);
rb_io_check_initialized(io);
rb_io_check_readable(io);
FILE *fp = rb_io_stdio_file(io);
style_t *style;
errno = 0;
if ((style = postscript_style_read(fp)) == NULL)
{
if (errno)
rb_sys_fail(__func__);
else
rb_raise(rb_eRuntimeError, "Failed read from stream");
}
return TypedData_Wrap_Struct(cls, &style_type, style);
}
|