add IFF constants
This commit is contained in:
		
							parent
							
								
									239dec2d43
								
							
						
					
					
						commit
						73bd4d93a2
					
				@ -174,6 +174,24 @@ static VALUE rb_sigar_net_route(VALUE obj)
 | 
			
		||||
 | 
			
		||||
#include "./rbsigar_generated.rx"
 | 
			
		||||
 | 
			
		||||
#define RB_SIGAR_CONST_INT(name) \
 | 
			
		||||
    rb_define_const(rclass, #name, INT2FIX(SIGAR_##name))
 | 
			
		||||
 | 
			
		||||
static void Init_rbsigar_constants(VALUE rclass)
 | 
			
		||||
{
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_UP);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_BROADCAST);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_DEBUG);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_LOOPBACK);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_POINTOPOINT);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_NOTRAILERS);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_RUNNING);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_NOARP);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_PROMISC);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_ALLMULTI);
 | 
			
		||||
    RB_SIGAR_CONST_INT(IFF_MULTICAST);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Init_rbsigar(void)
 | 
			
		||||
{
 | 
			
		||||
    VALUE rclass = rb_define_class("Sigar", rb_cObject);
 | 
			
		||||
@ -186,6 +204,8 @@ void Init_rbsigar(void)
 | 
			
		||||
    rb_define_singleton_method(rclass, "net_interface_flags_to_s",
 | 
			
		||||
                               rb_sigar_net_interface_flags_to_s, 1);
 | 
			
		||||
 | 
			
		||||
    Init_rbsigar_constants(rclass);
 | 
			
		||||
 | 
			
		||||
    /* generated */
 | 
			
		||||
    rb_sigar_define_module_methods(rclass);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user