summaryrefslogtreecommitdiffstats
path: root/ext
Commit message (Collapse)AuthorAgeFilesLines
...
* * string.c (rb_str_aset): should raise error if an indexing stringmatz2002-06-042-4/+5
| | | | | | | | | | | | is not found in the receiver. * sprintf.c (rb_f_sprintf): "%d" should convert objects into integers using Integer(). * lib/tempfile.rb (Tempfile::size): added. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2517 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * tkfont.rb: Fix bugs on TkFont.init_widget_font for Tk8.x.nagai2002-06-0410-171/+721
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * tkafter.rb: Add self to 1st argument of interval- and loop-proc TkAfter#current_interval returns an interval (sleep) time value TkAfter#current_args returns an array of arguments TkAfter#return_value returns a return value of last loop-proc e.g. TkAfter.new( proc{|obj| 500 - obj.current_interval}, 10, [proc{|obj| p obj.current_args}, 'proc', 1], proc{|obj| p obj.current_args; ['return', 2]}, [proc{|obj| p obj.return_value p ['proc', obj.current_args[0].call(obj.return_value[1], obj.current_args[1])]}, proc{|*args| args[0] + args[1]}, 1], proc{p ['proc', 4]} ).start(100) * tk*.rb: Allow to use Symbols for parameters. Allow new notation of constructor (also allow old notation). e.g. TkFrame.new('classname'=>'User'){|base| pack f = TkFrame.new(base, :classname=>'ButtonFrame').pack TkButton.new( :parent => f, :text => 'Quit', :command => proc{exit} ).pack( :fill => :x, :pady => 2 ) } * tkcanvas.rb: (TkcItem) Add 'coords' parameter to the canvas item constructor (for new notation of constructor). e.g. c = TkCanvas.new.pack l = TkcLine.new(c, :coords=>[[0,0], [100,100]]) * tcltklib.c: New 'mainloop' and 'mainloop_watchdog'. The priority of their event-loop can be controlled. They accept an optional argument. If it false, they don't exit although the root widget is destroyed. This function is sometimes useful, if it is used with 'restart'. 'mainloop' can't treat Thread#join/value in a callback routine. (e.g. TkButton.new(:command=>proc{p Thread.new{button.invoke}.value}) ) 'mainloop_watchdog' can treat them, but watchdog thread is always running (so, a little heavier than 'mainloop'). If the purpose of using Thread#join/value is to do something under some safe-level, please use Proc object. (e.g. :command=>proc{$SAFE=1;proc{$SAFE=2;button.invoke}.call;p $SAFE}) * tk.rb: Support functions of new 'mainloop' and 'mainloop_watchdog'. * tk.rb: (Tk.restart) Add 'app-name' paramater and 'use' parameter. 'app-name' specifies the name and the resource class of the application. If 'app-name' is specified to 'xxx', the application class on the resource database is set to 'Xxx' and the application name is changed by the same rule of Tk.appname method. 'use' specifies the main window for embedding the root widget instead of generating a new window. * tk.rb: Add new parameter 'widgetname' to the widget constructor to support effective use of Resource Database. For example, the resource 'Xxx*quit.text: QUIT' can set the text of the button generated by the following code. e.g. Tk.restart('Xxx') TkButton.new(nil, 'widgetname'=>'quit', 'command'=>proc{exit}).pack Tk.mainloop * tk.rb: TkOption::get always returns a tainted string. Add TkOption::new_proc_class. It generates a class to import procedures defined on the resource database. For example, there is a following resource file. ----< resource-test >------------ *CMD.foo: {|*args| p [$SAFE, :foo, args]} *CMD.XXX.bar: {|*args| p [$SAFE, :bar, args]} *Button.command: ruby {p self; p $SAFE; TkOption::CMD::XXX.bar(1,2,3)} --------------------------------- The following code is a sample of use of the resource file. e.g. require 'tk' TkOption.readfile 'resource-test' p TkOption.new_proc_class(:CMD, [:foo], 1) p TkOption.new_proc_class(:XXX, [:bar], 2, false, TkOption::CMD) TkButton.new(:text=>'test').pack Tk.mainloop git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2515 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/getaddrinfo.c (gai_strerror): make literals const.nobu2002-06-031-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2513 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/addrinfo.h: typo.nobu2002-06-033-51/+122
| | | | | | | | | | | | | | * ext/socket/getaddrinfo.c (gai_strerror): get rid of warning. * ext/socket/socket.c (init_inetsock): ensures resources are freed at exceptions. * ext/socket/socket.c (init_unixsock): ditto. * ext/socket/socket.c (udp_connect): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2511 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* change PLATFORM with RUBY_PLATFORM.suke2002-06-032-2/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2510 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* merge win32ole from roughsuke2002-06-0130-0/+14144
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Wed May 29 18:55:47 2002 KONISHI Hiromasa <H_Konishi@ruby-lang.org>H_Konishi2002-05-291-2/+2
| | | | | | | | | * function renames my* and win32_* to rb_w32_* in win32/win32.c fixed files win32/win32.c, win32/win32.h, win32/dir.h, hash.c, rubysig.h, signal.c, ext/socket/socket.c git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2504 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * parse.y: yyparse #defines moved from intern.hmatz2002-05-291-18/+68
| | | | | | | | | | | | | | | | | | | * ruby.c (proc_options): access prefixed "ruby_yydebug". * applied modifies to pacify some of gcc -Wall warnings. * parse.y (arg): no more ugly hack for "**", so that "-2**2" to be parsed as "(-2)**2", whereas "- 2**2" or "-(2)**2" to be parsed as "-(2**2)". * parse.y (yylex): '-2' to be literal fixnum. [new] * time.c (time_succ): new method for Range support. * time.c (time_arg): nil test against v[6] (usec). git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2500 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ruby.c (proc_options): removed "-*-" support for #! line.matz2002-05-231-0/+45
| | | | | | | | | | | | | * io.c (rb_io_s_sysopen): new method to get a raw file descriptor. [new] * ext/socket/socket.c (tcp_sysaccept): new method to return an accepted socket fd (integer). [new] * ext/socket/socket.c (unix_sysaccept,sock_sysaccept): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2492 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of a function.ttate2002-05-201-1/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2478 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of a few functions.ttate2002-05-201-7/+2
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2477 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* rename PtrData::alloc and Struct#alloc to malloc respectively.ttate2002-05-205-20/+23
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2476 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of the declaration of rb_str_cat2().ttate2002-05-204-48/+37
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2475 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add DL::DLSTACK.ttate2002-05-154-60/+69
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2459 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* cast to long from char, short and int in ASM_PUSH_XXXX.ttate2002-05-122-7/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2452 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/dl: enable dl's stack emulation for constructing function call.ttate2002-05-111-3/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2451 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* enable dl's stack emulation for constructing function call.ttate2002-05-113-38/+122
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2450 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * re.c (rb_reg_s_quote): # also should be quoted.matz2002-05-071-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2440 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/iconv/iconv.c (iconv_try): should initialize exceptionsnobu2002-05-071-7/+10
| | | | | | | properly. (ruby-bugs-ja:PR#232) git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2437 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/extmk.rb.in, lib/mkmf.rb: use 'do...end' instead of '{}' for Borland make.eban2002-05-021-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2424 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Catch the exception SystemExit in extconf.rb.ttate2002-05-011-0/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2422 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* L641: rb_float_new(*((float*)ptr)) -> rb_float_new(*((double*)ptr)).ttate2002-05-011-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2418 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dl/ptr.c: missing break in switch statements.ttate2002-04-262-14/+32
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2415 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/stringio/stringio.c (strio_mark): must check if ptr is NULLnobu2002-04-231-2/+3
| | | | | | | | | | first. [ruby-talk:38873] * lib/mkmf.rb (create_makefile): should print depend file when make is other than nmake. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2399 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/extmk.rb.in (create_makefile): use `{$(srcdir)}' directive insteadusa2002-04-231-1/+1
| | | | | | | | | | of `$(srcdir)/' when including depend file. * lib/mkmf.rb (create_makefile): add `{$(srcdir)}' when including depend file. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2398 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add a sample which shows how to deal with C++ libraries.ttate2002-04-203-0/+97
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2394 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * configure.in: cleanup for autoconf 2.5x.eban2002-04-191-1/+1
| | | | | | | | * configure.in: use gcc -shared instead of dllwrap on Cygwin/MinGW. * ext/extmk.rb, lib/mkmf.rb: get rid of "--def=". git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2390 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/socket/extconf.rb: include <windows.h>, <winsock.h> on _WIN32.eban2002-04-191-9/+19
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* ext/dl/ptr.c: remove rb_dlptr_cast().ttate2002-04-191-39/+0
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2384 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* copied from ext/etc.nobu2002-04-184-0/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/Setup*, ext/bigfloat/*: Back out the import of BigFloat inknu2002-04-1711-5224/+0
| | | | | | | favor of its forthcoming successor, BigDecimal. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2378 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * pack.c (pack_unpack): should treat 'U' in character unit, not inmatz2002-04-151-1/+0
| | | | | | | | | | | | | byte unit. * error.c (exc_initialize): should clear backtrace information. * io.c (rb_io_fptr_cleanup): should close IO created by IO.new(fd). * rubyio.h: remove FMODE_FDOPEN git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2375 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Correct.ttate2002-04-141-8/+8
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2374 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Edit the documentation.ttate2002-04-141-2/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2373 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* raise() -> rb_raise(). (Thanks Tetsuya Watanabe)ttate2002-04-113-19/+13
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2361 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add DL::Importable::Internal::Struct#alloc.ttate2002-04-112-68/+53
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2360 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add dl.txt instead of README.ttate2002-04-112-8/+264
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2359 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* remove README and README.htmlttate2002-04-113-433/+12
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2358 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Support "unsigned short".ttate2002-04-111-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2357 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add "unsigned short".ttate2002-04-111-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2356 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* define alias "struct" and "union" in the module Importable.ttate2002-04-111-2/+7
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add/Fix types.ttate2002-04-101-1/+3
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2353 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Implement the substitution for structure members.ttate2002-04-101-1/+6
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2352 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * variable.c (rb_obj_remove_instance_variable): raise NameError ifmatz2002-04-101-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | specified instance variable is not defined. * variable.c (generic_ivar_remove): modified to check ivar existence. * file.c (rb_file_s_extname): new method based on the proposal (and patch) from Mike Hall. [new] * eval.c (error_handle): default to 1 unless status is set. * eval.c (ruby_options): guard error_handle() with PROT_NONE. * eval.c (ruby_stop): ditto. * math.c (math_acosh): added. [new] * math.c (math_asinh): ditto. * math.c (math_atanh): ditto. * struct.c (rb_struct_each_pair): method added. [new] * class.c (rb_singleton_class): wrong condition; was creating unnecessary singleton class. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * ext/stringio/stringio.c (check_modifiable): performancenobu2002-04-091-4/+15
| | | | | | | | | | | | | | improvement. avoid calling rb_str_modify() twice. * ext/stringio/stringio.c (strio_ungetc): ditto. * ext/stringio/stringio.c (strio_putc): ditto. * ext/stringio/stringio.c (strio_write): ditto, and use rb_str_cat() as possible. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2345 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* improve the prototype parser.ttate2002-04-051-0/+4
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2341 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* "extern" and "[]" of the module Importable returns a symbol.ttate2002-04-051-1/+5
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2340 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Add dl/struct.rb.ttate2002-04-053-141/+288
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2339 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of ineffective encoding/decoding procedures.ttate2002-04-041-17/+47
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2338 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* DLSTR(argv[i]) => DLSTR(RSTRING(argv[i])->ptr)ttate2002-04-041-1/+1
| | | | git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@2337 b2dd03c8-39d4-4d8f-98ff-823fe69b080e