* ext/socket/mkconstants.rb: check all alias possibility.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
48649d21c9
commit
85d13f6165
@ -1,3 +1,7 @@
|
|||||||
|
Thu Jan 1 21:08:34 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
|
* ext/socket/mkconstants.rb: check all alias possibility.
|
||||||
|
|
||||||
Thu Jan 1 20:59:55 2009 Tanaka Akira <akr@fsij.org>
|
Thu Jan 1 20:59:55 2009 Tanaka Akira <akr@fsij.org>
|
||||||
|
|
||||||
* ext/socket/mkconstants.rb: more possible aliases.
|
* ext/socket/mkconstants.rb: more possible aliases.
|
||||||
|
@ -93,28 +93,12 @@ ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_name_to_int(str_var, len_var,
|
|||||||
}
|
}
|
||||||
EOS
|
EOS
|
||||||
|
|
||||||
MAYBE_ALIAS = [
|
|
||||||
["AF_UNIX", "AF_LOCAL"],
|
|
||||||
["AF_ISO", "AF_OSI"],
|
|
||||||
["AF_E164", "AF_ISDN"],
|
|
||||||
["AF_NS", "AF_IPX"],
|
|
||||||
]
|
|
||||||
|
|
||||||
def each_alias(pat)
|
def each_alias(pat)
|
||||||
h = {}
|
names = []
|
||||||
each_name(pat) {|name|
|
each_name(pat) {|n|
|
||||||
h[name] = [name]
|
names << n
|
||||||
}
|
|
||||||
MAYBE_ALIAS.each {|names|
|
|
||||||
a = []
|
|
||||||
names.each {|n|
|
|
||||||
a << n if h.delete n
|
|
||||||
}
|
|
||||||
h[a.first] = a
|
|
||||||
}
|
|
||||||
h.each_value {|names|
|
|
||||||
yield names
|
|
||||||
}
|
}
|
||||||
|
yield names
|
||||||
end
|
end
|
||||||
|
|
||||||
ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name(int_var, pat)")
|
ERB.new(<<'EOS', nil, '%').def_method(Object, "gen_int_to_name(int_var, pat)")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user