summaryrefslogtreecommitdiff
path: root/ext/etc
diff options
context:
space:
mode:
Diffstat (limited to 'ext/etc')
-rw-r--r--ext/etc/etc.c42
1 files changed, 22 insertions, 20 deletions
diff --git a/ext/etc/etc.c b/ext/etc/etc.c
index 474f3ebde0..3f14669748 100644
--- a/ext/etc/etc.c
+++ b/ext/etc/etc.c
@@ -672,37 +672,38 @@ Init_etc(void)
rb_define_module_function(mEtc, "sysconfdir", etc_sysconfdir, 0);
rb_define_module_function(mEtc, "systmpdir", etc_systmpdir, 0);
- sPasswd = rb_struct_define(NULL,
- "name",
+ sPasswd = rb_struct_define_under(mEtc, "Passwd",
+ "name",
#ifdef HAVE_STRUCT_PASSWD_PW_PASSWD
- "passwd",
+ "passwd",
#endif
- "uid",
- "gid",
+ "uid",
+ "gid",
#ifdef HAVE_STRUCT_PASSWD_PW_GECOS
- "gecos",
+ "gecos",
#endif
- "dir",
- "shell",
+ "dir",
+ "shell",
#ifdef HAVE_STRUCT_PASSWD_PW_CHANGE
- "change",
+ "change",
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_QUOTA
- "quota",
+ "quota",
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_AGE
- "age",
+ "age",
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_CLASS
- "uclass",
+ "uclass",
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_COMMENT
- "comment",
+ "comment",
#endif
#ifdef HAVE_STRUCT_PASSWD_PW_EXPIRE
- "expire",
+ "expire",
#endif
- NULL);
+ NULL);
+#if 0
/* Define-const: Passwd
*
* Passwd is a Struct that contains the following members:
@@ -743,18 +744,19 @@ Init_etc(void)
* account expiration time(integer) must be compiled with +HAVE_STRUCT_PASSWD_PW_EXPIRE+
*/
rb_define_const(mEtc, "Passwd", sPasswd);
- rb_set_class_path(sPasswd, mEtc, "Passwd");
+#endif
rb_define_const(rb_cStruct, "Passwd", sPasswd); /* deprecated name */
rb_extend_object(sPasswd, rb_mEnumerable);
rb_define_singleton_method(sPasswd, "each", etc_each_passwd, 0);
#ifdef HAVE_GETGRENT
- sGroup = rb_struct_define(NULL, "name",
+ sGroup = rb_struct_define_under(mEtc, "Group", "name",
#ifdef HAVE_STRUCT_GROUP_GR_PASSWD
- "passwd",
+ "passwd",
#endif
- "gid", "mem", NULL);
+ "gid", "mem", NULL);
+#if 0
/* Define-const: Group
*
* Group is a Struct that is only available when compiled with +HAVE_GETGRENT+.
@@ -777,7 +779,7 @@ Init_etc(void)
* members of the group.
*/
rb_define_const(mEtc, "Group", sGroup);
- rb_set_class_path(sGroup, mEtc, "Group");
+#endif
rb_define_const(rb_cStruct, "Group", sGroup); /* deprecated name */
rb_extend_object(sGroup, rb_mEnumerable);
rb_define_singleton_method(sGroup, "each", etc_each_group, 0);