This patch is for ming-0.2a.
Glunz Wolfgang <wolfgang.glunz@siemens.com> wrote this patch.
This patch is already sent to the ming maintainer.
However, it is not included official source tree yet.

*** ming-0.2a_orig/ming.h	2001-08-17 19:05:50.000000000 +0200
--- ming-0.2a/ming.h	2002-01-04 13:57:34.000000000 +0100
***************
*** 38,45 ****
  void Ming_useSWFVersion(int version);
  
  /* change the error/warn behavior.  Default prints message and exits. */
! void Ming_setWarnFunction(void (*warn)(char *msg, ...));
! void Ming_setErrorFunction(void (*error)(char *msg, ...));
  
  
  typedef unsigned char byte;
--- 38,45 ----
  void Ming_useSWFVersion(int version);
  
  /* change the error/warn behavior.  Default prints message and exits. */
! void Ming_setWarnFunction(void (*warn)(const char *msg, ...));
! void Ming_setErrorFunction(void (*error)(const char *msg, ...));
  
  
  typedef unsigned char byte;
***************
*** 55,66 ****
  
  /* we dig opaque types */
  
! typedef void *SWFBlock, *SWFMatrix;
  
  
    /* SWFInput */
  
! typedef void *SWFInput;
  
  int SWFInput_length(SWFInput input);
  void SWFInput_rewind(SWFInput input);
--- 55,67 ----
  
  /* we dig opaque types */
  
! typedef struct _block *SWFBlock;
! typedef struct _matrix *SWFMatrix;
  
  
    /* SWFInput */
  
! typedef struct _swfInput *SWFInput;
  
  int SWFInput_length(SWFInput input);
  void SWFInput_rewind(SWFInput input);
***************
*** 80,94 ****
  
  /* everything with a character ID is an SWFCharacter */
  
! typedef void *SWFCharacter;
  
  float SWFCharacter_getWidth(SWFCharacter character);
  float SWFCharacter_getHeight(SWFCharacter character);
  
  
    /* SWFBitmap */
! 
! typedef void *SWFBitmap;
  
  void destroySWFBitmap(SWFBitmap b);
  int SWFBitmap_getWidth(SWFBitmap b);
--- 81,94 ----
  
  /* everything with a character ID is an SWFCharacter */
  
! typedef struct _character *SWFCharacter;
  
  float SWFCharacter_getWidth(SWFCharacter character);
  float SWFCharacter_getHeight(SWFCharacter character);
  
  
    /* SWFBitmap */
! typedef struct _character *SWFBitmap;
  
  void destroySWFBitmap(SWFBitmap b);
  int SWFBitmap_getWidth(SWFBitmap b);
***************
*** 99,105 ****
  
    /* SWFDBLBitmap extends SWFBitmap */
  
! typedef void *SWFDBLBitmap;
  
  SWFDBLBitmap newSWFDBLBitmap(FILE *f);
  SWFDBLBitmap newSWFDBLBitmap_fromInput(SWFInput input);
--- 99,105 ----
  
    /* SWFDBLBitmap extends SWFBitmap */
  
! typedef struct _swfDBLBitmap *SWFDBLBitmap;
  
  SWFDBLBitmap newSWFDBLBitmap(FILE *f);
  SWFDBLBitmap newSWFDBLBitmap_fromInput(SWFInput input);
***************
*** 107,113 ****
  
    /* SWFJpegBitmap extends SWFBitmap */
  
! typedef void *SWFJpegBitmap, *SWFJpegWithAlpha;
  
  SWFJpegBitmap newSWFJpegBitmap(FILE *f);
  SWFJpegBitmap newSWFJpegBitmap_fromInput(SWFInput input);
--- 107,115 ----
  
    /* SWFJpegBitmap extends SWFBitmap */
  
! typedef struct _swfJpegBitmap *SWFJpegBitmap;
! typedef struct _swfJpegWithAlpha *SWFJpegWithAlpha;
! 
  
  SWFJpegBitmap newSWFJpegBitmap(FILE *f);
  SWFJpegBitmap newSWFJpegBitmap_fromInput(SWFInput input);
***************
*** 117,123 ****
  
    /* SWFGradient */
  
! typedef void *SWFGradient;
  
  SWFGradient newSWFGradient();
  void destroySWFGradient(SWFGradient gradient);
--- 119,126 ----
  
    /* SWFGradient */
  
! typedef struct _gradient *SWFGradient;
! 
  
  SWFGradient newSWFGradient();
  void destroySWFGradient(SWFGradient gradient);
***************
*** 146,159 ****
  
  /* SWFLineStyle */
  
! typedef void *SWFLineStyle;
  
  SWFLineStyle newSWFLineStyle(int width, int r, int g, int b, int a);
  
  
    /* SWFShape */
  
! typedef void *SWFShape;
  
  SWFShape newSWFShape();
  void destroySWFShape(SWFBlock block);
--- 149,162 ----
  
  /* SWFLineStyle */
  
! typedef struct _lineStyle *SWFLineStyle;
  
  SWFLineStyle newSWFLineStyle(int width, int r, int g, int b, int a);
  
  
    /* SWFShape */
  
! typedef struct _shape *SWFShape;
  
  SWFShape newSWFShape();
  void destroySWFShape(SWFBlock block);
***************
*** 173,179 ****
  
  void SWFShape_end(SWFShape shape);
  
! int SWFShape_setLineStyle(SWFShape shape, unsigned short width,
  			  byte r, byte g, byte b, byte a);
  
  SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
--- 176,182 ----
  
  void SWFShape_end(SWFShape shape);
  
! void SWFShape_setLineStyle(SWFShape shape, unsigned short width,
  			  byte r, byte g, byte b, byte a);
  
  SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
***************
*** 191,197 ****
  
    /* SWFMorph */
  
! typedef void *SWFMorph;
  
  SWFMorph newSWFMorphShape();
  void destroySWFMorph(SWFBlock block);
--- 194,200 ----
  
    /* SWFMorph */
  
! typedef struct _morph *SWFMorph;
  
  SWFMorph newSWFMorphShape();
  void destroySWFMorph(SWFBlock block);
***************
*** 201,207 ****
  
    /* SWFFont */
  
! typedef void *SWFFont;
  
  SWFFont newSWFFont();
  SWFFont loadSWFFontFromFile(FILE *file);
--- 204,210 ----
  
    /* SWFFont */
  
! typedef struct _font *SWFFont;
  
  SWFFont newSWFFont();
  SWFFont loadSWFFontFromFile(FILE *file);
***************
*** 219,225 ****
  
    /* SWFText */
  
! typedef void *SWFText;
  
  SWFText newSWFText();
  SWFText newSWFText2();
--- 222,228 ----
  
    /* SWFText */
  
! typedef struct _text *SWFText;
  
  SWFText newSWFText();
  SWFText newSWFText2();
***************
*** 247,261 ****
  
    /* SWFBrowserFont */
  
! typedef void *SWFBrowserFont;
  
! SWFBrowserFont newSWFBrowserFont(char *name);
  void destroySWFBrowserFont(SWFBlock block);
  
  
    /* SWFTextField */
  
! typedef void *SWFTextField;
  
  #define SWFTEXTFIELD_ONMASK  0x2085 /* on bits */
  #define SWFTEXTFIELD_OFFMASK 0x38FF /* off bits */
--- 250,266 ----
  
    /* SWFBrowserFont */
  
! typedef struct _browserFont *SWFBrowserFont;
! 
  
! SWFBrowserFont newSWFBrowserFont(const char *name);
  void destroySWFBrowserFont(SWFBlock block);
  
  
    /* SWFTextField */
  
! //typedef void *SWFTextField;
! typedef struct _textField * SWFTextField;
  
  #define SWFTEXTFIELD_ONMASK  0x2085 /* on bits */
  #define SWFTEXTFIELD_OFFMASK 0x38FF /* off bits */
***************
*** 284,291 ****
  void SWFTextField_setBounds(SWFTextField field, float width, float height);
  void SWFTextField_setFlags(SWFTextField field, int flags);
  void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
! void SWFTextField_setVariableName(SWFTextField field, char *name);
! void SWFTextField_addString(SWFTextField field, char *string);
  
  void SWFTextField_setHeight(SWFTextField field, float height);
  void SWFTextField_setFieldHeight(SWFTextField field, float height);
--- 289,296 ----
  void SWFTextField_setBounds(SWFTextField field, float width, float height);
  void SWFTextField_setFlags(SWFTextField field, int flags);
  void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
! void SWFTextField_setVariableName(SWFTextField field, const char *name);
! void SWFTextField_addString(SWFTextField field, const char *string);
  
  void SWFTextField_setHeight(SWFTextField field, float height);
  void SWFTextField_setFieldHeight(SWFTextField field, float height);
***************
*** 300,306 ****
  
    /* sound - only mp3 streaming implemented */
  
! typedef void *SWFSound;
  
  SWFSound newSWFSound(FILE *file);
  SWFSound newSWFSound_fromInput(SWFInput input);
--- 305,311 ----
  
    /* sound - only mp3 streaming implemented */
  
! typedef struct _sound *SWFSound;
  
  SWFSound newSWFSound(FILE *file);
  SWFSound newSWFSound_fromInput(SWFInput input);
***************
*** 309,315 ****
  
    /* SWFCXform */
  
! typedef void *SWFCXform;
  
  SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
  		       float rMult, float gMult, float bMult, float aMult);
--- 314,320 ----
  
    /* SWFCXform */
  
! typedef struct _cXform *SWFCXform;
  
  SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
  		       float rMult, float gMult, float bMult, float aMult);
***************
*** 329,337 ****
  
    /* SWFAction */
  
! typedef void *SWFAction;
  
! SWFAction compileSWFActionCode(char *script);
  void destroySWFAction(SWFAction action);
  
  
--- 334,343 ----
  
    /* SWFAction */
  
! typedef struct _outputBlock *SWFOutputBlock;
! typedef SWFOutputBlock SWFAction;
  
! SWFAction compileSWFActionCode(const char *script);
  void destroySWFAction(SWFAction action);
  
  
***************
*** 384,390 ****
  
    /* SWFSprite */
  
! typedef void *SWFSprite;
  
  SWFSprite newSWFSprite();
  void destroySWFSprite(SWFBlock block);
--- 390,396 ----
  
    /* SWFSprite */
  
! typedef struct _sprite *SWFSprite;
  
  SWFSprite newSWFSprite();
  void destroySWFSprite(SWFBlock block);
***************
*** 432,438 ****
  void SWFPosition_moveTo(SWFPosition position, float x, float y);
  
  
! typedef void *SWFDisplayItem;
  
  void SWFDisplayItem_rotate(SWFDisplayItem item, float degrees);
  void SWFDisplayItem_rotateTo(SWFDisplayItem item, float degrees);
--- 438,444 ----
  void SWFPosition_moveTo(SWFPosition position, float x, float y);
  
  
! typedef struct _swfDisplayItem *SWFDisplayItem;
  
  void SWFDisplayItem_rotate(SWFDisplayItem item, float degrees);
  void SWFDisplayItem_rotateTo(SWFDisplayItem item, float degrees);
***************
*** 478,484 ****
  
  /* SWFFill adds a position object to manipulate SWFFillStyle's matrix. */
  
! typedef void *SWFFill;
  
  SWFFill newSWFFill(SWFFillStyle fillstyle);
  void destroySWFFill(SWFFill fill);
--- 484,490 ----
  
  /* SWFFill adds a position object to manipulate SWFFillStyle's matrix. */
  
! typedef struct _swfFill *SWFFill;
  
  SWFFill newSWFFill(SWFFillStyle fillstyle);
  void destroySWFFill(SWFFill fill);
***************
*** 508,515 ****
  
  /* shape_util.h */
  
! void SWFShape_setLine(SWFShape shape, unsigned short width,
! 		      byte r, byte g, byte b, byte a);
  
  SWFFill SWFShape_addSolidFill(SWFShape shape, byte r, byte g, byte b, byte a);
  SWFFill SWFShape_addGradientFill(SWFShape shape, SWFGradient gradient,
--- 514,521 ----
  
  /* shape_util.h */
  
! /* void SWFShape_setLine(SWFShape shape, unsigned short width,
! 		      byte r, byte g, byte b, byte a); */ /* declared later */
  
  SWFFill SWFShape_addSolidFill(SWFShape shape, byte r, byte g, byte b, byte a);
  SWFFill SWFShape_addGradientFill(SWFShape shape, SWFGradient gradient,
***************
*** 549,555 ****
  #define SWFShape_drawFontGlyph(s,f,c) SWFShape_drawGlyph(s,f,c)
  
  
! typedef void *SWFMovieClip;
  
  void destroySWFMovieClip(SWFMovieClip clip);
  SWFMovieClip newSWFMovieClip();
--- 555,561 ----
  #define SWFShape_drawFontGlyph(s,f,c) SWFShape_drawGlyph(s,f,c)
  
  
! typedef struct _swfMovieClip *SWFMovieClip;
  
  void destroySWFMovieClip(SWFMovieClip clip);
  SWFMovieClip newSWFMovieClip();
***************
*** 558,570 ****
  SWFDisplayItem SWFMovieClip_add(SWFMovieClip clip, SWFBlock block);
  void SWFMovieClip_remove(SWFMovieClip clip, SWFDisplayItem item);
  void SWFMovieClip_nextFrame(SWFMovieClip clip);
! void SWFMovieClip_labelFrame(SWFMovieClip clip, char *label);
  void SWFMovieClip_setSoundStream(SWFMovieClip clip, SWFSound sound, float rate);
  
  
  /* movie.h */
  
! typedef void *SWFMovie;
  
  void destroySWFMovie(SWFMovie movie);
  SWFMovie newSWFMovie();
--- 564,576 ----
  SWFDisplayItem SWFMovieClip_add(SWFMovieClip clip, SWFBlock block);
  void SWFMovieClip_remove(SWFMovieClip clip, SWFDisplayItem item);
  void SWFMovieClip_nextFrame(SWFMovieClip clip);
! void SWFMovieClip_labelFrame(SWFMovieClip clip, const char *label);
  void SWFMovieClip_setSoundStream(SWFMovieClip clip, SWFSound sound, float rate);
  
  
  /* movie.h */
  
! typedef struct _swfMovie *SWFMovie;
  
  void destroySWFMovie(SWFMovie movie);
  SWFMovie newSWFMovie();
***************
*** 574,580 ****
  void SWFMovie_setDimension(SWFMovie movie, float x, float y);
  void SWFMovie_setNumberOfFrames(SWFMovie movie, int frames);
  
! void SWFMovie_addExport(SWFMovie movie, SWFBlock block, char *name);
  
  /* XXX - 0.1 name: */
  #define SWFMovie_setFrames SWFMovie_setNumberOfFrames
--- 580,586 ----
  void SWFMovie_setDimension(SWFMovie movie, float x, float y);
  void SWFMovie_setNumberOfFrames(SWFMovie movie, int frames);
  
! void SWFMovie_addExport(SWFMovie movie, SWFBlock block, const char *name);
  
  /* XXX - 0.1 name: */
  #define SWFMovie_setFrames SWFMovie_setNumberOfFrames
***************
*** 586,592 ****
  SWFDisplayItem SWFMovie_add(SWFMovie movie, SWFBlock block);
  void SWFMovie_remove(SWFMovie movie, SWFDisplayItem item);
  void SWFMovie_nextFrame(SWFMovie movie);
! void SWFMovie_labelFrame(SWFMovie movie, char *label);
  
  int SWFMovie_output(SWFMovie movie, SWFByteOutputMethod method, void *data);
  
--- 592,598 ----
  SWFDisplayItem SWFMovie_add(SWFMovie movie, SWFBlock block);
  void SWFMovie_remove(SWFMovie movie, SWFDisplayItem item);
  void SWFMovie_nextFrame(SWFMovie movie);
! void SWFMovie_labelFrame(SWFMovie movie, const char *label);
  
  int SWFMovie_output(SWFMovie movie, SWFByteOutputMethod method, void *data);
  
***************
*** 602,604 ****
--- 608,611 ----
    fclose(f);
    return count;
  }
+ 
*** ming-0.2a_orig/mingpp.h	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/mingpp.h	2002-01-04 13:58:50.000000000 +0100
***************
*** 130,136 ****
   public:
    c_SWFAction action;
  
!   SWFAction(char *script)
      { this->action = compileSWFActionCode(script); }
  
    // movies, buttons, etc. destroy the c_SWFAction..
--- 130,136 ----
   public:
    c_SWFAction action;
  
!   SWFAction(const char *script)
      { this->action = compileSWFActionCode(script); }
  
    // movies, buttons, etc. destroy the c_SWFAction..
***************
*** 382,401 ****
   public:
    c_SWFBitmap bitmap;
  
!   SWFBitmap(char *filename, char *alpha=NULL)
    {
      if(strlen(filename) > 4)
      {
        if(strcmp(filename+strlen(filename)-4, ".dbl") == 0)
! 	this->bitmap = newSWFDBLBitmap(fopen(filename, "rb"));
! 
        else if(strcmp(filename+strlen(filename)-4, ".jpg") == 0)
        {
! 	if(alpha != NULL)
! 	  this->bitmap = newSWFJpegWithAlpha(fopen(filename, "rb"),
! 					     fopen(alpha, "rb"));
! 	else
! 	  this->bitmap = newSWFJpegBitmap(fopen(filename, "rb"));
        }
  
        else
--- 382,399 ----
   public:
    c_SWFBitmap bitmap;
  
!   SWFBitmap(const char *filename, const char *alpha=NULL)
    {
      if(strlen(filename) > 4)
      {
        if(strcmp(filename+strlen(filename)-4, ".dbl") == 0)
! 		this->bitmap = (c_SWFBitmap) newSWFDBLBitmap(fopen(filename, "rb")); // WOGL: cast needed ?
        else if(strcmp(filename+strlen(filename)-4, ".jpg") == 0)
        {
! 		if(alpha != NULL)
! 			this->bitmap = (c_SWFBitmap)  newSWFJpegWithAlpha(fopen(filename, "rb"), fopen(alpha, "rb")); // WOGL: cast needed ?
! 		else
! 			this->bitmap = (c_SWFBitmap)  newSWFJpegBitmap(fopen(filename, "rb")); // WOGL: cast needed ?
        }
  
        else
***************
*** 409,418 ****
    virtual ~SWFBitmap()
      { destroySWFBitmap(this->bitmap); }
  
!   float getWidth()
      { return SWFBitmap_getWidth(this->bitmap); }
  
!   float getHeight()
      { return SWFBitmap_getHeight(this->bitmap); }
  };
  
--- 407,416 ----
    virtual ~SWFBitmap()
      { destroySWFBitmap(this->bitmap); }
  
!   int getWidth()
      { return SWFBitmap_getWidth(this->bitmap); }
  
!   int getHeight()
      { return SWFBitmap_getHeight(this->bitmap); }
  };
  
***************
*** 430,454 ****
    SWFFont(FILE *file)
      { this->font = loadSWFFontFromFile(file); }
  
!   SWFFont(char *name)
    {
      if(strlen(name) > 4 &&
         strcmp(name + strlen(name) - 4, ".fdb") == 0)
        this->font = loadSWFFontFromFile(fopen(name, "rb"));
      else
!       this->font = newSWFBrowserFont(name);
    }
  
    virtual ~SWFFont()
!     { destroySWFFont(this->font); }
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->font; }
  
!   float getStringWidth(char *string)
      { return SWFFont_getStringWidth(this->font, string); }
  
!   float getWidth(char *string)
      { return SWFFont_getStringWidth(this->font, string); }
  
    float getAscent()
--- 428,452 ----
    SWFFont(FILE *file)
      { this->font = loadSWFFontFromFile(file); }
  
!   SWFFont(const char *name)
    {
      if(strlen(name) > 4 &&
         strcmp(name + strlen(name) - 4, ".fdb") == 0)
        this->font = loadSWFFontFromFile(fopen(name, "rb"));
      else
!       this->font = (c_SWFFont) newSWFBrowserFont(name); //wogl: cast needed here?
    }
  
    virtual ~SWFFont()
!   { destroySWFFont( (c_SWFBlock) (this->font) ); } //wogl: cast needed here?
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->font; }
  
!   float getStringWidth(const char *string)
      { return SWFFont_getStringWidth(this->font, string); }
  
!   float getWidth(const char *string)
      { return SWFFont_getStringWidth(this->font, string); }
  
    float getAscent()
***************
*** 476,482 ****
      { this->shape = shape; }
  
    virtual ~SWFShape()
!     { destroySWFShape(this->shape); }
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->shape; }
--- 474,480 ----
      { this->shape = shape; }
  
    virtual ~SWFShape()
!   { destroySWFShape((c_SWFBlock) (this->shape) ); } //wogl: cast needed here?
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->shape; }
***************
*** 569,575 ****
    void nextFrame()
      { SWFMovieClip_nextFrame(this->clip); }
  
!   void labelFrame(char *label)
      { SWFMovieClip_labelFrame(this->clip, label); }
  };
  
--- 567,573 ----
    void nextFrame()
      { SWFMovieClip_nextFrame(this->clip); }
  
!   void labelFrame(const char *label)
      { SWFMovieClip_labelFrame(this->clip, label); }
  };
  
***************
*** 585,591 ****
      { this->morph = newSWFMorphShape(); }
  
    virtual ~SWFMorph()
!     { destroySWFMorph(this->morph); }
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->morph; }
--- 583,589 ----
      { this->morph = newSWFMorphShape(); }
  
    virtual ~SWFMorph()
!   { destroySWFMorph((c_SWFBlock) (this->morph) ); } //wogl: cast needed here?
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->morph; }
***************
*** 609,621 ****
      { this->text = newSWFText2(); }
  
    virtual ~SWFText()
!     { destroySWFText(this->text); }
  
    c_SWFBlock getBlock()
!     { return (c_SWFBlock)this->text; }
  
    void setFont(SWFBlock *font)
!     { SWFText_setFont(this->text, font->getBlock()); }
  
    void setHeight(float height)
      { SWFText_setHeight(this->text, height); }
--- 607,619 ----
      { this->text = newSWFText2(); }
  
    virtual ~SWFText()
!   { destroySWFText( (c_SWFBlock) (this->text) ); }  //wogl: cast needed here?
  
    c_SWFBlock getBlock()
!   { return (c_SWFBlock)this->text; } //wogl: cast needed here?
  
    void setFont(SWFBlock *font)
!   { SWFText_setFont(this->text, (c_SWFFont) (font->getBlock()) ); } //wogl: cast needed here?
  
    void setHeight(float height)
      { SWFText_setHeight(this->text, height); }
***************
*** 627,633 ****
    void setColor(unsigned char r, unsigned char g, unsigned char b, int a=0xff)
      { SWFText_setColor(this->text, r, g, b, a); }
  
!   void addString(const char *string, float *advance=NULL)
      { SWFText_addString(this->text, string, advance); }
  
    void setSpacing(float spacing)
--- 625,631 ----
    void setColor(unsigned char r, unsigned char g, unsigned char b, int a=0xff)
      { SWFText_setColor(this->text, r, g, b, a); }
  
!   void addString(const char *string, int *advance=NULL)
      { SWFText_addString(this->text, string, advance); }
  
    void setSpacing(float spacing)
***************
*** 648,658 ****
   public:
    c_SWFBrowserFont browserFont;
  
!   SWFBrowserFont(char *name)
      { this->browserFont = newSWFBrowserFont(name); }
  
    virtual ~SWFBrowserFont()
!     { destroySWFBrowserFont(this->browserFont); }
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->browserFont; }
--- 646,656 ----
   public:
    c_SWFBrowserFont browserFont;
  
!   SWFBrowserFont(const char *name)
      { this->browserFont = newSWFBrowserFont(name); }
  
    virtual ~SWFBrowserFont()
!   { destroySWFBrowserFont((c_SWFBlock) (this->browserFont) ); } //wogl: cast needed here ?
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->browserFont; }
***************
*** 670,676 ****
      { this->textField = newSWFTextField(); }
  
    virtual ~SWFTextField()
!     { destroySWFTextField(this->textField); }
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->textField; }
--- 668,674 ----
      { this->textField = newSWFTextField(); }
  
    virtual ~SWFTextField()
!   { destroySWFTextField((c_SWFBlock) (this->textField) ); } // wogl: cast needed here ?
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->textField; }
***************
*** 687,696 ****
    void setColor(int r, int g, int b, int a=0xff)
      { SWFTextField_setColor(this->textField, r, g, b, a); }
  
!   void setVariableName(char *name)
      { SWFTextField_setVariableName(this->textField, name); }
  
!   void addString(char *string)
      { SWFTextField_addString(this->textField, string); }
  
    void setHeight(float height)
--- 685,694 ----
    void setColor(int r, int g, int b, int a=0xff)
      { SWFTextField_setColor(this->textField, r, g, b, a); }
  
!   void setVariableName(const char *name)
      { SWFTextField_setVariableName(this->textField, name); }
  
!   void addString(const char *string)
      { SWFTextField_addString(this->textField, string); }
  
    void setHeight(float height)
***************
*** 730,736 ****
      { this->button = newSWFButton(); }
  
    virtual ~SWFButton()
!     { destroySWFButton(this->button); }
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->button; }
--- 728,734 ----
      { this->button = newSWFButton(); }
  
    virtual ~SWFButton()
!   { destroySWFButton((c_SWFBlock) (this->button)); } // wogl: cast needed here ?
  
    c_SWFBlock getBlock()
      { return (c_SWFBlock)this->button; }
*** ming-0.2a_orig/src/blocklist.c	2001-08-17 19:06:02.000000000 +0200
--- ming-0.2a/src/blocklist.c	2002-01-01 21:30:58.000000000 +0100
***************
*** 39,45 ****
  
  SWFBlockList newSWFBlockList()
  {
!   SWFBlockList blockList = calloc(1, SWFBLOCKLIST_SIZE);
    return blockList;
  }
  
--- 39,45 ----
  
  SWFBlockList newSWFBlockList()
  {
!   SWFBlockList blockList = (SWFBlockList) calloc(1, SWFBLOCKLIST_SIZE);
    return blockList;
  }
  
*** ming-0.2a_orig/src/blocks/block.c	2001-08-17 19:06:05.000000000 +0200
--- ming-0.2a/src/blocks/block.c	2002-01-01 22:03:44.000000000 +0100
***************
*** 91,97 ****
  
  SWFBlock newEmptySWFBlock(SWFBlocktype type)
  {
!   SWFBlock block = calloc(1, BLOCK_SIZE);
    block->type = type;
  
    block->writeBlock = NULL;
--- 91,97 ----
  
  SWFBlock newEmptySWFBlock(SWFBlocktype type)
  {
!   SWFBlock block = (SWFBlock) calloc(1, BLOCK_SIZE);
    block->type = type;
  
    block->writeBlock = NULL;
*** ming-0.2a_orig/src/blocks/browserfont.c	2001-08-17 19:06:05.000000000 +0200
--- ming-0.2a/src/blocks/browserfont.c	2002-10-06 20:51:12.000000000 +0200
***************
*** 40,49 ****
    destroySWFOutput(f->out);
    free(f);
  }
! SWFBrowserFont newSWFBrowserFont(char *name)
  {
    unsigned int i;
!   SWFBrowserFont font = calloc(1, SWFBROWSERFONT_SIZE);
    SWFOutput out = newSWFOutput();
    memset(font, 0, SWFBROWSERFONT_SIZE);
  
--- 40,50 ----
    destroySWFOutput(f->out);
    free(f);
  }
! 
! SWFBrowserFont newSWFBrowserFont(const char *name)
  {
    unsigned int i;
!   SWFBrowserFont font = (SWFBrowserFont) calloc(1, SWFBROWSERFONT_SIZE);
    SWFOutput out = newSWFOutput();
    memset(font, 0, SWFBROWSERFONT_SIZE);
  
***************
*** 72,74 ****
--- 73,76 ----
  
    return font;
  }
+  
*** ming-0.2a_orig/src/blocks/browserfont.h	2001-08-17 19:06:06.000000000 +0200
--- ming-0.2a/src/blocks/browserfont.h	2001-10-14 20:04:22.000000000 +0200
***************
*** 35,40 ****
  
  #define SWFBROWSERFONT_SIZE sizeof(struct _browserFont)
  
! SWFBrowserFont newSWFBrowserFont(char *name);
  
  #endif /* SWF_BROWSERFONT_H_INCLUDED */
--- 35,40 ----
  
  #define SWFBROWSERFONT_SIZE sizeof(struct _browserFont)
  
! SWFBrowserFont newSWFBrowserFont(const char *name);
  
  #endif /* SWF_BROWSERFONT_H_INCLUDED */
*** ming-0.2a_orig/src/blocks/button.c	2001-08-17 19:06:06.000000000 +0200
--- ming-0.2a/src/blocks/button.c	2002-01-01 22:05:18.000000000 +0100
***************
*** 23,29 ****
  					  unsigned short layer,
  					  SWFMatrix matrix)
  {
!   SWFButtonRecord record = calloc(1, BUTTONRECORD_SIZE);
  
    record->flags = flags;
    record->character = character;
--- 23,29 ----
  					  unsigned short layer,
  					  SWFMatrix matrix)
  {
!   SWFButtonRecord record = (SWFButtonRecord) calloc(1, BUTTONRECORD_SIZE);
  
    record->flags = flags;
    record->character = character;
*** ming-0.2a_orig/src/blocks/cxform.c	2001-08-17 19:06:06.000000000 +0200
--- ming-0.2a/src/blocks/cxform.c	2002-01-01 22:06:38.000000000 +0100
***************
*** 25,31 ****
  SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
  		       float rMult, float gMult, float bMult, float aMult)
  {
!   SWFCXform cXform = malloc(CXFORM_SIZE);
  
    cXform->rMult = floor(256*rMult);
    cXform->gMult = floor(256*gMult);
--- 25,31 ----
  SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
  		       float rMult, float gMult, float bMult, float aMult)
  {
!   SWFCXform cXform = (SWFCXform) malloc(CXFORM_SIZE);
  
    cXform->rMult = floor(256*rMult);
    cXform->gMult = floor(256*gMult);
*** ming-0.2a_orig/src/blocks/dbl.c	2001-08-17 19:06:06.000000000 +0200
--- ming-0.2a/src/blocks/dbl.c	2002-01-01 22:42:24.000000000 +0100
***************
*** 52,58 ****
    int version;
    int width, height;
  
!   dbl = calloc(1, SWFDBLBITMAP_SIZE);
  
    CHARACTERID(dbl) = ++SWF_gNumCharacters;
    BLOCK(dbl)->writeBlock = writeSWFDBLBitmapToMethod;
--- 52,58 ----
    int version;
    int width, height;
  
!   dbl = (SWFDBLBitmap) calloc(1, SWFDBLBITMAP_SIZE);
  
    CHARACTERID(dbl) = ++SWF_gNumCharacters;
    BLOCK(dbl)->writeBlock = writeSWFDBLBitmapToMethod;
*** ming-0.2a_orig/src/blocks/error.c	2001-08-17 19:06:11.000000000 +0200
--- ming-0.2a/src/blocks/error.c	2002-10-06 20:51:12.000000000 +0200
***************
*** 1,10 ****
  
  #include <stdio.h>
  #include <stdarg.h>
  
! #include "error.h"
  
! void warn_default(char *msg, ...)
  {
    va_list args;
  
--- 1,11 ----
  
  #include <stdio.h>
  #include <stdarg.h>
+ #include <stdlib.h>
  
! #include "error.h" 
  
! void warn_default(const char *msg, ...)
  {
    va_list args;
  
***************
*** 13,19 ****
    va_end(args);
  }
  
! void error_default(char *msg, ...)
  {
    va_list args;
  
--- 14,20 ----
    va_end(args);
  }
  
! void error_default(const char *msg, ...)
  {
    va_list args;
  
***************
*** 23,43 ****
    exit(0);
  }
  
! void (*SWF_warn)(char *msg, ...) = warn_default;
! void (*SWF_error)(char *msg, ...) = error_default;
  
! void setSWFWarnFunction(void (*warnfunc)(char *msg, ...))
  {
    SWF_warn = warnfunc;
  }
  
! void setSWFErrorFunction(void (*errorfunc)(char *msg, ...))
  {
    SWF_error = errorfunc;
  }
  
! void SWF_assert(int c)
  {
    if(!c)
      SWF_error("failed assertion");
  }
--- 24,45 ----
    exit(0);
  }
  
! void (*SWF_warn)(const char *msg, ...) = warn_default;
! void (*SWF_error)(const char *msg, ...) = error_default;
  
! void setSWFWarnFunction(void (*warnfunc)(const char *msg, ...))
  {
    SWF_warn = warnfunc;
  }
  
! void setSWFErrorFunction(void (*errorfunc)(const char *msg, ...))
  {
    SWF_error = errorfunc;
  }
  
! void oldSWF_assert(int c)
  {
    if(!c)
      SWF_error("failed assertion");
  }
+  
*** ming-0.2a_orig/src/blocks/error.h	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/error.h	2002-10-06 20:51:07.000000000 +0200
***************
*** 4,18 ****
  
  /* XXX - error calls should be macros to save the file/lineno */
  
! extern void (*SWF_warn)(char *msg, ...);
! extern void (*SWF_error)(char *msg, ...);
  
! void warn_default(char *msg, ...);
! void error_default(char *msg, ...);
  
! void setSWFWarnFunction(void (*error)(char *msg, ...));
! void setSWFErrorFunction(void (*error)(char *msg, ...));
  
- void SWF_assert(int c);
  
  #endif /* SWF_ERROR_H_INCLUDED */
--- 4,24 ----
  
  /* XXX - error calls should be macros to save the file/lineno */
  
! extern void (*SWF_warn)(const char *msg, ...);
! extern void (*SWF_error)(const char *msg, ...);
  
! void warn_default(const char *msg, ...);
! void error_default(const char *msg, ...);
  
! void setSWFWarnFunction(void (*error)(const char *msg, ...));
! void setSWFErrorFunction(void (*error)(const char *msg, ...));
! 
! 
! #include <assert.h>
! 
! void oldSWF_assert(int c);
! #define SWF_assert(c) assert(c)
  
  
  #endif /* SWF_ERROR_H_INCLUDED */
+  
*** ming-0.2a_orig/src/blocks/exports.h	2001-08-17 19:06:11.000000000 +0200
--- ming-0.2a/src/blocks/exports.h	2002-10-06 20:51:08.000000000 +0200
***************
*** 5,8 ****
  {
    SWFBlock block;
    char *name;
! } *SWFExports;
--- 5,10 ----
  {
    SWFBlock block;
    char *name;
! } _swfexport;
! typedef struct swfexport *SWFExports;
!  
*** ming-0.2a_orig/src/blocks/input.c	2001-08-17 19:06:11.000000000 +0200
--- ming-0.2a/src/blocks/input.c	2002-06-23 16:47:48.000000000 +0200
***************
*** 1,7 ****
  
  #include <stdlib.h>
  #include <stdio.h>
! #include <errno.h>
  
  #include <sys/stat.h>
  
--- 1,7 ----
  
  #include <stdlib.h>
  #include <stdio.h>
! #include <errno.h> 
  
  #include <sys/stat.h>
  
***************
*** 140,146 ****
    if(fstat(fileno(f), &buf) == -1)
      SWF_error("Couldn't fstat filehandle in newSWFInput_file");;
  
!   input = calloc(1, sizeof(struct _swfInput));
  
    input->getChar = SWFInput_file_getChar;
    input->destroy = SWFInput_dtor;
--- 140,146 ----
    if(fstat(fileno(f), &buf) == -1)
      SWF_error("Couldn't fstat filehandle in newSWFInput_file");;
  
!   input = (SWFInput) calloc(1, sizeof(struct _swfInput));
  
    input->getChar = SWFInput_file_getChar;
    input->destroy = SWFInput_dtor;
***************
*** 189,195 ****
  
  SWFInput newSWFInput_buffer(unsigned char *buffer, int length)
  {
!   SWFInput input = calloc(1, sizeof(struct _swfInput));
  
    input->getChar = SWFInput_buffer_getChar;
    input->destroy = SWFInput_dtor;
--- 189,195 ----
  
  SWFInput newSWFInput_buffer(unsigned char *buffer, int length)
  {
!   SWFInput input = (SWFInput) calloc(1, sizeof(struct _swfInput));
  
    input->getChar = SWFInput_buffer_getChar;
    input->destroy = SWFInput_dtor;
***************
*** 312,319 ****
  
  SWFInput newSWFInput_stream(FILE *f)
  {
!   SWFInput input = calloc(1, sizeof(struct _swfInput));
!   struct _inputStreamData *data = calloc(1, sizeof(struct _inputStreamData));
  
    input->getChar = SWFInput_stream_getChar;
    input->destroy = SWFInput_stream_dtor;
--- 312,319 ----
  
  SWFInput newSWFInput_stream(FILE *f)
  {
!   SWFInput input = (SWFInput) calloc(1, sizeof(struct _swfInput));
!   struct _inputStreamData *data = (struct _inputStreamData *) calloc(1, sizeof(struct _inputStreamData));
  
    input->getChar = SWFInput_stream_getChar;
    input->destroy = SWFInput_stream_dtor;
*** ming-0.2a_orig/src/blocks/input.h	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/input.h	2002-01-01 21:03:06.000000000 +0100
***************
*** 9,18 ****
  
  struct _swfInput
  {
!   void (*destroy)(struct _swfInput *this);
!   int (*getChar)(struct _swfInput *this);
!   void (*seek)(struct _swfInput *this, long offset, int whence);
!   int (*eof)(struct _swfInput *this);
  
    int offset;
    int length;
--- 9,18 ----
  
  struct _swfInput
  {
!   void (*destroy)(struct _swfInput *This);
!   int (*getChar)(struct _swfInput *This);
!   void (*seek)(struct _swfInput *This, long offset, int whence);
!   int (*eof)(struct _swfInput *This);
  
    int offset;
    int length;
*** ming-0.2a_orig/src/blocks/jpeg.c	2001-08-17 19:06:07.000000000 +0200
--- ming-0.2a/src/blocks/jpeg.c	2002-01-01 21:28:46.000000000 +0100
***************
*** 29,35 ****
  #define JPEG_SOI  0xD8
  #define JPEG_EOI  0xD9
  
! #define JPEG_JFIF 0xE0
  
  /* encoding markers, quantization tables and Huffman tables */
  #define JPEG_QUANT 0xDB
--- 29,35 ----
  #define JPEG_SOI  0xD8
  #define JPEG_EOI  0xD9
  
! /* #define JPEG_JFIF 0xE0  */
  
  /* encoding markers, quantization tables and Huffman tables */
  #define JPEG_QUANT 0xDB
***************
*** 41,48 ****
  #define JPEG_SOF2 0xC2
  #define JPEG_SOS  0xDA
  
! #define JPEG_ED   0xED /* app13 */
! #define JPEG_EE   0xEE /* app14 */
  #define JPEG_DD   0xDD /* ??? */
  
  int completeSWFJpegBitmap(SWFBlock block)
--- 41,48 ----
  #define JPEG_SOF2 0xC2
  #define JPEG_SOS  0xDA
  
! /* #define JPEG_ED   0xED */ /* app13 */
! /* #define JPEG_EE   0xEE */ /* app14 */
  #define JPEG_DD   0xDD /* ??? */
  
  int completeSWFJpegBitmap(SWFBlock block)
***************
*** 50,56 ****
    return ((SWFJpegBitmap)block)->length;
  }
  
! #define BUFFER_SIZE 1024
  
  /* clumsy utility function.. */
  void dumpJpegBlock(byte type, SWFInput input,
--- 50,56 ----
    return ((SWFJpegBitmap)block)->length;
  }
  
! /* #define BUFFER_SIZE 1024 */
  
  /* clumsy utility function.. */
  void dumpJpegBlock(byte type, SWFInput input,
*** ming-0.2a_orig/src/blocks/loadfont.c	2001-08-17 19:06:08.000000000 +0200
--- ming-0.2a/src/blocks/loadfont.c	2002-01-01 22:23:00.000000000 +0100
***************
*** 45,52 ****
    return (unsigned long)(fgetc(f) + (fgetc(f)<<8) + (fgetc(f)<<16) + (fgetc(f)<<24));
  }
  
! int buffer;
! int bufbits = 0; /* # of bits in buffer */
  
  static void byteAlign()
  {
--- 45,52 ----
    return (unsigned long)(fgetc(f) + (fgetc(f)<<8) + (fgetc(f)<<16) + (fgetc(f)<<24));
  }
  
! static int buffer;
! static int bufbits = 0; /* # of bits in buffer */
  
  static void byteAlign()
  {
*** ming-0.2a_orig/src/blocks/matrix.c	2001-08-17 19:06:08.000000000 +0200
--- ming-0.2a/src/blocks/matrix.c	2002-01-01 22:13:42.000000000 +0100
***************
*** 19,25 ****
  
  #include <stdlib.h>
  #include <math.h>
! #include <float.h>
  
  #include "output.h"
  #include "matrix.h"
--- 19,25 ----
  
  #include <stdlib.h>
  #include <math.h>
! /* #include <float.h> */
  
  #include "output.h"
  #include "matrix.h"
***************
*** 31,37 ****
  
  SWFMatrix newSWFMatrix(float a, float b, float c, float d, int x, int y)
  {
!   SWFMatrix m = malloc(sizeof(struct _matrix));
    m->scaleX = a;
    m->rotate0 = b;
    m->rotate1 = c;
--- 31,37 ----
  
  SWFMatrix newSWFMatrix(float a, float b, float c, float d, int x, int y)
  {
!   SWFMatrix m = (SWFMatrix) malloc(sizeof(struct _matrix));
    m->scaleX = a;
    m->rotate0 = b;
    m->rotate1 = c;
***************
*** 69,76 ****
  
  SWFMatrix SWFMatrix_dup(SWFMatrix matrix)
  {
!   SWFMatrix m = malloc(sizeof(struct _matrix));
!   return memcpy(m, matrix, sizeof(struct _matrix));
  }
  
  void destroySWFMatrix(SWFMatrix matrix)
--- 69,76 ----
  
  SWFMatrix SWFMatrix_dup(SWFMatrix matrix)
  {
!   SWFMatrix m = (SWFMatrix) malloc(sizeof(struct _matrix));
!   return (SWFMatrix) memcpy(m, matrix, sizeof(struct _matrix));
  }
  
  void destroySWFMatrix(SWFMatrix matrix)
***************
*** 161,167 ****
    newy = m->scaleY * (*y) + m->rotate1 * (*x);
  
    *x = newx + (xlate ? m->translateX : 0);
!   *y = newx + (xlate ? m->translateY : 0);
  }
  
  
--- 161,167 ----
    newy = m->scaleY * (*y) + m->rotate1 * (*x);
  
    *x = newx + (xlate ? m->translateX : 0);
!   *y = newy + (xlate ? m->translateY : 0);
  }
  
  
*** ming-0.2a_orig/src/blocks/morph.c	2001-08-17 19:06:08.000000000 +0200
--- ming-0.2a/src/blocks/morph.c	2002-01-01 22:17:32.000000000 +0100
***************
*** 114,120 ****
  
  SWFMorph newSWFMorphShape()
  {
!   SWFMorph morph = calloc(1, MORPH_SIZE);
  
    BLOCK(morph)->type = SWF_DEFINEMORPHSHAPE;
    BLOCK(morph)->writeBlock = writeSWFMorphBlockToStream;
--- 114,120 ----
  
  SWFMorph newSWFMorphShape()
  {
!   SWFMorph morph = (SWFMorph) calloc(1, MORPH_SIZE);
  
    BLOCK(morph)->type = SWF_DEFINEMORPHSHAPE;
    BLOCK(morph)->writeBlock = writeSWFMorphBlockToStream;
*** ming-0.2a_orig/src/blocks/output.c	2001-08-17 19:06:08.000000000 +0200
--- ming-0.2a/src/blocks/output.c	2002-01-01 22:19:22.000000000 +0100
***************
*** 18,32 ****
  */
  
  #include <stdlib.h>
! #include <stdio.h>
  
  #include "output.h"
  
  SWFOutput newSWFOutput()
  {
!   SWFOutput out = calloc(1, OUTPUT_SIZE);
  
!   out->buffer = malloc(OUTPUT_BUFFER_INCREMENT);
    out->pos = out->buffer;
    *(out->pos) = 0;
    out->buffersize = out->free = OUTPUT_BUFFER_INCREMENT;
--- 18,32 ----
  */
  
  #include <stdlib.h>
! /* #include <stdio.h> */
  
  #include "output.h"
  
  SWFOutput newSWFOutput()
  {
!   SWFOutput out = (SWFOutput) calloc(1, OUTPUT_SIZE);
  
!   out->buffer = (unsigned char*) malloc(OUTPUT_BUFFER_INCREMENT+1);
    out->pos = out->buffer;
    *(out->pos) = 0;
    out->buffersize = out->free = OUTPUT_BUFFER_INCREMENT;
***************
*** 40,48 ****
  
  SWFOutput newSizedSWFOutput(int size)
  {
!   SWFOutput out = calloc(1, OUTPUT_SIZE);
  
!   out->buffer = malloc(size+1);
    out->pos = out->buffer;
    *(out->pos) = 0;
    out->buffersize = out->free = size+1;
--- 40,48 ----
  
  SWFOutput newSizedSWFOutput(int size)
  {
!   SWFOutput out = (SWFOutput) calloc(1, OUTPUT_SIZE);
  
!   out->buffer = (unsigned char*) malloc(size+1);
    out->pos = out->buffer;
    *(out->pos) = 0;
    out->buffersize = out->free = size+1;
***************
*** 118,136 ****
  {
    if(bytes >= out->free)
    {
!     int new = OUTPUT_BUFFER_INCREMENT *
                ((bytes-out->free-1)/OUTPUT_BUFFER_INCREMENT + 1);
  
      int num = out->pos - out->buffer; /* in case buffer gets displaced.. */
  
!     unsigned char *newbuf = realloc(out->buffer, out->buffersize+new);
  
      if(newbuf != out->buffer)
        out->pos = newbuf + num;
  
      out->buffer = newbuf;
!     out->buffersize += new;
!     out->free += new;
    }
  }
  
--- 118,136 ----
  {
    if(bytes >= out->free)
    {
!     int New = OUTPUT_BUFFER_INCREMENT *
                ((bytes-out->free-1)/OUTPUT_BUFFER_INCREMENT + 1);
  
      int num = out->pos - out->buffer; /* in case buffer gets displaced.. */
  
!     unsigned char *newbuf = realloc(out->buffer, out->buffersize+New);
  
      if(newbuf != out->buffer)
        out->pos = newbuf + num;
  
      out->buffer = newbuf;
!     out->buffersize += New;
!     out->free += New;
    }
  }
  
*** ming-0.2a_orig/src/blocks/outputblock.c	2001-08-17 19:06:08.000000000 +0200
--- ming-0.2a/src/blocks/outputblock.c	2002-01-01 22:19:36.000000000 +0100
***************
*** 43,49 ****
  }
  SWFOutputBlock newSWFOutputBlock(SWFOutput out, SWFBlocktype type)
  {
!   SWFOutputBlock block = calloc(1, SWFOUTPUTBLOCK_SIZE);
  
    BLOCK(block)->type = type;
    BLOCK(block)->writeBlock = writeSWFOutputBlockToStream;
--- 43,49 ----
  }
  SWFOutputBlock newSWFOutputBlock(SWFOutput out, SWFBlocktype type)
  {
!   SWFOutputBlock block = (SWFOutputBlock) calloc(1, SWFOUTPUTBLOCK_SIZE);
  
    BLOCK(block)->type = type;
    BLOCK(block)->writeBlock = writeSWFOutputBlockToStream;
***************
*** 99,105 ****
    return newSWFOutputBlock(out, SWF_REMOVEOBJECT2);
  }
  
! SWFOutputBlock newSWFFrameLabelBlock(char *string)
  {
    SWFOutput out = newSizedSWFOutput(strlen(string)+2);
    SWFOutput_writeString(out, string);
--- 99,105 ----
    return newSWFOutputBlock(out, SWF_REMOVEOBJECT2);
  }
  
! SWFOutputBlock newSWFFrameLabelBlock(const char *string)
  {
    SWFOutput out = newSizedSWFOutput(strlen(string)+2);
    SWFOutput_writeString(out, string);
*** ming-0.2a_orig/src/blocks/outputblock.h	2001-08-17 19:06:09.000000000 +0200
--- ming-0.2a/src/blocks/outputblock.h	2001-10-14 20:08:06.000000000 +0200
***************
*** 47,53 ****
  SWFOutputBlock newSWFSetBackgroundBlock(byte r, byte g, byte b);
  SWFOutputBlock newSWFRemoveObjectBlock(SWFCharacter character, int depth);
  SWFOutputBlock newSWFRemoveObject2Block(int depth);
! SWFOutputBlock newSWFFrameLabelBlock(char *string);
  SWFOutputBlock newSWFExportBlock(SWFExports exports, int nExports);
  
  #endif /* SWF_OUTPUTBLOCK_H_INCLUDED */
--- 47,53 ----
  SWFOutputBlock newSWFSetBackgroundBlock(byte r, byte g, byte b);
  SWFOutputBlock newSWFRemoveObjectBlock(SWFCharacter character, int depth);
  SWFOutputBlock newSWFRemoveObject2Block(int depth);
! SWFOutputBlock newSWFFrameLabelBlock(const char *string);
  SWFOutputBlock newSWFExportBlock(SWFExports exports, int nExports);
  
  #endif /* SWF_OUTPUTBLOCK_H_INCLUDED */
*** ming-0.2a_orig/src/blocks/placeobject.c	2001-08-17 19:06:11.000000000 +0200
--- ming-0.2a/src/blocks/placeobject.c	2002-01-01 22:51:16.000000000 +0100
***************
*** 17,27 ****
  
      for(i=0; i<place->nActions; ++i)
      {
!       SWFOutputBlock block = (SWFOutputBlock)place->actions[i];
  
        methodWriteUInt16(place->actionFlags[i], method, data);
!       methodWriteUInt32(SWFOutput_length(block->output), method, data);
!       SWFOutput_writeToMethod(block->output, method, data);
      }
  
      methodWriteUInt16(0, method, data); /* trailing 0 for end of actions */
--- 17,27 ----
  
      for(i=0; i<place->nActions; ++i)
      {
!       SWFOutputBlock lblock = (SWFOutputBlock)place->actions[i];
  
        methodWriteUInt16(place->actionFlags[i], method, data);
!       methodWriteUInt32(SWFOutput_length(lblock->output), method, data);
!       SWFOutput_writeToMethod(lblock->output, method, data);
      }
  
      methodWriteUInt16(0, method, data); /* trailing 0 for end of actions */
***************
*** 73,80 ****
  
      for(i=0; i<place->nActions; ++i)
      {
!       SWFOutputBlock block = (SWFOutputBlock)place->actions[i];
!       actionLen += 6 + SWFOutput_length(block->output);
      }
  
      actionLen += 2;
--- 73,80 ----
  
      for(i=0; i<place->nActions; ++i)
      {
!       SWFOutputBlock lblock = (SWFOutputBlock)place->actions[i];
!       actionLen += 6 + SWFOutput_length(lblock->output);
      }
  
      actionLen += 2;
***************
*** 113,119 ****
  
  SWFPlaceObject2Block newSWFPlaceObject2Block(int depth)
  {
!   SWFPlaceObject2Block place = calloc(1, sizeof(struct _placeObject2Block));
  
    BLOCK(place)->type = SWF_PLACEOBJECT2;
    BLOCK(place)->writeBlock = writeSWFPlaceObject2BlockToStream;
--- 113,119 ----
  
  SWFPlaceObject2Block newSWFPlaceObject2Block(int depth)
  {
!   SWFPlaceObject2Block place = (SWFPlaceObject2Block) calloc(1, sizeof(struct _placeObject2Block));
  
    BLOCK(place)->type = SWF_PLACEOBJECT2;
    BLOCK(place)->writeBlock = writeSWFPlaceObject2BlockToStream;
*** ming-0.2a_orig/src/blocks/rect.c	2001-08-17 19:06:09.000000000 +0200
--- ming-0.2a/src/blocks/rect.c	2002-01-01 22:25:24.000000000 +0100
***************
*** 50,56 ****
  
  SWFRect newSWFRect(int minX, int maxX, int minY, int maxY)
  {
!   SWFRect rect = malloc(SWFRECT_SIZE);
    rect->minX = min(minX, maxX);
    rect->maxX = max(minX, maxX);
    rect->minY = min(minY, maxY);
--- 50,56 ----
  
  SWFRect newSWFRect(int minX, int maxX, int minY, int maxY)
  {
!   SWFRect rect = (SWFRect) malloc(SWFRECT_SIZE);
    rect->minX = min(minX, maxX);
    rect->maxX = max(minX, maxX);
    rect->minY = min(minY, maxY);
*** ming-0.2a_orig/src/blocks/shape.c	2001-08-17 19:06:09.000000000 +0200
--- ming-0.2a/src/blocks/shape.c	2002-01-01 22:53:14.000000000 +0100
***************
*** 66,72 ****
  }
  SWFShape newSWFShape()
  {
!   SWFShape shape = calloc(1, SHAPE_SIZE);
  
    BLOCK(shape)->writeBlock = writeSWFShapeBlockToMethod;
    BLOCK(shape)->complete = completeSWFShapeBlock;
--- 66,72 ----
  }
  SWFShape newSWFShape()
  {
!   SWFShape shape = (SWFShape) calloc(1, SHAPE_SIZE);
  
    BLOCK(shape)->writeBlock = writeSWFShapeBlockToMethod;
    BLOCK(shape)->complete = completeSWFShapeBlock;
***************
*** 151,169 ****
    {
      case SHAPERECORD_STATECHANGE:
      {
!       StateChangeRecord change = calloc(1, sizeof(struct _stateChangeRecord));
        shape->records[shape->nRecords].record.stateChange = change;
        break;
      }
      case SHAPERECORD_LINETO:
      {
!       LineToRecord lineTo = calloc(1, sizeof(struct _lineToRecord));
        shape->records[shape->nRecords].record.lineTo = lineTo;
        break;
      }
      case SHAPERECORD_CURVETO:
      {
!       CurveToRecord curveTo = calloc(1, sizeof(struct _curveToRecord));
        shape->records[shape->nRecords].record.curveTo = curveTo;
        break;
      }
--- 151,169 ----
    {
      case SHAPERECORD_STATECHANGE:
      {
!       StateChangeRecord change = (StateChangeRecord) calloc(1, sizeof(struct _stateChangeRecord));
        shape->records[shape->nRecords].record.stateChange = change;
        break;
      }
      case SHAPERECORD_LINETO:
      {
!       LineToRecord lineTo = (LineToRecord) calloc(1, sizeof(struct _lineToRecord));
        shape->records[shape->nRecords].record.lineTo = lineTo;
        break;
      }
      case SHAPERECORD_CURVETO:
      {
!       CurveToRecord curveTo = (CurveToRecord) calloc(1, sizeof(struct _curveToRecord));
        shape->records[shape->nRecords].record.curveTo = curveTo;
        break;
      }
***************
*** 468,474 ****
  SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
  					byte r, byte g, byte b, byte a)
  {
!   SWFFillStyle fill = calloc(1, FILLSTYLE_SIZE);
  
    fill->type = SWF_FILL_SOLID;
    fill->data.solid.r = r;
--- 468,474 ----
  SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
  					byte r, byte g, byte b, byte a)
  {
!   SWFFillStyle fill = (SWFFillStyle) calloc(1, FILLSTYLE_SIZE);
  
    fill->type = SWF_FILL_SOLID;
    fill->data.solid.r = r;
***************
*** 499,505 ****
  SWFFillStyle SWFShape_addBitmapFillStyle(SWFShape shape,
  					 SWFBitmap bitmap, byte flags)
  {
!   SWFFillStyle fill = calloc(1, FILLSTYLE_SIZE);
  
    if(flags == SWF_FILL_CLIPPED_BITMAP)
      fill->type = SWF_FILL_CLIPPED_BITMAP;
--- 499,505 ----
  SWFFillStyle SWFShape_addBitmapFillStyle(SWFShape shape,
  					 SWFBitmap bitmap, byte flags)
  {
!   SWFFillStyle fill = (SWFFillStyle) calloc(1, FILLSTYLE_SIZE);
  
    if(flags == SWF_FILL_CLIPPED_BITMAP)
      fill->type = SWF_FILL_CLIPPED_BITMAP;
*** ming-0.2a_orig/src/blocks/sprite.c	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/sprite.c	2002-01-01 22:28:42.000000000 +0100
***************
*** 73,79 ****
  
  SWFSprite newSWFSprite()
  {
!   SWFSprite sprite = calloc(1, SWF_SPRITE_SIZE);
  
    CHARACTERID(sprite) = ++SWF_gNumCharacters;
    BLOCK(sprite)->type = SWF_DEFINESPRITE;
--- 73,79 ----
  
  SWFSprite newSWFSprite()
  {
!   SWFSprite sprite = (SWFSprite) calloc(1, SWF_SPRITE_SIZE);
  
    CHARACTERID(sprite) = ++SWF_gNumCharacters;
    BLOCK(sprite)->type = SWF_DEFINESPRITE;
*** ming-0.2a_orig/src/blocks/swf.h	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/swf.h	2002-10-06 20:47:59.000000000 +0200
***************
*** 26,39 ****
  
  typedef unsigned char byte;
  
! extern void (*SWF_warn)(char *msg, ...);
! extern void (*SWF_error)(char *msg, ...);
  
! void setSWFWarnFunction(void (*error)(char *msg, ...));
! void setSWFErrorFunction(void (*error)(char *msg, ...));
  
  void SWF_assert(int c);
! 
  
    /* a generic output method.  specific instances dump output to file,
       send to stdout, etc. */
--- 26,43 ----
  
  typedef unsigned char byte;
  
! #if 0
! // this seems to be a duplicate of error.h
! extern void (*SWF_warn)(const char *msg, ...);
! extern void (*SWF_error)(const char *msg, ...);
  
! void setSWFWarnFunction(void (*error)(const char *msg, ...));
! void setSWFErrorFunction(void (*error)(const char *msg, ...));
  
  void SWF_assert(int c);
! #else
! #include "error.h"
! #endif
  
    /* a generic output method.  specific instances dump output to file,
       send to stdout, etc. */
***************
*** 51,57 ****
  
    /* SWFBlock is the parent for all classes in this directory */
  
! typedef void *SWFBlock;
  
  int completeSWFBlock(SWFBlock block);
  void destroySWFBlock(SWFBlock block);
--- 55,62 ----
  
    /* SWFBlock is the parent for all classes in this directory */
  
! /*typedef void *SWFBlock; */
! typedef struct _block *SWFBlock;
  
  int completeSWFBlock(SWFBlock block);
  void destroySWFBlock(SWFBlock block);
***************
*** 66,72 ****
  
    /* SWFInput */
  
! typedef void *SWFInput;
  
  int SWFInput_length(SWFInput input);
  void SWFInput_rewind(SWFInput input);
--- 71,77 ----
  
    /* SWFInput */
  
! typedef struct _swfInput *SWFInput;
  
  int SWFInput_length(SWFInput input);
  void SWFInput_rewind(SWFInput input);
***************
*** 82,88 ****
  
    /* SWFOutput */
  
! typedef void *SWFOutput;
  
  SWFOutput newSWFOutput();
  SWFOutput newSizedSWFOutput(int size);
--- 87,94 ----
  
    /* SWFOutput */
  
! /* typedef void *SWFOutput; */
! typedef struct _output *SWFOutput;
  
  SWFOutput newSWFOutput();
  SWFOutput newSizedSWFOutput(int size);
***************
*** 96,103 ****
  
  
    /* SWFRect */
! 
! typedef void *SWFRect;
  
  SWFRect newSWFRect(int minX, int maxX, int minY, int maxY);
  void destroySWFRect(SWFRect rect);
--- 102,108 ----
  
  
    /* SWFRect */
! typedef struct _swfRect *SWFRect;
  
  SWFRect newSWFRect(int minX, int maxX, int minY, int maxY);
  void destroySWFRect(SWFRect rect);
***************
*** 111,117 ****
  
  /* everything with a character ID is an SWFCharacter */
  
! typedef void *SWFCharacter;
  
  /* this is a silly hack to track blocks which are dependent on others.
     Would be nice to have this in the ming layer above instead */
--- 116,122 ----
  
  /* everything with a character ID is an SWFCharacter */
  
! typedef struct _character *SWFCharacter;
  
  /* this is a silly hack to track blocks which are dependent on others.
     Would be nice to have this in the ming layer above instead */
***************
*** 129,135 ****
  
    /* SWFBitmap */
  
! typedef void *SWFBitmap;
  
  void destroySWFBitmap(SWFBlock block);
  int SWFBitmap_getWidth(SWFBitmap b);
--- 134,140 ----
  
    /* SWFBitmap */
  
! typedef struct _character *SWFBitmap;
  
  void destroySWFBitmap(SWFBlock block);
  int SWFBitmap_getWidth(SWFBitmap b);
***************
*** 140,146 ****
  
    /* SWFDBLBitmap */
  
! typedef void *SWFDBLBitmap;
  
  SWFDBLBitmap newSWFDBLBitmap(FILE *f);
  SWFDBLBitmap newSWFDBLBitmap_fromInput(SWFInput input);
--- 145,151 ----
  
    /* SWFDBLBitmap */
  
! typedef struct _swfDBLBitmap *SWFDBLBitmap;
  
  SWFDBLBitmap newSWFDBLBitmap(FILE *f);
  SWFDBLBitmap newSWFDBLBitmap_fromInput(SWFInput input);
***************
*** 148,154 ****
  
    /* SWFJpegBitmap */
  
! typedef void *SWFJpegBitmap, *SWFJpegWithAlpha;
  
  SWFJpegBitmap newSWFJpegBitmap(FILE *f);
  SWFJpegBitmap newSWFJpegBitmap_fromInput(SWFInput input);
--- 153,160 ----
  
    /* SWFJpegBitmap */
  
! typedef struct _swfJpegBitmap *SWFJpegBitmap;
! typedef struct _swfJpegWithAlpha *SWFJpegWithAlpha;
  
  SWFJpegBitmap newSWFJpegBitmap(FILE *f);
  SWFJpegBitmap newSWFJpegBitmap_fromInput(SWFInput input);
***************
*** 158,164 ****
  
    /* SWFGradient */
  
! typedef void *SWFGradient;
  
  SWFGradient newSWFGradient();
  void destroySWFGradient(SWFGradient gradient);
--- 164,170 ----
  
    /* SWFGradient */
  
! typedef struct _gradient *SWFGradient;
  
  SWFGradient newSWFGradient();
  void destroySWFGradient(SWFGradient gradient);
***************
*** 168,179 ****
  
    /* SWFMatrix */
  
! typedef void *SWFMatrix;
  
! SWFMatrix newSWFMatrix(int a, int b, int c, int d, int x, int y);
  void destroySWFMatrix(SWFMatrix matrix);
  
! SWFMatrix SWFMatrix_set(SWFMatrix m,
  			float a, float b, float c, float d, int x, int y);
  void SWFMatrix_clearTranslate(SWFMatrix m);
  void SWFMatrix_clearTransform(SWFMatrix m);
--- 174,185 ----
  
    /* SWFMatrix */
  
! typedef struct _matrix *SWFMatrix;
  
! SWFMatrix newSWFMatrix(float a, float b, float c, float d, int x, int y);
  void destroySWFMatrix(SWFMatrix matrix);
  
! void SWFMatrix_set(SWFMatrix m,
  			float a, float b, float c, float d, int x, int y);
  void SWFMatrix_clearTranslate(SWFMatrix m);
  void SWFMatrix_clearTransform(SWFMatrix m);
***************
*** 181,187 ****
  
    /* SWFFont */
  
! typedef void *SWFFont;
  
  SWFFont newSWFFont();
  SWFFont loadSWFFontFromFile(FILE *file);
--- 187,193 ----
  
    /* SWFFont */
  
! typedef struct _font *SWFFont;
  
  SWFFont newSWFFont();
  SWFFont loadSWFFontFromFile(FILE *file);
***************
*** 196,202 ****
  
    /* SWFText */
  
! typedef void *SWFText;
  
  SWFText newSWFText();
  SWFText newSWFText2();
--- 202,209 ----
  
    /* SWFText */
  
! typedef struct _text *SWFText;
! 
  
  SWFText newSWFText();
  SWFText newSWFText2();
***************
*** 222,236 ****
  
    /* SWFBrowserFont */
  
! typedef void *SWFBrowserFont;
  
! SWFBrowserFont newSWFBrowserFont(char *name);
  void destroySWFBrowserFont(SWFBlock block);
  
  
    /* SWFTextField */
  
! typedef void *SWFTextField;
  
  #define SWFTEXTFIELD_ONMASK  0x2085 /* on bits */
  #define SWFTEXTFIELD_OFFMASK 0x38FF /* off bits */
--- 229,243 ----
  
    /* SWFBrowserFont */
  
! typedef struct _browserFont *SWFBrowserFont;
  
! SWFBrowserFont newSWFBrowserFont(const char *name);
  void destroySWFBrowserFont(SWFBlock block);
  
  
    /* SWFTextField */
  
! typedef struct _textField *SWFTextField;
  
  #define SWFTEXTFIELD_ONMASK  0x2085 /* on bits */
  #define SWFTEXTFIELD_OFFMASK 0x38FF /* off bits */
***************
*** 259,266 ****
  void SWFTextField_setScaledBounds(SWFTextField field, int width, int height);
  void SWFTextField_setFlags(SWFTextField field, int flags);
  void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
! void SWFTextField_setVariableName(SWFTextField field, char *name);
! void SWFTextField_addString(SWFTextField field, char *string);
  
  void SWFTextField_setScaledFontHeight(SWFTextField field, int height);
  void SWFTextField_setScaledFieldHeight(SWFTextField field, int height);
--- 266,273 ----
  void SWFTextField_setScaledBounds(SWFTextField field, int width, int height);
  void SWFTextField_setFlags(SWFTextField field, int flags);
  void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
! void SWFTextField_setVariableName(SWFTextField field, const char *name);
! void SWFTextField_addString(SWFTextField field, const char *string);
  
  void SWFTextField_setScaledFontHeight(SWFTextField field, int height);
  void SWFTextField_setScaledFieldHeight(SWFTextField field, int height);
***************
*** 275,281 ****
  
    /* SWFFillStyle */
  
! typedef void *SWFFillStyle;
  
  #define SWFFILL_SOLID		0x00
  #define SWFFILL_GRADIENT	0x10
--- 282,288 ----
  
    /* SWFFillStyle */
  
! typedef struct _fillStyle *SWFFillStyle;
  
  #define SWFFILL_SOLID		0x00
  #define SWFFILL_GRADIENT	0x10
***************
*** 294,300 ****
  
    /* SWFLineStyle */
  
! typedef void *SWFLineStyle;
  
  SWFLineStyle newSWFLineStyle(int width, int r, int g, int b, int a);
  byte SWFLineStyle_equals(SWFLineStyle line, unsigned short width,
--- 301,307 ----
  
    /* SWFLineStyle */
  
! typedef struct _lineStyle *SWFLineStyle;
  
  SWFLineStyle newSWFLineStyle(int width, int r, int g, int b, int a);
  byte SWFLineStyle_equals(SWFLineStyle line, unsigned short width,
***************
*** 303,309 ****
  
    /* SWFShape */
  
! typedef void *SWFShape;
  
  SWFShape newSWFShape();
  void destroySWFShape(SWFBlock block);
--- 310,316 ----
  
    /* SWFShape */
  
! typedef struct _shape *SWFShape;
  
  SWFShape newSWFShape();
  void destroySWFShape(SWFBlock block);
***************
*** 336,342 ****
  
  void SWFShape_end(SWFShape shape);
  
! int SWFShape_setLineStyle(SWFShape shape, unsigned short width,
  			  byte r, byte g, byte b, byte a);
  
  SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
--- 343,349 ----
  
  void SWFShape_end(SWFShape shape);
  
! void SWFShape_setLineStyle(SWFShape shape, unsigned short width,
  			  byte r, byte g, byte b, byte a);
  
  SWFFillStyle SWFShape_addSolidFillStyle(SWFShape shape,
***************
*** 354,360 ****
  
    /* SWFMorph */
  
! typedef void *SWFMorph;
  
  SWFMorph newSWFMorphShape();
  void destroySWFMorph(SWFBlock block);
--- 361,367 ----
  
    /* SWFMorph */
  
! typedef struct _morph *SWFMorph;
  
  SWFMorph newSWFMorphShape();
  void destroySWFMorph(SWFBlock block);
***************
*** 364,370 ****
  
    /* sound - only mp3 streaming implemented */
  
! typedef void *SWFSound;
  
  #define SWF_SOUND_COMPRESSION      0xf0
  #define SWF_SOUND_NOT_COMPRESSED   (0<<4)
--- 371,377 ----
  
    /* sound - only mp3 streaming implemented */
  
! typedef struct _sound *SWFSound;
  
  #define SWF_SOUND_COMPRESSION      0xf0
  #define SWF_SOUND_NOT_COMPRESSED   (0<<4)
***************
*** 395,401 ****
  
    /* SWFCXform */
  
! typedef void *SWFCXform;
  
  SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
  		       float rMult, float gMult, float bMult, float aMult);
--- 402,408 ----
  
    /* SWFCXform */
  
! typedef struct _cXform *SWFCXform;
  
  SWFCXform newSWFCXform(int rAdd, int gAdd, int bAdd, int aAdd,
  		       float rMult, float gMult, float bMult, float aMult);
***************
*** 415,431 ****
  
    /* SWFAction */
  
! typedef void *SWFAction;
  
  SWFAction newSWFAction();
  SWFAction newSWFAction_fromOutput(SWFOutput out);
! SWFAction compileSWFActionCode(char *script);
  void destroySWFAction(SWFAction action);
  
  
    /* placeobject.h */
  
! typedef void *SWFPlaceObject2Block;
  
  #define SWF_PLACEACTION_ONLOAD      (1<<0)
  #define SWF_PLACEACTION_ENTERFRAME  (1<<1)
--- 422,440 ----
  
    /* SWFAction */
  
! 
! typedef struct _outputBlock *SWFOutputBlock;
! typedef SWFOutputBlock SWFAction;
  
  SWFAction newSWFAction();
  SWFAction newSWFAction_fromOutput(SWFOutput out);
! SWFAction compileSWFActionCode(const char *script);
  void destroySWFAction(SWFAction action);
  
  
    /* placeobject.h */
  
! typedef struct _placeObject2Block *SWFPlaceObject2Block;
  
  #define SWF_PLACEACTION_ONLOAD      (1<<0)
  #define SWF_PLACEACTION_ENTERFRAME  (1<<1)
***************
*** 437,443 ****
  #define SWF_PLACEACTION_KEYUP       (1<<7)
  #define SWF_PLACEACTION_DATA        (1<<8)
  
! SWFPlaceObject2Block newSWFPlaceObject2Block();
  
  void SWFPlaceObject2Block_setDepth(SWFPlaceObject2Block block, int depth);
  void SWFPlaceObject2Block_setName(SWFPlaceObject2Block block,
--- 446,452 ----
  #define SWF_PLACEACTION_KEYUP       (1<<7)
  #define SWF_PLACEACTION_DATA        (1<<8)
  
! SWFPlaceObject2Block newSWFPlaceObject2Block(int depth);
  
  void SWFPlaceObject2Block_setDepth(SWFPlaceObject2Block block, int depth);
  void SWFPlaceObject2Block_setName(SWFPlaceObject2Block block,
***************
*** 462,477 ****
  
    /* random blocks */
  
! typedef void *SWFOutputBlock;
! typedef void *SWFExports;
  
! SWFBlock newSWFPlaceObjectBlock(SWFCharacter character, int depth,
  				SWFMatrix matrix, SWFCXform cXform);
  
  SWFOutputBlock newSWFRemoveObjectBlock(SWFCharacter character, int depth);
  SWFOutputBlock newSWFRemoveObject2Block(int depth);
! SWFOutputBlock newSWFFrameLabelBlock(char *string);
! SWFBlock newSWFSetBackgroundBlock(byte r, byte g, byte b);
  SWFBlock newSWFShowFrameBlock();
  SWFBlock newSWFEndBlock();
  SWFBlock newSWFProtectBlock();
--- 471,486 ----
  
    /* random blocks */
  
! /* typedef struct _outputBlock *SWFOutputBlock; */
! typedef struct swfexport *SWFExports;
  
! SWFOutputBlock newSWFPlaceObjectBlock(SWFCharacter character, int depth,
  				SWFMatrix matrix, SWFCXform cXform);
  
  SWFOutputBlock newSWFRemoveObjectBlock(SWFCharacter character, int depth);
  SWFOutputBlock newSWFRemoveObject2Block(int depth);
! SWFOutputBlock newSWFFrameLabelBlock(const char *string);
! SWFOutputBlock newSWFSetBackgroundBlock(byte r, byte g, byte b);
  SWFBlock newSWFShowFrameBlock();
  SWFBlock newSWFEndBlock();
  SWFBlock newSWFProtectBlock();
***************
*** 480,486 ****
  
    /* SWFButton */
  
! typedef void *SWFButton;
  
  #define SWFBUTTON_HIT    (1<<3)
  #define SWFBUTTON_DOWN   (1<<2)
--- 489,495 ----
  
    /* SWFButton */
  
! typedef struct _button *SWFButton;
  
  #define SWFBUTTON_HIT    (1<<3)
  #define SWFBUTTON_DOWN   (1<<2)
***************
*** 530,536 ****
  
    /* SWFSprite */
  
! typedef void *SWFSprite;
  
  SWFSprite newSWFSprite();
  void destroySWFSprite(SWFBlock block);
--- 539,545 ----
  
    /* SWFSprite */
  
! typedef struct _sprite *SWFSprite;
  
  SWFSprite newSWFSprite();
  void destroySWFSprite(SWFBlock block);
***************
*** 541,543 ****
--- 550,553 ----
  void SWFSprite_addBlock(SWFSprite sprite, SWFBlock block);
  
  #endif /* SWF_H_INCLUDED */
+  
*** ming-0.2a_orig/src/blocks/text.c	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/text.c	2002-01-01 22:54:00.000000000 +0100
***************
*** 93,99 ****
  
  SWFText newSWFText()
  {
!   SWFText text = calloc(1, SWF_TEXT_SIZE);
  
    CHARACTERID(text) = ++SWF_gNumCharacters;
    BLOCK(text)->type = SWF_DEFINETEXT;
--- 93,99 ----
  
  SWFText newSWFText()
  {
!   SWFText text = (SWFText) calloc(1, SWF_TEXT_SIZE);
  
    CHARACTERID(text) = ++SWF_gNumCharacters;
    BLOCK(text)->type = SWF_DEFINETEXT;
***************
*** 118,124 ****
  
  SWFTextRecord newSWFTextRecord()
  {
!   SWFTextRecord textRecord = calloc(1, TEXTRECORD_SIZE);
    textRecord->spacing = 1.0;
    textRecord->height = 240;
    return textRecord;
--- 118,124 ----
  
  SWFTextRecord newSWFTextRecord()
  {
!   SWFTextRecord textRecord = (SWFTextRecord) calloc(1, TEXTRECORD_SIZE);
    textRecord->spacing = 1.0;
    textRecord->height = 240;
    return textRecord;
***************
*** 307,313 ****
    textRecord->string = strdup(string);
  
    l = strlen(string);
!   textRecord->advance = malloc(sizeof(int)*l);
  
    if(textRecord->isBrowserFont)
    {
--- 307,313 ----
    textRecord->string = strdup(string);
  
    l = strlen(string);
!   textRecord->advance = (int*)malloc(sizeof(int)*l);
  
    if(textRecord->isBrowserFont)
    {
*** ming-0.2a_orig/src/blocks/textfield.c	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/textfield.c	2002-01-01 22:31:50.000000000 +0100
***************
*** 108,114 ****
  }
  SWFTextField newSWFTextField()
  {
!   SWFTextField field = calloc(1, SWFTEXTFIELD_SIZE);
  
    BLOCK(field)->writeBlock = writeSWFTextFieldToMethod;
    BLOCK(field)->complete = completeSWFTextField;
--- 108,114 ----
  }
  SWFTextField newSWFTextField()
  {
!   SWFTextField field = (SWFTextField) calloc(1, SWFTEXTFIELD_SIZE);
  
    BLOCK(field)->writeBlock = writeSWFTextFieldToMethod;
    BLOCK(field)->complete = completeSWFTextField;
***************
*** 168,178 ****
    field->b = b;
    field->a = a;
  }
! void SWFTextField_setVariableName(SWFTextField field, char *name)
  {
    field->varName = strdup(name);
  }
! void SWFTextField_addString(SWFTextField field, char *string)
  {
    int l;
  
--- 168,178 ----
    field->b = b;
    field->a = a;
  }
! void SWFTextField_setVariableName(SWFTextField field, const char *name)
  {
    field->varName = strdup(name);
  }
! void SWFTextField_addString(SWFTextField field, const char *string)
  {
    int l;
  
*** ming-0.2a_orig/src/blocks/textfield.h	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/textfield.h	2001-11-04 16:01:54.000000000 +0100
***************
*** 85,98 ****
  #define SWFTEXTFIELD_SIZE sizeof(struct _textField)
  
  SWFTextField newSWFTextField();
! SWFBrowserFont newSWFBrowserFont(char *name);
  
  void SWFTextField_setFont(SWFTextField field, SWFBlock font);
  void SWFTextField_setScaledBounds(SWFTextField field, int width, int height);
  void SWFTextField_setFlags(SWFTextField field, int flags);
  void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
! void SWFTextField_setVariableName(SWFTextField field, char *name);
! void SWFTextField_addString(SWFTextField field, char *string);
  
  void SWFTextField_setScaledFontHeight(SWFTextField field, int height);
  void SWFTextField_setScaledFieldHeight(SWFTextField field, int height);
--- 85,98 ----
  #define SWFTEXTFIELD_SIZE sizeof(struct _textField)
  
  SWFTextField newSWFTextField();
! SWFBrowserFont newSWFBrowserFont(const char *name);
  
  void SWFTextField_setFont(SWFTextField field, SWFBlock font);
  void SWFTextField_setScaledBounds(SWFTextField field, int width, int height);
  void SWFTextField_setFlags(SWFTextField field, int flags);
  void SWFTextField_setColor(SWFTextField field, byte r, byte g, byte b, byte a);
! void SWFTextField_setVariableName(SWFTextField field, const char *name);
! void SWFTextField_addString(SWFTextField field, const char *string);
  
  void SWFTextField_setScaledFontHeight(SWFTextField field, int height);
  void SWFTextField_setScaledFieldHeight(SWFTextField field, int height);
*** ming-0.2a_orig/src/blocks/ttffont.c	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/ttffont.c	2001-10-14 20:15:14.000000000 +0200
***************
*** 140,146 ****
    return font;
  }
  
! SWFFont loadSWFFontFromTTF(char *file)
  {
    SWFFont font = newSWFFont();
    font->file = file;
--- 140,146 ----
    return font;
  }
  
! SWFFont loadSWFFontFromTTF(const char *file)
  {
    SWFFont font = newSWFFont();
    font->file = file;
*** ming-0.2a_orig/src/blocks/ttffont.h	2001-08-17 19:06:10.000000000 +0200
--- ming-0.2a/src/blocks/ttffont.h	2001-10-14 20:12:22.000000000 +0200
***************
*** 57,63 ****
  struct _font
  {
    swfCharacter character;
!   char *file;
    int nGlyphs;
    byte flags;
    byte codeToGlyph[256];
--- 57,63 ----
  struct _font
  {
    swfCharacter character;
!   const char *file;
    int nGlyphs;
    byte flags;
    byte codeToGlyph[256];
***************
*** 97,103 ****
  
  SWFFont newSWFFont();
  void destroySWFFont();
! SWFFont loadSWFFontFromTTF(char *file);
  
  void SWFFont_addTextToList(SWFFont font, struct _textRecord *text);
  void SWFFont_resolveTextList(SWFFont font);
--- 97,103 ----
  
  SWFFont newSWFFont();
  void destroySWFFont();
! SWFFont loadSWFFontFromTTF(const char *file);
  
  void SWFFont_addTextToList(SWFFont font, struct _textRecord *text);
  void SWFFont_resolveTextList(SWFFont font);
*** ming-0.2a_orig/src/displaylist.c	2001-08-17 19:06:02.000000000 +0200
--- ming-0.2a/src/displaylist.c	2002-01-01 21:39:16.000000000 +0100
***************
*** 18,28 ****
  */
  
  #include <stdlib.h>
! #include <string.h>
! #include <math.h>
  
  #include "displaylist.h"
! #include "blocktypes.h"
  
  void destroySWFDisplayItem(SWFDisplayItem item)
  {
--- 18,28 ----
  */
  
  #include <stdlib.h>
! /* #include <string.h> */
! #include <math.h> 
  
  #include "displaylist.h"
! /* #include "blocktypes.h" */
  
  void destroySWFDisplayItem(SWFDisplayItem item)
  {
***************
*** 56,62 ****
  
  SWFDisplayList newSWFDisplayList()
  {
!   SWFDisplayList list = calloc(1, SWFDISPLAYLIST_SIZE);
  
    list->isSprite = FALSE;
    list->head = NULL;
--- 56,62 ----
  
  SWFDisplayList newSWFDisplayList()
  {
!   SWFDisplayList list = (SWFDisplayList) calloc(1, SWFDISPLAYLIST_SIZE);
  
    list->isSprite = FALSE;
    list->head = NULL;
***************
*** 68,74 ****
  
  SWFDisplayList newSWFSpriteDisplayList()
  {
!   SWFDisplayList list = calloc(1, SWFDISPLAYLIST_SIZE);
  
    list->isSprite = TRUE;
    list->head = NULL;
--- 68,74 ----
  
  SWFDisplayList newSWFSpriteDisplayList()
  {
!   SWFDisplayList list = (SWFDisplayList) calloc(1, SWFDISPLAYLIST_SIZE);
  
    list->isSprite = TRUE;
    list->head = NULL;
***************
*** 80,86 ****
  
  SWFDisplayItem SWFDisplayList_add(SWFDisplayList list, SWFCharacter character)
  {
!   SWFDisplayItem item = calloc(1, SWFDISPLAYITEM_SIZE);
  
    item->flags = ITEM_NEW;
    item->next = NULL;
--- 80,86 ----
  
  SWFDisplayItem SWFDisplayList_add(SWFDisplayList list, SWFCharacter character)
  {
!   SWFDisplayItem item = (SWFDisplayItem) calloc(1, SWFDISPLAYITEM_SIZE);
  
    item->flags = ITEM_NEW;
    item->next = NULL;
*** ming-0.2a_orig/src/ming.c	2001-08-17 19:06:02.000000000 +0200
--- ming-0.2a/src/ming.c	2002-10-06 20:51:42.000000000 +0200
***************
*** 1,5 ****
  
! #include "ming.h"
  
  extern int SWF_gNumCharacters;
  
--- 1,5 ----
  
! #include "mingint.h"
  
  extern int SWF_gNumCharacters;
  
***************
*** 37,48 ****
  }
  
  
! void Ming_setWarnFunction(void (*warn)(char *msg, ...))
  {
    setSWFWarnFunction(warn);
  }
  
! void Ming_setErrorFunction(void (*error)(char *msg, ...))
  {
    setSWFErrorFunction(error);
  }
--- 37,48 ----
  }
  
  
! void Ming_setWarnFunction(void (*warn)(const char *msg, ...))
  {
    setSWFWarnFunction(warn);
  }
  
! void Ming_setErrorFunction(void (*error)(const char *msg, ...))
  {
    setSWFErrorFunction(error);
  }
***************
*** 54,56 ****
--- 54,57 ----
  
    SWF_versionNum = version;
  }
+  
*** ming-0.2a_orig/src/movie.c	2001-08-17 19:06:03.000000000 +0200
--- ming-0.2a/src/movie.c	2002-10-06 20:51:42.000000000 +0200
***************
*** 21,27 ****
  #include <math.h>
  #include "movie.h"
  #include "shape_util.h"
! #include "ming.h"
  
  static void destroySWFExports(SWFMovie movie)
  {
--- 21,27 ----
  #include <math.h>
  #include "movie.h"
  #include "shape_util.h"
! #include "mingint.h"
  
  static void destroySWFExports(SWFMovie movie)
  {
***************
*** 48,58 ****
    free(movie);
  }
  
! extern int SWF_gNumCharacters;
  
  SWFMovie newSWFMovieWithVersion(int version)
  {
!   SWFMovie movie = calloc(1, SWFMOVIE_SIZE);
  
    movie->version = version;
    movie->blockList = newSWFBlockList();
--- 48,58 ----
    free(movie);
  }
  
! //extern int SWF_gNumCharacters;
  
  SWFMovie newSWFMovieWithVersion(int version)
  {
!   SWFMovie movie = (SWFMovie) calloc(1, SWFMOVIE_SIZE);
  
    movie->version = version;
    movie->blockList = newSWFBlockList();
***************
*** 109,115 ****
    SWFBlockList_addBlock(movie->blockList, block);
  }
  
! void SWFMovie_addExport(SWFMovie movie, SWFBlock block, char *name)
  {
    if(SWFBlock_getType(block) == SWF_DEFINESPRITE)
    {
--- 109,115 ----
    SWFBlockList_addBlock(movie->blockList, block);
  }
  
! void SWFMovie_addExport(SWFMovie movie, SWFBlock block, const char *name)
  {
    if(SWFBlock_getType(block) == SWF_DEFINESPRITE)
    {
***************
*** 215,221 ****
    SWFMovie_addBlock(movie, newSWFShowFrameBlock());
  }
  
! void SWFMovie_labelFrame(SWFMovie movie, char *label)
  {
    SWFMovie_addBlock(movie, newSWFFrameLabelBlock(label));
  }
--- 215,221 ----
    SWFMovie_addBlock(movie, newSWFShowFrameBlock());
  }
  
! void SWFMovie_labelFrame(SWFMovie movie, const char *label)
  {
    SWFMovie_addBlock(movie, newSWFFrameLabelBlock(label));
  }
***************
*** 263,265 ****
--- 263,266 ----
  
    return length;
  }
+  
*** ming-0.2a_orig/src/movie.h	2001-08-17 19:06:03.000000000 +0200
--- ming-0.2a/src/movie.h	2001-10-14 19:43:20.000000000 +0200
***************
*** 68,80 ****
  SWFDisplayItem SWFMovie_add(SWFMovie movie, SWFBlock block);
  void SWFMovie_remove(SWFMovie movie, SWFDisplayItem item);
  void SWFMovie_nextFrame(SWFMovie movie);
! void SWFMovie_labelFrame(SWFMovie movie, char *label);
  
! void SWFMovie_addExport(SWFMovie movie, SWFBlock block, char *name);
  
  int SWFMovie_output(SWFMovie movie, SWFByteOutputMethod method, void *data);
  
! static inline int SWFMovie_save(SWFMovie movie, char *filename)
  {
    FILE *f = fopen(filename, "wb");
    int count;
--- 68,80 ----
  SWFDisplayItem SWFMovie_add(SWFMovie movie, SWFBlock block);
  void SWFMovie_remove(SWFMovie movie, SWFDisplayItem item);
  void SWFMovie_nextFrame(SWFMovie movie);
! void SWFMovie_labelFrame(SWFMovie movie, const char *label);
  
! void SWFMovie_addExport(SWFMovie movie, SWFBlock block, const char *name);
  
  int SWFMovie_output(SWFMovie movie, SWFByteOutputMethod method, void *data);
  
! static inline int SWFMovie_save(SWFMovie movie, const char *filename)
  {
    FILE *f = fopen(filename, "wb");
    int count;
*** ming-0.2a_orig/src/movieclip.c	2001-08-17 19:06:03.000000000 +0200
--- ming-0.2a/src/movieclip.c	2002-01-01 21:36:26.000000000 +0100
***************
*** 18,24 ****
  */
  
  #include <stdlib.h>
! #include <math.h>
  
  #include "movieclip.h"
  
--- 18,24 ----
  */
  
  #include <stdlib.h>
! /* #include <math.h> */
  
  #include "movieclip.h"
  
***************
*** 92,98 ****
    SWFDisplayItem_remove(item);
  }
  
! void SWFMovieClip_labelFrame(SWFMovieClip clip, char *label)
  {
    SWFSprite_addBlock((SWFSprite)clip, (SWFBlock)newSWFFrameLabelBlock(label));
  }
--- 92,98 ----
    SWFDisplayItem_remove(item);
  }
  
! void SWFMovieClip_labelFrame(SWFMovieClip clip, const char *label)
  {
    SWFSprite_addBlock((SWFSprite)clip, (SWFBlock)newSWFFrameLabelBlock(label));
  }
*** ming-0.2a_orig/src/movieclip.h	2001-08-17 19:06:03.000000000 +0200
--- ming-0.2a/src/movieclip.h	2001-10-14 20:06:24.000000000 +0200
***************
*** 54,60 ****
  SWFDisplayItem SWFMovieClip_add(SWFMovieClip clip, SWFBlock block);
  void SWFMovieClip_remove(SWFMovieClip clip, SWFDisplayItem item);
  void SWFMovieClip_nextFrame(SWFMovieClip clip);
! void SWFMovieClip_labelFrame(SWFMovieClip clip, char *label);
  void SWFMovie_setSoundStream(SWFMovieClip movie, SWFSound sound, float rate);
  
  int SWFMovieClip_output(SWFMovieClip clip, SWFByteOutputMethod method, void *data);
--- 54,60 ----
  SWFDisplayItem SWFMovieClip_add(SWFMovieClip clip, SWFBlock block);
  void SWFMovieClip_remove(SWFMovieClip clip, SWFDisplayItem item);
  void SWFMovieClip_nextFrame(SWFMovieClip clip);
! void SWFMovieClip_labelFrame(SWFMovieClip clip, const char *label);
  void SWFMovie_setSoundStream(SWFMovieClip movie, SWFSound sound, float rate);
  
  int SWFMovieClip_output(SWFMovieClip clip, SWFByteOutputMethod method, void *data);
*** ming-0.2a_orig/src/position.c	2001-08-17 19:06:04.000000000 +0200
--- ming-0.2a/src/position.c	2002-01-01 21:36:54.000000000 +0100
***************
*** 32,38 ****
  /* position wraps a matrix */
  SWFPosition newSWFPosition(SWFMatrix matrix)
  {
!   SWFPosition p = calloc(1, SWFPOSITION_SIZE);
  
    p->xScale = 1.0;
    p->yScale = 1.0;
--- 32,38 ----
  /* position wraps a matrix */
  SWFPosition newSWFPosition(SWFMatrix matrix)
  {
!   SWFPosition p = (SWFPosition)calloc(1, SWFPOSITION_SIZE);
  
    p->xScale = 1.0;
    p->yScale = 1.0;
*** ming-0.2a_orig/src/shape_cubic.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/src/shape_cubic.c	2002-10-06 20:51:43.000000000 +0200
***************
*** 1,5 ****
--- 1,6 ----
  
  #include <math.h>
+ #include <memory.h>
  #include "shape_util.h"
  
  extern int Ming_cubicThreshold;
***************
*** 45,108 ****
    return abs(ax-bx) + abs(ay-by);
  }
  
! static void subdivideCubicLeft(cubic *new, cubic *old, float t)
  {
    SWF_assert(t>0.0 && t<1.0);
  
!   if(new != old)
!     memcpy(new, old, sizeof(cubic));
  
!   new->d.x = t*new->c.x + (1-t)*new->d.x;
!   new->d.y = t*new->c.y + (1-t)*new->d.y;
!   new->c.x = t*new->b.x + (1-t)*new->c.x;
!   new->c.y = t*new->b.y + (1-t)*new->c.y;
!   new->b.x = t*new->a.x + (1-t)*new->b.x;
!   new->b.y = t*new->a.y + (1-t)*new->b.y;
! 
!   new->d.x = t*new->c.x + (1-t)*new->d.x;
!   new->d.y = t*new->c.y + (1-t)*new->d.y;
!   new->c.x = t*new->b.x + (1-t)*new->c.x;
!   new->c.y = t*new->b.y + (1-t)*new->c.y;
  
!   new->d.x = t*new->c.x + (1-t)*new->d.x;
!   new->d.y = t*new->c.y + (1-t)*new->d.y;
  }
  
! static void subdivideCubicRight(cubic *new, cubic *old, float t)
  {
!   SWF_assert(t>0.0 && t<1.0);
! 
!   if(new != old)
!     memcpy(new, old, sizeof(cubic));
! 
!   new->a.x = t*new->a.x + (1-t)*new->b.x;
!   new->a.y = t*new->a.y + (1-t)*new->b.y;
!   new->b.x = t*new->b.x + (1-t)*new->c.x;
!   new->b.y = t*new->b.y + (1-t)*new->c.y;
!   new->c.x = t*new->c.x + (1-t)*new->d.x;
!   new->c.y = t*new->c.y + (1-t)*new->d.y;
! 
!   new->a.x = t*new->a.x + (1-t)*new->b.x;
!   new->a.y = t*new->a.y + (1-t)*new->b.y;
!   new->b.x = t*new->b.x + (1-t)*new->c.x;
!   new->b.y = t*new->b.y + (1-t)*new->c.y;
  
!   new->a.x = t*new->a.x + (1-t)*new->b.x;
!   new->a.y = t*new->a.y + (1-t)*new->b.y;
  }
  
  static int SWFShape_approxCubic(SWFShape shape, cubic *c);
  
  static int subdivideCubic(SWFShape shape, cubic *c)
  {
!   cubic new;
    int nCurves;
  
!   subdivideCubicLeft(&new, c, 0.5);
!   nCurves = SWFShape_approxCubic(shape, &new);
  
!   subdivideCubicRight(&new, c, 0.5);
!   nCurves += SWFShape_approxCubic(shape, &new);
  
    return nCurves;
  }
--- 46,118 ----
    return abs(ax-bx) + abs(ay-by);
  }
  
! static void subdivideCubicLeft(cubic *New, cubic *old, float t)
  {
    SWF_assert(t>0.0 && t<1.0);
  
!   if(New != old)
!     memcpy(New, old, sizeof(cubic));
  
!   New->d.x = t*New->c.x + (1-t)*New->d.x;
!   New->d.y = t*New->c.y + (1-t)*New->d.y;
!   New->c.x = t*New->b.x + (1-t)*New->c.x;
!   New->c.y = t*New->b.y + (1-t)*New->c.y;
!   New->b.x = t*New->a.x + (1-t)*New->b.x;
!   New->b.y = t*New->a.y + (1-t)*New->b.y;
! 
!   New->d.x = t*New->c.x + (1-t)*New->d.x;
!   New->d.y = t*New->c.y + (1-t)*New->d.y;
!   New->c.x = t*New->b.x + (1-t)*New->c.x;
!   New->c.y = t*New->b.y + (1-t)*New->c.y;
  
!   New->d.x = t*New->c.x + (1-t)*New->d.x;
!   New->d.y = t*New->c.y + (1-t)*New->d.y;
  }
  
! static void subdivideCubicRight(cubic *New, cubic *old, float t)
  {
! #if 0
! 	if (0 && ! (t>0.0f && t<1.0f) ) {
! 		printf("t is out of range : %f\n",t);
! 		fflush(stdout);
! 	}
! #endif
! 	int inrange ; 
! 	inrange = (t>0.0f) && (t<1.0f);
!  // SWF_assert((t>0.0 && t<1.0));
! 	SWF_assert(inrange);
! 
!   if(New != old)
!     memcpy(New, old, sizeof(cubic));
! 
!   New->a.x = t*New->a.x + (1-t)*New->b.x;
!   New->a.y = t*New->a.y + (1-t)*New->b.y;
!   New->b.x = t*New->b.x + (1-t)*New->c.x;
!   New->b.y = t*New->b.y + (1-t)*New->c.y;
!   New->c.x = t*New->c.x + (1-t)*New->d.x;
!   New->c.y = t*New->c.y + (1-t)*New->d.y;
! 
!   New->a.x = t*New->a.x + (1-t)*New->b.x;
!   New->a.y = t*New->a.y + (1-t)*New->b.y;
!   New->b.x = t*New->b.x + (1-t)*New->c.x;
!   New->b.y = t*New->b.y + (1-t)*New->c.y;
  
!   New->a.x = t*New->a.x + (1-t)*New->b.x;
!   New->a.y = t*New->a.y + (1-t)*New->b.y;
  }
  
  static int SWFShape_approxCubic(SWFShape shape, cubic *c);
  
  static int subdivideCubic(SWFShape shape, cubic *c)
  {
!   cubic New;
    int nCurves;
  
!   subdivideCubicLeft(&New, c, 0.5);
!   nCurves = SWFShape_approxCubic(shape, &New);
  
!   subdivideCubicRight(&New, c, 0.5);
!   nCurves += SWFShape_approxCubic(shape, &New);
  
    return nCurves;
  }
***************
*** 200,206 ****
  
    cubic pts = { { (float)ax, (float)ay }, { (float)bx, (float)by },
  		{ (float)cx, (float)cy }, { (float)dx, (float)dy } };
!   cubic new;
  
    if(d>0)
    {
--- 210,216 ----
  
    cubic pts = { { (float)ax, (float)ay }, { (float)bx, (float)by },
  		{ (float)cx, (float)cy }, { (float)dx, (float)dy } };
!   cubic New;
  
    if(d>0)
    {
***************
*** 226,240 ****
  
    if(t1 > 0.0 && t1 < 1.0)
    {
!     subdivideCubicLeft(&new, &pts, t1);
  
!     nCurves += SWFShape_approxCubic(shape, &new);
  
      /*
      nCurves += SWFShape_drawCubicTo(shape,
! 				    new.b.x, new.b.y,
! 				    new.c.x, new.c.y,
! 				    new.d.x, new.d.y);
      */
  
      subdivideCubicRight(&pts, &pts, t1);
--- 236,250 ----
  
    if(t1 > 0.0 && t1 < 1.0)
    {
!     subdivideCubicLeft(&New, &pts, t1);
  
!     nCurves += SWFShape_approxCubic(shape, &New);
  
      /*
      nCurves += SWFShape_drawCubicTo(shape,
! 				    New.b.x, New.b.y,
! 				    New.c.x, New.c.y,
! 				    New.d.x, New.d.y);
      */
  
      subdivideCubicRight(&pts, &pts, t1);
***************
*** 243,257 ****
  
    if(t2 > 0.0 && t2 < 1.0)
    {
!     subdivideCubicLeft(&new, &pts, t2);
  
!     nCurves += SWFShape_approxCubic(shape, &new);
  
      /*
      nCurves += SWFShape_drawCubicTo(shape,
! 				    new.b.x, new.b.y,
! 				    new.c.x, new.c.y,
! 				    new.d.x, new.d.y);
      */
  
      subdivideCubicRight(&pts, &pts, t2);
--- 253,267 ----
  
    if(t2 > 0.0 && t2 < 1.0)
    {
!     subdivideCubicLeft(&New, &pts, t2);
  
!     nCurves += SWFShape_approxCubic(shape, &New);
  
      /*
      nCurves += SWFShape_drawCubicTo(shape,
! 				    New.b.x, New.b.y,
! 				    New.c.x, New.c.y,
! 				    New.d.x, New.d.y);
      */
  
      subdivideCubicRight(&pts, &pts, t2);
***************
*** 291,293 ****
--- 301,304 ----
  				    (int)rint(dx*Ming_scale),
  				    (int)rint(dy*Ming_scale));
  }
+  
*** ming-0.2a_orig/src/shape_util.h	2001-08-17 19:06:04.000000000 +0200
--- ming-0.2a/src/shape_util.h	2002-01-01 20:28:56.000000000 +0100
***************
*** 27,34 ****
  float SWFCharacter_getHeight(SWFCharacter character);
  
  
- void SWFShape_setLine(SWFShape shape, unsigned short width,
- 		      byte r, byte g, byte b, byte a);
  
  SWFFill SWFShape_addSolidFill(SWFShape shape, byte r, byte g, byte b, byte a);
  
--- 27,32 ----
*** ming-0.2a_orig/src/test.c	2001-08-17 19:06:04.000000000 +0200
--- ming-0.2a/src/test.c	2002-10-06 20:51:43.000000000 +0200
***************
*** 8,14 ****
  */
  
  #include <time.h>
! #include "ming.h"
  
  #define WIDTH 320
  #define HEIGHT 240
--- 8,15 ----
  */
  
  #include <time.h>
! #include <stdlib.h>
! #include "../ming.h"
  
  #define WIDTH 320
  #define HEIGHT 240
***************
*** 343,345 ****
--- 344,347 ----
  
    exit(0);
  }
+  
*** ming-0.2a_orig/util/blocktypes.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/util/blocktypes.c	2002-01-01 20:41:34.000000000 +0100
***************
*** 1,7 ****
  
  #include "blocktypes.h"
  
! char *blockName(int header)
  {
    switch(header)
    {
--- 1,7 ----
  
  #include "blocktypes.h"
  
! const char *blockName(int header)
  {
    switch(header)
    {
*** ming-0.2a_orig/util/decompile.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/util/decompile.c	2002-10-06 20:51:58.000000000 +0200
***************
*** 128,141 ****
  static char *negateString(char *s)
  {
    int i, l = strlen(s)+1;
!   char *new = realloc(s, l+1);
  
    for(i=l; i>0; --i)
!     new[i] = new[i-1];
  
!   new[0] = '-';
  
!   return new;
  }
  
  static Property getSetProperty(int prop)
--- 128,141 ----
  static char *negateString(char *s)
  {
    int i, l = strlen(s)+1;
!   char *New = realloc(s, l+1);
  
    for(i=l; i>0; --i)
!     New[i] = New[i-1];
  
!   New[0] = '-';
  
!   return New;
  }
  
  static Property getSetProperty(int prop)
***************
*** 226,234 ****
  
        if(right->type == 's')
        {
! 	Stack new = newProperty(atoi(right->data.string));
  	destroy(right);
! 	right = new;
        }
        return newTree(left, type, right);
      }
--- 226,234 ----
  
        if(right->type == 's')
        {
! 	Stack New = newProperty(atoi(right->data.string));
  	destroy(right);
! 	right = New;
        }
        return newTree(left, type, right);
      }
***************
*** 258,266 ****
  
        if(property->type == 's')
        {
! 	Stack new = newProperty(atoi(property->data.string));
  	destroy(property);
! 	property = new;
        }
  
        return newTree(newTree(target, type, property),
--- 258,266 ----
  
        if(property->type == 's')
        {
! 	Stack New = newProperty(atoi(property->data.string));
  	destroy(property);
! 	property = New;
        }
  
        return newTree(newTree(target, type, property),
***************
*** 1403,1405 ****
--- 1403,1406 ----
      i = end-1;
    }
  }
+  
*** ming-0.2a_orig/util/listfdb.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/util/listfdb.c	2002-10-06 20:51:58.000000000 +0200
***************
*** 18,24 ****
  #define true (boolean)1
  #define false (boolean)0
  
! char *blockName(Blocktype type);
  
  char *indent()
  {
--- 18,24 ----
  #define true (boolean)1
  #define false (boolean)0
  
! const char *blockName(Blocktype type);
  
  char *indent()
  {
***************
*** 461,463 ****
--- 461,464 ----
  
    return 0;
  }
+  
*** ming-0.2a_orig/util/listswf.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/util/listswf.c	2002-10-06 20:51:59.000000000 +0200
***************
*** 18,24 ****
  
  #define puts(s) fputs((s),stdout)
  
! char *blockName(Blocktype type);
  void skipBytes(FILE *f, int length);
  
  #define INDENT_LEVEL 3
--- 18,24 ----
  
  #define puts(s) fputs((s),stdout)
  
! const char *blockName(Blocktype type);
  void skipBytes(FILE *f, int length);
  
  #define INDENT_LEVEL 3
***************
*** 1998,2000 ****
--- 1998,2001 ----
  
    return 0;
  }
+  
*** ming-0.2a_orig/util/png2dbl.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/util/png2dbl.c	2001-10-14 19:11:56.000000000 +0200
***************
*** 7,13 ****
  #include <png.h>
  #include <zlib.h>
  
! int verbose = 0;
  
  void error(char *s, ...)
  {
--- 7,13 ----
  #include <png.h>
  #include <zlib.h>
  
! static int verbose = 0;
  
  void error(char *s, ...)
  {
***************
*** 19,25 ****
    exit(1);
  }
  
! void usage()
  {
    printf("png2dbl - convert a png file to an SWF DefineBitsLossless\n");
    printf("          or DefineBitsLossless2 block\n");
--- 19,25 ----
    exit(1);
  }
  
! static void usage()
  {
    printf("png2dbl - convert a png file to an SWF DefineBitsLossless\n");
    printf("          or DefineBitsLossless2 block\n");
***************
*** 49,55 ****
    png_infop info_ptr, end_info;
    png_bytep *row_pointers;
  
!   int i, rowbytes, depth;
  
    if(!fp)
      error("Couldn't open file!\n");
--- 49,55 ----
    png_infop info_ptr, end_info;
    png_bytep *row_pointers;
  
!   unsigned int i, rowbytes, depth;
  
    if(!fp)
      error("Couldn't open file!\n");
***************
*** 147,153 ****
      png.color_type = PNG_COLOR_TYPE_PALETTE;
      png.num_palette = 1 << depth;
  
!     png.palette = malloc(sizeof(png_color) * png.num_palette);
  
      for(i=0; i<(int)png.num_palette; ++i)
        png.palette[i].red = png.palette[i].green = png.palette[i].blue = 
--- 147,153 ----
      png.color_type = PNG_COLOR_TYPE_PALETTE;
      png.num_palette = 1 << depth;
  
!     png.palette = (png_color*) malloc(sizeof(png_color) * png.num_palette);
  
      for(i=0; i<(int)png.num_palette; ++i)
        png.palette[i].red = png.palette[i].green = png.palette[i].blue = 
***************
*** 156,165 ****
  
  
    /* malloc stuff */
!   row_pointers = malloc(png.height*sizeof(png_bytep));
    rowbytes = png_get_rowbytes(png_ptr, info_ptr);
  
!   png.data = malloc(png.height * rowbytes);
  
    for(i=0; i<png.height; ++i)
      row_pointers[i] = png.data + rowbytes*i;
--- 156,165 ----
  
  
    /* malloc stuff */
!   row_pointers = (png_bytep*) malloc(png.height*sizeof(png_bytep));
    rowbytes = png_get_rowbytes(png_ptr, info_ptr);
  
!   png.data = (unsigned char*) malloc(png.height * rowbytes);
  
    for(i=0; i<png.height; ++i)
      row_pointers[i] = png.data + rowbytes*i;
***************
*** 170,176 ****
    || png.color_type == PNG_COLOR_TYPE_RGB) {
      /* alpha has to be pre-applied, bytes shifted */
  
!     int x, y;
      unsigned char *p;
      int alpha;
      unsigned char r, g, b;
--- 170,176 ----
    || png.color_type == PNG_COLOR_TYPE_RGB) {
      /* alpha has to be pre-applied, bytes shifted */
  
!     unsigned int x, y;
      unsigned char *p;
      int alpha;
      unsigned char r, g, b;
***************
*** 204,210 ****
  {
    unsigned char *data, *outdata;
    int size;
!   long outsize;
    int hasAlpha =
      png.color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
      png.color_type == PNG_COLOR_TYPE_RGB_ALPHA;
--- 204,210 ----
  {
    unsigned char *data, *outdata;
    int size;
!   unsigned long outsize;
    int hasAlpha =
      png.color_type == PNG_COLOR_TYPE_GRAY_ALPHA ||
      png.color_type == PNG_COLOR_TYPE_RGB_ALPHA;
***************
*** 220,226 ****
    {
      int tablesize = png.num_palette * sizeof(png_color);
  
!     data = realloc(png.palette, tablesize + size);
  
      memcpy(data + tablesize, png.data, size);
      size += tablesize;
--- 220,226 ----
    {
      int tablesize = png.num_palette * sizeof(png_color);
  
!     data = (unsigned char*) realloc(png.palette, tablesize + size);
  
      memcpy(data + tablesize, png.data, size);
      size += tablesize;
***************
*** 228,234 ****
    else
      data = png.data;
  
!   outdata = malloc(outsize = (int)floor(size*1.01+12));
  
    /* compress the RGB color table (if present) and image data one block */
  
--- 228,234 ----
    else
      data = png.data;
  
!   outdata = (unsigned char*) malloc(outsize = (int)floor(size*1.01+12));
  
    /* compress the RGB color table (if present) and image data one block */
  
*** ming-0.2a_orig/util/swftophp.c	2001-08-17 19:06:16.000000000 +0200
--- ming-0.2a/util/swftophp.c	2002-10-06 20:51:59.000000000 +0200
***************
*** 18,24 ****
  #endif
  
  void skipBytes(FILE *f, int length);
! char *blockName(int);
  
  void readMatrix(FILE *f, struct Matrix *s)
  {
--- 18,24 ----
  #endif
  
  void skipBytes(FILE *f, int length);
! const char *blockName(int);
  
  void readMatrix(FILE *f, struct Matrix *s)
  {
***************
*** 1575,1577 ****
--- 1575,1578 ----
  
    exit(0);
  }
+  
