Class: XCB::ListHostsReply

Inherits:
Object
  • Object
show all
Defined in:
ext/xproto.c

Instance Method Summary collapse

Instance Method Details

#hostsObject



4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
# File 'ext/xproto.c', line 4389

static VALUE
r_XCB_ListHostsReply_get_hosts(VALUE r_self)
{
	xcb_list_hosts_reply_t *reply;
	Data_Get_Struct(r_self, xcb_list_hosts_reply_t, reply);
	xcb_host_iterator_t iterator = xcb_list_hosts_hosts_iterator(reply);
	VALUE r_hosts = rb_ary_new();
	while (iterator.rem != 0) {
		xcb_host_t *data = malloc(sizeof(xcb_host_t));
		if (data == NULL)
			rb_raise(rb_eNoMemError, "NoMemoryError");
		VALUE r_data = Data_Wrap_Struct(r_XCB_HOST, NULL, NULL, data);
		*data = *iterator.data;
		rb_ary_push(r_hosts, r_data);
		xcb_host_next(&iterator);
	}
	return r_hosts;
}

#hosts_lenObject



4382
4383
4384
4385
4386
4387
4388
# File 'ext/xproto.c', line 4382

static VALUE
r_XCB_ListHostsReply_get_hosts_len(VALUE r_self)
{
	xcb_list_hosts_reply_t *reply;
	Data_Get_Struct(r_self, xcb_list_hosts_reply_t, reply);
	return INT2FIX(reply->hosts_len);
}

#modeObject



4375
4376
4377
4378
4379
4380
4381
# File 'ext/xproto.c', line 4375

static VALUE
r_XCB_ListHostsReply_get_mode(VALUE r_self)
{
	xcb_list_hosts_reply_t *reply;
	Data_Get_Struct(r_self, xcb_list_hosts_reply_t, reply);
	return INT2FIX(reply->mode);
}