IPC-Door

 view release on metacpan or  search on metacpan

Door.xs  view on Meta::CPAN

__info(sv_path, sv_class)
    SV * sv_path
    SV * sv_class
PREINIT:
    char * path = SvPV(sv_path, PL_na);
    char * class = SvPV(sv_class, PL_na);
    int fd;
    struct stat stat;
    door_info_t info;
    SV * sv;
PPCODE:
    if ((fd = open(path, O_RDONLY)) < 0) {
        WARN(("open() failed: %s\n", strerror(errno)));
        XSRETURN_UNDEF;
    }
    if (fstat(fd, &stat) < 0) {
        WARN(("fstat() failed:%s \n", strerror(errno)));
        XSRETURN_UNDEF;
    }
    if (S_ISDOOR(stat.st_mode) == 0) {
        WARN(("%s is not a door\n", path));

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

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* 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 IPC::Door macro", s));
          PUSHs(sv);
          break;

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

	dTARGET;
#endif
	STRLEN		len;
        int		type;
	IV		iv;
	/* NV		nv;	Uncomment this if you need to return NVs */
	/* const char	*pv;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
        /* Change this to constant(aTHX_ s, len, &iv, &nv);
           if you need to return both NVs and IVs */
	type = constant(aTHX_ s, len, &iv);
      /* 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 IPC::Door macro", s));
          PUSHs(sv);
          break;



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