summaryrefslogtreecommitdiff
path: root/ext/socket/mkconstants.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 16:16:08 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2009-01-01 16:16:08 +0000
commit59556a0849afb29c699261a9a837e72c590686bc (patch)
treeb86bb7e4f681a3c08dac949067f36dc5a70e09c5 /ext/socket/mkconstants.rb
parentc6bbf28a9f139a5fbf34e54673328d3d58e8e397 (diff)
* ext/socket/socket.c (level_arg): defined.
(bsock_setsockopt): use level_arg. (bsock_getsockopt): ditto. * ext/socket/mkconstants.rb: generate level_to_int. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21258 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/socket/mkconstants.rb')
-rw-r--r--ext/socket/mkconstants.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/ext/socket/mkconstants.rb b/ext/socket/mkconstants.rb
index d3eac7f..a4f7569 100644
--- a/ext/socket/mkconstants.rb
+++ b/ext/socket/mkconstants.rb
@@ -151,6 +151,12 @@ socktype_to_int(char *str, int len, int *valp)
<%= gen_name_to_int("str", "len", "valp", /\ASOCK_/) %>
}
+static int
+level_to_int(char *str, int len, int *valp)
+{
+<%= gen_name_to_int("str", "len", "valp", /\A(SOL_SOCKET\z|IPPROTO_)/) %>
+}
+
static char *
family_to_str(int val)
{