InlineX-C2XS

 view release on metacpan or  search on metacpan

expected_c.txt  view on Meta::CPAN

		val = *psv;
		vl->vertex[p].x = SvNV(val);
		psv = av_fetch(pt, 1, 0);
		val = *psv;
		vl->vertex[p].y = SvNV(val);
		dbg_p(("added %0.2f, %0.2f\n",
			vl->vertex[p].x, vl->vertex[p].y
			));
	}
	dbg_p(("returning\n"));
}

AV* vertex_list_to_pts(gpc_vertex_list* vl) {
	AV* pts;
	AV* pt;
	int p;
	dbg_p(("%d vertices\n", vl->num_vertices));
	pts = newAV();
	for(p = 0; p < vl->num_vertices; p++) {
		pt = newAV();
		av_push(pts, newRV_noinc((SV*) pt));
		av_push(pt, newSVnv(vl->vertex[p].x));
		av_push(pt, newSVnv(vl->vertex[p].y));
		dbg_p(("point %d: %0.2f, %0.2f\n",
			p, vl->vertex[p].x, vl->vertex[p].y
			));
	}
	return(pts);
}


void gpc_free_polygon2(gpc_polygon *p) {
	int c;
	for (c= 0; c < p->num_contours; c++) {
  	dbg_p(("free contour %d\n", c));
    FREE(p->contour[c].vertex);
	}
	dbg_p(("free hole\n"));
	FREE(p->hole);
	dbg_p(("free contour\n"));
	FREE(p->contour);
	p->num_contours= 0;
}



MODULE = Math::Geometry::Planar::GPC::Polygon	PACKAGE = Math::Geometry::Planar::GPC::Polygon	PREFIX = remove_

PROTOTYPES: DISABLE


SV *
new (class)
	char *	class

void
DESTROY (obj)
	SV *	obj
	PREINIT:
	I32* temp;
	PPCODE:
	temp = PL_markstack_ptr++;
	DESTROY(obj);
	if (PL_markstack_ptr != temp) {
          /* truly void, because dXSARGS not invoked */
	  PL_markstack_ptr = temp;
	  XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
	return; /* assume stack size is correct */

int
from_file (obj, filename, want_hole)
	SV *	obj
	char *	filename
	int	want_hole

void
to_file (obj, filename, want_hole)
	SV *	obj
	char *	filename
	int	want_hole
	PREINIT:
	I32* temp;
	PPCODE:
	temp = PL_markstack_ptr++;
	to_file(obj, filename, want_hole);
	if (PL_markstack_ptr != temp) {
          /* truly void, because dXSARGS not invoked */
	  PL_markstack_ptr = temp;
	  XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
	return; /* assume stack size is correct */

SV *
clip_to (obj, clp, action)
	SV *	obj
	SV *	clp
	char *	action

void
remove_add_polygon (obj, pg, hole)
	SV *	obj
	SV *	pg
	int	hole
	PREINIT:
	I32* temp;
	PPCODE:
	temp = PL_markstack_ptr++;
	remove_add_polygon(obj, pg, hole);
	if (PL_markstack_ptr != temp) {
          /* truly void, because dXSARGS not invoked */
	  PL_markstack_ptr = temp;
	  XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
	return; /* assume stack size is correct */

void
get_polygons (obj)
	SV *	obj
	PREINIT:
	I32* temp;
	PPCODE:
	temp = PL_markstack_ptr++;
	get_polygons(obj);
	if (PL_markstack_ptr != temp) {
          /* truly void, because dXSARGS not invoked */
	  PL_markstack_ptr = temp;
	  XSRETURN_EMPTY; /* return empty stack */
        }
        /* must have used dXSARGS; list context implied */
	return; /* assume stack size is correct */

BOOT:
printf("Hi from bootstrap\n");



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