[#26975] [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp>

山本です。

56 messages 2005/09/07
[#26976] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/07

まつもと ゆきひろです

[#26977] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/07

山本です。

[#26978] Re: [proposal] ANSI style function — nobu@... 2005/09/07

なかだです。

[#26979] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/07

山本です。

[#26980] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/07

まつもと ゆきひろです

[#26983] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26988] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26989] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26990] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/08

まつもと ゆきひろです

[#26991] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/08

山本です。

[#26995] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/09

山本です。

[#26996] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/09

まつもと ゆきひろです

[#26998] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/09

山本です。

[#27000] Re: [proposal] ANSI style function — Takahiro Kambe <taca@...> 2005/09/09

In message <20050909220539.E1B26BB8.ocean@m2.ccsnet.ne.jp>

[#27001] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27002] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27003] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27004] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27005] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27006] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27007] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27008] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27009] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27011] Re: [proposal] ANSI style function — Yukihiro Matsumoto <matz@...> 2005/09/10

まつもと ゆきひろです

[#27013] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/10

山本です。

[#27016] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/11

山本です。

[#27015] Re: [proposal] ANSI style function — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/11

山本です。

[#26984] elimination of "extern int errno;" — Takahiro Kambe <taca@...>

こんにちは。

48 messages 2005/09/08
[#27023] sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <20050908.120716.71112483.taca@back-street.net>

[#27024] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27025] Re: sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <1126489480.743964.31599.nullmailer@x31.priv.netlab.jp>

[#27027] Re: sizeof(FILE) problem on DragonFly BSD — Takahiro Kambe <taca@...> 2005/09/12

In message <20050912.104954.92585084.taca@back-street.net>

[#27029] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27035] Re: sizeof(FILE) problem on DragonFly BSD — "U.Nakamura" <usa@...> 2005/09/12

こんにちは、なかむら(う)です。

[#27036] Re: sizeof(FILE) problem on DragonFly BSD — Yukihiro Matsumoto <matz@...> 2005/09/12

まつもと ゆきひろです

[#27079] ruby-1.8.3 status for release (Re: Re: sizeof(FILE) problem on DragonFly BSD) — Masayoshi Takahashi <maki@...> 2005/09/15

高橋征義です。

[#27081] Re: ruby-1.8.3 status for release (Re: Re: sizeof(FILE) problem on DragonFly BSD) — Yukihiro Matsumoto <matz@...> 2005/09/15

まつもと ゆきひろです

[#27082] Re: ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...> 2005/09/15

高橋征義です。

[#27083] Re: ruby-1.8.3 status for release — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/09/15

山本です。

[#27099] Re: ruby-1.8.3 status for release — Hidetoshi NAGAI <nagai@...> 2005/09/15

永井@知能.九工大です.

[#27531] ruby/tk installation without tcl/tk (for 1.8.4) — "H.Yamamoto" <ocean@...2.ccsnet.ne.jp> 2005/10/26

山本です。

[#27619] Re: ruby/tk installation without tcl/tk (for 1.8.4) — Hidetoshi NAGAI <nagai@...> 2005/11/02

永井@知能.九工大です.

[#27139] ruby-1.8.3 status for release — Masayoshi Takahashi <maki@...>

高橋征義です。

66 messages 2005/09/18
[#27193] Re: ruby-1.8.3 status for release — TAKAHASHI Masayoshi <maki@...> 2005/09/20

高橋征義です。

[#27251] 脆弱性レポート翻訳者募集 — Yukihiro Matsumoto <matz@...>

まつもと ゆきひろです

13 messages 2005/09/21

[#27321] RubyGemsとOS platformとの関係 — Daigo Moriwaki <techml@...>

こんにちは、森脇です。

42 messages 2005/09/26
[#27327] Re: RubyGemsとOS platformとの関係 — nobuyoshi nakada <nobuyoshi.nakada@...> 2005/09/27

なかだです。

[#27330] Re: RubyGemsとOS platformとの関係 — Yukihiro Matsumoto <matz@...> 2005/09/27

まつもと ゆきひろです

[#27337] Re: RubyGems と OS platform との関係 — NISHIO Mizuho <jurader@...> 2005/09/27

西尾瑞穂 と言います。

[#27343] Re: RubyGems と OS platform との関係 — Yukihiro Matsumoto <matz@...> 2005/09/28

まつもと ゆきひろです

[#27347] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/09/28

In article <1127872084.608903.6359.nullmailer@x31.priv.netlab.jp>,

[#27348] Re: RubyGems と OS platform との関係 — Yukihiro Matsumoto <matz@...> 2005/09/28

まつもと ゆきひろです

[#27359] Re: RubyGems と OS platform との関係 — Daigo Moriwaki <techml@...> 2005/09/28

森脇です。

[#27364] Re: RubyGems と OS platform との関係 — akira yamada / やまだあきら <akira@...> 2005/09/30

Daigo Moriwaki wrote:

[#27365] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/09/30

In article <433CC31E.20802@ruby-lang.org>,

[#27367] Re: RubyGems と OS platform との関係 — akira yamada / やまだあきら <akira@...> 2005/09/30

Tanaka Akira wrote:

[#27369] Re: RubyGems と OS platform との関係 — Tanaka Akira <akr@...17n.org> 2005/10/01

In article <433D4CED.9030005@ruby-lang.org>,

[ruby-dev:26938] Re: fail on make install

From: nobuyoshi nakada <nobuyoshi.nakada@...>
Date: 2005-09-01 09:16:13 UTC
List: ruby-dev #26938
なかだです。

At Thu, 1 Sep 2005 07:39:10 +0900,
nobu@ruby-lang.org wrote in [ruby-dev:26933]:
> 後から気づいたんですが、[ruby-dev:26930]のようにインタプリタが
> 必要な部分とそうでない部分を分けるなら、rb_sys_warning()もなん
> とかしないといけませんね。初期化時点ではruby_verboseはfalseなの
> で問題は出てませんが。

ポインタで切り替えようかと思いましたが、win32だとstat()などがマ
クロになっているので、こんなところでどうでしょうか。

# やっぱりdefファイルで名前を挿げ替えるようにしたほうがいいかも。


Index: dir.c
===================================================================
RCS file: /cvs/ruby/src/ruby/dir.c,v
retrieving revision 1.143
diff -U2 -p -r1.143 dir.c
--- dir.c	30 Aug 2005 14:49:51 -0000	1.143
+++ dir.c	1 Sep 2005 03:07:28 -0000
@@ -72,4 +72,5 @@ char *strchr _((char*,char));
 #define FNM_DOTMATCH	0x04
 #define FNM_CASEFOLD	0x08
+#define FNM_VERBOSE	0x10
 
 #define FNM_NOMATCH	1
@@ -924,10 +925,11 @@ dir_s_rmdir(obj, dir)
 /* System call with warning */
 static int
-do_stat(path, pst)
+do_stat(path, pst, flags)
     const char *path;
     struct stat *pst;
+    int flags;
 {
     int ret = stat(path, pst);
-    if (ret < 0 && errno != ENOENT)
+    if (ret < 0 && (flags & FNM_VERBOSE) && errno != ENOENT)
 	rb_protect((VALUE (*)_((VALUE)))rb_sys_warning, (VALUE)path, 0);
 
@@ -936,10 +938,11 @@ do_stat(path, pst)
 
 static int
-do_lstat(path, pst)
+do_lstat(path, pst, flags)
     const char *path;
     struct stat *pst;
+    int flags;
 {
     int ret = lstat(path, pst);
-    if (ret < 0 && errno != ENOENT)
+    if (ret < 0 && (flags & FNM_VERBOSE) && errno != ENOENT)
 	rb_protect((VALUE (*)_((VALUE)))rb_sys_warning, (VALUE)path, 0);
 
@@ -948,9 +951,10 @@ do_lstat(path, pst)
 
 static DIR *
-do_opendir(path)
+do_opendir(path, flags)
     const char *path;
+    int flags;
 {
     DIR *dirp = opendir(path);
-    if (dirp == NULL && errno != ENOENT && errno != ENOTDIR)
+    if (!dirp && (flags & FNM_VERBOSE) && errno != ENOENT && errno != ENOTDIR)
 	rb_protect((VALUE (*)_((VALUE)))rb_sys_warning, (VALUE)path, 0);
 
@@ -1169,20 +1173,5 @@ glob_func_caller(val)
 }
 
-static int
-glob_call_func(func, path, arg)
-    void (*func) _((const char *, VALUE));
-    const char *path;
-    VALUE arg;
-{
-    int status;
-    struct glob_args args;
-
-    args.func = func;
-    args.c = path;
-    args.v = arg;
-
-    rb_protect(glob_func_caller, (VALUE)&args, &status);
-    return status;
-}
+#define glob_call_func(func, path, arg) (*func)(path, arg)
 
 static int
@@ -1195,5 +1184,5 @@ glob_helper(path, dirsep, exist, isdir, 
     struct glob_pattern **end;
     int flags;
-    void (*func) _((const char *, VALUE));
+    int (*func) _((const char *, VALUE));
     VALUE arg;
 {
@@ -1230,5 +1219,5 @@ glob_helper(path, dirsep, exist, isdir, 
     if (*path) {
 	if (match_all && exist == UNKNOWN) {
-	    if (do_lstat(path, &st) == 0) {
+	    if (do_lstat(path, &st, flags) == 0) {
 		exist = YES;
 		isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
@@ -1240,5 +1229,5 @@ glob_helper(path, dirsep, exist, isdir, 
 	}
 	if (match_dir && isdir == UNKNOWN) {
-	    if (do_stat(path, &st) == 0) {
+	    if (do_stat(path, &st, flags) == 0) {
 		exist = YES;
 		isdir = S_ISDIR(st.st_mode) ? YES : NO;
@@ -1265,5 +1254,5 @@ glob_helper(path, dirsep, exist, isdir, 
     if (magical || recursive) {
 	struct dirent *dp;
-	DIR *dirp = do_opendir(*path ? path : ".");
+	DIR *dirp = do_opendir(*path ? path : ".", flags);
 	if (dirp == NULL) return 0;
 
@@ -1275,5 +1264,5 @@ glob_helper(path, dirsep, exist, isdir, 
 		&& fnmatch("*", dp->d_name, flags) == 0) {
 #ifndef _WIN32
-		if (do_lstat(buf, &st) == 0)
+		if (do_lstat(buf, &st, flags) == 0)
 		    new_isdir = S_ISDIR(st.st_mode) ? YES : S_ISLNK(st.st_mode) ? UNKNOWN : NO;
 		else
@@ -1346,9 +1335,9 @@ glob_helper(path, dirsep, exist, isdir, 
 }
 
-static int
-rb_glob2(path, flags, func, arg)
+int
+ruby_glob(path, flags, func, arg)
     const char *path;
     int flags;
-    void (*func) _((const char *, VALUE));
+    int (*func) _((const char *, VALUE));
     VALUE arg;
 {
@@ -1386,32 +1375,39 @@ rb_glob2(path, flags, func, arg)
 }
 
-struct rb_glob_args {
-    void (*func) _((const char*, VALUE));
-    VALUE arg;
-};
-
-static VALUE
+static int
 rb_glob_caller(path, a)
     const char *path;
     VALUE a;
 {
-    struct rb_glob_args *args = (struct rb_glob_args *)a;
-    (*args->func)(path, args->arg);
-    return Qnil;
+    int status;
+    struct glob_args *args = (struct glob_args *)a;
+
+    args->c = path;
+    rb_protect(glob_func_caller, a, &status);
+    return status;
 }
 
-void
-rb_glob(path, func, arg)
+static int
+rb_glob2(path, flags, func, arg)
     const char *path;
-    void (*func) _((const char*, VALUE));
+    int flags;
+    void (*func) _((const char *, VALUE));
     VALUE arg;
 {
-    struct rb_glob_args args;
+    struct glob_args args;
     int status;
 
     args.func = func;
-    args.arg = arg;
-    status = rb_glob2(path, 0, rb_glob_caller, &args);
+    args.v = arg;
+    return ruby_glob(path, flags | FNM_VERBOSE, rb_glob_caller, (VALUE)&args);
+}
 
+void
+rb_glob(path, func, arg)
+    const char *path;
+    void (*func) _((const char*, VALUE));
+    VALUE arg;
+{
+    int status = rb_glob2(path, 0, func, arg);
     if (status) rb_jump_tag(status);
 }
Index: ruby.h
===================================================================
RCS file: /cvs/ruby/src/ruby/ruby.h,v
retrieving revision 1.118
diff -U2 -p -r1.118 ruby.h
--- ruby.h	27 Jul 2005 07:27:17 -0000	1.118
+++ ruby.h	1 Sep 2005 03:06:33 -0000
@@ -484,4 +484,5 @@ void rb_obj_infect _((VALUE,VALUE));
 
 void rb_glob _((const char*,void(*)(const char*,VALUE),VALUE));
+int ruby_glob _((const char*,int,int(*)(const char*,VALUE),VALUE));
 
 VALUE rb_define_class _((const char*,VALUE));
Index: win32/win32.c
===================================================================
RCS file: /cvs/ruby/src/ruby/win32/win32.c,v
retrieving revision 1.164
diff -U2 -p -r1.164 win32.c
--- win32/win32.c	18 Aug 2005 02:07:28 -0000	1.164
+++ win32/win32.c	1 Sep 2005 03:05:16 -0000
@@ -1024,5 +1024,5 @@ typedef struct _NtCmdLineElement {
 #define NTSTRING 0x4	// element contains a quoted string
 
-static void
+static int
 insert(const char *path, VALUE vinfo)
 {
@@ -1038,4 +1038,6 @@ insert(const char *path, VALUE vinfo)
     **tail = tmpcurr;
     *tail = &tmpcurr->next;
+
+    return 0;
 }
 
@@ -1062,5 +1064,5 @@ cmdglob(NtCmdLineElement *patt, NtCmdLin
 	if (*p == '\\')
 	    *p = '/';
-    rb_glob(buf, insert, (VALUE)&tail);
+    ruby_glob(buf, 0, insert, (VALUE)&tail);
     if (buf != buffer)
 	free(buf);


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

In This Thread