void gfxr_free_resource(gfx_resource_t *resource, int type) { if (!resource) return; switch (type) { case GFX_RESOURCE_TYPE_VIEW: FREEALL(gfxr_free_view, view); break; case GFX_RESOURCE_TYPE_PIC: FREEALL(gfxr_free_pic, pic); break; case GFX_RESOURCE_TYPE_FONT: FREEALL(gfxr_free_font, font); break; case GFX_RESOURCE_TYPE_CURSOR: FREEALL(gfx_free_pixmap, pointer); break; default: warning("[GFX] Attempt to free invalid resource type %d", type); } free(resource); }
void REGARGS fplFree(struct Data *scr) { struct Data onstack; onstack=*scr; /* copy the entire struct */ scr=&onstack; /* use the `stack-struct' */ FREEALL(); }