From 32b4a67051d83fd252f4570d6577ef9994d51572 Mon Sep 17 00:00:00 2001 From: Daouda Lo Date: Tue, 20 May 2003 09:35:30 +0000 Subject: - big updates --- USER/USER.xs | 16 +++++++--------- 1 file 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))); } } -- cgit v1.2.1