[#15846] Ruby M17N request — "K.Kosako" <kosako@...>

今書いているライブラリを、あらかじめRuby M17Nに対応させておこうとして、

62 messages 2002/02/04
[#15847] Re: Ruby M17N request — matz@... (Yukihiro Matsumoto) 2002/02/04

まつもと ゆきひろです

[#15854] Re: Ruby M17N request — "K.Kosako" <kosako@...> 2002/02/05

Yukihiro Matsumotoさんの<1012831868.125952.28017.nullmailer@ev.netlab.jp>から

[#16070] Re: Ruby M17N request — "K.Kosako" <kosako@...> 2002/02/25

<20020205045749.0AAA015B@helium.ruby-lang.org>から

[#16072] Re: Ruby M17N request — "Akinori MUSHA" <knu@...> 2002/02/25

At Mon, 25 Feb 2002 19:57:05 +0900,

[#16073] Re: Ruby M17N request — "Akinori MUSHA" <knu@...> 2002/02/25

At Mon, 25 Feb 2002 21:00:46 +0900,

[#16173] Re: Ruby M17N request — "Akinori MUSHA" <knu@...> 2002/03/02

At Mon, 25 Feb 2002 19:57:05 +0900,

[#16196] Oni Guruma imported into our repository — "Akinori MUSHA" <knu@...> 2002/03/04

At Sun, 3 Mar 2002 07:15:40 +0900,

[#16275] Re: Oni Guruma imported into our repository — matz@... (Yukihiro Matsumoto) 2002/03/08

まつもと ゆきひろです

[#16222] Re: Oni Guruma(Re: Ruby M17N request) — nobu.nakada@... 2002/03/05

なかだです。

[#16228] Re: Oni Guruma(Re: Ruby M17N request) — "K.Kosako" <kosako@...> 2002/03/06

nobu.nakada@nifty.ne.jpさんの

[#16237] Re: Oni Guruma(Re: Ruby M17N request) — nobu.nakada@... 2002/03/06

なかだです。

[#16241] Re: Oni Guruma(Re: Ruby M17N request) — "K.Kosako" <kosako@...> 2002/03/07

nobu.nakada@nifty.ne.jpさんの

[#16242] Re: Oni Guruma(Re: Ruby M17N request) — nobu.nakada@... 2002/03/07

なかだです。

[#16442] Re: Oni Guruma(Re: Ruby M17N request) — nobu.nakada@... 2002/03/17

なかだです。

[#15867] [BUG?] include after module definition and extend module — keiju@... (Keiju ISHITSUKA)

けいじゅ@日本ラショナルソフトウェアです.

15 messages 2002/02/08
[#15869] Re: [BUG?] include after module definition and extend module — matz@... (Yukihiro Matsumoto) 2002/02/08

まつもと ゆきひろです

[#15932] Re: [BUG?] include after module definition and extend module — keiju@... (石塚圭樹) 2002/02/18

けいじゅ@日本ラショナルソフトウェアです.

[#15938] Re: [BUG?] include after module definition and extend module — matz@... (Yukihiro Matsumoto) 2002/02/18

まつもと ゆきひろです

[#15914] making net/*.rb grok URI — "Akinori MUSHA" <knu@...>

 net/*.rb モジュール群をぜひとも標準添付となった URI クラスに

30 messages 2002/02/17
[#15915] Re: making net/*.rb grok URI — "Akinori MUSHA" <knu@...> 2002/02/17

At Mon, 18 Feb 2002 04:33:42 +0900,

[#15931] Re: making net/*.rb grok URI — Minero Aoki <aamine@...> 2002/02/18

あおきです。

[#15934] Re: making net/*.rb grok URI — "Akinori MUSHA" <knu@...> 2002/02/18

At Mon, 18 Feb 2002 15:24:22 +0900,

[#15937] Re: making net/*.rb grok URI — Minero Aoki <aamine@...> 2002/02/18

あおきです。

[#15958] Re: making net/*.rb grok URI — TAKAHASHI Masayoshi <maki@...> 2002/02/19

高橋征義です。

[#15978] Re: making net/*.rb grok URI — Tanaka Akira <akr@...17n.org> 2002/02/19

In article <200202190432.NAA18796@mx.inac.co.jp>,

[#16002] Re: making net/*.rb grok URI — TAKAHASHI Masayoshi <maki@...> 2002/02/20

高橋征義です。

[#16013] Re: making net/*.rb grok URI — Tanaka Akira <akr@...17n.org> 2002/02/20

In article <20020221020159R.maki@rubycolor.org>,

[#15988] Re: [rubyist:1097] Re: % 記法 — nobu.nakada@...

なかだです。

21 messages 2002/02/20
[#17594] Re: [rubyist:1097] Re: % 記法 — nobu.nakada@... 2002/06/26

なかだです。

[#16049] defined? autoload constant — Kazuhiro NISHIYAMA <zn@...>

西山和広です。

35 messages 2002/02/24
[#16058] Re: defined? autoload constant — matz@... (Yukihiro Matsumoto) 2002/02/25

まつもと ゆきひろです

[#16298] Re: defined? autoload constant — nobu.nakada@... 2002/03/09

なかだです。

[#16304] Re: defined? autoload constant — matz@... (Yukihiro Matsumoto) 2002/03/09

まつもと ゆきひろです

[#16375] Re: defined? autoload constant — keiju@... (石塚圭樹) 2002/03/14

けいじゅ@日本ラショナルソフトウェアです.

[#16380] Re: defined? autoload constant — nobu.nakada@... 2002/03/14

なかだです。

[#16398] Re: defined? autoload constant — keiju@... (石塚圭樹) 2002/03/14

けいじゅ@日本ラショナルソフトウェアです.

[#16399] Re: defined? autoload constant — nobu.nakada@... 2002/03/14

なかだです。

[#16400] Re: defined? autoload constant — keiju@... (石塚圭樹) 2002/03/14

けいじゅ@日本ラショナルソフトウェアです.

[#16403] Re: defined? autoload constant — matz@... (Yukihiro Matsumoto) 2002/03/14

まつもと ゆきひろです

[#16407] Re: defined? autoload constant — nobu.nakada@... 2002/03/15

なかだです。

[#16409] Re: defined? autoload constant — matz@... (Yukihiro Matsumoto) 2002/03/15

まつもと ゆきひろです

[#16481] Re: defined? autoload constant — keiju@... (石塚圭樹) 2002/03/19

けいじゅ@日本ラショナルソフトウェアです.

[#16482] Re: defined? autoload constant — matz@... (Yukihiro Matsumoto) 2002/03/19

まつもと ゆきひろです

[#16082] Array#select without block — matz@... (Yukihiro Matsumoto)

まつもと ゆきひろです

14 messages 2002/02/25

[#16102] No trace_func event at if-elsif-else line — "NAKAMURA, Hiroshi" <nakahiro@...>

なひです。

21 messages 2002/02/26
[#16103] Re: No trace_func event at if-elsif-else line — matz@... (Yukihiro Matsumoto) 2002/02/26

まつもと ゆきひろです

[#16109] Re: No trace_func event at if-elsif-else line — "NAKAMURA, Hiroshi" <nakahiro@...> 2002/02/26

なひです。

[#16110] Re: No trace_func event at if-elsif-else line — matz@... (Yukihiro Matsumoto) 2002/02/26

まつもと ゆきひろです

[#16117] Re: No trace_func event at if-elsif-else line — "NAKAMURA, Hiroshi" <nakahiro@...> 2002/02/26

なひです。

[#16127] Re: No trace_func event at if-elsif-else line — matz@... (Yukihiro Matsumoto) 2002/02/26

まつもと ゆきひろです

[#16133] Re: No trace_func event at if-elsif-else line — "NAKAMURA, Hiroshi" <nakahiro@...> 2002/02/27

なひです。

[#16135] Re: No trace_func event at if-elsif-else line — matz@... (Yukihiro Matsumoto) 2002/02/27

まつもと ゆきひろです

[#16256] Rite debug API (was Re: No trace_func event at if-elsif-else line) — "NAKAMURA, Hiroshi" <nakahiro@...> 2002/03/07

なひです。どうせ一年も先の話なのでのんびりと。

[#16258] Re: Rite debug API (was Re: No trace_func event at if-elsif-else line) — matz@... (Yukihiro Matsumoto) 2002/03/07

まつもと ゆきひろです

[#16134] Defining (Python) Source Code Encoding — TAKAHASHI Masayoshi <maki@...>

高橋征義です。ruby-list の「localized document」ともやや関係あり?

13 messages 2002/02/27

[ruby-dev:15861] syscall

From: nobu.nakada@...
Date: 2002-02-07 02:38:10 UTC
List: ruby-dev #15861
なかだです。

syscallがいまいち使いようがないので、こんなものを作ってみました。


Index: Makefile.in
===================================================================
RCS file: /cvs/ruby/src/ruby/Makefile.in,v
retrieving revision 1.30
diff -u -2 -p -r1.30 Makefile.in
--- Makefile.in	2002/01/11 15:36:11	1.30
+++ Makefile.in	2002/02/07 02:17:00
@@ -84,5 +84,5 @@ OBJS	      = array.@OBJEXT@ \
 		$(MISSING)
 
-all:		miniruby$(EXEEXT) @PREP@ rbconfig.rb $(LIBRUBY)
+all:		miniruby$(EXEEXT) @PREP@ rbconfig.rb $(LIBRUBY) @syscall_rb@
 		@@MINIRUBY@ -Cext extmk.rb @EXTSTATIC@
 
@@ -144,4 +144,7 @@ fake.rb:	miniruby$(EXEEXT)
 		end \
 		' > $@
+
+syscall.rb:	mksyscall.rb miniruby$(EXEEXT)
+		@./miniruby$(EXEEXT) $< $@
 
 config.status:	$(srcdir)/configure
Index: configure.in
===================================================================
RCS file: /cvs/ruby/src/ruby/configure.in,v
retrieving revision 1.109
diff -u -2 -p -r1.109 configure.in
--- configure.in	2002/02/06 08:23:46	1.109
+++ configure.in	2002/02/07 01:27:42
@@ -303,4 +303,6 @@ AC_CHECK_FUNCS(fmod killpg drand48 rando
 	      dlopen sigprocmask sigaction _setjmp setsid telldir seekdir fchmod\
 	      mktime timegm)
+test x$ac_cv_func_syscall = xyes && syscall_rb=syscall.rb
+AC_SUBST(syscall_rb)
 AC_STRUCT_TIMEZONE
 AC_CACHE_CHECK(for struct tm.tm_gmtoff, rb_cv_member_struct_tm_tm_gmtoff,
Index: instruby.rb
===================================================================
RCS file: /cvs/ruby/src/ruby/instruby.rb,v
retrieving revision 1.19
diff -u -2 -p -r1.19 instruby.rb
--- instruby.rb	2001/04/30 17:55:56	1.19
+++ instruby.rb	2002/02/07 02:17:45
@@ -100,3 +100,4 @@ Dir.chdir wdir
 File.install "config.h", archlibdir, 0644, true
 File.install "rbconfig.rb", archlibdir, 0644, true
+File.install "syscall.rb", archlibdir, 0644, true if File.exist? "syscall.rb"
 # vi:set sw=2:
Index: mksyscall.rb
===================================================================
RCS file: mksyscall.rb
diff -N mksyscall.rb
--- /dev/null	Thu Jan  1 09:00:00 1970
+++ mksyscall.rb	Thu Feb  7 11:31:08 2002
@@ -0,0 +1,114 @@
+#!./miniruby -I.
+
+require 'mkmf'
+
+class Syscall < Hash
+  CONFTEST = "conftest.c"
+
+  def initialize
+    headers = {}
+
+    open(CONFTEST, "w") do |f|
+      f.print <<SRC
+#include "config.h"
+#if HAVE_SYSCALL_H && HAVE_SYSCALL
+#include <syscall.h>
+#else
+!!!NotImplemented
+#endif
+SRC
+    end
+    IO.foreach("|"+format(CPP, $CPPFLAGS, $CFLAGS, "")) do |l|
+      case l
+      when /^\s*\#\s*(?:line)?\s+\d+\s+"((?!conftest\.c).+)"/
+	headers[$1] = true
+      when /^!!!NotImplemented/
+	raise NotImplementedError
+      else
+	l.scan(/\bSYS_\w+/) {|s| self[s] = true}
+      end
+    end
+
+    if empty?
+      raise NotImplementedError if headers.empty?
+      headers.each_key do |f|
+	IO.foreach(f) do |l|
+	  self[$1] = true if /^\s*\#\s*define\s+(SYS_\w+)/ =~ l
+	end
+      end
+      raise NotImplementedError if empty?
+    end
+
+    return unless find {|n, s| s == true}
+
+    open(CONFTEST, "w") do |f|
+      f.print "#include <syscall.h>\n"
+      each_key {|s| f.print "\"#{s}\"=#{s}\n"}
+    end
+    IO.foreach("|"+format(CPP, $CPPFLAGS, $CFLAGS, "")) do |l|
+      if /^\"(SYS_\w+)\"=\s*(.*)/ =~ l
+	s, n = $1, $2
+	self[s] = n.to_i if /^(?:0x[0-9a-f]+|0[0-7]+|\d+)$/ =~ n
+      end
+    end
+
+    src = ""
+    each do |s, n|
+      src << "printf(\"#{s}=%d\n\", #{s});\n" if n == true
+    end
+    if !src.empty? and try_link0("#include <syscall.h>\n\nint main(){\n"+src+"}\n")
+      IO.foreach("|./conftest") do |l|
+	if /^(SYS_\w+)=(\d+)/ =~ l
+	  s, n = $1, $2
+	  self[s] = n.to_i
+	end
+      end
+    end
+  ensure
+    File.unlink(*Dir["conftest*"])
+  end
+
+  def write_to(f)
+    syscalls = []
+    each {|s, n| syscalls << [n, s.sub(/^SYS_/, ""), s]}
+    syscalls.sort!
+    f.print "module Syscall\n"
+    f.print "  Platform = %[", `uname -srm`.chomp, "].each {|s| s.freeze}.freeze\n"
+    f.print "\n  NR = {}\n"
+    syscalls.each do |n, t, s|
+      f.print "  NR[:#{t}] = #{s} = #{n}\n"
+    end
+    f.print "\n  module_function\n"
+    syscalls.each do |n, t, s|
+      f.print "  def #{t}(*args) syscall(#{n}, *args) end\n"
+    end
+    f.print "end\n"
+  end
+end
+
+case ARGV.size
+when 0, 1
+else
+  STDERR.print "usage: #{$0} [output]\n"
+  exit 1
+end
+
+begin
+  syscalls = Syscall.new
+rescue NotImplementedError
+  STDERR.print "#{$0}: syscall.h or syscall number not found.\n"
+  exit(1)
+end
+
+if output = ARGV.shift
+  open(output, "w") {|f| syscalls.write_to(f)}
+else
+  syscalls.write_to(STDOUT)
+end
+
+# Local Variables:
+# mode			: ruby
+# tab-width		: 8
+# ruby-indent-level	: 2
+# End:
+# vi: sw=2 ts=8


-- 
--- 僕の前にBugはない。
--- 僕の後ろにBugはできる。
    中田 伸悦

In This Thread

Prev Next