Linux-Shadow

 view release on metacpan or  search on metacpan

Shadow.xs  view on Meta::CPAN


PROTOTYPES: DISABLE

INCLUDE: const-xs.inc

void
getspnam (name)
        const char * name
    INIT:
        struct spwd *shadow;
    PPCODE:
        shadow = getspnam(name);
        if (shadow) {
            XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_namp)));
            XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_pwdp)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_lstchg)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_min)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_max)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_warn)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_inact)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_expire)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_flag)));
        }

void
getspent ()
    INIT:
        struct spwd *shadow;
    PPCODE:
        shadow = getspent();
        if (shadow) {
            XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_namp)));
            XPUSHs(sv_2mortal(newSVpvf("%s", shadow->sp_pwdp)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_lstchg)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_min)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_max)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_warn)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_inact)));
            XPUSHs(sv_2mortal(newSViv(shadow->sp_expire)));

fallback/const-xs.inc  view on Meta::CPAN

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	/* IV		iv;	Uncomment this if you need to return IVs */
	/* NV		nv;	Uncomment this if you need to return NVs */
	const char	*pv;
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
	type = constant(aTHX_ s, len, &pv);
      /* Return 1 or 2 items. First is error message, or undef if no error.
           Second, if present, is found value */
        switch (type) {
        case PERL_constant_NOTFOUND:
          sv =
	    sv_2mortal(newSVpvf("%s is not a valid Linux::Shadow macro", s));
          PUSHs(sv);
          break;
        case PERL_constant_NOTDEF:



( run in 0.873 second using v1.01-cache-2.11-cpan-5511b514fd6 )