[macruby-changes] [2390] MacRuby/trunk

source_changes at macosforge.org source_changes at macosforge.org
Wed Aug 26 13:15:01 PDT 2009


Revision: 2390
          http://trac.macosforge.org/projects/ruby/changeset/2390
Author:   lsansonetti at apple.com
Date:     2009-08-26 13:14:57 -0700 (Wed, 26 Aug 2009)
Log Message:
-----------
ported the etc extension to the new runtime and added it to the build

Modified Paths:
--------------
    MacRuby/trunk/ext/etc/etc.c
    MacRuby/trunk/rakelib/builder.rake

Modified: MacRuby/trunk/ext/etc/etc.c
===================================================================
--- MacRuby/trunk/ext/etc/etc.c	2009-08-26 11:44:00 UTC (rev 2389)
+++ MacRuby/trunk/ext/etc/etc.c	2009-08-26 20:14:57 UTC (rev 2390)
@@ -41,7 +41,7 @@
  *   Etc.getlogin -> 'guest'
  */
 static VALUE
-etc_getlogin(VALUE obj)
+etc_getlogin(VALUE obj, SEL sel)
 {
     char *login;
 
@@ -117,7 +117,7 @@
  * passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
  */
 static VALUE
-etc_getpwuid(int argc, VALUE *argv, VALUE obj)
+etc_getpwuid(VALUE obj, SEL sel, int argc, VALUE *argv)
 {
 #if defined(HAVE_GETPWENT)
     VALUE id;
@@ -148,7 +148,7 @@
  * passwd="x", uid=0, gid=0, gecos="root",dir="/root", shell="/bin/bash">
  */
 static VALUE
-etc_getpwnam(VALUE obj, VALUE nam)
+etc_getpwnam(VALUE obj, SEL sel, VALUE nam)
 {
 #ifdef HAVE_GETPWENT
     struct passwd *pwd;
@@ -201,7 +201,7 @@
  *
  */
 static VALUE
-etc_passwd(VALUE obj)
+etc_passwd(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETPWENT
     struct passwd *pw;
@@ -225,7 +225,7 @@
  * to getpwent will return the first entry again.
  */
 static VALUE
-etc_setpwent(VALUE obj)
+etc_setpwent(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETPWENT
     setpwent();
@@ -237,7 +237,7 @@
  * getpwent, and closes the file.
  */
 static VALUE
-etc_endpwent(VALUE obj)
+etc_endpwent(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETPWENT
     endpwent();
@@ -272,7 +272,7 @@
  * - Passwd#shell contains the path to the login shell of the user as a String.
  */
 static VALUE
-etc_getpwent(VALUE obj)
+etc_getpwent(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETPWENT
     struct passwd *pw;
@@ -318,7 +318,7 @@
  *
  */
 static VALUE
-etc_getgrgid(int argc, VALUE *argv, VALUE obj)
+etc_getgrgid(VALUE obj, SEL sel, int argc, VALUE *argv)
 {
 #ifdef HAVE_GETGRENT
     VALUE id;
@@ -351,7 +351,7 @@
  *
  */
 static VALUE
-etc_getgrnam(VALUE obj, VALUE nam)
+etc_getgrnam(VALUE obj, SEL sel, VALUE nam)
 {
 #ifdef HAVE_GETGRENT
     struct group *grp;
@@ -405,7 +405,7 @@
  *
  */
 static VALUE
-etc_group(VALUE obj)
+etc_group(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETGRENT
     struct group *grp;
@@ -429,7 +429,7 @@
  * to getgrent will return the first entry again.
  */
 static VALUE
-etc_setgrent(VALUE obj)
+etc_setgrent(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETGRENT
     setgrent();
@@ -441,7 +441,7 @@
  * getgrent, and closes the file.
  */
 static VALUE
-etc_endgrent(VALUE obj)
+etc_endgrent(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETGRENT
     endgrent();
@@ -470,7 +470,7 @@
  *   members of the group.
  */
 static VALUE
-etc_getgrent(VALUE obj)
+etc_getgrent(VALUE obj, SEL sel)
 {
 #ifdef HAVE_GETGRENT
     struct group *gr;
@@ -494,21 +494,21 @@
 {
     mEtc = rb_define_module("Etc");
 
-    rb_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
+    rb_objc_define_module_function(mEtc, "getlogin", etc_getlogin, 0);
 
-    rb_define_module_function(mEtc, "getpwuid", etc_getpwuid, -1);
-    rb_define_module_function(mEtc, "getpwnam", etc_getpwnam, 1);
-    rb_define_module_function(mEtc, "setpwent", etc_setpwent, 0);
-    rb_define_module_function(mEtc, "endpwent", etc_endpwent, 0);
-    rb_define_module_function(mEtc, "getpwent", etc_getpwent, 0);
-    rb_define_module_function(mEtc, "passwd", etc_passwd, 0);
+    rb_objc_define_module_function(mEtc, "getpwuid", etc_getpwuid, -1);
+    rb_objc_define_module_function(mEtc, "getpwnam", etc_getpwnam, 1);
+    rb_objc_define_module_function(mEtc, "setpwent", etc_setpwent, 0);
+    rb_objc_define_module_function(mEtc, "endpwent", etc_endpwent, 0);
+    rb_objc_define_module_function(mEtc, "getpwent", etc_getpwent, 0);
+    rb_objc_define_module_function(mEtc, "passwd", etc_passwd, 0);
 
-    rb_define_module_function(mEtc, "getgrgid", etc_getgrgid, -1);
-    rb_define_module_function(mEtc, "getgrnam", etc_getgrnam, 1);
-    rb_define_module_function(mEtc, "group", etc_group, 0);
-    rb_define_module_function(mEtc, "setgrent", etc_setgrent, 0);
-    rb_define_module_function(mEtc, "endgrent", etc_endgrent, 0);
-    rb_define_module_function(mEtc, "getgrent", etc_getgrent, 0);
+    rb_objc_define_module_function(mEtc, "getgrgid", etc_getgrgid, -1);
+    rb_objc_define_module_function(mEtc, "getgrnam", etc_getgrnam, 1);
+    rb_objc_define_module_function(mEtc, "group", etc_group, 0);
+    rb_objc_define_module_function(mEtc, "setgrent", etc_setgrent, 0);
+    rb_objc_define_module_function(mEtc, "endgrent", etc_endgrent, 0);
+    rb_objc_define_module_function(mEtc, "getgrent", etc_getgrent, 0);
 
     sPasswd =  rb_struct_define("Passwd",
 				"name", "passwd", "uid", "gid",
@@ -535,9 +535,8 @@
 				"expire",
 #endif
 				NULL);
+    rb_define_const(mEtc, "Passwd", sPasswd);
 
-    rb_register_mark_object(sPasswd);
-
 #ifdef HAVE_GETGRENT
     sGroup = rb_struct_define("Group", "name",
 #ifdef HAVE_ST_GR_PASSWD
@@ -545,6 +544,6 @@
 #endif
 			      "gid", "mem", NULL);
 
-    rb_register_mark_object(sGroup);
+    rb_define_const(mEtc, "Group", sGroup);
 #endif
 }

Modified: MacRuby/trunk/rakelib/builder.rake
===================================================================
--- MacRuby/trunk/rakelib/builder.rake	2009-08-26 11:44:00 UTC (rev 2389)
+++ MacRuby/trunk/rakelib/builder.rake	2009-08-26 20:14:57 UTC (rev 2390)
@@ -312,7 +312,7 @@
 EXTMK_ARGS = "#{SCRIPT_ARGS} --extension --extstatic"
 INSTRUBY_ARGS = "#{SCRIPT_ARGS} --data-mode=0644 --prog-mode=0755 --installed-list #{INSTALLED_LIST} --mantype=\"doc\" --sym-dest-dir=\"#{SYM_INSTDIR}\""
 
-EXTENSIONS = ['ripper', 'digest', 'readline', 'libyaml', 'fcntl', 'zlib']
+EXTENSIONS = ['ripper', 'digest', 'etc', 'readline', 'libyaml', 'fcntl', 'zlib']
 def perform_extensions_target(target)
   EXTENSIONS.map { |x| File.join('ext', x) }.each do |ext_dir|
     Dir.glob(File.join(ext_dir, '**/extconf.rb')) do |p|
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-changes/attachments/20090826/cd7177c7/attachment.html>


More information about the macruby-changes mailing list