blob: 2072cb5d65438ce168012c565f11546638615a71 [file] [log] [blame]
Bryan Duxburyd815c212009-03-19 18:57:43 +00001
2#define GET_TRANSPORT(obj) rb_ivar_get(obj, transport_ivar_id)
3#define GET_STRICT_READ(obj) rb_ivar_get(obj, strict_read_ivar_id)
4#define GET_STRICT_WRITE(obj) rb_ivar_get(obj, strict_write_ivar_id)
5#define WRITE(obj, data, length) rb_funcall(obj, write_method_id, 1, rb_str_new(data, length))
6#define CHECK_NIL(obj) if (NIL_P(obj)) { rb_raise(rb_eStandardError, "nil argument not allowed!");}
7#define READ(obj, length) rb_funcall(GET_TRANSPORT(obj), read_method_id, 1, INT2FIX(length))