Basic-Types-XS

 view release on metacpan or  search on metacpan

lib/Basic/Types/XS.xs  view on Meta::CPAN

		STRLEN retlen;
		char * i = SvPV(param, retlen);
		if (!retlen || i[0] == 0 || i[0] == 1) {
			return 1;
		}
	}

	return 0;
}

char *get_caller(void) {
	dTHX;
	char *callr = HvNAME((HV*)CopSTASH(PL_curcop));
	return callr;
}

static char * get_error_message (SV * self, const char * type) {
	dTHX;
	SV ** sv = hv_fetch((HV*)SvRV(self), "message", 7, 0);
	if (sv) {
		STRLEN retlen;

lib/Basic/Types/XS.xs  view on Meta::CPAN

		}
		SvREFCNT_inc(self);
		SV * cb = *hv_fetch((HV*)SvRV(self), "constraint", 10, 0);
		RETVAL = (CV*)cb;
	OUTPUT:
		RETVAL

void
import( ...)
	CODE:
		char *pkg = get_caller();
		STRLEN retlen;
		int i = 1;
		for (i = 1; i < items; i++) {
			char * ex = SvPV(ST(i), retlen);
			char name [strlen(pkg) + 2 + retlen];
			sprintf(name, "%s::%s", pkg, ex);
			if (strcmp(ex, "Any") == 0) {
				newXS(name, XS_Basic__Types__XS__Definition_Any, __FILE__);
			} else if (strcmp(ex, "Defined") == 0) {
				newXS(name, XS_Basic__Types__XS__Definition_Defined, __FILE__);



( run in 2.168 seconds using v1.01-cache-2.11-cpan-75ffa21a3d4 )