+void swf_FontPrepareForEditText(SWFFONT * f);
+
+/* notice: if you set the fontid, make sure you call swf_FontPrepareForEditText() for the font first */
+void swf_SetEditText(TAG*tag, U16 flags, SRECT r, const char*text, RGBA*color,
+ int maxlength, U16 font, U16 height, EditTextLayout*layout, const char*variable);
+
+SRECT swf_SetDefineText(TAG*tag, SWFFONT*font, RGBA*rgb, const char*text, int scale);
+
+void swf_DrawText(drawer_t*draw, SWFFONT*font, int size, const char*text);
+
+// swffont.c
+
+SWFFONT* swf_LoadTrueTypeFont(const char*filename);
+SWFFONT* swf_LoadT1Font(const char*filename);
+SWFFONT* swf_LoadFont(const char*filename);
+
+void swf_SetLoadFontParameters(int scale, int skip_unused, int full_unicode);
+
+// swfdump.c
+
+void swf_DumpHeader(FILE * f,SWF * swf);
+void swf_DumpMatrix(FILE * f,MATRIX * m);
+void swf_DumpTag(FILE * f,TAG * t);
+void swf_DumpSWF(FILE * f,SWF*swf);
+void swf_DumpGradient(FILE* f, GRADIENT*gradient);
+char* swf_TagGetName(TAG*tag);
+void swf_DumpFont(SWFFONT * font);
+
+// swfbits.c
+
+int swf_ImageHasAlpha(RGBA*img, int width, int height);
+int swf_ImageGetNumberOfPaletteEntries(RGBA*img, int width, int height, RGBA*palette);
+
+typedef int JPEGBITS;
+JPEGBITS * swf_SetJPEGBitsStart(TAG * t,int width,int height,int quality); // deprecated
+int swf_SetJPEGBitsLines(JPEGBITS * jpegbits,U8 ** data,int n); // deprecated
+int swf_SetJPEGBitsLine(JPEGBITS * jpegbits,U8 * data); // deprecated
+int swf_SetJPEGBitsFinish(JPEGBITS * jpegbits); // deprecated
+
+void swf_GetJPEGSize(const char * fname, int*width, int*height);
+
+int swf_SetJPEGBits(TAG * t,const char * fname,int quality);
+void swf_SetJPEGBits2(TAG * t,U16 width,U16 height,RGBA * bitmap,int quality);
+int swf_SetJPEGBits3(TAG * tag,U16 width,U16 height,RGBA* bitmap, int quality);
+RGBA* swf_JPEG2TagToImage(TAG*tag, int*width, int*height);
+void swf_RemoveJPEGTables(SWF*swf);
+
+void swf_SaveJPEG(char*filename, RGBA*pixels, int width, int height, int quality);
+
+#define BYTES_PER_SCANLINE(width) ((width+3)&0xfffffffc)
+
+#define BMF_8BIT 3 // Bitmap formats
+#define BMF_16BIT 4
+#define BMF_32BIT 5
+
+int swf_SetLosslessBits(TAG * t,U16 width,U16 height,void * bitmap,U8 bitmap_flags);
+int swf_SetLosslessBitsIndexed(TAG * t,U16 width,U16 height,U8 * bitmap,RGBA * palette,U16 ncolors);
+int swf_SetLosslessBitsGrayscale(TAG * t,U16 width,U16 height,U8 * bitmap);
+void swf_SetLosslessImage(TAG*tag, RGBA*data, int width, int height); //WARNING: will change tag->id
+
+RGBA* swf_DefineLosslessBitsTagToImage(TAG*tag, int*width, int*height);
+
+RGBA* swf_ExtractImage(TAG*tag, int*dwidth, int*dheight);
+RGBA* swf_ImageScale(RGBA*data, int width, int height, int newwidth, int newheight);
+TAG* swf_AddImage(TAG*tag, int bitid, RGBA*mem, int width, int height, int quality);
+
+// swfsound.c
+void swf_SetSoundStreamHead(TAG*tag, int avgnumsamples);
+void swf_SetSoundStreamBlock(TAG*tag, S16*samples, int seek, char first); /* expects 2304 samples */
+void swf_SetSoundDefine(TAG*tag, S16*samples, int num);
+void swf_SetSoundDefineMP3(TAG*tag, U8* data, unsigned length,
+ unsigned SampRate,
+ unsigned Channels,
+ unsigned NumFrames);
+void swf_SetSoundInfo(TAG*tag, SOUNDINFO*info);
+
+// swftools.c
+
+void swf_Optimize(SWF*swf);
+U8 swf_isDefiningTag(TAG * t);
+U8 swf_isPseudoDefiningTag(TAG * t);
+U8 swf_isAllowedSpriteTag(TAG * t);
+U8 swf_isImageTag(TAG*tag);
+U8 swf_isShapeTag(TAG*tag);
+U8 swf_isTextTag(TAG*tag);
+U8 swf_isFontTag(TAG*tag);
+U8 swf_isPlaceTag(TAG*tag);
+
+U16 swf_GetDefineID(TAG * t);
+SRECT swf_GetDefineBBox(TAG * t);
+void swf_SetDefineBBox(TAG * t, SRECT r);
+
+void swf_SetDefineID(TAG * t, U16 newid);
+U16 swf_GetPlaceID(TAG * t); //PLACEOBJECT, PLACEOBJECT2 (sometimes), REMOVEOBJECT
+int swf_GetDepth(TAG * t); //PLACEOBJECT,PLACEOBJECT2,REMOVEOBJECT,REMOVEOBJECT2,SETTABINDEX
+char* swf_GetName(TAG * t); //PLACEOBJECT2, FRAMELABEL
+MATRIX * swf_MatrixJoin(MATRIX * d,MATRIX * s1,MATRIX * s2);
+MATRIX * swf_MatrixMapTriangle(MATRIX * m,int dx,int dy,
+ int x0,int y0,int x1,int y1,int x2,int y2);
+int swf_GetNumUsedIDs(TAG * t);
+void swf_GetUsedIDs(TAG * t, int * positions);
+char swf_Relocate(SWF*swf, char*bitmap); // bitmap is 65536 bytes, bitmap[a]==0 means id a is free
+void swf_RelocateDepth(SWF*swf, char*bitmap); // bitmap is 65536 bytes, bitmap[d]==0 means depth d is free
+
+TAG* swf_Concatenate (TAG*list1,TAG*list2); // warning: both list1 and list2 are invalid after this call.
+
+RGBA swf_GetSWFBackgroundColor(SWF*swf);
+
+// swfcgi.c
+
+void swf_uncgi(); // same behaviour as Steven Grimm's uncgi-library
+
+// as3/abc.c
+void*swf_ReadABC(TAG*tag);
+void*swf_DumpABC(FILE*fo, void*code, char*prefix);
+void swf_WriteABC(TAG*tag, void*code);
+void swf_FreeABC(void*code);
+void swf_AddButtonLinks(SWF*swf, char stop_each_frame, char events);
+TAG*swf_AddAS3FontDefine(TAG*tag, U16 id, char*fontname);
+#include "as3/compiler.h"
+
+// swfaction.c
+
+typedef struct _ActionTAG
+{ U8 op;
+ U16 len;
+ U8 * data;
+
+ struct _ActionTAG * next;
+ struct _ActionTAG * prev;
+
+ struct _ActionTAG * parent;
+ U8 tmp[8]; // store small operands here.
+} ActionTAG;
+
+typedef struct _ActionMarker
+{
+ ActionTAG* atag;
+} ActionMarker;
+
+ActionTAG* swf_ActionGet(TAG*tag);
+void swf_ActionFree(ActionTAG*tag);
+void swf_ActionSet(TAG*tag, ActionTAG*actions);
+void swf_DumpActions(ActionTAG*atag, char*prefix);
+void swf_ActionEnumerateURLs(ActionTAG*atag, char*(*callback)(char*));
+void swf_ActionEnumerateTargets(ActionTAG*atag, char*(*callback)(char*));
+void swf_ActionEnumerateStrings(ActionTAG*atag, char*(*callback)(char*));
+
+// using action/actioncompiler.h:
+ActionTAG* swf_ActionCompile(const char* source, int version);
+
+#define ACTION__GOTOFRAME 0x81
+#define ACTION__GETURL 0x83
+ActionTAG* action_End(ActionTAG*atag);
+ActionTAG* action_NextFrame(ActionTAG*atag);
+ActionTAG* action_PreviousFrame(ActionTAG*atag);
+ActionTAG* action_Play(ActionTAG*atag);
+ActionTAG* action_Stop(ActionTAG*atag);
+ActionTAG* action_ToggleQuality(ActionTAG*atag);
+ActionTAG* action_StopSounds(ActionTAG*atag);
+ActionTAG* action_Add(ActionTAG*atag);
+ActionTAG* action_Subtract(ActionTAG*atag);
+ActionTAG* action_Multiply(ActionTAG*atag);
+ActionTAG* action_Divide(ActionTAG*atag);
+ActionTAG* action_Equals(ActionTAG*atag);
+ActionTAG* action_Less(ActionTAG*atag);
+ActionTAG* action_And(ActionTAG*atag);
+ActionTAG* action_Or(ActionTAG*atag);
+ActionTAG* action_Not(ActionTAG*atag);
+ActionTAG* action_StringEquals(ActionTAG*atag);
+ActionTAG* action_StringLength(ActionTAG*atag);
+ActionTAG* action_StringExtract(ActionTAG*atag);
+ActionTAG* action_Pop(ActionTAG*atag);
+ActionTAG* action_ToInteger(ActionTAG*atag);
+ActionTAG* action_GetVariable(ActionTAG*atag);
+ActionTAG* action_SetVariable(ActionTAG*atag);
+ActionTAG* action_SetTarget2(ActionTAG*atag);
+ActionTAG* action_StringAdd(ActionTAG*atag);
+ActionTAG* action_GetProperty(ActionTAG*atag);
+ActionTAG* action_SetProperty(ActionTAG*atag);
+ActionTAG* action_CloneSprite(ActionTAG*atag);
+ActionTAG* action_RemoveSprite(ActionTAG*atag);
+ActionTAG* action_Trace(ActionTAG*atag);
+ActionTAG* action_StartDrag(ActionTAG*atag);
+ActionTAG* action_EndDrag(ActionTAG*atag);
+ActionTAG* action_StringLess(ActionTAG*atag);
+ActionTAG* action_RandomNumber(ActionTAG*atag);
+ActionTAG* action_MBStringLength(ActionTAG*atag);
+ActionTAG* action_CharToAscii(ActionTAG*atag);
+ActionTAG* action_AsciiToChar(ActionTAG*atag);
+ActionTAG* action_GetTime(ActionTAG*atag);
+ActionTAG* action_MBStringExtract(ActionTAG*atag);
+ActionTAG* action_MBCharToAscii(ActionTAG*atag);
+ActionTAG* action_MBAsciiToChar(ActionTAG*atag);
+ActionTAG* action_Delete(ActionTAG*atag);
+ActionTAG* action_Delete2(ActionTAG*atag);
+ActionTAG* action_DefineLocal(ActionTAG*atag);
+ActionTAG* action_CallFunction(ActionTAG*atag);
+ActionTAG* action_Return(ActionTAG*atag);
+ActionTAG* action_Modulo(ActionTAG*atag);
+ActionTAG* action_NewObject(ActionTAG*atag);
+ActionTAG* action_DefineLocal2(ActionTAG*atag);
+ActionTAG* action_InitArray(ActionTAG*atag);
+ActionTAG* action_Makehash(ActionTAG*atag);
+ActionTAG* action_TypeOf(ActionTAG*atag);
+ActionTAG* action_TargetPath(ActionTAG*atag);
+ActionTAG* action_Enumerate(ActionTAG*atag);
+ActionTAG* action_Add2(ActionTAG*atag);
+ActionTAG* action_Less2(ActionTAG*atag);
+ActionTAG* action_Equals2(ActionTAG*atag);
+ActionTAG* action_ToNumber(ActionTAG*atag);
+ActionTAG* action_ToString(ActionTAG*atag);
+ActionTAG* action_PushDuplicate(ActionTAG*atag);
+ActionTAG* action_StackSwap(ActionTAG*atag);
+ActionTAG* action_GetMember(ActionTAG*atag);
+ActionTAG* action_SetMember(ActionTAG*atag);
+ActionTAG* action_Increment(ActionTAG*atag);
+ActionTAG* action_Decrement(ActionTAG*atag);
+ActionTAG* action_CallMethod(ActionTAG*atag);
+ActionTAG* action_NewMethod(ActionTAG*atag);
+ActionTAG* action_BitAnd(ActionTAG*atag);
+ActionTAG* action_BitOr(ActionTAG*atag);
+ActionTAG* action_BitXor(ActionTAG*atag);
+ActionTAG* action_BitLShift(ActionTAG*atag);
+ActionTAG* action_BitRShift(ActionTAG*atag);
+ActionTAG* action_BitURShift(ActionTAG*atag);
+ActionTAG* action_GotoFrame(ActionTAG*atag, U16 frame);
+ActionTAG* action_GetUrl(ActionTAG*atag, const char* url, char* label);
+ActionTAG* action_StoreRegister(ActionTAG*atag, U8 reg);
+ActionTAG* action_Constantpool(ActionTAG*atag, char* constantpool);
+ActionTAG* action_WaitForFrame(ActionTAG*atag, U16 frame, U8 skip);
+ActionTAG* action_SetTarget(ActionTAG*atag, const char* target);
+ActionTAG* action_GotoLabel(ActionTAG*atag, char* label);
+ActionTAG* action_WaitForFrame2(ActionTAG*atag, U8 skip);
+ActionTAG* action_With(ActionTAG*atag, char*object);
+ActionTAG* action_PushString(ActionTAG*atag, const char*str);
+ActionTAG* action_PushFloat(ActionTAG*atag, float f);
+ActionTAG* action_PushNULL(ActionTAG*atag);
+ActionTAG* action_PushRegister(ActionTAG*atag, U8 reg);
+ActionTAG* action_PushBoolean(ActionTAG*atag, char c);
+ActionTAG* action_PushDouble(ActionTAG*atag, double d);
+ActionTAG* action_PushInt(ActionTAG*atag, int i);
+ActionTAG* action_PushLookup(ActionTAG*atag, U8 index);
+ActionTAG* action_Jump(ActionTAG*atag, U16 branch);
+ActionTAG* action_GetUrl2(ActionTAG*atag, U8 method);
+ActionTAG* action_DefineFunction(ActionTAG*atag, U8*data, int len);
+ActionTAG* action_If(ActionTAG*atag, U16 branch);
+ActionTAG* action_Call(ActionTAG*atag);
+ActionTAG* action_GotoFrame2(ActionTAG*atag, U8 method);
+ActionMarker action_setMarker(ActionTAG*atag);
+void action_fixjump(ActionMarker m1, ActionMarker m2);