summaryrefslogtreecommitdiff
path: root/ext/socket/mkconstants.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-02 01:53:02 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-02-02 01:53:02 +0000
commitef9206bbea3b8cb1af66966e74fe8527edab2418 (patch)
tree6150f80801b0de3e46bf2e673e04bb05815850f6 /ext/socket/mkconstants.rb
parenta2d8643e9313590e339933d296ff13d8d85f6b45 (diff)
* ext/socket/rubysocket.h (rb_cSockOpt): declared.
(sockopt_new): ditto. (Init_sockopt): ditto. * ext/socket/init.c (Init_socket_init): call Init_sockopt. * ext/socket/depend: add dependency for option.o * ext/socket/mkconstants.rb: generate intern_level, intern_so_optname, intern_ip_optname, intern_ipv6_optname, intern_tcp_optname, intern_udp_optname and intern_scm_optname. * ext/socket/extconf.rb: add option.o. * ext/socket/basicsocket.c (bsock_setsockopt): accept Socket::Option object. (bsock_getsockopt): return Socket::Option object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21936 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/mkconstants.rb')
-rw-r--r--ext/socket/mkconstants.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index c7f599b..fd1fe3d 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -254,6 +254,13 @@ def_intern('intern_family', /\AAF_/)
def_intern('intern_protocol_family', /\APF_/)
def_intern('intern_socktype', /\ASOCK_/)
def_intern('intern_ipproto', /\AIPPROTO_/)
+def_intern('intern_level', /\A(SOL_SOCKET\z|IPPROTO_)/, /\A(SOL_|IPPROTO_)/)
+def_intern('intern_so_optname', /\ASO_/, "SO_")
+def_intern('intern_ip_optname', /\AIP_/, "IP_")
+def_intern('intern_ipv6_optname', /\AIPV6_/, "IPV6_")
+def_intern('intern_tcp_optname', /\ATCP_/, "TCP_")
+def_intern('intern_udp_optname', /\AUDP_/, "UDP_")
+def_intern('intern_scm_optname', /\ASCM_/, "SCM_")
result = ERB.new(<<'EOS', nil, '%').result(binding)
/* autogenerated file */