fixup ruby NetAddress.to_s

This commit is contained in:
Doug MacEachern 2007-09-09 17:21:45 +00:00
parent a67de34fcd
commit eec208a660
2 changed files with 5 additions and 3 deletions

View File

@ -2140,7 +2140,7 @@ our %field_types = (
Int => "rb_int2inum", Int => "rb_int2inum",
Char => "CHR2FIX", Char => "CHR2FIX",
String => "rb_str_new2", String => "rb_str_new2",
NetAddress => "rb_sigar_net_address_to_string", NetAddress => "rb_sigar_net_address_to_s",
); );
my $rx_file = 'rbsigar_generated.rx'; my $rx_file = 'rbsigar_generated.rx';

View File

@ -59,13 +59,15 @@ static VALUE rb_sigar_net_interface_flags_to_s(VALUE rclass, VALUE flags)
return rb_str_new2(sigar_net_interface_flags_to_string(NUM2LL(flags), buffer)); return rb_str_new2(sigar_net_interface_flags_to_string(NUM2LL(flags), buffer));
} }
static VALUE rb_sigar_net_address_to_string(sigar_net_address_t address) static VALUE rb_sigar_net_address_to_string(sigar_net_address_t *address)
{ {
char addr_str[SIGAR_INET6_ADDRSTRLEN]; char addr_str[SIGAR_INET6_ADDRSTRLEN];
sigar_net_address_to_string(NULL, &address, addr_str); sigar_net_address_to_string(NULL, address, addr_str);
return rb_str_new2(addr_str); return rb_str_new2(addr_str);
} }
#define rb_sigar_net_address_to_s(a) rb_sigar_net_address_to_string(&a)
static VALUE rb_sigar_new_list(char *data, unsigned long number, static VALUE rb_sigar_new_list(char *data, unsigned long number,
int size, VALUE rclass) int size, VALUE rclass)
{ {