Граф коммитов

2498 Коммитов

Автор SHA1 Сообщение Дата
akr 69d908a10c * ext/socket/socket.c (host_str): add flags_ptr argument to specify
AI_NUMERICHOST if host is numeric form.
  (port_str): add flags_ptr argument to specify AI_NUMERICSERV if port
  is numeric form.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 15:21:43 +00:00
akr 55b2bf4dec * ext/socket/socket.c (rb_cAddrInfo): new class AddrInfo.
(s_recvfrom): return AddrInfo as address.
  (s_recvfrom_nonblock): ditto.
  (sock_accept): ditto.
  (sock_accept_nonblock): ditto.
  (sock_sysaccept): ditto.
  (bsock_send): accept AddrInfo as address argument.
  (sock_connect): ditto.
  (sock_connect_nonblock): ditto.
  (sock_bind): ditto.
  (sock_s_unpack_sockaddr_in): ditto.
  (sock_s_unpack_sockaddr_un): ditto.
  (bsock_local_address): new method BasicSocket#local_address.
  (bsock_remote_address): new method BasicSocket#remote_address.
  (addrinfo_initialize): new method AddrInfo#initialize.
  (addrinfo_inspect): new method AddrInfo#inspect.
  (addrinfo_afamily): new method AddrInfo#afamily.
  (addrinfo_pfamily): new method AddrInfo#pfamily.
  (addrinfo_socktype): new method AddrInfo#socktype.
  (addrinfo_protocol): new method AddrInfo#protocol.
  (addrinfo_to_sockaddr): new method AddrInfo#to_sockaddr.
  (addrinfo_canonname): new method AddrInfo#canonname.
  (addrinfo_ip_p): new method AddrInfo#ip?.
  (addrinfo_ipv4_p): new method AddrInfo#ipv4?.
  (addrinfo_ipv6_p): new method AddrInfo#ipv6?.
  (addrinfo_unix_p): new method AddrInfo#unix?.
  (addrinfo_getnameinfo): new method AddrInfo#getnameinfo.
  (addrinfo_s_getaddrinfo): new method AddrInfo.getaddrinfo.
  (addrinfo_s_tcp): new method AddrInfo.tcp.
  (addrinfo_s_udp): new method AddrInfo.udp.
  (addrinfo_s_unix): new method AddrInfo.unix.
  (Init_socket): define new class and methods.
  (sock_getaddrinfo): apply socktype hack regardless of ai_flags.
  (addrinfo_new): defined.
  (get_afamily): ditto.
  (fd_socket_addrinfo): ditto.
  (io_socket_addrinfo): ditto.
  (SockAddrStringValue): ditto.
  (SockAddrStringValuePtr): ditto.
  (sockaddr_string_value): ditto.
  (sockaddr_string_value_ptr): ditto.
  (rb_addrinfo_t): ditto.
  (addrinfo_mark): ditto.
  (addrinfo_free): ditto.
  (addrinfo_s_allocate): ditto.
  (IS_ADDRINFO): ditto.
  (check_addrinfo): ditto.
  (get_addrinfo): ditto.
  (alloc_addrinfo): ditto.
  (init_addrinfo): ditto.
  (addrinfo_new): ditto.
  (call_getaddrinfo): ditto.
  (init_addrinfo_getaddrinfo): ditto.
  (make_inspectname): ditto.
  (addrinfo_firstonly_new): ditto.
  (addrinfo_list_new): ditto.
  (init_unix_addrinfo): ditto.
  (ai_get_afamily): ditto.

* ext/socket/mkconstants.rb: generate intern_protocol_family,
  intern_socktype and intern_ipproto.

  [ruby-dev:37692]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21371 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 14:20:15 +00:00
nobu 3117bab125 * ext/socket/socket.c (ruby_getaddrinfo, ruby_getaddrinfo__aix):
constified.

* ext/socket/socket.c (ruby_getnameinfo__aix): protoized.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-07 08:06:29 +00:00
nobu b5470fd243 * ext/socket/socket.c (io_call_close, io_close, pair_yield):
unused unless socketpair exists.

* ext/socket/getnameinfo.c (getnameinfo): moved conditinally used
  variable.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-06 10:18:44 +00:00
kazu 8dd121b5b7 * ext/curses/curses.c (free_window): use xfree instead of free.
[ruby-dev:37200]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-05 07:16:12 +00:00
kazu 8f86bc858f * ext/gdbm/gdbm.c (rb_gdbm_fetch): remove needless cast.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-05 06:53:42 +00:00
akr d4a0895181 * ext/socket/socket.c (rb_getaddrinfo): defined for address lookup without GVL.
(struct getaddrinfo_arg): defined.
  (nogvl_getaddrinfo): defined.
  (rb_getnameinfo): defined for name lookup without GVL.
  (getnameinfo_arg): defined.
  (nogvl_getnameinfo): defined.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21319 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 13:38:58 +00:00
nobu a7999ab13c * ext/extmk.rb (extmake): does not use both of makefile.rb and
extconf.rb at the same time.

* lib/mkmf.rb (DLLIB): depends on Makefile.  [ruby-core:21096]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21297 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 02:11:33 +00:00
nobu 9ac6838183 * ext/socket/socket.c (constant_arg): constified.
* ext/socket/socket.c (optname_arg): cygwin does not have
  IPPROTO_IPV6.

* ext/socket/mkconstants.rb (ipv6_optname_to_int): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21296 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-04 00:27:43 +00:00
akr d51c5a137f * ext/socket/socket.c: redundant #ifdef removed.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21289 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-03 19:34:17 +00:00
akr a900ab57de * ext/socket/socket.c: don't apply socktype hack [ruby-core:184] for
sock_s_getaddrinfo.
  (sock_getaddrinfo): add socktype_hack argument.
  (sock_addrinfo): call sock_getaddrinfo with socktype_hack.
  (sock_s_getaddrinfo): call sock_getaddrinfo without socktype_hack.
  [ruby-dev:37674]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21278 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 14:36:39 +00:00
akr e4b7c0e8a3 * ext/socket/mkconstants.rb: rename family_to_str to intern_family.
it returns ID now.

* ext/socket/socket.c (ipaddr): use intern_family.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21272 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 08:46:26 +00:00
akr b5aebd12c0 * ext/socket/mkconstants.rb: use ID in the values of
family_to_str_hash.  family_to_str returns a VALUE.

* ext/socket/socket.c (ipaddr): follow family_to_str change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21271 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 08:22:36 +00:00
akr 9ce8d4e3b9 * ext/socket/mkconstants.rb: refactored to gather stringizer
description.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21270 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 08:02:36 +00:00
akr 775d5d8f03 * ext/socket/mkconstants.rb: make common prefix optional.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21269 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 06:33:24 +00:00
akr d68b60741c * ext/socket/mkconstants.rb: use hash for family_to_str to avoid
linear search.  lenp argument removed.

* ext/socket/socket.c (ipaddr): call family_to_str without lenp
  argument.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 06:01:57 +00:00
akr 270f2034a7 * ext/socket/mkconstants.rb (gen_int_to_name): don't compare constants
in preprocessor because the constants may be enum.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21267 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 05:33:56 +00:00
akr 90a65796e7 * ext/socket/mkconstants.rb (gen_int_to_name): add lenp argument.
* ext/socket/socket.c (ipaddr): follow argument change.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-02 05:12:14 +00:00
akr 28c2711230 * ext/socket/mkconstants.rb: check duplicates.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21264 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 19:43:49 +00:00
akr aa0ae0d3b6 * ext/socket/socket.c (optname_arg): defined.
(bsock_setsockopt): use optname_arg.
  (bsock_getsockopt): ditto.

* ext/socket/mkconstants.rb: generate so_optname_to_int,
  ip_optname_to_int, ipv6_optname_to_int, tcp_optname_to_int and
  udp_optname_to_int.
  more constants.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21261 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 17:40:41 +00:00
akr ff7e0f7f61 * ext/socket/socket.c (constant_arg): extracted from family_arg.
(family_arg): use constant_arg.
  (socktype_arg): ditto.
  (level_arg): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21260 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 17:09:35 +00:00
akr 59556a0849 * 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
2009-01-01 16:16:08 +00:00
akr c6bbf28a9f * ext/socket/socket.c (family_arg): accept symbols as well.
(socktype_arg): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21257 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:59:10 +00:00
akr 31fa80dadd * ext/socket/socket.c (sock_s_getaddrinfo): use socktype_arg.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21256 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:50:16 +00:00
akr f0dd0577b0 * ext/socket/socket.c (family_arg): extracted from
setup_domain_and_type.
  (socktype_arg): ditto.
  (udp_init): use family_arg.
  (sock_s_gethostbyaddr): ditto.
  (sock_s_getaddrinfo): ditto.
  (sock_s_getnameinfo): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21254 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 15:15:31 +00:00
akr e924cabede * ext/socket/socket.c (sock_s_getnameinfo): use family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21252 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 12:26:57 +00:00
akr 85d13f6165 * 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
2009-01-01 12:09:34 +00:00
akr 48649d21c9 * ext/socket/mkconstants.rb: more possible aliases.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21250 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 12:00:13 +00:00
akr afb0581aa8 * ext/socket/mkconstants.rb: AF_ISO and AF_OSI may be aliased.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21249 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:55:05 +00:00
akr e485a566ed * ext/socket/socket.c (sock_s_getaddrinfo): use family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21247 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:47:55 +00:00
akr 6e4149f04a * ext/socket/socket.c: include constants.h at top.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21246 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 11:18:18 +00:00
akr 10bc6f8d49 * ext/socket/mkconstants.rb: add valp argument for family_to_int and
socktype_to_int.

* ext/socket/socket.c (setup_domain_and_type): use valp argument.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 10:54:38 +00:00
akr 175561f8dd * ext/socket/mkconstants.rb: generate family_to_str.
* ext/socket/socket.c (ipaddr): use family_to_str.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21244 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 10:37:41 +00:00
akr 9787d4faae * ext/socket/mkconstants.rb: generate socktype_to_int.
* ext/socket/socket.c (setup_domain_and_type): use socktype_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21243 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 08:38:14 +00:00
akr 009ad25fdd * ext/socket/socket.c (setup_domain_and_type): initialize ptr.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21242 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 08:27:41 +00:00
akr 7454eab701 * ext/socket/mkconstants.rb: refine family_to_int.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21241 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 08:03:36 +00:00
akr 0c838b4947 * ext/socket/mkconstants.rb: generate family_to_int().
* ext/socket/socket.c (setup_domain_and_type): use family_to_int.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21240 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:49:31 +00:00
akr 89cf0ec1a6 * ext/socket/mkconstants.rb: generate init_constants function.
* ext/socket/socket.c (Init_socket): call init_constants.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21238 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:09:19 +00:00
akr 2b3e480bef * ext/socket/mkconstants.rb (Socket::AF_INET6): moved from socket.c.
(Socket::PF_INET6): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21237 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 07:04:31 +00:00
akr 1c0e798d5c * ext/socket/mkconstants.rb: use erb.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21225 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 06:28:34 +00:00
akr 212e90ce3a * ext/socket/mkconstants.rb: add -o option.
* ext/socket/depend: use mkconstants.rb with -o option.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21224 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-01-01 06:08:41 +00:00
akr ddedc6f125 * ext/socket/socket.c (sock_s_socketpair): yield if a block is given.
(io_call_close): defined.
  (io_close): defined.
  (pair_yield): defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21216 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 15:05:16 +00:00
akr 021aaa70d6 * ext/openssl/ossl_ssl.c (ossl_ssl_read_internal): show openssl error
code in EWOULDBLOCK error.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21210 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 08:18:12 +00:00
akr ef2ff2776b * ext/openssl/ossl_digest.c (GetDigestPtr): use StringValueCStr
instead of STR2CSTR.

* ext/openssl/ossl_pkey_ec.c (ossl_ec_key_initialize): ditto.
  (ossl_ec_group_initialize): ditto.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21208 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 05:55:25 +00:00
akr cb4d7b1a7f * ext/openssl/lib/openssl/buffering.rb (Buffering#read_nonblock):
implemented.

* ext/openssl/ossl_ssl.c (rb_sys_fail_path): removed.
  (fcntl.h): don't include.
  (ossl_ssl_read_internal): defined.
  (ossl_ssl_read): use ossl_ssl_read_internal.
  (ossl_ssl_read_nonblock): use ossl_ssl_read_internal.
  (Init_ossl_ssl): define sysread_nonblock, instead of read_nonblock.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21207 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-31 04:52:18 +00:00
akr a413e50c41 * ext/socket/mkconstants.rb: use sock_define_uconst for INADDR_*
constants because Socket::INADDR_LOOPBACK should be 0x7f000001
  instead of -0xffffff.

* ext/socket/socket.c (sock_define_uconst): defined.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21202 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30 12:19:40 +00:00
ko1 6961f8becc * ext/dl/test/test_import.rb: fix a prototype decl.
pointed out by Takehiro Kubo [ruby-core:20971].



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21186 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-30 08:05:06 +00:00
ko1 d0ed5a9378 * ext/dl/test/test_base.rb: add libc search logic.
this patch is written by Takehiro Kubo.
  [ruby-core:20963] [Bug #932]
* ext/dl/dl.h: Add ",..." as the last argument.
  this patch is written by Takehiro Kubo.
  Bug #633 [ruby-core:19289]
* ext/dl/lib/dl/stack.rb: add add_padding() to calculate
  alignment.  this patch is written by Takehiro Kubo.
  Bug #633 [ruby-core:19289]
* ext/dl/test/test_func.rb: atof()'s return value is double.
  this patch is written by Takehiro Kubo.
  Bug #633 [ruby-core:19289]
* ext/dl/test/test_import.rb:
  - atof()'s return value is double.
  - The types of qsort's second and third argument are size_t.
  - fprintf()'s return value is int.
  this patch is written by Takehiro Kubo.
  Bug #633 [ruby-core:19289]



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21182 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 14:54:24 +00:00
yugui db86fef72f * ext/dl/test/test_base.rb: add x86_64-linux's case again. #932
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21177 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 12:39:31 +00:00
matz d33298e524 * ext/io/wait/wait.c (io_nread): returns number of bytes available
for read.  response to feature request #936 in [ruby-core:20917].

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21169 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-29 09:07:20 +00:00