Functions | Variables

ext/socket/option.c File Reference

#include "rubysocket.h"
Include dependency graph for option.c:

Go to the source code of this file.

Functions

static VALUE constant_to_sym (int constant, ID(*intern_const)(int))
static VALUE optname_to_sym (int level, int optname)
static VALUE sockopt_initialize (VALUE self, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE data)
VALUE rsock_sockopt_new (int family, int level, int optname, VALUE data)
static VALUE sockopt_family_m (VALUE self)
static int sockopt_level (VALUE self)
static VALUE sockopt_level_m (VALUE self)
static int sockopt_optname (VALUE self)
static VALUE sockopt_optname_m (VALUE self)
static VALUE sockopt_data (VALUE self)
static VALUE sockopt_s_int (VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE vint)
static VALUE sockopt_int (VALUE self)
static VALUE sockopt_s_bool (VALUE klass, VALUE vfamily, VALUE vlevel, VALUE voptname, VALUE vbool)
static VALUE sockopt_bool (VALUE self)
static VALUE sockopt_s_linger (VALUE klass, VALUE vonoff, VALUE vsecs)
static VALUE sockopt_linger (VALUE self)
static int inspect_int (int level, int optname, VALUE data, VALUE ret)
static int inspect_errno (int level, int optname, VALUE data, VALUE ret)
static int inspect_timeval_as_interval (int level, int optname, VALUE data, VALUE ret)
static VALUE sockopt_inspect (VALUE self)
static VALUE sockopt_unpack (VALUE self, VALUE template)
void rsock_init_sockopt (void)

Variables

VALUE rb_cSockOpt

Function Documentation

static VALUE constant_to_sym ( int  constant,
ID(*)(int)  intern_const 
) [static]

Definition at line 6 of file option.c.

References ID2SYM, INT2NUM(), and name.

Referenced by optname_to_sym().

static int inspect_errno ( int  level,
int  optname,
VALUE  data,
VALUE  ret 
) [static]

Definition at line 312 of file option.c.

References err, rb_str_catf(), RSTRING_LEN, RSTRING_PTR, and strerror().

Referenced by sockopt_inspect().

static int inspect_int ( int  level,
int  optname,
VALUE  data,
VALUE  ret 
) [static]

Definition at line 298 of file option.c.

References rb_str_catf(), RSTRING_LEN, and RSTRING_PTR.

Referenced by sockopt_inspect().

static int inspect_timeval_as_interval ( int  level,
int  optname,
VALUE  data,
VALUE  ret 
) [static]

Definition at line 386 of file option.c.

References rb_str_catf(), RSTRING_LEN, and RSTRING_PTR.

Referenced by sockopt_inspect().

static VALUE optname_to_sym ( int  level,
int  optname 
) [static]
void rsock_init_sockopt ( void   ) 
VALUE rsock_sockopt_new ( int  family,
int  level,
int  optname,
VALUE  data 
)
static VALUE sockopt_bool ( VALUE  self  )  [static]

Definition at line 224 of file option.c.

References Qfalse, rb_eTypeError, rb_raise(), RSTRING_LEN, RSTRING_PTR, sockopt_data(), and StringValue.

Referenced by rsock_init_sockopt().

static VALUE sockopt_data ( VALUE  self  )  [static]
static VALUE sockopt_family_m ( VALUE  self  )  [static]

Definition at line 81 of file option.c.

References rb_attr_get(), and rb_intern.

Referenced by rsock_init_sockopt(), and sockopt_inspect().

static VALUE sockopt_initialize ( VALUE  self,
VALUE  vfamily,
VALUE  vlevel,
VALUE  voptname,
VALUE  data 
) [static]
static VALUE sockopt_inspect ( VALUE  self  )  [static]
static VALUE sockopt_int ( VALUE  self  )  [static]

Definition at line 178 of file option.c.

References INT2NUM(), rb_eTypeError, rb_raise(), RSTRING_LEN, RSTRING_PTR, sockopt_data(), and StringValue.

Referenced by rsock_init_sockopt().

static int sockopt_level ( VALUE  self  )  [static]

Definition at line 87 of file option.c.

References NUM2INT, rb_attr_get(), and rb_intern.

Referenced by sockopt_level_m(), and sockopt_linger().

static VALUE sockopt_level_m ( VALUE  self  )  [static]

Definition at line 102 of file option.c.

References INT2NUM(), and sockopt_level().

Referenced by rsock_init_sockopt(), and sockopt_inspect().

static VALUE sockopt_linger ( VALUE  self  )  [static]
static int sockopt_optname ( VALUE  self  )  [static]

Definition at line 108 of file option.c.

References NUM2INT, rb_attr_get(), and rb_intern.

Referenced by sockopt_linger(), and sockopt_optname_m().

static VALUE sockopt_optname_m ( VALUE  self  )  [static]

Definition at line 123 of file option.c.

References INT2NUM(), and sockopt_optname().

Referenced by rsock_init_sockopt(), and sockopt_inspect().

static VALUE sockopt_s_bool ( VALUE  klass,
VALUE  vfamily,
VALUE  vlevel,
VALUE  voptname,
VALUE  vbool 
) [static]
static VALUE sockopt_s_int ( VALUE  klass,
VALUE  vfamily,
VALUE  vlevel,
VALUE  voptname,
VALUE  vint 
) [static]
static VALUE sockopt_s_linger ( VALUE  klass,
VALUE  vonoff,
VALUE  vsecs 
) [static]

Definition at line 251 of file option.c.

References AF_UNSPEC, NIL_P, NUM2INT, rb_check_to_integer(), rb_str_new(), rsock_sockopt_new(), and RTEST.

Referenced by rsock_init_sockopt().

static VALUE sockopt_unpack ( VALUE  self,
VALUE  template 
) [static]

Definition at line 656 of file option.c.

References rb_funcall(), rb_intern, and sockopt_data().

Referenced by rsock_init_sockopt().


Variable Documentation

Definition at line 3 of file option.c.

Referenced by rsock_init_sockopt(), and rsock_sockopt_new().