Search-ContextGraph

 view release on metacpan or  search on metacpan

ContextGraph.xs  view on Meta::CPAN

		int startSize;
		int i;
		int result_count;
		
    INIT:
    	result_count = 0;
    	undef = (SV*) &PL_sv_undef;
		list =  (AV *) sv_2mortal((SV *)newAV());
		startSize = 64;
		
    PPCODE:
		result = collect_results(graph);
		for (i = 0; result[i].weight > 0; i++) {
			entry = newAV();
			/* fprintf( stderr, "weight %ld, %ld, %f \n", i, result[i].sink, result[i].weight);
			*/
			av_push(entry, newSViv(result[i].sink));
			av_push(entry, newSVnv(result[i].weight));
			av_push(list, newRV_noinc((SV *)entry));
			result_count++;
		}

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;	Uncomment this if you need to return PVs */
    INPUT:
	SV *		sv;
        const char *	s = SvPV(sv, len);
    PPCODE:
	type = constant(aTHX_ s, len);
      /* 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 Search::ContextGraph macro", s));
          PUSHs(sv);
          break;
        case PERL_constant_NOTDEF:
          sv = sv_2mortal(newSVpvf(



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