ruby-bugsからのフォワードです。どんなもんでしょう。 ------- Start of forwarded message ------- From: will.sobel / barra.com To: bugs-admin / ruby-lang.org Subject: DL support for const char** (PR#1196) Cc: ruby-bugs / ruby-lang.org X-Loop: ruby-bugs / ruby-lang.org Date: Fri, 17 Oct 2003 08:43:37 +0900 (JST) Full_Name: William Sobel Version: 1.8 OS: sparc-solaris Submission from: (NULL) (144.203.11.223) Can we add support for const char** as we have support for void* and char*? This would be consistent with the 'p' and 's' type to to_a when given a null ptr terminated list of strings allocated from a buffer. The problem is if I use 's' it will segv when xfree is called. I can use 'p', but it isn't as pretty. ;-) Thanks, Will Changes: Index: ptr.c =================================================================== RCS file: /src/ruby/ext/dl/ptr.c,v retrieving revision 1.18 diff -c -r1.18 ptr.c *** ptr.c 24 Mar 2003 09:38:36 -0000 1.18 --- ptr.c 16 Oct 2003 23:40:10 -0000 *************** *** 344,350 **** n = data->size / sizeof(void*); break; default: ! if (t == 'p' || t == 's') { int i; for (i=0; ((void**)(data->ptr))[i]; i++) {}; n = i; --- 344,350 ---- n = data->size / sizeof(void*); break; default: ! if (t == 'p' || t == 's' || t == 'S') { int i; for (i=0; ((void**)(data->ptr))[i]; i++) {}; n = i; ------- End of forwarded message -------