rendered paste body# 81 "usb.c"
static VALUE rb_cUSB_Bus; static st_table *bus_objects; typedef struct { struct usb_bus *ptr; VALUE parent; } rusb_bu
s_t; static void rusb_bus_free(void *p) { if (p) free(p); } static VALUE rusb_bus_make(struct usb_bus *p, VALUE paren
t) { VALUE v; rusb_bus_t *d; if (p == ((void *)0)) { return ((VALUE)4); } if (st_lookup(bus_objects, (st_data_t)p, (s
t_data_t *)&v)) return v; d = (rusb_bus_t *)ruby_xmalloc(sizeof(*d)); d->ptr = p; d->parent = parent; v = rb_data_obj
ect_alloc(rb_cUSB_Bus,d,(RUBY_DATA_FUNC)0,(RUBY_DATA_FUNC)rusb_bus_free); st_add_direct(bus_objects, (st_data_t)p, (s
t_data_t)v); return v; } static rusb_bus_t *check_usb_bus(VALUE v) { rb_check_type((VALUE)(v),0x22); if (((struct RDa
ta*)(v))->dfree != rusb_bus_free) { rb_raise(rb_eTypeError, "wrong argument type %s (expected USB::" "Bus" ")", rb_cl
ass2name(rb_class_of((VALUE)(v)))); } return (((struct RData*)(v))->data); } static rusb_bus_t *get_rusb_bus(VALUE v)
{ rusb_bus_t *d = check_usb_bus(v); if (!d) { rb_raise(rb_eArgError, "revoked USB::" "Bus"); } return d; } static st
ruct usb_bus *get_usb_bus(VALUE v) { return get_rusb_bus(v)->ptr; } static VALUE get_usb_bus_parent(VALUE v) { return
get_rusb_bus(v)->parent; }