X-Git-Url: http://git.asbjorn.biz/?a=blobdiff_plain;ds=sidebyside;f=lib%2Frfxswf.c;h=ae33ad5139946802e8b2a8b17121b7aebd31a0a9;hb=08d4f2d6189db011641111a11c53da37424942fc;hp=e6f30c15c1fb188e8cc311a0836631734ba82276;hpb=f27ce8fa3df8e15dc792bd008a37c5981b994267;p=swftools.git diff --git a/lib/rfxswf.c b/lib/rfxswf.c index e6f30c1..ae33ad5 100644 --- a/lib/rfxswf.c +++ b/lib/rfxswf.c @@ -1488,6 +1488,21 @@ int swf_WriteCGI(SWF * swf) return swf_WriteSWF(fileno(stdout),swf); } +SWF* swf_CopySWF(SWF*swf) +{ + SWF*nswf = rfx_alloc(sizeof(SWF)); + memcpy(nswf, swf, sizeof(SWF)); + nswf->firstTag = 0; + TAG*tag = swf->firstTag; + TAG*ntag = 0; + while(tag) { + ntag = swf_CopyTag(ntag, tag); + if(!nswf->firstTag) + nswf->firstTag = ntag; + } + return nswf; +} + void swf_FreeTags(SWF * swf) // Frees all malloc'ed memory for tags { TAG * t = swf->firstTag;