/*! Moves all of the EmbStitchList data to EmbPolylineObjectList data for pattern (\a p). */ void embPattern_moveStitchListToPolylines(EmbPattern* p) { if(!p) { embLog_error("emb-pattern.c embPattern_moveStitchListToPolylines(), p argument is null\n"); return; } embPattern_copyStitchListToPolylines(p); /* Free the stitchList and threadList since their data has now been transferred to polylines */ embStitchList_free(p->stitchList); p->stitchList = 0; p->lastStitch = 0; embThreadList_free(p->threadList); p->threadList = 0; p->lastThread = 0; }
/* Frees all memory allocated in the pattern. */ void embPattern_free(EmbPattern* p) { if(!p) { embLog_error("emb-pattern.c embPattern_free(), p argument is null\n"); return; } embStitchList_free(p->stitchList); embThreadList_free(p->threadList); embArcObjectList_free(p->arcObjList); embCircleObjectList_free(p->circleObjList); embEllipseObjectList_free(p->ellipseObjList); embLineObjectList_free(p->lineObjList); /* TODO: embPathObjectList_free(p->pathObjList); */ embPointObjectList_free(p->pointObjList); embPolygonObjectList_free(p->polygonObjList); embPolylineObjectList_free(p->polylineObjList); embRectObjectList_free(p->rectObjList); /* TODO: embSplineObjectList_free(p->splineObjList); */ free(p); p = 0; }
/*! Frees all memory allocated in the pattern (\a p). */ void embPattern_free(EmbPattern* p) { if(!p) { embLog_error("emb-pattern.c embPattern_free(), p argument is null\n"); return; } embStitchList_free(p->stitchList); p->stitchList = 0; p->lastStitch = 0; embThreadList_free(p->threadList); p->threadList = 0; p->lastThread = 0; embArcObjectList_free(p->arcObjList); p->arcObjList = 0; p->lastArcObj = 0; embCircleObjectList_free(p->circleObjList); p->circleObjList = 0; p->lastCircleObj = 0; embEllipseObjectList_free(p->ellipseObjList); p->ellipseObjList = 0; p->lastEllipseObj = 0; embLineObjectList_free(p->lineObjList); p->lineObjList = 0; p->lastLineObj = 0; embPathObjectList_free(p->pathObjList); p->pathObjList = 0; p->lastPathObj = 0; embPointObjectList_free(p->pointObjList); p->pointObjList = 0; p->lastPointObj = 0; embPolygonObjectList_free(p->polygonObjList); p->polygonObjList = 0; p->lastPolygonObj = 0; embPolylineObjectList_free(p->polylineObjList); p->polylineObjList = 0; p->lastPolylineObj = 0; embRectObjectList_free(p->rectObjList); p->rectObjList = 0; p->lastRectObj = 0; /* embSplineObjectList_free(p->splineObjList); p->splineObjList = 0; p->lastSplineObj = 0; TODO: finish this */ free(p); p = 0; }
void embPattern_moveStitchListToPolylines(EmbPattern* p) { if(!p) { embLog_error("emb-pattern.c embPattern_moveStitchListToPolylines(), p argument is null\n"); return; } embPattern_copyStitchListToPolylines(p); embStitchList_free(p->stitchList); }