aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaouda Lo <daouda@mandriva.com>2003-05-20 09:35:30 +0000
committerDaouda Lo <daouda@mandriva.com>2003-05-20 09:35:30 +0000
commit32b4a67051d83fd252f4570d6577ef9994d51572 (patch)
tree75ee4aa27500ad9f27f9cc1461678b176064f9b1
parent8c89e923a783653c30a00627bb9e69d37c834529 (diff)
downloaduserdrake-32b4a67051d83fd252f4570d6577ef9994d51572.tar
userdrake-32b4a67051d83fd252f4570d6577ef9994d51572.tar.gz
userdrake-32b4a67051d83fd252f4570d6577ef9994d51572.tar.bz2
userdrake-32b4a67051d83fd252f4570d6577ef9994d51572.tar.xz
userdrake-32b4a67051d83fd252f4570d6577ef9994d51572.zip
- big updates
-rw-r--r--USER/USER.xs16
1 files changed, 7 insertions, 9 deletions
diff --git a/USER/USER.xs b/USER/USER.xs
index ff955ea..ca360a0 100644
--- a/USER/USER.xs
+++ b/USER/USER.xs
@@ -109,7 +109,7 @@ Admin_lookup_user_name(self, name)
USER__ERR *error = NULL;
ent = lu_ent_new();
if (lu_user_lookup_name(self, name, ent, &error)) {
- XPUSHs(sv_2mortal(newSViv(ent)));
+ XPUSHs(sv_2mortal(sv_bless(newRV_noinc(newSViv(ent)), gv_stashpv("USER::ENT", 1))));
} else {
lu_ent_free(ent);
}
@@ -192,7 +192,7 @@ Ent_DESTROY(self)
void
Ent_EntType(self)
USER::ENT *self
- CODE:
+ PPCODE:
switch (self->type) {
case lu_invalid:
break;
@@ -205,9 +205,7 @@ Ent_EntType(self)
default:
break;
}
- OUTPUT:
- RETVAL
-
+
void
Ent_UserName(self)
USER::ENT *self
@@ -233,10 +231,10 @@ Ent_GroupName(self)
values = lu_ent_get(self, LU_GROUPNAME);
if (values != NULL) {
value = g_value_array_get_nth(values, 0);
- if (G_VALUE_HOLDS_LONG(value)) {
- XPUSHs(sv_2mortal(newSViv(g_value_get_long(value))));
- } else if (G_VALUE_HOLDS_STRING(value)) {
- XPUSHs(sv_2mortal(newSViv(atol(g_value_get_string(value)))));
+ if (G_VALUE_HOLDS_STRING(value)) {
+ XPUSHs(sv_2mortal(newSVpv(g_value_get_string(value), 0)));
+ } else if (G_VALUE_HOLDS_LONG(value)) {
+ XPUSHs(sv_2mortal(newSVpv(g_strdup_printf("%ld", g_value_get_long(value)), 0)));
}
}