ming-0.4.5/0000755000175000017500000000000012154727176007467 500000000000000ming-0.4.5/macros/0000755000175000017500000000000012154727171010746 500000000000000ming-0.4.5/macros/Makefile.in0000644000175000017500000002651612154727025012743 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = macros DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/python.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/ming_config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GIFLIB = @GIFLIB@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERFACE_AGE = @INTERFACE_AGE@ INTERFACE_CURRENT = @INTERFACE_CURRENT@ INTERFACE_REVISION = @INTERFACE_REVISION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATHLIB = @MATHLIB@ MICRO_VERSION = @MICRO_VERSION@ MING_VERSION = @MING_VERSION@ MINOR_VERSION = @MINOR_VERSION@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PHP = @PHP@ PHPIZE = @PHPIZE@ PNGLIB = @PNGLIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHCFLAGS = @SHCFLAGS@ SHELL = @SHELL@ STRIP = @STRIP@ TCL = @TCL@ TCL_INC_DIR = @TCL_INC_DIR@ TCL_LIB_DIR = @TCL_LIB_DIR@ VERSION = @VERSION@ XLIB = @XLIB@ YACC = @YACC@ ZLIB = @ZLIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = \ ming.m4 \ python.m4 all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu macros/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu macros/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ distclean distclean-generic distclean-libtool distdir dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs maintainer-clean \ maintainer-clean-generic mostlyclean mostlyclean-generic \ mostlyclean-libtool pdf pdf-am ps ps-am uninstall uninstall-am # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ming-0.4.5/macros/Makefile.am0000644000175000017500000000004511454264373012723 00000000000000EXTRA_DIST = \ ming.m4 \ python.m4 ming-0.4.5/macros/ming.m40000644000175000017500000000454211454264373012071 00000000000000dnl dnl Copyright (C) 2005, 2006 Free Software Foundation, Inc. dnl dnl This program is free software; you can redistribute it and/or modify dnl it under the terms of the GNU General Public License as published by dnl the Free Software Foundation; either version 2 of the License, or dnl (at your option) any later version. dnl dnl This program is distributed in the hope that it will be useful, dnl but WITHOUT ANY WARRANTY; without even the implied warranty of dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the dnl GNU General Public License for more details. dnl You should have received a copy of the GNU General Public License dnl along with this program; if not, write to the Free Software dnl Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA dnl dnl # Configure paths for Ming # Author: Sandro Santilli # # This macro uses ming-config, which was # not available as of Ming 0.3beta1 # # # Use: # AC_PATH_MING # # Provides: # MING_VERSION - Ming version string (example: "0.4.1" or "0.4.0.beta2") # MING_VERSION_CODE - a 8digits number encoding Major, Minor, Patch and Beta numbers. # examples: 00040002 (0.4.0.beta2) 00040100 (0.4.1) # MING_CFLAGS # MING_LIBS # MAKESWF # AC_DEFUN([AC_PATH_MING], [ MING_CFLAGS="" MING_LIBS="" AC_ARG_WITH(ming,[ --with-ming=[] Path to the ming-config command], [ case "${withval}" in yes|no) ;; *) MING_CONFIG=${withval} ;; esac ], MING_CONFIG="") if test x"$MING_CONFIG" = "x"; then AC_PATH_PROG(MING_CONFIG, ming-config) fi if test x"$MING_CONFIG" != "x"; then MING_VERSION=`$MING_CONFIG --version` major=`echo $MING_VERSION | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\1/'` minor=`echo $MING_VERSION | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\2/'` micro=`echo $MING_VERSION | \ sed 's/\([[0-9]]*\)\.\([[0-9]]*\)\.\([[0-9]]*\).*/\3/'` beta=`echo $MING_VERSION | sed -ne 's/.*beta\([[0-9]]*\).*/\1/p'` MING_VERSION_CODE=`printf %2.2d%2.2d%2.2d%2.2d $major $minor $micro $beta` MING_CFLAGS=`$MING_CONFIG --cflags` MING_LIBS=`$MING_CONFIG --libs` MING_PATH=`$MING_CONFIG --bindir` AC_PATH_PROG([MAKESWF], [makeswf], , [$MING_PATH:$PATH]) fi AC_SUBST(MING_VERSION_CODE) AC_SUBST(MING_VERSION) AC_SUBST(MING_CFLAGS) AC_SUBST(MING_LIBS) AC_SUBST(MAKESWF) ]) ming-0.4.5/macros/lt~obsolete.m40000644000175000017500000001375612154727020013507 00000000000000# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004. # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 5 lt~obsolete.m4 # These exist entirely to fool aclocal when bootstrapping libtool. # # In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN) # which have later been changed to m4_define as they aren't part of the # exported API, or moved to Autoconf or Automake where they belong. # # The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN # in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us # using a macro with the same name in our local m4/libtool.m4 it'll # pull the old libtool.m4 in (it doesn't see our shiny new m4_define # and doesn't know about Autoconf macros at all.) # # So we provide this file, which has a silly filename so it's always # included after everything else. This provides aclocal with the # AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything # because those macros already exist, or will be overwritten later. # We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. # # Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here. # Yes, that means every name once taken will need to remain here until # we give up compatibility with versions before 1.7, at which point # we need to keep only those names which we still refer to. # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])]) m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])]) m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])]) m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])]) m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])]) m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])]) m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])]) m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])]) m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])]) m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])]) m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])]) m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])]) m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])]) m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])]) m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])]) m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])]) m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])]) m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])]) m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])]) m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])]) m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])]) m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])]) m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])]) m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])]) m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])]) m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])]) m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])]) m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])]) m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])]) m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])]) m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])]) m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])]) m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])]) m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])]) m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])]) m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])]) m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])]) m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])]) m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])]) m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])]) m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])]) m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])]) m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])]) m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])]) m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])]) m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])]) m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])]) m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])]) m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])]) m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])]) m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])]) m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])]) m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])]) m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])]) m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])]) m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])]) m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])]) ming-0.4.5/macros/ltoptions.m40000644000175000017500000003007312154727020013157 00000000000000# Helper functions for option handling. -*- Autoconf -*- # # Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation, # Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 7 ltoptions.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])]) # _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME) # ------------------------------------------ m4_define([_LT_MANGLE_OPTION], [[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])]) # _LT_SET_OPTION(MACRO-NAME, OPTION-NAME) # --------------------------------------- # Set option OPTION-NAME for macro MACRO-NAME, and if there is a # matching handler defined, dispatch to it. Other OPTION-NAMEs are # saved as a flag. m4_define([_LT_SET_OPTION], [m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]), _LT_MANGLE_DEFUN([$1], [$2]), [m4_warning([Unknown $1 option `$2'])])[]dnl ]) # _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET]) # ------------------------------------------------------------ # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. m4_define([_LT_IF_OPTION], [m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])]) # _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET) # ------------------------------------------------------- # Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME # are set. m4_define([_LT_UNLESS_OPTIONS], [m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option), [m4_define([$0_found])])])[]dnl m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3 ])[]dnl ]) # _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST) # ---------------------------------------- # OPTION-LIST is a space-separated list of Libtool options associated # with MACRO-NAME. If any OPTION has a matching handler declared with # LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about # the unknown option and exit. m4_defun([_LT_SET_OPTIONS], [# Set options m4_foreach([_LT_Option], m4_split(m4_normalize([$2])), [_LT_SET_OPTION([$1], _LT_Option)]) m4_if([$1],[LT_INIT],[ dnl dnl Simply set some default values (i.e off) if boolean options were not dnl specified: _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no ]) _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no ]) dnl dnl If no reference was made to various pairs of opposing options, then dnl we run the default mode handler for the pair. For example, if neither dnl `shared' nor `disable-shared' was passed, we enable building of shared dnl archives by default: _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED]) _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC]) _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC]) _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install], [_LT_ENABLE_FAST_INSTALL]) ]) ])# _LT_SET_OPTIONS ## --------------------------------- ## ## Macros to handle LT_INIT options. ## ## --------------------------------- ## # _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME) # ----------------------------------------- m4_define([_LT_MANGLE_DEFUN], [[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])]) # LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE) # ----------------------------------------------- m4_define([LT_OPTION_DEFINE], [m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl ])# LT_OPTION_DEFINE # dlopen # ------ LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes ]) AU_DEFUN([AC_LIBTOOL_DLOPEN], [_LT_SET_OPTION([LT_INIT], [dlopen]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `dlopen' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], []) # win32-dll # --------- # Declare package support for building win32 dll's. LT_OPTION_DEFINE([LT_INIT], [win32-dll], [enable_win32_dll=yes case $host in *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*) AC_CHECK_TOOL(AS, as, false) AC_CHECK_TOOL(DLLTOOL, dlltool, false) AC_CHECK_TOOL(OBJDUMP, objdump, false) ;; esac test -z "$AS" && AS=as _LT_DECL([], [AS], [1], [Assembler program])dnl test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl ])# win32-dll AU_DEFUN([AC_LIBTOOL_WIN32_DLL], [AC_REQUIRE([AC_CANONICAL_HOST])dnl _LT_SET_OPTION([LT_INIT], [win32-dll]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `win32-dll' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], []) # _LT_ENABLE_SHARED([DEFAULT]) # ---------------------------- # implement the --enable-shared flag, and supports the `shared' and # `disable-shared' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_SHARED], [m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([shared], [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@], [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_shared=yes ;; no) enable_shared=no ;; *) enable_shared=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_shared=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_shared=]_LT_ENABLE_SHARED_DEFAULT) _LT_DECL([build_libtool_libs], [enable_shared], [0], [Whether or not to build shared libraries]) ])# _LT_ENABLE_SHARED LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])]) # Old names: AC_DEFUN([AC_ENABLE_SHARED], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared]) ]) AC_DEFUN([AC_DISABLE_SHARED], [_LT_SET_OPTION([LT_INIT], [disable-shared]) ]) AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)]) AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_SHARED], []) dnl AC_DEFUN([AM_DISABLE_SHARED], []) # _LT_ENABLE_STATIC([DEFAULT]) # ---------------------------- # implement the --enable-static flag, and support the `static' and # `disable-static' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_STATIC], [m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([static], [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@], [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_static=yes ;; no) enable_static=no ;; *) enable_static=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_static=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_static=]_LT_ENABLE_STATIC_DEFAULT) _LT_DECL([build_old_libs], [enable_static], [0], [Whether or not to build static libraries]) ])# _LT_ENABLE_STATIC LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])]) # Old names: AC_DEFUN([AC_ENABLE_STATIC], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static]) ]) AC_DEFUN([AC_DISABLE_STATIC], [_LT_SET_OPTION([LT_INIT], [disable-static]) ]) AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)]) AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_ENABLE_STATIC], []) dnl AC_DEFUN([AM_DISABLE_STATIC], []) # _LT_ENABLE_FAST_INSTALL([DEFAULT]) # ---------------------------------- # implement the --enable-fast-install flag, and support the `fast-install' # and `disable-fast-install' LT_INIT options. # DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'. m4_define([_LT_ENABLE_FAST_INSTALL], [m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl AC_ARG_ENABLE([fast-install], [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@], [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])], [p=${PACKAGE-default} case $enableval in yes) enable_fast_install=yes ;; no) enable_fast_install=no ;; *) enable_fast_install=no # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for pkg in $enableval; do IFS="$lt_save_ifs" if test "X$pkg" = "X$p"; then enable_fast_install=yes fi done IFS="$lt_save_ifs" ;; esac], [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT) _LT_DECL([fast_install], [enable_fast_install], [0], [Whether or not to optimize for fast installation])dnl ])# _LT_ENABLE_FAST_INSTALL LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])]) LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])]) # Old names: AU_DEFUN([AC_ENABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `fast-install' option into LT_INIT's first parameter.]) ]) AU_DEFUN([AC_DISABLE_FAST_INSTALL], [_LT_SET_OPTION([LT_INIT], [disable-fast-install]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `disable-fast-install' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], []) dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], []) # _LT_WITH_PIC([MODE]) # -------------------- # implement the --with-pic flag, and support the `pic-only' and `no-pic' # LT_INIT options. # MODE is either `yes' or `no'. If omitted, it defaults to `both'. m4_define([_LT_WITH_PIC], [AC_ARG_WITH([pic], [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@], [try to use only PIC/non-PIC objects @<:@default=use both@:>@])], [lt_p=${PACKAGE-default} case $withval in yes|no) pic_mode=$withval ;; *) pic_mode=default # Look at the argument we got. We use all the common list separators. lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR," for lt_pkg in $withval; do IFS="$lt_save_ifs" if test "X$lt_pkg" = "X$lt_p"; then pic_mode=yes fi done IFS="$lt_save_ifs" ;; esac], [pic_mode=default]) test -z "$pic_mode" && pic_mode=m4_default([$1], [default]) _LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl ])# _LT_WITH_PIC LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])]) LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])]) # Old name: AU_DEFUN([AC_LIBTOOL_PICMODE], [_LT_SET_OPTION([LT_INIT], [pic-only]) AC_DIAGNOSE([obsolete], [$0: Remove this warning and the call to _LT_SET_OPTION when you put the `pic-only' option into LT_INIT's first parameter.]) ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_PICMODE], []) ## ----------------- ## ## LTDL_INIT Options ## ## ----------------- ## m4_define([_LTDL_MODE], []) LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive], [m4_define([_LTDL_MODE], [nonrecursive])]) LT_OPTION_DEFINE([LTDL_INIT], [recursive], [m4_define([_LTDL_MODE], [recursive])]) LT_OPTION_DEFINE([LTDL_INIT], [subproject], [m4_define([_LTDL_MODE], [subproject])]) m4_define([_LTDL_TYPE], []) LT_OPTION_DEFINE([LTDL_INIT], [installable], [m4_define([_LTDL_TYPE], [installable])]) LT_OPTION_DEFINE([LTDL_INIT], [convenience], [m4_define([_LTDL_TYPE], [convenience])]) ming-0.4.5/macros/libtool.m40000644000175000017500000105754212154727020012603 00000000000000# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- # # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. m4_define([_LT_COPYING], [dnl # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, # 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # Written by Gordon Matzigkeit, 1996 # # This file is part of GNU Libtool. # # GNU Libtool is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of # the License, or (at your option) any later version. # # As a special exception to the GNU General Public License, # if you distribute this file as part of a program or library that # is built using GNU Libtool, you may include this file under the # same distribution terms that you use for the rest of that program. # # GNU Libtool is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with GNU Libtool; see the file COPYING. If not, a copy # can be downloaded from http://www.gnu.org/licenses/gpl.html, or # obtained by writing to the Free Software Foundation, Inc., # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. ]) # serial 57 LT_INIT # LT_PREREQ(VERSION) # ------------------ # Complain and exit if this libtool version is less that VERSION. m4_defun([LT_PREREQ], [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, [m4_default([$3], [m4_fatal([Libtool version $1 or higher is required], 63)])], [$2])]) # _LT_CHECK_BUILDDIR # ------------------ # Complain if the absolute build directory name contains unusual characters m4_defun([_LT_CHECK_BUILDDIR], [case `pwd` in *\ * | *\ *) AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; esac ]) # LT_INIT([OPTIONS]) # ------------------ AC_DEFUN([LT_INIT], [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl AC_BEFORE([$0], [LT_LANG])dnl AC_BEFORE([$0], [LT_OUTPUT])dnl AC_BEFORE([$0], [LTDL_INIT])dnl m4_require([_LT_CHECK_BUILDDIR])dnl dnl Autoconf doesn't catch unexpanded LT_ macros by default: m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 dnl unless we require an AC_DEFUNed macro: AC_REQUIRE([LTOPTIONS_VERSION])dnl AC_REQUIRE([LTSUGAR_VERSION])dnl AC_REQUIRE([LTVERSION_VERSION])dnl AC_REQUIRE([LTOBSOLETE_VERSION])dnl m4_require([_LT_PROG_LTMAIN])dnl _LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}]) dnl Parse OPTIONS _LT_SET_OPTIONS([$0], [$1]) # This can be used to rebuild libtool when needed LIBTOOL_DEPS="$ltmain" # Always use our own libtool. LIBTOOL='$(SHELL) $(top_builddir)/libtool' AC_SUBST(LIBTOOL)dnl _LT_SETUP # Only expand once: m4_define([LT_INIT]) ])# LT_INIT # Old names: AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PROG_LIBTOOL], []) dnl AC_DEFUN([AM_PROG_LIBTOOL], []) # _LT_CC_BASENAME(CC) # ------------------- # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. m4_defun([_LT_CC_BASENAME], [for cc_temp in $1""; do case $cc_temp in compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; \-*) ;; *) break;; esac done cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"` ]) # _LT_FILEUTILS_DEFAULTS # ---------------------- # It is okay to use these file commands and assume they have been set # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. m4_defun([_LT_FILEUTILS_DEFAULTS], [: ${CP="cp -f"} : ${MV="mv -f"} : ${RM="rm -f"} ])# _LT_FILEUTILS_DEFAULTS # _LT_SETUP # --------- m4_defun([_LT_SETUP], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl _LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl dnl _LT_DECL([], [host_alias], [0], [The host system])dnl _LT_DECL([], [host], [0])dnl _LT_DECL([], [host_os], [0])dnl dnl _LT_DECL([], [build_alias], [0], [The build system])dnl _LT_DECL([], [build], [0])dnl _LT_DECL([], [build_os], [0])dnl dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl dnl AC_REQUIRE([AC_PROG_LN_S])dnl test -z "$LN_S" && LN_S="ln -s" _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl dnl AC_REQUIRE([LT_CMD_MAX_LEN])dnl _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl m4_require([_LT_CMD_RELOAD])dnl m4_require([_LT_CHECK_MAGIC_METHOD])dnl m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl m4_require([_LT_CMD_OLD_ARCHIVE])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_WITH_SYSROOT])dnl _LT_CONFIG_LIBTOOL_INIT([ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes INIT. if test -n "\${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi ]) if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi _LT_CHECK_OBJDIR m4_require([_LT_TAG_COMPILER])dnl case $host_os in aix3*) # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi ;; esac # Global variables: ofile=libtool can_build_shared=yes # All known linkers require a `.a' archive for static linking (except MSVC, # which needs '.lib'). libext=a with_gnu_ld="$lt_cv_prog_gnu_ld" old_CC="$CC" old_CFLAGS="$CFLAGS" # Set sane defaults for various variables test -z "$CC" && CC=cc test -z "$LTCC" && LTCC=$CC test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS test -z "$LD" && LD=ld test -z "$ac_objext" && ac_objext=o _LT_CC_BASENAME([$compiler]) # Only perform the check for file, if the check method requires it test -z "$MAGIC_CMD" && MAGIC_CMD=file case $deplibs_check_method in file_magic*) if test "$file_magic_cmd" = '$MAGIC_CMD'; then _LT_PATH_MAGIC fi ;; esac # Use C for the default configuration in the libtool script LT_SUPPORTED_TAG([CC]) _LT_LANG_C_CONFIG _LT_LANG_DEFAULT_CONFIG _LT_CONFIG_COMMANDS ])# _LT_SETUP # _LT_PREPARE_SED_QUOTE_VARS # -------------------------- # Define a few sed substitution that help us do robust quoting. m4_defun([_LT_PREPARE_SED_QUOTE_VARS], [# Backslashify metacharacters that are still active within # double-quoted strings. sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' # Same as above, but do not quote variable references. double_quote_subst='s/\([["`\\]]\)/\\\1/g' # Sed substitution to delay expansion of an escaped shell variable in a # double_quote_subst'ed string. delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' # Sed substitution to delay expansion of an escaped single quote. delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' # Sed substitution to avoid accidental globbing in evaled expressions no_glob_subst='s/\*/\\\*/g' ]) # _LT_PROG_LTMAIN # --------------- # Note that this code is called both from `configure', and `config.status' # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, # `config.status' has no value for ac_aux_dir unless we are using Automake, # so we pass a copy along to make sure it has a sensible value anyway. m4_defun([_LT_PROG_LTMAIN], [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) ltmain="$ac_aux_dir/ltmain.sh" ])# _LT_PROG_LTMAIN ## ------------------------------------- ## ## Accumulate code for creating libtool. ## ## ------------------------------------- ## # So that we can recreate a full libtool script including additional # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS # in macros and then make a single call at the end using the `libtool' # label. # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) # ---------------------------------------- # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL_INIT], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_INIT], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_INIT]) # _LT_CONFIG_LIBTOOL([COMMANDS]) # ------------------------------ # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. m4_define([_LT_CONFIG_LIBTOOL], [m4_ifval([$1], [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], [$1 ])])]) # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) # ----------------------------------------------------- m4_defun([_LT_CONFIG_SAVE_COMMANDS], [_LT_CONFIG_LIBTOOL([$1]) _LT_CONFIG_LIBTOOL_INIT([$2]) ]) # _LT_FORMAT_COMMENT([COMMENT]) # ----------------------------- # Add leading comment marks to the start of each line, and a trailing # full-stop to the whole comment if one is not present already. m4_define([_LT_FORMAT_COMMENT], [m4_ifval([$1], [ m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) )]) ## ------------------------ ## ## FIXME: Eliminate VARNAME ## ## ------------------------ ## # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) # ------------------------------------------------------------------- # CONFIGNAME is the name given to the value in the libtool script. # VARNAME is the (base) name used in the configure script. # VALUE may be 0, 1 or 2 for a computed quote escaped value based on # VARNAME. Any other value will be used directly. m4_define([_LT_DECL], [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], [m4_ifval([$1], [$1], [$2])]) lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) m4_ifval([$4], [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) lt_dict_add_subkey([lt_decl_dict], [$2], [tagged?], [m4_ifval([$5], [yes], [no])])]) ]) # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) # -------------------------------------------------------- m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_tag_varnames], [_lt_decl_filter([tagged?], [yes], $@)]) # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) # --------------------------------------------------------- m4_define([_lt_decl_filter], [m4_case([$#], [0], [m4_fatal([$0: too few arguments: $#])], [1], [m4_fatal([$0: too few arguments: $#: $1])], [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], [lt_dict_filter([lt_decl_dict], $@)])[]dnl ]) # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) # -------------------------------------------------- m4_define([lt_decl_quote_varnames], [_lt_decl_filter([value], [1], $@)]) # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_dquote_varnames], [_lt_decl_filter([value], [2], $@)]) # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) # --------------------------------------------------- m4_define([lt_decl_varnames_tagged], [m4_assert([$# <= 2])dnl _$0(m4_quote(m4_default([$1], [[, ]])), m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]), m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))]) m4_define([_lt_decl_varnames_tagged], [m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])]) # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) # ------------------------------------------------ m4_define([lt_decl_all_varnames], [_$0(m4_quote(m4_default([$1], [[, ]])), m4_if([$2], [], m4_quote(lt_decl_varnames), m4_quote(m4_shift($@))))[]dnl ]) m4_define([_lt_decl_all_varnames], [lt_join($@, lt_decl_varnames_tagged([$1], lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl ]) # _LT_CONFIG_STATUS_DECLARE([VARNAME]) # ------------------------------------ # Quote a variable value, and forward it to `config.status' so that its # declaration there will have the same value as in `configure'. VARNAME # must have a single quote delimited value for this to work. m4_define([_LT_CONFIG_STATUS_DECLARE], [$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`']) # _LT_CONFIG_STATUS_DECLARATIONS # ------------------------------ # We delimit libtool config variables with single quotes, so when # we write them to config.status, we have to be sure to quote all # embedded single quotes properly. In configure, this macro expands # each variable declared with _LT_DECL (and _LT_TAGDECL) into: # # ='`$ECHO "$" | $SED "$delay_single_quote_subst"`' m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAGS # ---------------- # Output comment and list of tags supported by the script m4_defun([_LT_LIBTOOL_TAGS], [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl available_tags="_LT_TAGS"dnl ]) # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) # ----------------------------------- # Extract the dictionary values for VARNAME (optionally with TAG) and # expand to a commented shell variable setting: # # # Some comment about what VAR is for. # visible_name=$lt_internal_name m4_define([_LT_LIBTOOL_DECLARE], [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [description])))[]dnl m4_pushdef([_libtool_name], m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), [0], [_libtool_name=[$]$1], [1], [_libtool_name=$lt_[]$1], [2], [_libtool_name=$lt_[]$1], [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl ]) # _LT_LIBTOOL_CONFIG_VARS # ----------------------- # Produce commented declarations of non-tagged libtool config variables # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' # script. Tagged libtool config variables (even for the LIBTOOL CONFIG # section) are produced by _LT_LIBTOOL_TAG_VARS. m4_defun([_LT_LIBTOOL_CONFIG_VARS], [m4_foreach([_lt_var], m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) # _LT_LIBTOOL_TAG_VARS(TAG) # ------------------------- m4_define([_LT_LIBTOOL_TAG_VARS], [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) # _LT_TAGVAR(VARNAME, [TAGNAME]) # ------------------------------ m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) # _LT_CONFIG_COMMANDS # ------------------- # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of # variables for single and double quote escaping we saved from calls # to _LT_DECL, we can put quote escaped variables declarations # into `config.status', and then the shell code to quote escape them in # for loops in `config.status'. Finally, any additional code accumulated # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. m4_defun([_LT_CONFIG_COMMANDS], [AC_PROVIDE_IFELSE([LT_OUTPUT], dnl If the libtool generation code has been placed in $CONFIG_LT, dnl instead of duplicating it all over again into config.status, dnl then we will have config.status run $CONFIG_LT later, so it dnl needs to know what name is stored there: [AC_CONFIG_COMMANDS([libtool], [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], dnl If the libtool generation code is destined for config.status, dnl expand the accumulated commands and init code now: [AC_CONFIG_COMMANDS([libtool], [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) ])#_LT_CONFIG_COMMANDS # Initialize. m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], [ # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH sed_quote_subst='$sed_quote_subst' double_quote_subst='$double_quote_subst' delay_variable_subst='$delay_variable_subst' _LT_CONFIG_STATUS_DECLARATIONS LTCC='$LTCC' LTCFLAGS='$LTCFLAGS' compiler='$compiler_DEFAULT' # A function that is used when there is no print builtin or printf. func_fallback_echo () { eval 'cat <<_LTECHO_EOF \$[]1 _LTECHO_EOF' } # Quote evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_quote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done # Double-quote double-evaled strings. for var in lt_decl_all_varnames([[ \ ]], lt_decl_dquote_varnames); do case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in *[[\\\\\\\`\\"\\\$]]*) eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ;; *) eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" ;; esac done _LT_OUTPUT_LIBTOOL_INIT ]) # _LT_GENERATED_FILE_INIT(FILE, [COMMENT]) # ------------------------------------ # Generate a child script FILE with all initialization necessary to # reuse the environment learned by the parent script, and make the # file executable. If COMMENT is supplied, it is inserted after the # `#!' sequence but before initialization text begins. After this # macro, additional text can be appended to FILE to form the body of # the child script. The macro ends with non-zero status if the # file could not be fully written (such as if the disk is full). m4_ifdef([AS_INIT_GENERATED], [m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])], [m4_defun([_LT_GENERATED_FILE_INIT], [m4_require([AS_PREPARE])]dnl [m4_pushdef([AS_MESSAGE_LOG_FD])]dnl [lt_write_fail=0 cat >$1 <<_ASEOF || lt_write_fail=1 #! $SHELL # Generated by $as_me. $2 SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$1 <<\_ASEOF || lt_write_fail=1 AS_SHELL_SANITIZE _AS_PREPARE exec AS_MESSAGE_FD>&1 _ASEOF test $lt_write_fail = 0 && chmod +x $1[]dnl m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT # LT_OUTPUT # --------- # This macro allows early generation of the libtool script (before # AC_OUTPUT is called), incase it is used in configure for compilation # tests. AC_DEFUN([LT_OUTPUT], [: ${CONFIG_LT=./config.lt} AC_MSG_NOTICE([creating $CONFIG_LT]) _LT_GENERATED_FILE_INIT(["$CONFIG_LT"], [# Run this file to recreate a libtool stub with the current configuration.]) cat >>"$CONFIG_LT" <<\_LTEOF lt_cl_silent=false exec AS_MESSAGE_LOG_FD>>config.log { echo AS_BOX([Running $as_me.]) } >&AS_MESSAGE_LOG_FD lt_cl_help="\ \`$as_me' creates a local libtool stub from the current configuration, for use in further configure time tests before the real libtool is generated. Usage: $[0] [[OPTIONS]] -h, --help print this help, then exit -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files Report bugs to ." lt_cl_version="\ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) configured by $[0], generated by m4_PACKAGE_STRING. Copyright (C) 2011 Free Software Foundation, Inc. This config.lt script is free software; the Free Software Foundation gives unlimited permision to copy, distribute and modify it." while test $[#] != 0 do case $[1] in --version | --v* | -V ) echo "$lt_cl_version"; exit 0 ;; --help | --h* | -h ) echo "$lt_cl_help"; exit 0 ;; --debug | --d* | -d ) debug=: ;; --quiet | --q* | --silent | --s* | -q ) lt_cl_silent=: ;; -*) AC_MSG_ERROR([unrecognized option: $[1] Try \`$[0] --help' for more information.]) ;; *) AC_MSG_ERROR([unrecognized argument: $[1] Try \`$[0] --help' for more information.]) ;; esac shift done if $lt_cl_silent; then exec AS_MESSAGE_FD>/dev/null fi _LTEOF cat >>"$CONFIG_LT" <<_LTEOF _LT_OUTPUT_LIBTOOL_COMMANDS_INIT _LTEOF cat >>"$CONFIG_LT" <<\_LTEOF AC_MSG_NOTICE([creating $ofile]) _LT_OUTPUT_LIBTOOL_COMMANDS AS_EXIT(0) _LTEOF chmod +x "$CONFIG_LT" # configure is writing to config.log, but config.lt does its own redirection, # appending to config.log, which fails on DOS, as config.log is still kept # open by configure. Here we exec the FD to /dev/null, effectively closing # config.log, so it can be properly (re)opened and appended to by config.lt. lt_cl_success=: test "$silent" = yes && lt_config_lt_args="$lt_config_lt_args --quiet" exec AS_MESSAGE_LOG_FD>/dev/null $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false exec AS_MESSAGE_LOG_FD>>config.log $lt_cl_success || AS_EXIT(1) ])# LT_OUTPUT # _LT_CONFIG(TAG) # --------------- # If TAG is the built-in tag, create an initial libtool script with a # default configuration from the untagged config vars. Otherwise add code # to config.status for appending the configuration named by TAG from the # matching tagged config vars. m4_defun([_LT_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_CONFIG_SAVE_COMMANDS([ m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl m4_if(_LT_TAG, [C], [ # See if we are running on zsh, and set the options which allow our # commands through without removal of \ escapes. if test -n "${ZSH_VERSION+set}" ; then setopt NO_GLOB_SUBST fi cfgfile="${ofile}T" trap "$RM \"$cfgfile\"; exit 1" 1 2 15 $RM "$cfgfile" cat <<_LT_EOF >> "$cfgfile" #! $SHELL # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: # NOTE: Changes made to this file will be lost: look at ltmain.sh. # _LT_COPYING _LT_LIBTOOL_TAGS # ### BEGIN LIBTOOL CONFIG _LT_LIBTOOL_CONFIG_VARS _LT_LIBTOOL_TAG_VARS # ### END LIBTOOL CONFIG _LT_EOF case $host_os in aix3*) cat <<\_LT_EOF >> "$cfgfile" # AIX sometimes has problems with the GCC collect2 program. For some # reason, if we set the COLLECT_NAMES environment variable, the problems # vanish in a puff of smoke. if test "X${COLLECT_NAMES+set}" != Xset; then COLLECT_NAMES= export COLLECT_NAMES fi _LT_EOF ;; esac _LT_PROG_LTMAIN # We use sed instead of cat because bash on DJGPP gets confused if # if finds mixed CR/LF and LF-only lines. Since sed operates in # text mode, it properly converts lines to CR/LF. This bash problem # is reportedly fixed, but why not run on old versions too? sed '$q' "$ltmain" >> "$cfgfile" \ || (rm -f "$cfgfile"; exit 1) _LT_PROG_REPLACE_SHELLFNS mv -f "$cfgfile" "$ofile" || (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") chmod +x "$ofile" ], [cat <<_LT_EOF >> "$ofile" dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded dnl in a comment (ie after a #). # ### BEGIN LIBTOOL TAG CONFIG: $1 _LT_LIBTOOL_TAG_VARS(_LT_TAG) # ### END LIBTOOL TAG CONFIG: $1 _LT_EOF ])dnl /m4_if ], [m4_if([$1], [], [ PACKAGE='$PACKAGE' VERSION='$VERSION' TIMESTAMP='$TIMESTAMP' RM='$RM' ofile='$ofile'], []) ])dnl /_LT_CONFIG_SAVE_COMMANDS ])# _LT_CONFIG # LT_SUPPORTED_TAG(TAG) # --------------------- # Trace this macro to discover what tags are supported by the libtool # --tag option, using: # autoconf --trace 'LT_SUPPORTED_TAG:$1' AC_DEFUN([LT_SUPPORTED_TAG], []) # C support is built-in for now m4_define([_LT_LANG_C_enabled], []) m4_define([_LT_TAGS], []) # LT_LANG(LANG) # ------------- # Enable libtool support for the given language if not already enabled. AC_DEFUN([LT_LANG], [AC_BEFORE([$0], [LT_OUTPUT])dnl m4_case([$1], [C], [_LT_LANG(C)], [C++], [_LT_LANG(CXX)], [Go], [_LT_LANG(GO)], [Java], [_LT_LANG(GCJ)], [Fortran 77], [_LT_LANG(F77)], [Fortran], [_LT_LANG(FC)], [Windows Resource], [_LT_LANG(RC)], [m4_ifdef([_LT_LANG_]$1[_CONFIG], [_LT_LANG($1)], [m4_fatal([$0: unsupported language: "$1"])])])dnl ])# LT_LANG # _LT_LANG(LANGNAME) # ------------------ m4_defun([_LT_LANG], [m4_ifdef([_LT_LANG_]$1[_enabled], [], [LT_SUPPORTED_TAG([$1])dnl m4_append([_LT_TAGS], [$1 ])dnl m4_define([_LT_LANG_]$1[_enabled], [])dnl _LT_LANG_$1_CONFIG($1)])dnl ])# _LT_LANG m4_ifndef([AC_PROG_GO], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_GO. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_GO], [AC_LANG_PUSH(Go)dnl AC_ARG_VAR([GOC], [Go compiler command])dnl AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl _AC_ARG_VAR_LDFLAGS()dnl AC_CHECK_TOOL(GOC, gccgo) if test -z "$GOC"; then if test -n "$ac_tool_prefix"; then AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo]) fi fi if test -z "$GOC"; then AC_CHECK_PROG(GOC, gccgo, gccgo, false) fi ])#m4_defun ])#m4_ifndef # _LT_LANG_DEFAULT_CONFIG # ----------------------- m4_defun([_LT_LANG_DEFAULT_CONFIG], [AC_PROVIDE_IFELSE([AC_PROG_CXX], [LT_LANG(CXX)], [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) AC_PROVIDE_IFELSE([AC_PROG_F77], [LT_LANG(F77)], [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) AC_PROVIDE_IFELSE([AC_PROG_FC], [LT_LANG(FC)], [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal dnl pulling things in needlessly. AC_PROVIDE_IFELSE([AC_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], [LT_LANG(GCJ)], [AC_PROVIDE_IFELSE([LT_PROG_GCJ], [LT_LANG(GCJ)], [m4_ifdef([AC_PROG_GCJ], [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([A][M_PROG_GCJ], [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) m4_ifdef([LT_PROG_GCJ], [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) AC_PROVIDE_IFELSE([AC_PROG_GO], [LT_LANG(GO)], [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])]) AC_PROVIDE_IFELSE([LT_PROG_RC], [LT_LANG(RC)], [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) ])# _LT_LANG_DEFAULT_CONFIG # Obsolete macros: AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_CXX], []) dnl AC_DEFUN([AC_LIBTOOL_F77], []) dnl AC_DEFUN([AC_LIBTOOL_FC], []) dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) dnl AC_DEFUN([AC_LIBTOOL_RC], []) # _LT_TAG_COMPILER # ---------------- m4_defun([_LT_TAG_COMPILER], [AC_REQUIRE([AC_PROG_CC])dnl _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl # If no C compiler was specified, use CC. LTCC=${LTCC-"$CC"} # If no C compiler flags were specified, use CFLAGS. LTCFLAGS=${LTCFLAGS-"$CFLAGS"} # Allow CC to be a program name with arguments. compiler=$CC ])# _LT_TAG_COMPILER # _LT_COMPILER_BOILERPLATE # ------------------------ # Check for compiler boilerplate output or warnings with # the simple compiler test code. m4_defun([_LT_COMPILER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_compile_test_code" >conftest.$ac_ext eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_compiler_boilerplate=`cat conftest.err` $RM conftest* ])# _LT_COMPILER_BOILERPLATE # _LT_LINKER_BOILERPLATE # ---------------------- # Check for linker boilerplate output or warnings with # the simple link test code. m4_defun([_LT_LINKER_BOILERPLATE], [m4_require([_LT_DECL_SED])dnl ac_outfile=conftest.$ac_objext echo "$lt_simple_link_test_code" >conftest.$ac_ext eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err _lt_linker_boilerplate=`cat conftest.err` $RM -r conftest* ])# _LT_LINKER_BOILERPLATE # _LT_REQUIRED_DARWIN_CHECKS # ------------------------- m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ case $host_os in rhapsody* | darwin*) AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) AC_CHECK_TOOL([LIPO], [lipo], [:]) AC_CHECK_TOOL([OTOOL], [otool], [:]) AC_CHECK_TOOL([OTOOL64], [otool64], [:]) _LT_DECL([], [DSYMUTIL], [1], [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) _LT_DECL([], [NMEDIT], [1], [Tool to change global to local symbols on Mac OS X]) _LT_DECL([], [LIPO], [1], [Tool to manipulate fat objects and archives on Mac OS X]) _LT_DECL([], [OTOOL], [1], [ldd/readelf like tool for Mach-O binaries on Mac OS X]) _LT_DECL([], [OTOOL64], [1], [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], [lt_cv_apple_cc_single_mod=no if test -z "${LT_MULTI_MODULE}"; then # By default we will add the -single_module flag. You can override # by either setting the environment variable LT_MULTI_MODULE # non-empty at configure time, or by adding -multi_module to the # link flags. rm -rf libconftest.dylib* echo "int foo(void){return 1;}" > conftest.c echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ -dynamiclib -Wl,-single_module conftest.c 2>conftest.err _lt_result=$? # If there is a non-empty error log, and "single_module" # appears in it, assume the flag caused a linker warning if test -s conftest.err && $GREP single_module conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD # Otherwise, if the output was created with a 0 exit code from # the compiler, it worked. elif test -f libconftest.dylib && test $_lt_result -eq 0; then lt_cv_apple_cc_single_mod=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -rf libconftest.dylib* rm -f conftest.* fi]) AC_CACHE_CHECK([for -exported_symbols_list linker flag], [lt_cv_ld_exported_symbols_list], [lt_cv_ld_exported_symbols_list=no save_LDFLAGS=$LDFLAGS echo "_main" > conftest.sym LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [lt_cv_ld_exported_symbols_list=yes], [lt_cv_ld_exported_symbols_list=no]) LDFLAGS="$save_LDFLAGS" ]) AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load], [lt_cv_ld_force_load=no cat > conftest.c << _LT_EOF int forced_loaded() { return 2;} _LT_EOF echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD cat > conftest.c << _LT_EOF int main() { return 0;} _LT_EOF echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD $LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err _lt_result=$? if test -s conftest.err && $GREP force_load conftest.err; then cat conftest.err >&AS_MESSAGE_LOG_FD elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then lt_cv_ld_force_load=yes else cat conftest.err >&AS_MESSAGE_LOG_FD fi rm -f conftest.err libconftest.a conftest conftest.c rm -rf conftest.dSYM ]) case $host_os in rhapsody* | darwin1.[[012]]) _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; darwin1.*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; darwin*) # darwin 5.x on # if running on 10.5 or later, the deployment target defaults # to the OS version, if on x86, and 10.4, the deployment # target defaults to 10.4. Don't you love it? case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; 10.[[012]]*) _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; 10.*) _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; esac ;; esac if test "$lt_cv_apple_cc_single_mod" = "yes"; then _lt_dar_single_mod='$single_module' fi if test "$lt_cv_ld_exported_symbols_list" = "yes"; then _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' else _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' fi if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then _lt_dsymutil='~$DSYMUTIL $lib || :' else _lt_dsymutil= fi ;; esac ]) # _LT_DARWIN_LINKER_FEATURES([TAG]) # --------------------------------- # Checks for linker and compiler features on darwin m4_defun([_LT_DARWIN_LINKER_FEATURES], [ m4_require([_LT_REQUIRED_DARWIN_CHECKS]) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported if test "$lt_cv_ld_force_load" = "yes"; then _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`' m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes], [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes]) else _LT_TAGVAR(whole_archive_flag_spec, $1)='' fi _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" case $cc_basename in ifort*) _lt_dar_can_shared=yes ;; *) _lt_dar_can_shared=$GCC ;; esac if test "$_lt_dar_can_shared" = "yes"; then output_verbose_link_cmd=func_echo_all _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" m4_if([$1], [CXX], [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" fi ],[]) else _LT_TAGVAR(ld_shlibs, $1)=no fi ]) # _LT_SYS_MODULE_PATH_AIX([TAGNAME]) # ---------------------------------- # Links a minimal program and checks the executable # for the system default hardcoded library path. In most cases, # this is /usr/lib:/lib, but when the MPI compilers are used # the location of the communication and MPI libs are included too. # If we don't find anything, use the default library path according # to the aix ld manual. # Store the results from the different compilers for each TAGNAME. # Allow to override them for all tags through lt_cv_aix_libpath. m4_defun([_LT_SYS_MODULE_PATH_AIX], [m4_require([_LT_DECL_SED])dnl if test "${lt_cv_aix_libpath+set}" = set; then aix_libpath=$lt_cv_aix_libpath else AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])], [AC_LINK_IFELSE([AC_LANG_PROGRAM],[ lt_aix_libpath_sed='[ /Import File Strings/,/^$/ { /^0/ { s/^0 *\([^ ]*\) *$/\1/ p } }]' _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` # Check for a 64-bit object if we didn't find anything. if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` fi],[]) if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib" fi ]) aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1]) fi ])# _LT_SYS_MODULE_PATH_AIX # _LT_SHELL_INIT(ARG) # ------------------- m4_define([_LT_SHELL_INIT], [m4_divert_text([M4SH-INIT], [$1 ])])# _LT_SHELL_INIT # _LT_PROG_ECHO_BACKSLASH # ----------------------- # Find how we can fake an echo command that does not interpret backslash. # In particular, with Autoconf 2.60 or later we add some code to the start # of the generated configure script which will find a shell with a builtin # printf (which we can use as an echo command). m4_defun([_LT_PROG_ECHO_BACKSLASH], [ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO AC_MSG_CHECKING([how to print strings]) # Test print first, because it will be a builtin if present. if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \ test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='print -r --' elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then ECHO='printf %s\n' else # Use this function as a fallback that always works. func_fallback_echo () { eval 'cat <<_LTECHO_EOF $[]1 _LTECHO_EOF' } ECHO='func_fallback_echo' fi # func_echo_all arg... # Invoke $ECHO with all args, space-separated. func_echo_all () { $ECHO "$*" } case "$ECHO" in printf*) AC_MSG_RESULT([printf]) ;; print*) AC_MSG_RESULT([print -r]) ;; *) AC_MSG_RESULT([cat]) ;; esac m4_ifdef([_AS_DETECT_SUGGESTED], [_AS_DETECT_SUGGESTED([ test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || ( ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO PATH=/empty FPATH=/empty; export PATH FPATH test "X`printf %s $ECHO`" = "X$ECHO" \ || test "X`print -r -- $ECHO`" = "X$ECHO" )])]) _LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts]) _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes]) ])# _LT_PROG_ECHO_BACKSLASH # _LT_WITH_SYSROOT # ---------------- AC_DEFUN([_LT_WITH_SYSROOT], [AC_MSG_CHECKING([for sysroot]) AC_ARG_WITH([sysroot], [ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the compiler's sysroot if not specified).], [], [with_sysroot=no]) dnl lt_sysroot will always be passed unquoted. We quote it here dnl in case the user passed a directory name. lt_sysroot= case ${with_sysroot} in #( yes) if test "$GCC" = yes; then lt_sysroot=`$CC --print-sysroot 2>/dev/null` fi ;; #( /*) lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"` ;; #( no|'') ;; #( *) AC_MSG_RESULT([${with_sysroot}]) AC_MSG_ERROR([The sysroot must be an absolute path.]) ;; esac AC_MSG_RESULT([${lt_sysroot:-no}]) _LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl [dependent libraries, and in which our libraries should be installed.])]) # _LT_ENABLE_LOCK # --------------- m4_defun([_LT_ENABLE_LOCK], [AC_ARG_ENABLE([libtool-lock], [AS_HELP_STRING([--disable-libtool-lock], [avoid locking (might break parallel builds)])]) test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes # Some flags need to be propagated to the compiler or linker for good # libtool support. case $host in ia64-*-hpux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.$ac_objext` in *ELF-32*) HPUX_IA64_MODE="32" ;; *ELF-64*) HPUX_IA64_MODE="64" ;; esac fi rm -rf conftest* ;; *-*-irix6*) # Find out which ABI we are using. echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then if test "$lt_cv_prog_gnu_ld" = yes; then case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -melf32bsmip" ;; *N32*) LD="${LD-ld} -melf32bmipn32" ;; *64-bit*) LD="${LD-ld} -melf64bmip" ;; esac else case `/usr/bin/file conftest.$ac_objext` in *32-bit*) LD="${LD-ld} -32" ;; *N32*) LD="${LD-ld} -n32" ;; *64-bit*) LD="${LD-ld} -64" ;; esac fi fi rm -rf conftest* ;; x86_64-*kfreebsd*-gnu|x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *32-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_i386" ;; ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; sparc64-*linux*) LD="${LD-ld} -m elf32_sparc" ;; esac ;; *64-bit*) case $host in x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; sparc*-*linux*) LD="${LD-ld} -m elf64_sparc" ;; esac ;; esac fi rm -rf conftest* ;; *-*-sco3.2v5*) # On SCO OpenServer 5, we need -belf to get full-featured binaries. SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -belf" AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, [AC_LANG_PUSH(C) AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no]) AC_LANG_POP]) if test x"$lt_cv_cc_needs_belf" != x"yes"; then # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf CFLAGS="$SAVE_CFLAGS" fi ;; *-*solaris*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext if AC_TRY_EVAL(ac_compile); then case `/usr/bin/file conftest.o` in *64-bit*) case $lt_cv_prog_gnu_ld in yes*) case $host in i?86-*-solaris*) LD="${LD-ld} -m elf_x86_64" ;; sparc*-*-solaris*) LD="${LD-ld} -m elf64_sparc" ;; esac # GNU ld 2.21 introduced _sol2 emulations. Use them if available. if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then LD="${LD-ld}_sol2" fi ;; *) if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then LD="${LD-ld} -64" fi ;; esac ;; esac fi rm -rf conftest* ;; esac need_locks="$enable_libtool_lock" ])# _LT_ENABLE_LOCK # _LT_PROG_AR # ----------- m4_defun([_LT_PROG_AR], [AC_CHECK_TOOLS(AR, [ar], false) : ${AR=ar} : ${AR_FLAGS=cru} _LT_DECL([], [AR], [1], [The archiver]) _LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive]) AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file], [lt_cv_ar_at_file=no AC_COMPILE_IFELSE([AC_LANG_PROGRAM], [echo conftest.$ac_objext > conftest.lst lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD' AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -eq 0; then # Ensure the archiver fails upon bogus file names. rm -f conftest.$ac_objext libconftest.a AC_TRY_EVAL([lt_ar_try]) if test "$ac_status" -ne 0; then lt_cv_ar_at_file=@ fi fi rm -f conftest.* libconftest.a ]) ]) if test "x$lt_cv_ar_at_file" = xno; then archiver_list_spec= else archiver_list_spec=$lt_cv_ar_at_file fi _LT_DECL([], [archiver_list_spec], [1], [How to feed a file listing to the archiver]) ])# _LT_PROG_AR # _LT_CMD_OLD_ARCHIVE # ------------------- m4_defun([_LT_CMD_OLD_ARCHIVE], [_LT_PROG_AR AC_CHECK_TOOL(STRIP, strip, :) test -z "$STRIP" && STRIP=: _LT_DECL([], [STRIP], [1], [A symbol stripping program]) AC_CHECK_TOOL(RANLIB, ranlib, :) test -z "$RANLIB" && RANLIB=: _LT_DECL([], [RANLIB], [1], [Commands used to install an old-style archive]) # Determine commands to create old-style static archives. old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs' old_postinstall_cmds='chmod 644 $oldlib' old_postuninstall_cmds= if test -n "$RANLIB"; then case $host_os in openbsd*) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib" ;; *) old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib" ;; esac old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib" fi case $host_os in darwin*) lock_old_archive_extraction=yes ;; *) lock_old_archive_extraction=no ;; esac _LT_DECL([], [old_postinstall_cmds], [2]) _LT_DECL([], [old_postuninstall_cmds], [2]) _LT_TAGDECL([], [old_archive_cmds], [2], [Commands used to build an old-style archive]) _LT_DECL([], [lock_old_archive_extraction], [0], [Whether to use a lock for old archive extraction]) ])# _LT_CMD_OLD_ARCHIVE # _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------------------- # Check whether the given compiler option works AC_DEFUN([_LT_COMPILER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4]) echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="$3" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. # The option is referenced via a variable to avoid confusing sed. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>conftest.err) ac_status=$? cat conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s "$ac_outfile"; then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings other than the usual output. $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi fi $RM conftest* ]) if test x"[$]$2" = xyes; then m4_if([$5], , :, [$5]) else m4_if([$6], , :, [$6]) fi ])# _LT_COMPILER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], []) # _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS, # [ACTION-SUCCESS], [ACTION-FAILURE]) # ---------------------------------------------------- # Check whether the given linker option works AC_DEFUN([_LT_LINKER_OPTION], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_SED])dnl AC_CACHE_CHECK([$1], [$2], [$2=no save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS $3" echo "$lt_simple_link_test_code" > conftest.$ac_ext if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then # The linker can only warn and ignore the option if not recognized # So say no if there are warnings if test -s conftest.err; then # Append any errors to the config.log. cat conftest.err 1>&AS_MESSAGE_LOG_FD $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2 if diff conftest.exp conftest.er2 >/dev/null; then $2=yes fi else $2=yes fi fi $RM -r conftest* LDFLAGS="$save_LDFLAGS" ]) if test x"[$]$2" = xyes; then m4_if([$4], , :, [$4]) else m4_if([$5], , :, [$5]) fi ])# _LT_LINKER_OPTION # Old name: AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], []) # LT_CMD_MAX_LEN #--------------- AC_DEFUN([LT_CMD_MAX_LEN], [AC_REQUIRE([AC_CANONICAL_HOST])dnl # find the maximum length of command line arguments AC_MSG_CHECKING([the maximum length of command line arguments]) AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl i=0 teststring="ABCD" case $build_os in msdosdjgpp*) # On DJGPP, this test can blow up pretty badly due to problems in libc # (any single argument exceeding 2000 bytes causes a buffer overrun # during glob expansion). Even if it were fixed, the result of this # check would be larger than it should be. lt_cv_sys_max_cmd_len=12288; # 12K is about right ;; gnu*) # Under GNU Hurd, this test is not required because there is # no limit to the length of command line arguments. # Libtool will interpret -1 as no limit whatsoever lt_cv_sys_max_cmd_len=-1; ;; cygwin* | mingw* | cegcc*) # On Win9x/ME, this test blows up -- it succeeds, but takes # about 5 minutes as the teststring grows exponentially. # Worse, since 9x/ME are not pre-emptively multitasking, # you end up with a "frozen" computer, even though with patience # the test eventually succeeds (with a max line length of 256k). # Instead, let's just punt: use the minimum linelength reported by # all of the supported platforms: 8192 (on NT/2K/XP). lt_cv_sys_max_cmd_len=8192; ;; mint*) # On MiNT this can take a long time and run out of memory. lt_cv_sys_max_cmd_len=8192; ;; amigaos*) # On AmigaOS with pdksh, this test takes hours, literally. # So we just punt and use a minimum line length of 8192. lt_cv_sys_max_cmd_len=8192; ;; netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` elif test -x /usr/sbin/sysctl; then lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax` else lt_cv_sys_max_cmd_len=65536 # usable default for all BSDs fi # And add a safety zone lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` ;; interix*) # We know the value 262144 and hardcode it with a safety zone (like BSD) lt_cv_sys_max_cmd_len=196608 ;; os2*) # The test takes a long time on OS/2. lt_cv_sys_max_cmd_len=8192 ;; osf*) # Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure # due to this test when exec_disable_arg_limit is 1 on Tru64. It is not # nice to cause kernel panics so lets avoid the loop below. # First set a reasonable default. lt_cv_sys_max_cmd_len=16384 # if test -x /sbin/sysconfig; then case `/sbin/sysconfig -q proc exec_disable_arg_limit` in *1*) lt_cv_sys_max_cmd_len=-1 ;; esac fi ;; sco3.2v5*) lt_cv_sys_max_cmd_len=102400 ;; sysv5* | sco5v6* | sysv4.2uw2*) kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null` if test -n "$kargmax"; then lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[ ]]//'` else lt_cv_sys_max_cmd_len=32768 fi ;; *) lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null` if test -n "$lt_cv_sys_max_cmd_len"; then lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4` lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3` else # Make teststring a little bigger before we do anything with it. # a 1K string should be a reasonable start. for i in 1 2 3 4 5 6 7 8 ; do teststring=$teststring$teststring done SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}} # If test is not a shell built-in, we'll probably end up computing a # maximum length that is only half of the actual maximum length, but # we can't tell. while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \ = "X$teststring$teststring"; } >/dev/null 2>&1 && test $i != 17 # 1/2 MB should be enough do i=`expr $i + 1` teststring=$teststring$teststring done # Only check the string length outside the loop. lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1` teststring= # Add a significant safety factor because C++ compilers can tack on # massive amounts of additional arguments before passing them to the # linker. It appears as though 1/2 is a usable value. lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2` fi ;; esac ]) if test -n $lt_cv_sys_max_cmd_len ; then AC_MSG_RESULT($lt_cv_sys_max_cmd_len) else AC_MSG_RESULT(none) fi max_cmd_len=$lt_cv_sys_max_cmd_len _LT_DECL([], [max_cmd_len], [0], [What is the maximum length of a command?]) ])# LT_CMD_MAX_LEN # Old name: AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], []) # _LT_HEADER_DLFCN # ---------------- m4_defun([_LT_HEADER_DLFCN], [AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl ])# _LT_HEADER_DLFCN # _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE, # ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING) # ---------------------------------------------------------------- m4_defun([_LT_TRY_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "$cross_compiling" = yes; then : [$4] else lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 lt_status=$lt_dlunknown cat > conftest.$ac_ext <<_LT_EOF [#line $LINENO "configure" #include "confdefs.h" #if HAVE_DLFCN_H #include #endif #include #ifdef RTLD_GLOBAL # define LT_DLGLOBAL RTLD_GLOBAL #else # ifdef DL_GLOBAL # define LT_DLGLOBAL DL_GLOBAL # else # define LT_DLGLOBAL 0 # endif #endif /* We may have to define LT_DLLAZY_OR_NOW in the command line if we find out it does not work in some platform. */ #ifndef LT_DLLAZY_OR_NOW # ifdef RTLD_LAZY # define LT_DLLAZY_OR_NOW RTLD_LAZY # else # ifdef DL_LAZY # define LT_DLLAZY_OR_NOW DL_LAZY # else # ifdef RTLD_NOW # define LT_DLLAZY_OR_NOW RTLD_NOW # else # ifdef DL_NOW # define LT_DLLAZY_OR_NOW DL_NOW # else # define LT_DLLAZY_OR_NOW 0 # endif # endif # endif # endif #endif /* When -fvisbility=hidden is used, assume the code has been annotated correspondingly for the symbols needed. */ #if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3)) int fnord () __attribute__((visibility("default"))); #endif int fnord () { return 42; } int main () { void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW); int status = $lt_dlunknown; if (self) { if (dlsym (self,"fnord")) status = $lt_dlno_uscore; else { if (dlsym( self,"_fnord")) status = $lt_dlneed_uscore; else puts (dlerror ()); } /* dlclose (self); */ } else puts (dlerror ()); return status; }] _LT_EOF if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null lt_status=$? case x$lt_status in x$lt_dlno_uscore) $1 ;; x$lt_dlneed_uscore) $2 ;; x$lt_dlunknown|x*) $3 ;; esac else : # compilation failed $3 fi fi rm -fr conftest* ])# _LT_TRY_DLOPEN_SELF # LT_SYS_DLOPEN_SELF # ------------------ AC_DEFUN([LT_SYS_DLOPEN_SELF], [m4_require([_LT_HEADER_DLFCN])dnl if test "x$enable_dlopen" != xyes; then enable_dlopen=unknown enable_dlopen_self=unknown enable_dlopen_self_static=unknown else lt_cv_dlopen=no lt_cv_dlopen_libs= case $host_os in beos*) lt_cv_dlopen="load_add_on" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ;; mingw* | pw32* | cegcc*) lt_cv_dlopen="LoadLibrary" lt_cv_dlopen_libs= ;; cygwin*) lt_cv_dlopen="dlopen" lt_cv_dlopen_libs= ;; darwin*) # if libdl is installed we need to link against it AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[ lt_cv_dlopen="dyld" lt_cv_dlopen_libs= lt_cv_dlopen_self=yes ]) ;; *) AC_CHECK_FUNC([shl_load], [lt_cv_dlopen="shl_load"], [AC_CHECK_LIB([dld], [shl_load], [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"], [AC_CHECK_FUNC([dlopen], [lt_cv_dlopen="dlopen"], [AC_CHECK_LIB([dl], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"], [AC_CHECK_LIB([svld], [dlopen], [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"], [AC_CHECK_LIB([dld], [dld_link], [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"]) ]) ]) ]) ]) ]) ;; esac if test "x$lt_cv_dlopen" != xno; then enable_dlopen=yes else enable_dlopen=no fi case $lt_cv_dlopen in dlopen) save_CPPFLAGS="$CPPFLAGS" test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" save_LDFLAGS="$LDFLAGS" wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" save_LIBS="$LIBS" LIBS="$lt_cv_dlopen_libs $LIBS" AC_CACHE_CHECK([whether a program can dlopen itself], lt_cv_dlopen_self, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes, lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross) ]) if test "x$lt_cv_dlopen_self" = xyes; then wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\" AC_CACHE_CHECK([whether a statically linked program can dlopen itself], lt_cv_dlopen_self_static, [dnl _LT_TRY_DLOPEN_SELF( lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=no, lt_cv_dlopen_self_static=cross) ]) fi CPPFLAGS="$save_CPPFLAGS" LDFLAGS="$save_LDFLAGS" LIBS="$save_LIBS" ;; esac case $lt_cv_dlopen_self in yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; *) enable_dlopen_self=unknown ;; esac case $lt_cv_dlopen_self_static in yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; *) enable_dlopen_self_static=unknown ;; esac fi _LT_DECL([dlopen_support], [enable_dlopen], [0], [Whether dlopen is supported]) _LT_DECL([dlopen_self], [enable_dlopen_self], [0], [Whether dlopen of programs is supported]) _LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0], [Whether dlopen of statically linked programs is supported]) ])# LT_SYS_DLOPEN_SELF # Old name: AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], []) # _LT_COMPILER_C_O([TAGNAME]) # --------------------------- # Check to see if options -c and -o are simultaneously supported by compiler. # This macro does not hard code the compiler like AC_PROG_CC_C_O. m4_defun([_LT_COMPILER_C_O], [m4_require([_LT_DECL_SED])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no $RM -r conftest 2>/dev/null mkdir conftest cd conftest mkdir out echo "$lt_simple_compile_test_code" > conftest.$ac_ext lt_compiler_flag="-o out/conftest2.$ac_objext" # Insert the option either (1) after the last *FLAGS variable, or # (2) before a word containing "conftest.", or (3) at the end. # Note that $ac_compile itself does not contain backslashes and begins # with a dollar sign (not a hyphen), so the echo should work correctly. lt_compile=`echo "$ac_compile" | $SED \ -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \ -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \ -e 's:$: $lt_compiler_flag:'` (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$lt_compile" 2>out/conftest.err) ac_status=$? cat out/conftest.err >&AS_MESSAGE_LOG_FD echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD if (exit $ac_status) && test -s out/conftest2.$ac_objext then # The compiler can only warn and ignore the option if not recognized # So say no if there are warnings $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2 if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes fi fi chmod u+w . 2>&AS_MESSAGE_LOG_FD $RM conftest* # SGI C++ compiler will create directory out/ii_files/ for # template instantiation test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files $RM out/* && rmdir out cd .. $RM -r conftest $RM conftest* ]) _LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1], [Does compiler simultaneously support -c and -o options?]) ])# _LT_COMPILER_C_O # _LT_COMPILER_FILE_LOCKS([TAGNAME]) # ---------------------------------- # Check to see if we can do hard links to lock some files if needed m4_defun([_LT_COMPILER_FILE_LOCKS], [m4_require([_LT_ENABLE_LOCK])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl _LT_COMPILER_C_O([$1]) hard_links="nottested" if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then # do not overwrite the value of need_locks provided by the user AC_MSG_CHECKING([if we can lock with hard links]) hard_links=yes $RM conftest* ln conftest.a conftest.b 2>/dev/null && hard_links=no touch conftest.a ln conftest.a conftest.b 2>&5 || hard_links=no ln conftest.a conftest.b 2>/dev/null && hard_links=no AC_MSG_RESULT([$hard_links]) if test "$hard_links" = no; then AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe]) need_locks=warn fi else need_locks=no fi _LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?]) ])# _LT_COMPILER_FILE_LOCKS # _LT_CHECK_OBJDIR # ---------------- m4_defun([_LT_CHECK_OBJDIR], [AC_CACHE_CHECK([for objdir], [lt_cv_objdir], [rm -f .libs 2>/dev/null mkdir .libs 2>/dev/null if test -d .libs; then lt_cv_objdir=.libs else # MS-DOS does not allow filenames that begin with a dot. lt_cv_objdir=_libs fi rmdir .libs 2>/dev/null]) objdir=$lt_cv_objdir _LT_DECL([], [objdir], [0], [The name of the directory that contains temporary libtool files])dnl m4_pattern_allow([LT_OBJDIR])dnl AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/", [Define to the sub-directory in which libtool stores uninstalled libraries.]) ])# _LT_CHECK_OBJDIR # _LT_LINKER_HARDCODE_LIBPATH([TAGNAME]) # -------------------------------------- # Check hardcoding attributes. m4_defun([_LT_LINKER_HARDCODE_LIBPATH], [AC_MSG_CHECKING([how to hardcode library paths into programs]) _LT_TAGVAR(hardcode_action, $1)= if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" || test -n "$_LT_TAGVAR(runpath_var, $1)" || test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then # We can hardcode non-existent directories. if test "$_LT_TAGVAR(hardcode_direct, $1)" != no && # If the only mechanism to avoid hardcoding is shlibpath_var, we # have to relink, otherwise we might link with an installed library # when we should be linking with a yet-to-be-installed one ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no && test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then # Linking always hardcodes the temporary library directory. _LT_TAGVAR(hardcode_action, $1)=relink else # We can link without hardcoding, and we can hardcode nonexisting dirs. _LT_TAGVAR(hardcode_action, $1)=immediate fi else # We cannot hardcode anything, or else we can only hardcode existing # directories. _LT_TAGVAR(hardcode_action, $1)=unsupported fi AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)]) if test "$_LT_TAGVAR(hardcode_action, $1)" = relink || test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then # Fast installation is not supported enable_fast_install=no elif test "$shlibpath_overrides_runpath" = yes || test "$enable_shared" = no; then # Fast installation is not necessary enable_fast_install=needless fi _LT_TAGDECL([], [hardcode_action], [0], [How to hardcode a shared library path into an executable]) ])# _LT_LINKER_HARDCODE_LIBPATH # _LT_CMD_STRIPLIB # ---------------- m4_defun([_LT_CMD_STRIPLIB], [m4_require([_LT_DECL_EGREP]) striplib= old_striplib= AC_MSG_CHECKING([whether stripping libraries is possible]) if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" AC_MSG_RESULT([yes]) else # FIXME - insert some real tests, host_os isn't really good enough case $host_os in darwin*) if test -n "$STRIP" ; then striplib="$STRIP -x" old_striplib="$STRIP -S" AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) fi ;; *) AC_MSG_RESULT([no]) ;; esac fi _LT_DECL([], [old_striplib], [1], [Commands to strip libraries]) _LT_DECL([], [striplib], [1]) ])# _LT_CMD_STRIPLIB # _LT_SYS_DYNAMIC_LINKER([TAG]) # ----------------------------- # PORTME Fill in your ld.so characteristics m4_defun([_LT_SYS_DYNAMIC_LINKER], [AC_REQUIRE([AC_CANONICAL_HOST])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_OBJDUMP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CHECK_SHELL_FEATURES])dnl AC_MSG_CHECKING([dynamic linker characteristics]) m4_if([$1], [], [ if test "$GCC" = yes; then case $host_os in darwin*) lt_awk_arg="/^libraries:/,/LR/" ;; *) lt_awk_arg="/^libraries:/" ;; esac case $host_os in mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;; *) lt_sed_strip_eq="s,=/,/,g" ;; esac lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq` case $lt_search_path_spec in *\;*) # if the path contains ";" then we assume it to be the separator # otherwise default to the standard path separator (i.e. ":") - it is # assumed that no part of a normal pathname contains ";" but that should # okay in the real world where ";" in dirpaths is itself problematic. lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'` ;; *) lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"` ;; esac # Ok, now we have the path, separated by spaces, we can step through it # and add multilib dir if necessary. lt_tmp_lt_search_path_spec= lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null` for lt_sys_path in $lt_search_path_spec; do if test -d "$lt_sys_path/$lt_multi_os_dir"; then lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir" else test -d "$lt_sys_path" && \ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path" fi done lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk ' BEGIN {RS=" "; FS="/|\n";} { lt_foo=""; lt_count=0; for (lt_i = NF; lt_i > 0; lt_i--) { if ($lt_i != "" && $lt_i != ".") { if ($lt_i == "..") { lt_count++; } else { if (lt_count == 0) { lt_foo="/" $lt_i lt_foo; } else { lt_count--; } } } } if (lt_foo != "") { lt_freq[[lt_foo]]++; } if (lt_freq[[lt_foo]] == 1) { print lt_foo; } }'` # AWK program above erroneously prepends '/' to C:/dos/paths # for these hosts. case $host_os in mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\ $SED 's,/\([[A-Za-z]]:\),\1,g'` ;; esac sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP` else sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" fi]) library_names_spec= libname_spec='lib$name' soname_spec= shrext_cmds=".so" postinstall_cmds= postuninstall_cmds= finish_cmds= finish_eval= shlibpath_var= shlibpath_overrides_runpath=unknown version_type=none dynamic_linker="$host_os ld.so" sys_lib_dlsearch_path_spec="/lib /usr/lib" need_lib_prefix=unknown hardcode_into_libs=no # when you set need_version to no, make sure it does not cause -set_version # flags to be left without arguments need_version=unknown case $host_os in aix3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a' shlibpath_var=LIBPATH # AIX 3 has no versioning support, so we append a major version to the name. soname_spec='${libname}${release}${shared_ext}$major' ;; aix[[4-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no hardcode_into_libs=yes if test "$host_cpu" = ia64; then # AIX 5 supports IA64 library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH else # With GCC up to 2.95.x, collect2 would create an import file # for dependence libraries. The import file would start with # the line `#! .'. This would cause the generated library to # depend on `.', always an invalid library. This was fixed in # development snapshots of GCC prior to 3.0. case $host_os in aix4 | aix4.[[01]] | aix4.[[01]].*) if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)' echo ' yes ' echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then : else can_build_shared=no fi ;; esac # AIX (on Power*) has no versioning support, so currently we can not hardcode correct # soname into executable. Probably we can add versioning support to # collect2, so additional links can be useful in future. if test "$aix_use_runtimelinking" = yes; then # If using run time linking (on AIX 4.2 or later) use lib.so # instead of lib.a to let people know that these are not # typical AIX shared libraries. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' else # We preserve .a as extension for shared libraries through AIX4.2 # and later when we are not doing run time linking. library_names_spec='${libname}${release}.a $libname.a' soname_spec='${libname}${release}${shared_ext}$major' fi shlibpath_var=LIBPATH fi ;; amigaos*) case $host_cpu in powerpc) # Since July 2007 AmigaOS4 officially supports .so libraries. # When compiling the executable, add -use-dynld -Lsobjs: to the compileline. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' ;; m68k) library_names_spec='$libname.ixlibrary $libname.a' # Create ${libname}_ixlibrary.a entries in /sys/libs. finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done' ;; esac ;; beos*) library_names_spec='${libname}${shared_ext}' dynamic_linker="$host_os ld.so" shlibpath_var=LIBRARY_PATH ;; bsdi[[45]]*) version_type=linux # correct to gnu/linux during the next big refactor need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" # the default ld.so.conf also contains /usr/contrib/lib and # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow # libtool to hard-code these into programs ;; cygwin* | mingw* | pw32* | cegcc*) version_type=windows shrext_cmds=".dll" need_version=no need_lib_prefix=no case $GCC,$cc_basename in yes,*) # gcc library_names_spec='$libname.dll.a' # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname~ chmod a+x \$dldir/$dlname~ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then eval '\''$striplib \$dldir/$dlname'\'' || exit \$?; fi' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes case $host_os in cygwin*) # Cygwin DLLs use 'cyg' prefix rather than 'lib' soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"]) ;; mingw* | cegcc*) # MinGW DLLs use traditional 'lib' prefix soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; pw32*) # pw32 DLLs use 'pw' prefix rather than 'lib' library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' ;; esac dynamic_linker='Win32 ld.exe' ;; *,cl*) # Native MSVC libname_spec='$name' soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}' library_names_spec='${libname}.dll.lib' case $build_os in mingw*) sys_lib_search_path_spec= lt_save_ifs=$IFS IFS=';' for lt_path in $LIB do IFS=$lt_save_ifs # Let DOS variable expansion print the short 8.3 style file name. lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"` sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path" done IFS=$lt_save_ifs # Convert to MSYS style. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'` ;; cygwin*) # Convert to unix form, then to dos form, then back to unix form # but this time dos style (no spaces!) so that the unix form looks # like /cygdrive/c/PROGRA~1:/cygdr... sys_lib_search_path_spec=`cygpath --path --unix "$LIB"` sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null` sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` ;; *) sys_lib_search_path_spec="$LIB" if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then # It is most probably a Windows format PATH. sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'` else sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"` fi # FIXME: find the short name or the path components, as spaces are # common. (e.g. "Program Files" -> "PROGRA~1") ;; esac # DLL is installed to $(libdir)/../bin by postinstall_cmds postinstall_cmds='base_file=`basename \${file}`~ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~ dldir=$destdir/`dirname \$dlpath`~ test -d \$dldir || mkdir -p \$dldir~ $install_prog $dir/$dlname \$dldir/$dlname' postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~ dlpath=$dir/\$dldll~ $RM \$dlpath' shlibpath_overrides_runpath=yes dynamic_linker='Win32 link.exe' ;; *) # Assume MSVC wrapper library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib' dynamic_linker='Win32 ld.exe' ;; esac # FIXME: first we should search . and the directory the executable is in shlibpath_var=PATH ;; darwin* | rhapsody*) dynamic_linker="$host_os dyld" version_type=darwin need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext' soname_spec='${libname}${release}${major}$shared_ext' shlibpath_overrides_runpath=yes shlibpath_var=DYLD_LIBRARY_PATH shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`' m4_if([$1], [],[ sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"]) sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib' ;; dgux*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. if test -x /usr/bin/objformat; then objformat=`/usr/bin/objformat` else case $host_os in freebsd[[23]].*) objformat=aout ;; *) objformat=elf ;; esac fi version_type=freebsd-$objformat case $version_type in freebsd-elf*) library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' need_version=no need_lib_prefix=no ;; freebsd-*) library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' need_version=yes ;; esac shlibpath_var=LD_LIBRARY_PATH case $host_os in freebsd2.*) shlibpath_overrides_runpath=yes ;; freebsd3.[[01]]* | freebsdelf3.[[01]]*) shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \ freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1) shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; *) # from 4.6 on, and DragonFly shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; esac ;; haiku*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no dynamic_linker="$host_os runtime_loader" library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LIBRARY_PATH shlibpath_overrides_runpath=yes sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib' hardcode_into_libs=yes ;; hpux9* | hpux10* | hpux11*) # Give a soname corresponding to the major version so that dld.sl refuses to # link against other versions. version_type=sunos need_lib_prefix=no need_version=no case $host_cpu in ia64*) shrext_cmds='.so' hardcode_into_libs=yes dynamic_linker="$host_os dld.so" shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' if test "X$HPUX_IA64_MODE" = X32; then sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib" else sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64" fi sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; hppa*64*) shrext_cmds='.sl' hardcode_into_libs=yes dynamic_linker="$host_os dld.sl" shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH shlibpath_overrides_runpath=yes # Unless +noenvvar is specified. library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64" sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec ;; *) shrext_cmds='.sl' dynamic_linker="$host_os dld.sl" shlibpath_var=SHLIB_PATH shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' ;; esac # HP-UX runs *really* slowly unless shared libraries are mode 555, ... postinstall_cmds='chmod 555 $lib' # or fails outright, so override atomically: install_override_mode=555 ;; interix[[3-9]]*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; irix5* | irix6* | nonstopux*) case $host_os in nonstopux*) version_type=nonstopux ;; *) if test "$lt_cv_prog_gnu_ld" = yes; then version_type=linux # correct to gnu/linux during the next big refactor else version_type=irix fi ;; esac need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}' case $host_os in irix5* | nonstopux*) libsuff= shlibsuff= ;; *) case $LD in # libtool.m4 will add one of these switches to LD *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ") libsuff= shlibsuff= libmagic=32-bit;; *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ") libsuff=64 shlibsuff=64 libmagic=64-bit;; *) libsuff= shlibsuff= libmagic=never-match;; esac ;; esac shlibpath_var=LD_LIBRARY${shlibsuff}_PATH shlibpath_overrides_runpath=no sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" hardcode_into_libs=yes ;; # No shared lib support for Linux oldld, aout, or coff. linux*oldld* | linux*aout* | linux*coff*) dynamic_linker=no ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no # Some binutils ld are patched to set DT_RUNPATH AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath], [lt_cv_shlibpath_overrides_runpath=no save_LDFLAGS=$LDFLAGS save_libdir=$libdir eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \ LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\"" AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null], [lt_cv_shlibpath_overrides_runpath=yes])]) LDFLAGS=$save_LDFLAGS libdir=$save_libdir ]) shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath # This implies no fast_install, which is unacceptable. # Some rework will be needed to allow for fast_install # before this can be enabled. hardcode_into_libs=yes # Append ld.so.conf contents to the search path if test -f /etc/ld.so.conf; then lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '` sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra" fi # We used to test for /lib/ld.so.1 and disable shared libraries on # powerpc, because MkLinux only supported shared libraries with the # GNU dynamic linker. Since this was broken with cross compilers, # most powerpc-linux boxes support dynamic linking these days and # people can always --disable-shared, the test was removed, and we # assume the GNU/Linux dynamic linker is in use. dynamic_linker='GNU/Linux ld.so' ;; netbsdelf*-gnu) version_type=linux need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='NetBSD ld.elf_so' ;; netbsd*) version_type=sunos need_lib_prefix=no need_version=no if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' dynamic_linker='NetBSD (a.out) ld.so' else library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' dynamic_linker='NetBSD ld.elf_so' fi shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes ;; newsos6) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes ;; *nto* | *qnx*) version_type=qnx need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes dynamic_linker='ldqnx.so' ;; openbsd*) version_type=sunos sys_lib_dlsearch_path_spec="/usr/lib" need_lib_prefix=no # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs. case $host_os in openbsd3.3 | openbsd3.3.*) need_version=yes ;; *) need_version=no ;; esac library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' shlibpath_var=LD_LIBRARY_PATH if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then case $host_os in openbsd2.[[89]] | openbsd2.[[89]].*) shlibpath_overrides_runpath=no ;; *) shlibpath_overrides_runpath=yes ;; esac else shlibpath_overrides_runpath=yes fi ;; os2*) libname_spec='$name' shrext_cmds=".dll" need_lib_prefix=no library_names_spec='$libname${shared_ext} $libname.a' dynamic_linker='OS/2 ld.exe' shlibpath_var=LIBPATH ;; osf3* | osf4* | osf5*) version_type=osf need_lib_prefix=no need_version=no soname_spec='${libname}${release}${shared_ext}$major' library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" ;; rdos*) dynamic_linker=no ;; solaris*) version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes # ldd complains unless libraries are executable postinstall_cmds='chmod +x $lib' ;; sunos4*) version_type=sunos library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix' finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes if test "$with_gnu_ld" = yes; then need_lib_prefix=no fi need_version=yes ;; sysv4 | sysv4.3*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH case $host_vendor in sni) shlibpath_overrides_runpath=no need_lib_prefix=no runpath_var=LD_RUN_PATH ;; siemens) need_lib_prefix=no ;; motorola) need_lib_prefix=no need_version=no shlibpath_overrides_runpath=no sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' ;; esac ;; sysv4*MP*) if test -d /usr/nec ;then version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}' soname_spec='$libname${shared_ext}.$major' shlibpath_var=LD_LIBRARY_PATH fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) version_type=freebsd-elf need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=yes hardcode_into_libs=yes if test "$with_gnu_ld" = yes; then sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib' else sys_lib_search_path_spec='/usr/ccs/lib /usr/lib' case $host_os in sco3.2v5*) sys_lib_search_path_spec="$sys_lib_search_path_spec /lib" ;; esac fi sys_lib_dlsearch_path_spec='/usr/lib' ;; tpf*) # TPF is a cross-target only. Preferred cross-host = GNU/Linux. version_type=linux # correct to gnu/linux during the next big refactor need_lib_prefix=no need_version=no library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' shlibpath_var=LD_LIBRARY_PATH shlibpath_overrides_runpath=no hardcode_into_libs=yes ;; uts4*) version_type=linux # correct to gnu/linux during the next big refactor library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}' soname_spec='${libname}${release}${shared_ext}$major' shlibpath_var=LD_LIBRARY_PATH ;; *) dynamic_linker=no ;; esac AC_MSG_RESULT([$dynamic_linker]) test "$dynamic_linker" = no && can_build_shared=no variables_saved_for_relink="PATH $shlibpath_var $runpath_var" if test "$GCC" = yes; then variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH" fi if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec" fi if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec" fi _LT_DECL([], [variables_saved_for_relink], [1], [Variables whose values should be saved in libtool wrapper scripts and restored at link time]) _LT_DECL([], [need_lib_prefix], [0], [Do we need the "lib" prefix for modules?]) _LT_DECL([], [need_version], [0], [Do we need a version for libraries?]) _LT_DECL([], [version_type], [0], [Library versioning type]) _LT_DECL([], [runpath_var], [0], [Shared library runtime path variable]) _LT_DECL([], [shlibpath_var], [0],[Shared library path variable]) _LT_DECL([], [shlibpath_overrides_runpath], [0], [Is shlibpath searched before the hard-coded library search path?]) _LT_DECL([], [libname_spec], [1], [Format of library name prefix]) _LT_DECL([], [library_names_spec], [1], [[List of archive names. First name is the real one, the rest are links. The last name is the one that the linker finds with -lNAME]]) _LT_DECL([], [soname_spec], [1], [[The coded name of the library, if different from the real name]]) _LT_DECL([], [install_override_mode], [1], [Permission mode override for installation of shared libraries]) _LT_DECL([], [postinstall_cmds], [2], [Command to use after installation of a shared archive]) _LT_DECL([], [postuninstall_cmds], [2], [Command to use after uninstallation of a shared archive]) _LT_DECL([], [finish_cmds], [2], [Commands used to finish a libtool library installation in a directory]) _LT_DECL([], [finish_eval], [1], [[As "finish_cmds", except a single script fragment to be evaled but not shown]]) _LT_DECL([], [hardcode_into_libs], [0], [Whether we should hardcode library paths into libraries]) _LT_DECL([], [sys_lib_search_path_spec], [2], [Compile-time system search path for libraries]) _LT_DECL([], [sys_lib_dlsearch_path_spec], [2], [Run-time system search path for libraries]) ])# _LT_SYS_DYNAMIC_LINKER # _LT_PATH_TOOL_PREFIX(TOOL) # -------------------------- # find a file program which can recognize shared library AC_DEFUN([_LT_PATH_TOOL_PREFIX], [m4_require([_LT_DECL_EGREP])dnl AC_MSG_CHECKING([for $1]) AC_CACHE_VAL(lt_cv_path_MAGIC_CMD, [case $MAGIC_CMD in [[\\/*] | ?:[\\/]*]) lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path. ;; *) lt_save_MAGIC_CMD="$MAGIC_CMD" lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR dnl $ac_dummy forces splitting on constant user-supplied paths. dnl POSIX.2 word splitting is done only on the output of word expansions, dnl not every word. This closes a longstanding sh security hole. ac_dummy="m4_if([$2], , $PATH, [$2])" for ac_dir in $ac_dummy; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$1; then lt_cv_path_MAGIC_CMD="$ac_dir/$1" if test -n "$file_magic_test_file"; then case $deplibs_check_method in "file_magic "*) file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"` MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | $EGREP "$file_magic_regex" > /dev/null; then : else cat <<_LT_EOF 1>&2 *** Warning: the command libtool uses to detect shared libraries, *** $file_magic_cmd, produces output that libtool cannot recognize. *** The result is that libtool may fail to recognize shared libraries *** as such. This will affect the creation of libtool libraries that *** depend on shared libraries, but programs linked with such libtool *** libraries will work regardless of this problem. Nevertheless, you *** may want to report the problem to your system manager and/or to *** bug-libtool@gnu.org _LT_EOF fi ;; esac fi break fi done IFS="$lt_save_ifs" MAGIC_CMD="$lt_save_MAGIC_CMD" ;; esac]) MAGIC_CMD="$lt_cv_path_MAGIC_CMD" if test -n "$MAGIC_CMD"; then AC_MSG_RESULT($MAGIC_CMD) else AC_MSG_RESULT(no) fi _LT_DECL([], [MAGIC_CMD], [0], [Used to examine libraries when file_magic_cmd begins with "file"])dnl ])# _LT_PATH_TOOL_PREFIX # Old name: AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], []) # _LT_PATH_MAGIC # -------------- # find a file program which can recognize a shared library m4_defun([_LT_PATH_MAGIC], [_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH) if test -z "$lt_cv_path_MAGIC_CMD"; then if test -n "$ac_tool_prefix"; then _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH) else MAGIC_CMD=: fi fi ])# _LT_PATH_MAGIC # LT_PATH_LD # ---------- # find the pathname to the GNU or non-GNU linker AC_DEFUN([LT_PATH_LD], [AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PROG_ECHO_BACKSLASH])dnl AC_ARG_WITH([gnu-ld], [AS_HELP_STRING([--with-gnu-ld], [assume the C compiler uses GNU ld @<:@default=no@:>@])], [test "$withval" = no || with_gnu_ld=yes], [with_gnu_ld=no])dnl ac_prog=ld if test "$GCC" = yes; then # Check if gcc -print-prog-name=ld gives a path. AC_MSG_CHECKING([for ld used by $CC]) case $host in *-*-mingw*) # gcc leaves a trailing carriage return which upsets mingw ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; *) ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; esac case $ac_prog in # Accept absolute paths. [[\\/]]* | ?:[[\\/]]*) re_direlt='/[[^/]][[^/]]*/\.\./' # Canonicalize the pathname of ld ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'` while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"` done test -z "$LD" && LD="$ac_prog" ;; "") # If it fails, then pretend we aren't using GCC. ac_prog=ld ;; *) # If it is relative, then search for the first ld in PATH. with_gnu_ld=unknown ;; esac elif test "$with_gnu_ld" = yes; then AC_MSG_CHECKING([for GNU ld]) else AC_MSG_CHECKING([for non-GNU ld]) fi AC_CACHE_VAL(lt_cv_path_LD, [if test -z "$LD"; then lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then lt_cv_path_LD="$ac_dir/$ac_prog" # Check to see if the program is GNU ld. I'd rather use --version, # but apparently some variants of GNU ld only accept -v. # Break only if it was the GNU/non-GNU ld that we prefer. case `"$lt_cv_path_LD" -v 2>&1 &1 /dev/null 2>&1; then lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL' lt_cv_file_magic_cmd='func_win32_libid' else # Keep this pattern in sync with the one in func_win32_libid. lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' lt_cv_file_magic_cmd='$OBJDUMP -f' fi ;; cegcc*) # use the weaker test based on 'objdump'. See mingw*. lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?' lt_cv_file_magic_cmd='$OBJDUMP -f' ;; darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; esac else lt_cv_deplibs_check_method=pass_all fi ;; haiku*) lt_cv_deplibs_check_method=pass_all ;; hpux10.20* | hpux11*) lt_cv_file_magic_cmd=/usr/bin/file case $host_cpu in ia64*) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64' lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ;; hppa*64*) [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'] lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl ;; *) lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library' lt_cv_file_magic_test_file=/usr/lib/libc.sl ;; esac ;; interix[[3-9]]*) # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$' ;; irix5* | irix6* | nonstopux*) case $LD in *-32|*"-32 ") libmagic=32-bit;; *-n32|*"-n32 ") libmagic=N32;; *-64|*"-64 ") libmagic=64-bit;; *) libmagic=never-match;; esac lt_cv_deplibs_check_method=pass_all ;; # This must be glibc/ELF. linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) lt_cv_deplibs_check_method=pass_all ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$' fi ;; newos6*) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=/usr/lib/libnls.so ;; *nto* | *qnx*) lt_cv_deplibs_check_method=pass_all ;; openbsd*) if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$' else lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$' fi ;; osf3* | osf4* | osf5*) lt_cv_deplibs_check_method=pass_all ;; rdos*) lt_cv_deplibs_check_method=pass_all ;; solaris*) lt_cv_deplibs_check_method=pass_all ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*) lt_cv_deplibs_check_method=pass_all ;; sysv4 | sysv4.3*) case $host_vendor in motorola) lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]' lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*` ;; ncr) lt_cv_deplibs_check_method=pass_all ;; sequent) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )' ;; sni) lt_cv_file_magic_cmd='/bin/file' lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib" lt_cv_file_magic_test_file=/lib/libc.so ;; siemens) lt_cv_deplibs_check_method=pass_all ;; pc) lt_cv_deplibs_check_method=pass_all ;; esac ;; tpf*) lt_cv_deplibs_check_method=pass_all ;; esac ]) file_magic_glob= want_nocaseglob=no if test "$build" = "$host"; then case $host_os in mingw* | pw32*) if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then want_nocaseglob=yes else file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"` fi ;; esac fi file_magic_cmd=$lt_cv_file_magic_cmd deplibs_check_method=$lt_cv_deplibs_check_method test -z "$deplibs_check_method" && deplibs_check_method=unknown _LT_DECL([], [deplibs_check_method], [1], [Method to check whether dependent libraries are shared objects]) _LT_DECL([], [file_magic_cmd], [1], [Command to use when deplibs_check_method = "file_magic"]) _LT_DECL([], [file_magic_glob], [1], [How to find potential files when deplibs_check_method = "file_magic"]) _LT_DECL([], [want_nocaseglob], [1], [Find potential files using nocaseglob when deplibs_check_method = "file_magic"]) ])# _LT_CHECK_MAGIC_METHOD # LT_PATH_NM # ---------- # find the pathname to a BSD- or MS-compatible name lister AC_DEFUN([LT_PATH_NM], [AC_REQUIRE([AC_PROG_CC])dnl AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM, [if test -n "$NM"; then # Let the user override the test. lt_cv_path_NM="$NM" else lt_nm_to_check="${ac_tool_prefix}nm" if test -n "$ac_tool_prefix" && test "$build" = "$host"; then lt_nm_to_check="$lt_nm_to_check nm" fi for lt_tmp_nm in $lt_nm_to_check; do lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do IFS="$lt_save_ifs" test -z "$ac_dir" && ac_dir=. tmp_nm="$ac_dir/$lt_tmp_nm" if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then # Check to see if the nm accepts a BSD-compat flag. # Adding the `sed 1q' prevents false positives on HP-UX, which says: # nm: unknown option "B" ignored # Tru64's nm complains that /dev/null is an invalid object file case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in */dev/null* | *'Invalid file or object type'*) lt_cv_path_NM="$tmp_nm -B" break ;; *) case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in */dev/null*) lt_cv_path_NM="$tmp_nm -p" break ;; *) lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but continue # so that we can try to find one that supports BSD flags ;; esac ;; esac fi done IFS="$lt_save_ifs" done : ${lt_cv_path_NM=no} fi]) if test "$lt_cv_path_NM" != "no"; then NM="$lt_cv_path_NM" else # Didn't find any BSD compatible name lister, look for dumpbin. if test -n "$DUMPBIN"; then : # Let the user override the test. else AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :) case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in *COFF*) DUMPBIN="$DUMPBIN -symbols" ;; *) DUMPBIN=: ;; esac fi AC_SUBST([DUMPBIN]) if test "$DUMPBIN" != ":"; then NM="$DUMPBIN" fi fi test -z "$NM" && NM=nm AC_SUBST([NM]) _LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface], [lt_cv_nm_interface="BSD nm" echo "int some_variable = 0;" > conftest.$ac_ext (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD) (eval "$ac_compile" 2>conftest.err) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD) (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out) cat conftest.err >&AS_MESSAGE_LOG_FD (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD) cat conftest.out >&AS_MESSAGE_LOG_FD if $GREP 'External.*some_variable' conftest.out > /dev/null; then lt_cv_nm_interface="MS dumpbin" fi rm -f conftest*]) ])# LT_PATH_NM # Old names: AU_ALIAS([AM_PROG_NM], [LT_PATH_NM]) AU_ALIAS([AC_PROG_NM], [LT_PATH_NM]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AM_PROG_NM], []) dnl AC_DEFUN([AC_PROG_NM], []) # _LT_CHECK_SHAREDLIB_FROM_LINKLIB # -------------------------------- # how to determine the name of the shared library # associated with a specific link library. # -- PORTME fill in with the dynamic library characteristics m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB], [m4_require([_LT_DECL_EGREP]) m4_require([_LT_DECL_OBJDUMP]) m4_require([_LT_DECL_DLLTOOL]) AC_CACHE_CHECK([how to associate runtime and link libraries], lt_cv_sharedlib_from_linklib_cmd, [lt_cv_sharedlib_from_linklib_cmd='unknown' case $host_os in cygwin* | mingw* | pw32* | cegcc*) # two different shell functions defined in ltmain.sh # decide which to use based on capabilities of $DLLTOOL case `$DLLTOOL --help 2>&1` in *--identify-strict*) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib ;; *) lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback ;; esac ;; *) # fallback: assume linklib IS sharedlib lt_cv_sharedlib_from_linklib_cmd="$ECHO" ;; esac ]) sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO _LT_DECL([], [sharedlib_from_linklib_cmd], [1], [Command to associate shared and link libraries]) ])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB # _LT_PATH_MANIFEST_TOOL # ---------------------- # locate the manifest tool m4_defun([_LT_PATH_MANIFEST_TOOL], [AC_CHECK_TOOL(MANIFEST_TOOL, mt, :) test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool], [lt_cv_path_mainfest_tool=no echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out cat conftest.err >&AS_MESSAGE_LOG_FD if $GREP 'Manifest Tool' conftest.out > /dev/null; then lt_cv_path_mainfest_tool=yes fi rm -f conftest*]) if test "x$lt_cv_path_mainfest_tool" != xyes; then MANIFEST_TOOL=: fi _LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl ])# _LT_PATH_MANIFEST_TOOL # LT_LIB_M # -------- # check for math library AC_DEFUN([LT_LIB_M], [AC_REQUIRE([AC_CANONICAL_HOST])dnl LIBM= case $host in *-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*) # These system don't have libm, or don't need it ;; *-ncr-sysv4.3*) AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm") ;; *) AC_CHECK_LIB(m, cos, LIBM="-lm") ;; esac AC_SUBST([LIBM]) ])# LT_LIB_M # Old name: AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([AC_CHECK_LIBM], []) # _LT_COMPILER_NO_RTTI([TAGNAME]) # ------------------------------- m4_defun([_LT_COMPILER_NO_RTTI], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= if test "$GCC" = yes; then case $cc_basename in nvcc*) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;; *) _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;; esac _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions], lt_cv_prog_compiler_rtti_exceptions, [-fno-rtti -fno-exceptions], [], [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"]) fi _LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1], [Compiler flag to turn off builtin functions]) ])# _LT_COMPILER_NO_RTTI # _LT_CMD_GLOBAL_SYMBOLS # ---------------------- m4_defun([_LT_CMD_GLOBAL_SYMBOLS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_PROG_CC])dnl AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([LT_PATH_NM])dnl AC_REQUIRE([LT_PATH_LD])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_TAG_COMPILER])dnl # Check for command to grab the raw symbol name followed by C symbol from nm. AC_MSG_CHECKING([command to parse $NM output from $compiler object]) AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe], [ # These are sane defaults that work on at least a few old systems. # [They come from Ultrix. What could be older than Ultrix?!! ;)] # Character class describing NM global symbol codes. symcode='[[BCDEGRST]]' # Regexp to match symbols that can be accessed directly from C. sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)' # Define system-specific variables. case $host_os in aix*) symcode='[[BCDT]]' ;; cygwin* | mingw* | pw32* | cegcc*) symcode='[[ABCDGISTW]]' ;; hpux*) if test "$host_cpu" = ia64; then symcode='[[ABCDEGRST]]' fi ;; irix* | nonstopux*) symcode='[[BCDEGRST]]' ;; osf*) symcode='[[BCDEGQRST]]' ;; solaris*) symcode='[[BDRT]]' ;; sco3.2v5*) symcode='[[DT]]' ;; sysv4.2uw2*) symcode='[[DT]]' ;; sysv5* | sco5v6* | unixware* | OpenUNIX*) symcode='[[ABDT]]' ;; sysv4) symcode='[[DFNSTU]]' ;; esac # If we're using GNU nm, then use its standard symbol codes. case `$NM -V 2>&1` in *GNU* | *'with BFD'*) symcode='[[ABCDGIRSTW]]' ;; esac # Transform an extracted symbol line into a proper C declaration. # Some systems (esp. on ia64) link data and code symbols differently, # so use this general approach. lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'" # Transform an extracted symbol line into symbol name and symbol address lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'" lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'" # Handle CRLF in mingw tool chain opt_cr= case $build_os in mingw*) opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp ;; esac # Try without a prefix underscore, then with it. for ac_symprfx in "" "_"; do # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol. symxfrm="\\1 $ac_symprfx\\2 \\2" # Write the raw and C identifiers. if test "$lt_cv_nm_interface" = "MS dumpbin"; then # Fake it for dumpbin and say T for any non-static function # and D for any global variable. # Also find C++ and __fastcall symbols from MSVC++, # which start with @ or ?. lt_cv_sys_global_symbol_pipe="$AWK ['"\ " {last_section=section; section=\$ 3};"\ " /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\ " /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\ " \$ 0!~/External *\|/{next};"\ " / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\ " {if(hide[section]) next};"\ " {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\ " {split(\$ 0, a, /\||\r/); split(a[2], s)};"\ " s[1]~/^[@?]/{print s[1], s[1]; next};"\ " s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\ " ' prfx=^$ac_symprfx]" else lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'" fi lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'" # Check to see that the pipe works correctly. pipe_works=no rm -f conftest* cat > conftest.$ac_ext <<_LT_EOF #ifdef __cplusplus extern "C" { #endif char nm_test_var; void nm_test_func(void); void nm_test_func(void){} #ifdef __cplusplus } #endif int main(){nm_test_var='a';nm_test_func();return(0);} _LT_EOF if AC_TRY_EVAL(ac_compile); then # Now try to grab the symbols. nlist=conftest.nm if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then # Try sorting and uniquifying the output. if sort "$nlist" | uniq > "$nlist"T; then mv -f "$nlist"T "$nlist" else rm -f "$nlist"T fi # Make sure that we snagged all the symbols we need. if $GREP ' nm_test_var$' "$nlist" >/dev/null; then if $GREP ' nm_test_func$' "$nlist" >/dev/null; then cat <<_LT_EOF > conftest.$ac_ext /* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */ #if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE) /* DATA imports from DLLs on WIN32 con't be const, because runtime relocations are performed -- see ld's documentation on pseudo-relocs. */ # define LT@&t@_DLSYM_CONST #elif defined(__osf__) /* This system does not cope well with relocations in const data. */ # define LT@&t@_DLSYM_CONST #else # define LT@&t@_DLSYM_CONST const #endif #ifdef __cplusplus extern "C" { #endif _LT_EOF # Now generate the symbol file. eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext' cat <<_LT_EOF >> conftest.$ac_ext /* The mapping between symbol names and symbols. */ LT@&t@_DLSYM_CONST struct { const char *name; void *address; } lt__PROGRAM__LTX_preloaded_symbols[[]] = { { "@PROGRAM@", (void *) 0 }, _LT_EOF $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext cat <<\_LT_EOF >> conftest.$ac_ext {0, (void *) 0} }; /* This works around a problem in FreeBSD linker */ #ifdef FREEBSD_WORKAROUND static const void *lt_preloaded_setup() { return lt__PROGRAM__LTX_preloaded_symbols; } #endif #ifdef __cplusplus } #endif _LT_EOF # Now try linking the two files. mv conftest.$ac_objext conftstm.$ac_objext lt_globsym_save_LIBS=$LIBS lt_globsym_save_CFLAGS=$CFLAGS LIBS="conftstm.$ac_objext" CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)" if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then pipe_works=yes fi LIBS=$lt_globsym_save_LIBS CFLAGS=$lt_globsym_save_CFLAGS else echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD fi else echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD fi else echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD cat conftest.$ac_ext >&5 fi rm -rf conftest* conftst* # Do not use the global_symbol_pipe unless it works. if test "$pipe_works" = yes; then break else lt_cv_sys_global_symbol_pipe= fi done ]) if test -z "$lt_cv_sys_global_symbol_pipe"; then lt_cv_sys_global_symbol_to_cdecl= fi if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then AC_MSG_RESULT(failed) else AC_MSG_RESULT(ok) fi # Response file support. if test "$lt_cv_nm_interface" = "MS dumpbin"; then nm_file_list_spec='@' elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then nm_file_list_spec='@' fi _LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1], [Take the output of nm and produce a listing of raw symbols and C names]) _LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1], [Transform the output of nm in a proper C declaration]) _LT_DECL([global_symbol_to_c_name_address], [lt_cv_sys_global_symbol_to_c_name_address], [1], [Transform the output of nm in a C name address pair]) _LT_DECL([global_symbol_to_c_name_address_lib_prefix], [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1], [Transform the output of nm in a C name address pair when lib prefix is needed]) _LT_DECL([], [nm_file_list_spec], [1], [Specify filename containing input files for $NM]) ]) # _LT_CMD_GLOBAL_SYMBOLS # _LT_COMPILER_PIC([TAGNAME]) # --------------------------- m4_defun([_LT_COMPILER_PIC], [m4_require([_LT_TAG_COMPILER])dnl _LT_TAGVAR(lt_prog_compiler_wl, $1)= _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)= m4_if([$1], [CXX], [ # C++ specific cases for pic, static, wl, etc. if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; *djgpp*) # DJGPP does not support shared libraries at all _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac else case $host_os in aix[[4-9]]*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; chorus*) case $cc_basename in cxch68*) # Green Hills C++ Compiler # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a" ;; esac ;; mingw* | cygwin* | os2* | pw32* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; dgux*) case $cc_basename in ec++*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; ghcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; freebsd* | dragonfly*) # FreeBSD uses GNU C++ ;; hpux9* | hpux10* | hpux11*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' if test "$host_cpu" != ia64; then _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' fi ;; aCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac ;; *) ;; esac ;; interix*) # This is c89, which is MS Visual C++ (no shared libs) # Anyone wants to do a port? ;; irix5* | irix6* | nonstopux*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' # CC pic flag -KPIC is the default. ;; *) ;; esac ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # KAI C++ Compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; ecpc* ) # old Intel C++ for x86_64 which still supported -KPIC. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; icpc* ) # Intel C++, used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; pgCC* | pgcpp*) # Portland Group C++ compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; cxx*) # Compaq C++ # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL 8.0, 9.0 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; esac ;; esac ;; lynxos*) ;; m88k*) ;; mvs*) case $cc_basename in cxx*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall' ;; *) ;; esac ;; netbsd* | netbsdelf*-gnu) ;; *qnx* | *nto*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,' ;; RCC*) # Rational C++ 2.4.1 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; cxx*) # Digital/Compaq C++ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # Make sure the PIC flag is empty. It appears that all Alpha # Linux and Compaq Tru64 Unix objects are PIC. _LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; *) ;; esac ;; psos*) ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' ;; *) ;; esac ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; lcc*) # Lucid _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' ;; *) ;; esac ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) case $cc_basename in CC*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' ;; *) ;; esac ;; vxworks*) ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ], [ if test "$GCC" = yes; then _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' case $host_os in aix*) # All AIX code is PIC. if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; m68k) # FIXME: we need at least 68020 code to build shared libraries, but # adding the `-m68020' flag to GCC prevents building anything better, # like `-m68040'. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4' ;; esac ;; beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*) # PIC is the default for these OSes. ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). # Although the cygwin gcc ignores -fPIC, still need this for old-style # (--disable-auto-import) libraries m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; darwin* | rhapsody*) # PIC is the default on this platform # Common symbols not allowed in MH_DYLIB files _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common' ;; haiku*) # PIC is the default for Haiku. # The "-static" flag exists, but is broken. _LT_TAGVAR(lt_prog_compiler_static, $1)= ;; hpux*) # PIC is the default for 64-bit PA HP-UX, but not for 32-bit # PA HP-UX. On IA64 HP-UX, PIC is the default but the pic flag # sets the default TLS model and affects inlining. case $host_cpu in hppa*64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac ;; interix[[3-9]]*) # Interix 3.x gcc -fpic/-fPIC options generate broken code. # Instead, we relocate shared libraries at runtime. ;; msdosdjgpp*) # Just because we use GCC doesn't mean we suddenly get shared libraries # on systems that don't support them. _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no enable_shared=no ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic fi ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' ;; esac case $cc_basename in nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker ' if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)" fi ;; esac else # PORTME Check for flag to pass linker flags through the system compiler. case $host_os in aix*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' if test "$host_cpu" = ia64; then # AIX 5 now supports IA64 processor _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' else _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp' fi ;; mingw* | cygwin* | pw32* | os2* | cegcc*) # This hack is so that the source file can tell whether it is being # built for inclusion in a dll (and should export symbols for example). m4_if([$1], [GCJ], [], [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT']) ;; hpux9* | hpux10* | hpux11*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but # not for PA HP-UX. case $host_cpu in hppa*64*|ia64*) # +Z the default ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z' ;; esac # Is there a better lt_prog_compiler_static that works with the bundled CC? _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive' ;; irix5* | irix6* | nonstopux*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # PIC (with -KPIC) is the default. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in # old Intel for x86_64 which still supported -KPIC. ecc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # icc used to be incompatible with GCC. # ICC 10 doesn't accept -KPIC any more. icc* | ifort*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; # Lahey Fortran 8.1. lf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared' _LT_TAGVAR(lt_prog_compiler_static, $1)='--static' ;; nagfor*) # NAG Fortran compiler _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group compilers (*not* the Pentium gcc compiler, # which looks to be a dead project) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; ccc*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All Alpha code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; xl* | bgxl* | bgf* | mpixl*) # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink' ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*) # Sun Fortran 8.3 passes all unrecognized flags to the linker _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='' ;; *Sun\ F* | *Sun*Fortran*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' ;; *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' ;; *Intel*\ [[CF]]*Compiler*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-static' ;; *Portland\ Group*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; esac ;; esac ;; newsos6) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *nto* | *qnx*) # QNX uses GNU C++, but need to define -shared option too, otherwise # it will coredump. _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared' ;; osf3* | osf4* | osf5*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' # All OSF/1 code is PIC. _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; rdos*) _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared' ;; solaris*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' case $cc_basename in f77* | f90* | f95* | sunf77* | sunf90* | sunf95*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';; *) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';; esac ;; sunos4*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4 | sysv4.2uw2* | sysv4.3*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; sysv4*MP*) if test -d /usr/nec ;then _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' fi ;; sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; unicos*) _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,' _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; uts4*) _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic' _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic' ;; *) _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no ;; esac fi ]) case $host_os in # For platforms which do not support PIC, -DPIC is meaningless: *djgpp*) _LT_TAGVAR(lt_prog_compiler_pic, $1)= ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])" ;; esac AC_CACHE_CHECK([for $compiler option to produce PIC], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)], [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)]) _LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1) # # Check to make sure the PIC flag actually works. # if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works], [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)], [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [], [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in "" | " "*) ;; *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;; esac], [_LT_TAGVAR(lt_prog_compiler_pic, $1)= _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no]) fi _LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1], [Additional compiler flags for building library objects]) _LT_TAGDECL([wl], [lt_prog_compiler_wl], [1], [How to pass a linker flag through the compiler]) # # Check to make sure the static flag actually works. # wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\" _LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works], _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1), $lt_tmp_static_flag, [], [_LT_TAGVAR(lt_prog_compiler_static, $1)=]) _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1], [Compiler flag to prevent dynamic linking]) ])# _LT_COMPILER_PIC # _LT_LINKER_SHLIBS([TAGNAME]) # ---------------------------- # See if the linker supports building shared libraries. m4_defun([_LT_LINKER_SHLIBS], [AC_REQUIRE([LT_PATH_LD])dnl AC_REQUIRE([LT_PATH_NM])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_DECL_SED])dnl m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl m4_require([_LT_TAG_COMPILER])dnl AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) m4_if([$1], [CXX], [ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] case $host_os in aix[[4-9]]*) # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global defined # symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds" ;; cygwin* | mingw* | cegcc*) case $cc_basename in cl*) _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] ;; esac ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; *) _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' ;; esac ], [ runpath_var= _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_cmds, $1)= _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(old_archive_from_new_cmds, $1)= _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)= _LT_TAGVAR(thread_safe_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= # include_expsyms should be a list of space-separated symbols to be *always* # included in the symbol list _LT_TAGVAR(include_expsyms, $1)= # exclude_expsyms can be an extended regexp of symbols to exclude # it will be wrapped by ` (' and `)$', so one must not match beginning or # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', # as well as any symbol that contains `d'. _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'] # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out # platforms (ab)use it in PIC code, but their linkers get confused if # the symbol is explicitly referenced. Since portable code cannot # rely on this symbol name, it's probably fine to never include it in # preloaded symbol tables. # Exclude shared library initialization/finalization symbols. dnl Note also adjust exclude_expsyms for C++ above. extract_expsyms_cmds= case $host_os in cygwin* | mingw* | pw32* | cegcc*) # FIXME: the MSVC++ port hasn't been tested in a loooong time # When not using gcc, we currently assume that we are using # Microsoft Visual C++. if test "$GCC" != yes; then with_gnu_ld=no fi ;; interix*) # we just hope/assume this is gcc and not c89 (= MSVC++) with_gnu_ld=yes ;; openbsd*) with_gnu_ld=no ;; linux* | k*bsd*-gnu | gnu*) _LT_TAGVAR(link_all_deplibs, $1)=no ;; esac _LT_TAGVAR(ld_shlibs, $1)=yes # On some targets, GNU ld is compatible enough with the native linker # that we're better off using the native interface for both. lt_use_gnu_ld_interface=no if test "$with_gnu_ld" = yes; then case $host_os in aix*) # The AIX port of GNU ld has always aspired to compatibility # with the native linker. However, as the warning in the GNU ld # block says, versions before 2.19.5* couldn't really create working # shared libraries, regardless of the interface used. case `$LD -v 2>&1` in *\ \(GNU\ Binutils\)\ 2.19.5*) ;; *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;; *\ \(GNU\ Binutils\)\ [[3-9]]*) ;; *) lt_use_gnu_ld_interface=yes ;; esac ;; *) lt_use_gnu_ld_interface=yes ;; esac fi if test "$lt_use_gnu_ld_interface" = yes; then # If archive_cmds runs LD, not CC, wlarc should be empty wlarc='${wl}' # Set some defaults for GNU ld with shared library support. These # are reset later if shared libraries are not supported. Putting them # here allows them to be overridden if necessary. runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # ancient GNU ld didn't support --whole-archive et. al. if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi supports_anon_versioning=no case `$LD -v 2>&1` in *GNU\ gold*) supports_anon_versioning=yes ;; *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11 *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ... *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ... *\ 2.11.*) ;; # other 2.11 versions *) supports_anon_versioning=yes ;; esac # See if GNU ld supports shared libraries. case $host_os in aix[[3-9]]*) # On AIX/PPC, the GNU linker is very broken if test "$host_cpu" != ia64; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: the GNU linker, at least up to release 2.19, is reported *** to be unable to reliably create shared libraries on AIX. *** Therefore, libtool is disabling shared libraries support. If you *** really care for shared libraries, you may want to install binutils *** 2.20 or above, or modify your PATH so that a non-GNU linker is found. *** You will then need to restart the configuration process. _LT_EOF fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; cygwin* | mingw* | pw32* | cegcc*) # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols' _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'] if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu) tmp_diet=no if test "$host_os" = linux-dietlibc; then case $cc_basename in diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn) esac fi if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \ && test "$tmp_diet" = no then tmp_addflag=' $pic_flag' tmp_sharedflag='-shared' case $cc_basename,$host_cpu in pgcc*) # Portland Group C compiler _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag' ;; pgf77* | pgf90* | pgf95* | pgfortran*) # Portland Group f77 and f90 compilers _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' tmp_addflag=' $pic_flag -Mnomain' ;; ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64 tmp_addflag=' -i_dynamic' ;; efc*,ia64* | ifort*,ia64*) # Intel Fortran compiler on ia64 tmp_addflag=' -i_dynamic -nofor_main' ;; ifc* | ifort*) # Intel Fortran compiler tmp_addflag=' -nofor_main' ;; lf95*) # Lahey Fortran 8.1 _LT_TAGVAR(whole_archive_flag_spec, $1)= tmp_sharedflag='--shared' ;; xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below) tmp_sharedflag='-qmkshrobj' tmp_addflag= ;; nvcc*) # Cuda Compiler Driver 2.2 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes ;; esac case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C 5.9 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes tmp_sharedflag='-G' ;; *Sun\ F*) # Sun Fortran 8.3 tmp_sharedflag='-G' ;; esac _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi case $cc_basename in xlf* | bgf* | bgxlf* | mpixlf*) # IBM XL Fortran 10.1 on PPC cannot create shared libs itself _LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib' fi ;; esac else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib' wlarc= else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' fi ;; solaris*) if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: The releases 2.8.* of the GNU linker cannot reliably *** create shared libraries on Solaris systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.9.1 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*) case `$LD -v 2>&1` in *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*) _LT_TAGVAR(ld_shlibs, $1)=no cat <<_LT_EOF 1>&2 *** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not *** reliably create shared libraries on SCO systems. Therefore, libtool *** is disabling shared libraries support. We urge you to upgrade GNU *** binutils to release 2.16.91.0.3 or newer. Another option is to modify *** your PATH or compiler configuration so that the native linker is *** used, and then restart. _LT_EOF ;; *) # For security reasons, it is highly recommended that you always # use absolute paths for naming shared libraries, and exclude the # DT_RUNPATH tag from executables and libraries. But doing so # requires that you compile everything twice, which is a pain. if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; sunos4*) _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags' wlarc= _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then runpath_var= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else # PORTME fill in a description of your system's linker (not GNU ld) case $host_os in aix3*) _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname' # Note: this linker hardcodes the directories in LIBPATH if there # are no directories specified by -L. _LT_TAGVAR(hardcode_minus_L, $1)=yes if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then # Neither direct hardcoding nor static linking is supported with a # broken collect2. _LT_TAGVAR(hardcode_direct, $1)=unsupported fi ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else # If we're using GNU nm, then we don't want the "-C" option. # -C means demangle to AIX nm, but means don't demangle with GNU nm # Also, AIX nm treats weak defined symbols like other global # defined symbols, whereas GNU nm marks them as "W". if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' else _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols' fi aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then aix_use_runtimelinking=yes break fi done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GCC" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi ;; esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi _LT_TAGVAR(link_all_deplibs, $1)=no else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; amigaos*) case $host_cpu in powerpc) # see comment about AmigaOS4 .so support _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='' ;; m68k) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac ;; bsdi[[45]]*) _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic ;; cygwin* | mingw* | pw32* | cegcc*) # When not using gcc, we currently assume that we are using # Microsoft Visual C++. # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. case $cc_basename in cl*) # Native MSVC _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*' _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols' # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # Assume MSVC wrapper _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames=' # The linker will automatically build a .lib file if we build a DLL. _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' # FIXME: Should let the user specify the lib program. _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor # support. Future versions do this automatically, but an explicit c++rt0.o # does not break anything, and helps significantly (at the cost of a little # extra space). freebsd2.2*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # Unfortunately, older versions of FreeBSD 2 do not have this feature. freebsd2.*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; # FreeBSD 3 and greater uses gcc -shared to do shared libraries. freebsd* | dragonfly*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; hpux9*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; hpux10*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags' fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes fi ;; hpux11*) if test "$GCC" = yes && test "$with_gnu_ld" = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags' ;; esac else case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags' ;; *) m4_if($1, [], [ # Older versions of the 11.00 compiler do not understand -b yet # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does) _LT_LINKER_OPTION([if $CC understands -b], _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'], [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])], [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags']) ;; esac fi if test "$with_gnu_ld" = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # hardcode_minus_L: Not really in the search PATH, # but as the default location of the library. _LT_TAGVAR(hardcode_minus_L, $1)=yes ;; esac fi ;; irix5* | irix6* | nonstopux*) if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' # Try to use the -exported_symbol ld option, if it does not # work, assume that -exports_file does not work either and # implicitly export all symbols. # This should be the same for all languages, so no per-tag cache variable. AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol], [lt_cv_irix_exported_symbol], [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null" AC_LINK_IFELSE( [AC_LANG_SOURCE( [AC_LANG_CASE([C], [[int foo (void) { return 0; }]], [C++], [[int foo (void) { return 0; }]], [Fortran 77], [[ subroutine foo end]], [Fortran], [[ subroutine foo end]])])], [lt_cv_irix_exported_symbol=yes], [lt_cv_irix_exported_symbol=no]) LDFLAGS="$save_LDFLAGS"]) if test "$lt_cv_irix_exported_symbol" = yes; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib' fi else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes _LT_TAGVAR(link_all_deplibs, $1)=yes ;; netbsd* | netbsdelf*-gnu) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out else _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags' # ELF fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; newsos6) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *nto* | *qnx*) ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' else case $host_os in openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*) _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' ;; esac fi else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; os2*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def' _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def' ;; osf3*) if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; osf4* | osf5*) # as osf3* with the addition of -msym flag if test "$GCC" = yes; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' else _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~ $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp' # Both c and cxx compiler support -rpath directly _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' fi _LT_TAGVAR(archive_cmds_need_lc, $1)='no' _LT_TAGVAR(hardcode_libdir_separator, $1)=: ;; solaris*) _LT_TAGVAR(no_undefined_flag, $1)=' -z defs' if test "$GCC" = yes; then wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' else case `$CC -V 2>&1` in *"Compilers 5.0"*) wlarc='' _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp' ;; *) wlarc='${wl}' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp' ;; esac fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. GCC discards it without `$wl', # but is careful enough not to reorder. # Supported since Solaris 2.6 (maybe 2.5.1?) if test "$GCC" = yes; then _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' else _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' fi ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes ;; sunos4*) if test "x$host_vendor" = xsequent; then # Use $CC to link under sequent, because it throws in some extra .o # files that make .init and .fini sections work. _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4) case $host_vendor in sni) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true??? ;; siemens) ## LD is ld it makes a PLAMLIB ## CC just makes a GrossModule. _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs' _LT_TAGVAR(hardcode_direct, $1)=no ;; motorola) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie ;; esac runpath_var='LD_RUN_PATH' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; sysv4.3*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport' ;; sysv4*MP*) if test -d /usr/nec; then _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var=LD_RUN_PATH hardcode_runpath_var=yes _LT_TAGVAR(ld_shlibs, $1)=yes fi ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' if test "$GCC" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' else _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' fi ;; uts4*) _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(ld_shlibs, $1)=no ;; esac if test x$host_vendor = xsni; then case $host in sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym' ;; esac fi fi ]) AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld _LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl _LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl _LT_DECL([], [extract_expsyms_cmds], [2], [The commands to extract the exported symbol list from a shared archive]) # # Do we need to explicitly link libc? # case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in x|xyes) # Assume -lc should be added _LT_TAGVAR(archive_cmds_need_lc, $1)=yes if test "$enable_shared" = yes && test "$GCC" = yes; then case $_LT_TAGVAR(archive_cmds, $1) in *'~'*) # FIXME: we may have to deal with multi-command sequences. ;; '$CC '*) # Test whether the compiler implicitly links with -lc since on some # systems, -lgcc has to come before -lc. If gcc already passes -lc # to ld, don't add -lc before -lgcc. AC_CACHE_CHECK([whether -lc should be explicitly linked in], [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1), [$RM conftest* echo "$lt_simple_compile_test_code" > conftest.$ac_ext if AC_TRY_EVAL(ac_compile) 2>conftest.err; then soname=conftest lib=conftest libobjs=conftest.$ac_objext deplibs= wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1) compiler_flags=-v linker_flags=-v verstring= output_objdir=. libname=conftest lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1) _LT_TAGVAR(allow_undefined_flag, $1)= if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) then lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no else lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes fi _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag else cat conftest.err 1>&5 fi $RM conftest* ]) _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1) ;; esac fi ;; esac _LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0], [Whether or not to add -lc for building shared libraries]) _LT_TAGDECL([allow_libtool_libs_with_static_runtimes], [enable_shared_with_static_runtimes], [0], [Whether or not to disallow shared libs when runtime libs are static]) _LT_TAGDECL([], [export_dynamic_flag_spec], [1], [Compiler flag to allow reflexive dlopens]) _LT_TAGDECL([], [whole_archive_flag_spec], [1], [Compiler flag to generate shared objects directly from archives]) _LT_TAGDECL([], [compiler_needs_object], [1], [Whether the compiler copes with passing no objects directly]) _LT_TAGDECL([], [old_archive_from_new_cmds], [2], [Create an old-style archive from a shared archive]) _LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2], [Create a temporary old-style archive to link instead of a shared archive]) _LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive]) _LT_TAGDECL([], [archive_expsym_cmds], [2]) _LT_TAGDECL([], [module_cmds], [2], [Commands used to build a loadable module if different from building a shared archive.]) _LT_TAGDECL([], [module_expsym_cmds], [2]) _LT_TAGDECL([], [with_gnu_ld], [1], [Whether we are building with GNU ld or not]) _LT_TAGDECL([], [allow_undefined_flag], [1], [Flag that allows shared libraries with undefined symbols to be built]) _LT_TAGDECL([], [no_undefined_flag], [1], [Flag that enforces no undefined symbols]) _LT_TAGDECL([], [hardcode_libdir_flag_spec], [1], [Flag to hardcode $libdir into a binary during linking. This must work even if $libdir does not exist]) _LT_TAGDECL([], [hardcode_libdir_separator], [1], [Whether we need a single "-rpath" flag with a separated argument]) _LT_TAGDECL([], [hardcode_direct], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_direct_absolute], [0], [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes DIR into the resulting binary and the resulting library dependency is "absolute", i.e impossible to change by setting ${shlibpath_var} if the library is relocated]) _LT_TAGDECL([], [hardcode_minus_L], [0], [Set to "yes" if using the -LDIR flag during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_shlibpath_var], [0], [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into the resulting binary]) _LT_TAGDECL([], [hardcode_automatic], [0], [Set to "yes" if building a shared library automatically hardcodes DIR into the library and all subsequent libraries and executables linked against it]) _LT_TAGDECL([], [inherit_rpath], [0], [Set to yes if linker adds runtime paths of dependent libraries to runtime path list]) _LT_TAGDECL([], [link_all_deplibs], [0], [Whether libtool must link a program against all its dependency libraries]) _LT_TAGDECL([], [always_export_symbols], [0], [Set to "yes" if exported symbols are required]) _LT_TAGDECL([], [export_symbols_cmds], [2], [The commands to list exported symbols]) _LT_TAGDECL([], [exclude_expsyms], [1], [Symbols that should not be listed in the preloaded symbols]) _LT_TAGDECL([], [include_expsyms], [1], [Symbols that must always be exported]) _LT_TAGDECL([], [prelink_cmds], [2], [Commands necessary for linking programs (against libraries) with templates]) _LT_TAGDECL([], [postlink_cmds], [2], [Commands necessary for finishing linking programs]) _LT_TAGDECL([], [file_list_spec], [1], [Specify filename containing input files]) dnl FIXME: Not yet implemented dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1], dnl [Compiler flag to generate thread safe objects]) ])# _LT_LINKER_SHLIBS # _LT_LANG_C_CONFIG([TAG]) # ------------------------ # Ensure that the configuration variables for a C compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_C_CONFIG], [m4_require([_LT_DECL_EGREP])dnl lt_save_CC="$CC" AC_LANG_PUSH(C) # Source file extension for C test sources. ac_ext=c # Object file extension for compiled C test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(){return(0);}' _LT_TAG_COMPILER # Save the default compiler, since it gets overwritten when the other # tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP. compiler_DEFAULT=$CC # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) LT_SYS_DLOPEN_SELF _LT_CMD_STRIPLIB # Report which library types will actually be built AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_CONFIG($1) fi AC_LANG_POP CC="$lt_save_CC" ])# _LT_LANG_C_CONFIG # _LT_LANG_CXX_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a C++ compiler are suitably # defined. These variables are subsequently used by _LT_CONFIG to write # the compiler configuration to `libtool'. m4_defun([_LT_LANG_CXX_CONFIG], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl m4_require([_LT_DECL_EGREP])dnl m4_require([_LT_PATH_MANIFEST_TOOL])dnl if test -n "$CXX" && ( test "X$CXX" != "Xno" && ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) || (test "X$CXX" != "Xg++"))) ; then AC_PROG_CXXCPP else _lt_caught_CXX_error=yes fi AC_LANG_PUSH(C++) _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(compiler_needs_object, $1)=no _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for C++ test sources. ac_ext=cpp # Object file extension for compiled C++ test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the CXX compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_caught_CXX_error" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="int some_variable = 0;" # Code to be used in simple link tests lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_LD=$LD lt_save_GCC=$GCC GCC=$GXX lt_save_with_gnu_ld=$with_gnu_ld lt_save_path_LD=$lt_cv_path_LD if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx else $as_unset lt_cv_prog_gnu_ld fi if test -n "${lt_cv_path_LDCXX+set}"; then lt_cv_path_LD=$lt_cv_path_LDCXX else $as_unset lt_cv_path_LD fi test -z "${LDCXX+set}" || LD=$LDCXX CC=${CXX-"c++"} CFLAGS=$CXXFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then # We don't want -fno-exception when compiling C++ code, so set the # no_builtin_flag separately if test "$GXX" = yes; then _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' else _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)= fi if test "$GXX" = yes; then # Set up default GNU C++ configuration LT_PATH_LD # Check if GNU C++ uses GNU ld as the underlying linker, since the # archiving commands below assume that GNU ld is being used. if test "$with_gnu_ld" = yes; then _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # If archive_cmds runs LD, not CC, wlarc should be empty # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to # investigate it a little bit more. (MM) wlarc='${wl}' # ancient GNU ld didn't support --whole-archive et. al. if eval "`$CC -print-prog-name=ld` --help 2>&1" | $GREP 'no-whole-archive' > /dev/null; then _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' else _LT_TAGVAR(whole_archive_flag_spec, $1)= fi else with_gnu_ld=no wlarc= # A generic and very simple default shared library creation # command for GNU C++ for the case where it uses the native # linker, instead of GNU ld. If possible, this setting should # overridden to take advantage of the native linker features on # the platform it is being used on. _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' fi # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else GXX=no with_gnu_ld=no wlarc= fi # PORTME: fill in a description of your system's C++ link characteristics AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries]) _LT_TAGVAR(ld_shlibs, $1)=yes case $host_os in aix3*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aix[[4-9]]*) if test "$host_cpu" = ia64; then # On IA64, the linker does run time linking by default, so we don't # have to do anything special. aix_use_runtimelinking=no exp_sym_flag='-Bexport' no_entry_flag="" else aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal # AIX style linking. If -brtl is somewhere in LDFLAGS, we # need to do runtime linking. case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*) for ld_flag in $LDFLAGS; do case $ld_flag in *-brtl*) aix_use_runtimelinking=yes break ;; esac done ;; esac exp_sym_flag='-bexport' no_entry_flag='-bnoentry' fi # When large executables or shared objects are built, AIX ld can # have problems creating the table of contents. If linking a library # or program results in "error TOC overflow" add -mminimal-toc to # CXXFLAGS/CFLAGS for g++/gcc. In the cases where that is not # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS. _LT_TAGVAR(archive_cmds, $1)='' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(file_list_spec, $1)='${wl}-f,' if test "$GXX" = yes; then case $host_os in aix4.[[012]]|aix4.[[012]].*) # We only want to do this on AIX 4.2 and lower, the check # below for broken collect2 doesn't work under 4.3+ collect2name=`${CC} -print-prog-name=collect2` if test -f "$collect2name" && strings "$collect2name" | $GREP resolve_lib_name >/dev/null then # We have reworked collect2 : else # We have old collect2 _LT_TAGVAR(hardcode_direct, $1)=unsupported # It fails to find uninstalled libraries when the uninstalled # path is not listed in the libpath. Setting hardcode_minus_L # to unsupported forces relinking _LT_TAGVAR(hardcode_minus_L, $1)=yes _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)= fi esac shared_flag='-shared' if test "$aix_use_runtimelinking" = yes; then shared_flag="$shared_flag "'${wl}-G' fi else # not using gcc if test "$host_cpu" = ia64; then # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release # chokes on -Wl,-G. The following line is correct: shared_flag='-G' else if test "$aix_use_runtimelinking" = yes; then shared_flag='${wl}-G' else shared_flag='${wl}-bM:SRE' fi fi fi _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall' # It seems that -bexpall does not export symbols beginning with # underscore (_), so it is better to generate a list of symbols to # export. _LT_TAGVAR(always_export_symbols, $1)=yes if test "$aix_use_runtimelinking" = yes; then # Warning - without using the other runtime loading flags (-brtl), # -berok will link without error, but may produce a broken library. _LT_TAGVAR(allow_undefined_flag, $1)='-berok' # Determine the default libpath from the value encoded in an empty # executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag" else if test "$host_cpu" = ia64; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib' _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs" _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols" else # Determine the default libpath from the value encoded in an # empty executable. _LT_SYS_MODULE_PATH_AIX([$1]) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath" # Warning - without using the other run time loading flags, # -berok will link without error, but may produce a broken library. _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok' _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok' if test "$with_gnu_ld" = yes; then # We only use this code for GNU lds that support --whole-archive. _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' else # Exported symbols can be pulled into shared objects from archives _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience' fi _LT_TAGVAR(archive_cmds_need_lc, $1)=yes # This is similar to how AIX traditionally builds its shared # libraries. _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname' fi fi ;; beos*) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then _LT_TAGVAR(allow_undefined_flag, $1)=unsupported # Joseph Beckenbach says some releases of gcc # support --undefined. This deserves some investigation. FIXME _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; chorus*) case $cc_basename in *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; cygwin* | mingw* | pw32* | cegcc*) case $GXX,$cc_basename in ,cl* | no,cl*) # Native MSVC # hardcode_libdir_flag_spec is actually meaningless, as there is # no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' ' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=yes _LT_TAGVAR(file_list_spec, $1)='@' # Tell ltmain to make .lib files, not .a files. libext=lib # Tell ltmain to make .dll files, not .so files. shrext_cmds=".dll" # FIXME: Setting linknames here is a bad hack. _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames=' _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp; else $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp; fi~ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~ linknames=' # The linker will not automatically build a static lib if we build a DLL. # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true' _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes # Don't use ranlib _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib' _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~ lt_tool_outputfile="@TOOL_OUTPUT@"~ case $lt_outputfile in *.exe|*.EXE) ;; *) lt_outputfile="$lt_outputfile.exe" lt_tool_outputfile="$lt_tool_outputfile.exe" ;; esac~ func_to_tool_file "$lt_outputfile"~ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1; $RM "$lt_outputfile.manifest"; fi' ;; *) # g++ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless, # as there is no search path for DLLs. _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols' _LT_TAGVAR(allow_undefined_flag, $1)=unsupported _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' # If the export-symbols file already is a .def file (1st line # is EXPORTS), use it as is; otherwise, prepend... _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then cp $export_symbols $output_objdir/$soname.def; else echo EXPORTS > $output_objdir/$soname.def; cat $export_symbols >> $output_objdir/$soname.def; fi~ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib' else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; darwin* | rhapsody*) _LT_DARWIN_LINKER_FEATURES($1) ;; dgux*) case $cc_basename in ec++*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; ghcx*) # Green Hills C++ Compiler # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; freebsd2.*) # C++ shared libraries reported to be fairly broken before # switch to ELF _LT_TAGVAR(ld_shlibs, $1)=no ;; freebsd-elf*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; freebsd* | dragonfly*) # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF # conventions _LT_TAGVAR(ld_shlibs, $1)=yes ;; haiku*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(link_all_deplibs, $1)=yes ;; hpux9*) _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; hpux10*|hpux11*) if test $with_gnu_ld = no; then _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: case $host_cpu in hppa*64*|ia64*) ;; *) _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' ;; esac fi case $host_cpu in hppa*64*|ia64*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no ;; *) _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH, # but as the default # location of the library. ;; esac case $cc_basename in CC*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; aCC*) case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes; then if test $with_gnu_ld = no; then case $host_cpu in hppa*64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; ia64*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' ;; esac fi else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; interix[[3-9]]*) _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc. # Instead, shared libraries are loaded at an image base (0x10000000 by # default) and relocated if they conflict, which is a slow very memory # consuming and fragmenting process. To avoid this, we pick a random, # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link # time. Moving up from 0x10000000 also allows more sbrk(2) space. _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib' ;; irix5* | irix6*) case $cc_basename in CC*) # SGI C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' # Archives containing C++ object files must be created using # "CC -ar", where "CC" is the IRIX C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs' ;; *) if test "$GXX" = yes; then if test "$with_gnu_ld" = no; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' else _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib' fi fi _LT_TAGVAR(link_all_deplibs, $1)=yes ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: _LT_TAGVAR(inherit_rpath, $1)=yes ;; linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' # Archives containing C++ object files must be created using # "CC -Bstatic", where "CC" is the KAI C++ compiler. _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; icpc* | ecpc* ) # Intel C++ with_gnu_ld=yes # version 8.0 and above of icpc choke on multiply defined symbols # if we add $predep_objects and $postdep_objects, however 7.1 and # earlier do not add the objects themselves. case `$CC -V 2>&1` in *"Version 7."*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; *) # Version 8.0 or newer tmp_idyn= case $host_cpu in ia64*) tmp_idyn=' -i_dynamic';; esac _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' ;; esac _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive' ;; pgCC* | pgcpp*) # Portland Group C++ compiler case `$CC -V` in *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*) _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"' _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~ $RANLIB $oldlib' _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~ rm -rf $tpldir~ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; *) # Version 6 and above use weak symbols _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' ;; cxx*) # Compaq C++ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols' runpath_var=LD_RUN_PATH _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed' ;; xl* | mpixl* | bgxl*) # IBM XL 8.0 on PPC, with GNU ld _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic' _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' if test "x$supports_anon_versioning" = xyes; then _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~ echo "local: *; };" >> $output_objdir/$libname.ver~ $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib' fi ;; *) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive' _LT_TAGVAR(compiler_needs_object, $1)=yes # Not sure whether something based on # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 # would be better. output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; esac ;; esac ;; lynxos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; m88k*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; mvs*) case $cc_basename in cxx*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; netbsd*) if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags' wlarc= _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no fi # Workaround some broken pre-1.5 toolchains output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"' ;; *nto* | *qnx*) _LT_TAGVAR(ld_shlibs, $1)=yes ;; openbsd2*) # C++ shared libraries are fairly broken _LT_TAGVAR(ld_shlibs, $1)=no ;; openbsd*) if test -f /usr/libexec/ld.so; then _LT_TAGVAR(hardcode_direct, $1)=yes _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=yes _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib' _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E' _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' fi output_verbose_link_cmd=func_echo_all else _LT_TAGVAR(ld_shlibs, $1)=no fi ;; osf3* | osf4* | osf5*) case $cc_basename in KCC*) # Kuck and Associates, Inc. (KAI) C++ Compiler # KCC will only create a shared library if the output file # ends with ".so" (or ".sl" for HP-UX), so rename the library # to its proper name (with version) after linking. _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Archives containing C++ object files must be created using # the KAI C++ compiler. case $host in osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;; *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;; esac ;; RCC*) # Rational C++ 2.4.1 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; cxx*) case $host in osf3*) _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' ;; *) _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*' _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~ echo "-hidden">> $lib.exp~ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~ $RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir' ;; esac _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. # # There doesn't appear to be a way to prevent this compiler from # explicitly linking system object files so we need to strip them # from the output so that they don't get included in the library # dependencies. output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"' ;; *) if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*' case $host in osf3*) _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib' ;; esac _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=: # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no fi ;; esac ;; psos*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; sunos4*) case $cc_basename in CC*) # Sun C++ 4.x # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; lcc*) # Lucid # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # Sun C++ 4.2, 5.x and Centerline C++ _LT_TAGVAR(archive_cmds_need_lc,$1)=yes _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs' _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir' _LT_TAGVAR(hardcode_shlibpath_var, $1)=no case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) # The compiler driver will combine and reorder linker options, # but understands `-z linker_flag'. # Supported since Solaris 2.6 (maybe 2.5.1?) _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract' ;; esac _LT_TAGVAR(link_all_deplibs, $1)=yes output_verbose_link_cmd='func_echo_all' # Archives containing C++ object files must be created using # "CC -xar", where "CC" is the Sun C++ compiler. This is # necessary to make sure instantiated templates are included # in the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs' ;; gcx*) # Green Hills C++ Compiler _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' # The C++ compiler must be used to create the archive. _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs' ;; *) # GNU C++ compiler with Solaris linker if test "$GXX" = yes && test "$with_gnu_ld" = no; then _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs' if $CC --version | $GREP -v '^2\.7' > /dev/null; then _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' else # g++ 2.7 appears to require `-G' NOT `-shared' on this # platform. _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib' _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~ $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp' # Commands to make compiler produce verbose output that lists # what "hidden" libraries, object files and flags are used when # linking a shared library. output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"' fi _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir' case $host_os in solaris2.[[0-5]] | solaris2.[[0-5]].*) ;; *) _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract' ;; esac fi ;; esac ;; sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*) _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; sysv5* | sco3.2v5* | sco5v6*) # Note: We can NOT use -z defs as we might desire, because we do not # link with -lc, and that would cause any symbols used from libc to # always be unresolved, which means just about no library would # ever link correctly. If we're not using GNU ld we use -z text # though, which does catch some bad symbols but isn't as heavy-handed # as -z defs. _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text' _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs' _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(hardcode_shlibpath_var, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir' _LT_TAGVAR(hardcode_libdir_separator, $1)=':' _LT_TAGVAR(link_all_deplibs, $1)=yes _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport' runpath_var='LD_RUN_PATH' case $cc_basename in CC*) _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~ '"$_LT_TAGVAR(old_archive_cmds, $1)" _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~ '"$_LT_TAGVAR(reload_cmds, $1)" ;; *) _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags' ;; esac ;; tandem*) case $cc_basename in NCC*) # NonStop-UX NCC 3.20 # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac ;; vxworks*) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; *) # FIXME: insert proper C++ library support _LT_TAGVAR(ld_shlibs, $1)=no ;; esac AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)]) test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no _LT_TAGVAR(GCC, $1)="$GXX" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS LDCXX=$LD LD=$lt_save_LD GCC=$lt_save_GCC with_gnu_ld=$lt_save_with_gnu_ld lt_cv_path_LDCXX=$lt_cv_path_LD lt_cv_path_LD=$lt_save_path_LD lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld fi # test "$_lt_caught_CXX_error" != yes AC_LANG_POP ])# _LT_LANG_CXX_CONFIG # _LT_FUNC_STRIPNAME_CNF # ---------------------- # func_stripname_cnf prefix suffix name # strip PREFIX and SUFFIX off of NAME. # PREFIX and SUFFIX must not contain globbing or regex special # characters, hashes, percent signs, but SUFFIX may contain a leading # dot (in which case that matches only a dot). # # This function is identical to the (non-XSI) version of func_stripname, # except this one can be used by m4 code that may be executed by configure, # rather than the libtool script. m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl AC_REQUIRE([_LT_DECL_SED]) AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH]) func_stripname_cnf () { case ${2} in .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;; *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;; esac } # func_stripname_cnf ])# _LT_FUNC_STRIPNAME_CNF # _LT_SYS_HIDDEN_LIBDEPS([TAGNAME]) # --------------------------------- # Figure out "hidden" library dependencies from verbose # compiler output when linking a shared library. # Parse the compiler output and extract the necessary # objects, libraries and library flags. m4_defun([_LT_SYS_HIDDEN_LIBDEPS], [m4_require([_LT_FILEUTILS_DEFAULTS])dnl AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl # Dependencies to place before and after the object being linked: _LT_TAGVAR(predep_objects, $1)= _LT_TAGVAR(postdep_objects, $1)= _LT_TAGVAR(predeps, $1)= _LT_TAGVAR(postdeps, $1)= _LT_TAGVAR(compiler_lib_search_path, $1)= dnl we can't use the lt_simple_compile_test_code here, dnl because it contains code intended for an executable, dnl not a library. It's possible we should let each dnl tag define a new lt_????_link_test_code variable, dnl but it's only used here... m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF int a; void foo (void) { a = 0; } _LT_EOF ], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF class Foo { public: Foo (void) { a = 0; } private: int a; }; _LT_EOF ], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer*4 a a=0 return end _LT_EOF ], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF subroutine foo implicit none integer a a=0 return end _LT_EOF ], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF public class foo { private int a; public void bar (void) { a = 0; } }; _LT_EOF ], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF package foo func foo() { } _LT_EOF ]) _lt_libdeps_save_CFLAGS=$CFLAGS case "$CC $CFLAGS " in #( *\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;; *\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;; *\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;; esac dnl Parse the compiler output and extract the necessary dnl objects, libraries and library flags. if AC_TRY_EVAL(ac_compile); then # Parse the compiler output and extract the necessary # objects, libraries and library flags. # Sentinel used to keep track of whether or not we are before # the conftest object file. pre_test_object_deps_done=no for p in `eval "$output_verbose_link_cmd"`; do case ${prev}${p} in -L* | -R* | -l*) # Some compilers place space between "-{L,R}" and the path. # Remove the space. if test $p = "-L" || test $p = "-R"; then prev=$p continue fi # Expand the sysroot to ease extracting the directories later. if test -z "$prev"; then case $p in -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;; -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;; -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;; esac fi case $p in =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;; esac if test "$pre_test_object_deps_done" = no; then case ${prev} in -L | -R) # Internal compiler library paths should come after those # provided the user. The postdeps already come after the # user supplied libs so there is no need to process them. if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}" else _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}" fi ;; # The "-l" case would never come before the object being # linked, so don't bother handling this case. esac else if test -z "$_LT_TAGVAR(postdeps, $1)"; then _LT_TAGVAR(postdeps, $1)="${prev}${p}" else _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}" fi fi prev= ;; *.lto.$objext) ;; # Ignore GCC LTO objects *.$objext) # This assumes that the test object file only shows up # once in the compiler output. if test "$p" = "conftest.$objext"; then pre_test_object_deps_done=yes continue fi if test "$pre_test_object_deps_done" = no; then if test -z "$_LT_TAGVAR(predep_objects, $1)"; then _LT_TAGVAR(predep_objects, $1)="$p" else _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p" fi else if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then _LT_TAGVAR(postdep_objects, $1)="$p" else _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p" fi fi ;; *) ;; # Ignore the rest. esac done # Clean up. rm -f a.out a.exe else echo "libtool.m4: error: problem compiling $1 test program" fi $RM -f confest.$objext CFLAGS=$_lt_libdeps_save_CFLAGS # PORTME: override above test on systems where it is broken m4_if([$1], [CXX], [case $host_os in interix[[3-9]]*) # Interix 3.5 installs completely hosed .la files for C++, so rather than # hack all around it, let's just trust "g++" to DTRT. _LT_TAGVAR(predep_objects,$1)= _LT_TAGVAR(postdep_objects,$1)= _LT_TAGVAR(postdeps,$1)= ;; linux*) case `$CC -V 2>&1 | sed 5q` in *Sun\ C*) # Sun C++ 5.9 # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; solaris*) case $cc_basename in CC* | sunCC*) # The more standards-conforming stlport4 library is # incompatible with the Cstd library. Avoid specifying # it if it's in CXXFLAGS. Ignore libCrun as # -library=stlport4 depends on it. case " $CXX $CXXFLAGS " in *" -library=stlport4 "*) solaris_use_stlport4=yes ;; esac # Adding this requires a known-good setup of shared libraries for # Sun compiler versions before 5.6, else PIC objects from an old # archive will be linked into the output, leading to subtle bugs. if test "$solaris_use_stlport4" != yes; then _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun' fi ;; esac ;; esac ]) case " $_LT_TAGVAR(postdeps, $1) " in *" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;; esac _LT_TAGVAR(compiler_lib_search_dirs, $1)= if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'` fi _LT_TAGDECL([], [compiler_lib_search_dirs], [1], [The directories searched by this compiler when creating a shared library]) _LT_TAGDECL([], [predep_objects], [1], [Dependencies to place before and after the objects being linked to create a shared library]) _LT_TAGDECL([], [postdep_objects], [1]) _LT_TAGDECL([], [predeps], [1]) _LT_TAGDECL([], [postdeps], [1]) _LT_TAGDECL([], [compiler_lib_search_path], [1], [The library search path used internally by the compiler when linking a shared library]) ])# _LT_SYS_HIDDEN_LIBDEPS # _LT_LANG_F77_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for a Fortran 77 compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_F77_CONFIG], [AC_LANG_PUSH(Fortran 77) if test -z "$F77" || test "X$F77" = "Xno"; then _lt_disable_F77=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for f77 test sources. ac_ext=f # Object file extension for compiled f77 test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the F77 compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_F77" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${F77-"f77"} CFLAGS=$FFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) GCC=$G77 if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$G77" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC="$lt_save_CC" CFLAGS="$lt_save_CFLAGS" fi # test "$_lt_disable_F77" != yes AC_LANG_POP ])# _LT_LANG_F77_CONFIG # _LT_LANG_FC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for a Fortran compiler are # suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_FC_CONFIG], [AC_LANG_PUSH(Fortran) if test -z "$FC" || test "X$FC" = "Xno"; then _lt_disable_FC=yes fi _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(allow_undefined_flag, $1)= _LT_TAGVAR(always_export_symbols, $1)=no _LT_TAGVAR(archive_expsym_cmds, $1)= _LT_TAGVAR(export_dynamic_flag_spec, $1)= _LT_TAGVAR(hardcode_direct, $1)=no _LT_TAGVAR(hardcode_direct_absolute, $1)=no _LT_TAGVAR(hardcode_libdir_flag_spec, $1)= _LT_TAGVAR(hardcode_libdir_separator, $1)= _LT_TAGVAR(hardcode_minus_L, $1)=no _LT_TAGVAR(hardcode_automatic, $1)=no _LT_TAGVAR(inherit_rpath, $1)=no _LT_TAGVAR(module_cmds, $1)= _LT_TAGVAR(module_expsym_cmds, $1)= _LT_TAGVAR(link_all_deplibs, $1)=unknown _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds _LT_TAGVAR(no_undefined_flag, $1)= _LT_TAGVAR(whole_archive_flag_spec, $1)= _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no # Source file extension for fc test sources. ac_ext=${ac_fc_srcext-f} # Object file extension for compiled fc test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # No sense in running all these tests if we already determined that # the FC compiler isn't working. Some variables (like enable_shared) # are currently assumed to apply to all compilers on this platform, # and will be corrupted by setting them based on a non-working compiler. if test "$_lt_disable_FC" != yes; then # Code to be used in simple compile tests lt_simple_compile_test_code="\ subroutine t return end " # Code to be used in simple link tests lt_simple_link_test_code="\ program t end " # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_GCC=$GCC lt_save_CFLAGS=$CFLAGS CC=${FC-"f95"} CFLAGS=$FCFLAGS compiler=$CC GCC=$ac_cv_fc_compiler_gnu _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) if test -n "$compiler"; then AC_MSG_CHECKING([if libtool supports shared libraries]) AC_MSG_RESULT([$can_build_shared]) AC_MSG_CHECKING([whether to build shared libraries]) test "$can_build_shared" = "no" && enable_shared=no # On AIX, shared libraries and static libraries use the same namespace, and # are all built from PIC. case $host_os in aix3*) test "$enable_shared" = yes && enable_static=no if test -n "$RANLIB"; then archive_cmds="$archive_cmds~\$RANLIB \$lib" postinstall_cmds='$RANLIB $lib' fi ;; aix[[4-9]]*) if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then test "$enable_shared" = yes && enable_static=no fi ;; esac AC_MSG_RESULT([$enable_shared]) AC_MSG_CHECKING([whether to build static libraries]) # Make sure either enable_shared or enable_static is yes. test "$enable_shared" = yes || enable_static=yes AC_MSG_RESULT([$enable_static]) _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu" _LT_TAGVAR(LD, $1)="$LD" ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... _LT_SYS_HIDDEN_LIBDEPS($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_SYS_DYNAMIC_LINKER($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi # test -n "$compiler" GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS fi # test "$_lt_disable_FC" != yes AC_LANG_POP ])# _LT_LANG_FC_CONFIG # _LT_LANG_GCJ_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Java Compiler compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GCJ_CONFIG], [AC_REQUIRE([LT_PROG_GCJ])dnl AC_LANG_SAVE # Source file extension for Java test sources. ac_ext=java # Object file extension for compiled Java test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="class foo {}" # Code to be used in simple link tests lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GCJ-"gcj"} CFLAGS=$GCJFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # GCJ did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GCJ_CONFIG # _LT_LANG_GO_CONFIG([TAG]) # -------------------------- # Ensure that the configuration variables for the GNU Go compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_GO_CONFIG], [AC_REQUIRE([LT_PROG_GO])dnl AC_LANG_SAVE # Source file extension for Go test sources. ac_ext=go # Object file extension for compiled Go test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code="package main; func main() { }" # Code to be used in simple link tests lt_simple_link_test_code='package main; func main() { }' # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC=$CC lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC=yes CC=${GOC-"gccgo"} CFLAGS=$GOFLAGS compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_TAGVAR(LD, $1)="$LD" _LT_CC_BASENAME([$compiler]) # Go did not exist at the time GCC didn't implicitly link libc in. _LT_TAGVAR(archive_cmds_need_lc, $1)=no _LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds _LT_TAGVAR(reload_flag, $1)=$reload_flag _LT_TAGVAR(reload_cmds, $1)=$reload_cmds ## CAVEAT EMPTOR: ## There is no encapsulation within the following macros, do not change ## the running order or otherwise move them around unless you know exactly ## what you are doing... if test -n "$compiler"; then _LT_COMPILER_NO_RTTI($1) _LT_COMPILER_PIC($1) _LT_COMPILER_C_O($1) _LT_COMPILER_FILE_LOCKS($1) _LT_LINKER_SHLIBS($1) _LT_LINKER_HARDCODE_LIBPATH($1) _LT_CONFIG($1) fi AC_LANG_RESTORE GCC=$lt_save_GCC CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_GO_CONFIG # _LT_LANG_RC_CONFIG([TAG]) # ------------------------- # Ensure that the configuration variables for the Windows resource compiler # are suitably defined. These variables are subsequently used by _LT_CONFIG # to write the compiler configuration to `libtool'. m4_defun([_LT_LANG_RC_CONFIG], [AC_REQUIRE([LT_PROG_RC])dnl AC_LANG_SAVE # Source file extension for RC test sources. ac_ext=rc # Object file extension for compiled RC test sources. objext=o _LT_TAGVAR(objext, $1)=$objext # Code to be used in simple compile tests lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }' # Code to be used in simple link tests lt_simple_link_test_code="$lt_simple_compile_test_code" # ltmain only uses $CC for tagged configurations so make sure $CC is set. _LT_TAG_COMPILER # save warnings/boilerplate of simple test code _LT_COMPILER_BOILERPLATE _LT_LINKER_BOILERPLATE # Allow CC to be a program name with arguments. lt_save_CC="$CC" lt_save_CFLAGS=$CFLAGS lt_save_GCC=$GCC GCC= CC=${RC-"windres"} CFLAGS= compiler=$CC _LT_TAGVAR(compiler, $1)=$CC _LT_CC_BASENAME([$compiler]) _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes if test -n "$compiler"; then : _LT_CONFIG($1) fi GCC=$lt_save_GCC AC_LANG_RESTORE CC=$lt_save_CC CFLAGS=$lt_save_CFLAGS ])# _LT_LANG_RC_CONFIG # LT_PROG_GCJ # ----------- AC_DEFUN([LT_PROG_GCJ], [m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ], [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ], [AC_CHECK_TOOL(GCJ, gcj,) test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2" AC_SUBST(GCJFLAGS)])])[]dnl ]) # Old name: AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_GCJ], []) # LT_PROG_GO # ---------- AC_DEFUN([LT_PROG_GO], [AC_CHECK_TOOL(GOC, gccgo,) ]) # LT_PROG_RC # ---------- AC_DEFUN([LT_PROG_RC], [AC_CHECK_TOOL(RC, windres,) ]) # Old name: AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_RC], []) # _LT_DECL_EGREP # -------------- # If we don't have a new enough Autoconf to choose the best grep # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_EGREP], [AC_REQUIRE([AC_PROG_EGREP])dnl AC_REQUIRE([AC_PROG_FGREP])dnl test -z "$GREP" && GREP=grep _LT_DECL([], [GREP], [1], [A grep program that handles long lines]) _LT_DECL([], [EGREP], [1], [An ERE matcher]) _LT_DECL([], [FGREP], [1], [A literal string matcher]) dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too AC_SUBST([GREP]) ]) # _LT_DECL_OBJDUMP # -------------- # If we don't have a new enough Autoconf to choose the best objdump # available, choose the one first in the user's PATH. m4_defun([_LT_DECL_OBJDUMP], [AC_CHECK_TOOL(OBJDUMP, objdump, false) test -z "$OBJDUMP" && OBJDUMP=objdump _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper]) AC_SUBST([OBJDUMP]) ]) # _LT_DECL_DLLTOOL # ---------------- # Ensure DLLTOOL variable is set. m4_defun([_LT_DECL_DLLTOOL], [AC_CHECK_TOOL(DLLTOOL, dlltool, false) test -z "$DLLTOOL" && DLLTOOL=dlltool _LT_DECL([], [DLLTOOL], [1], [DLL creation program]) AC_SUBST([DLLTOOL]) ]) # _LT_DECL_SED # ------------ # Check for a fully-functional sed program, that truncates # as few characters as possible. Prefer GNU sed if found. m4_defun([_LT_DECL_SED], [AC_PROG_SED test -z "$SED" && SED=sed Xsed="$SED -e 1s/^X//" _LT_DECL([], [SED], [1], [A sed program that does not truncate output]) _LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"], [Sed that helps us avoid accidentally triggering echo(1) options like -n]) ])# _LT_DECL_SED m4_ifndef([AC_PROG_SED], [ ############################################################ # NOTE: This macro has been submitted for inclusion into # # GNU Autoconf as AC_PROG_SED. When it is available in # # a released version of Autoconf we should remove this # # macro and use it instead. # ############################################################ m4_defun([AC_PROG_SED], [AC_MSG_CHECKING([for a sed that does not truncate output]) AC_CACHE_VAL(lt_cv_path_SED, [# Loop through the user's path and test for sed and gsed. # Then use that list of sed's as ones to test for truncation. as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for lt_ac_prog in sed gsed; do for ac_exec_ext in '' $ac_executable_extensions; do if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext" fi done done done IFS=$as_save_IFS lt_ac_max=0 lt_ac_count=0 # Add /usr/xpg4/bin/sed as it is typically found on Solaris # along with /bin/sed that truncates output. for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do test ! -f $lt_ac_sed && continue cat /dev/null > conftest.in lt_ac_count=0 echo $ECHO_N "0123456789$ECHO_C" >conftest.in # Check for GNU sed and select it if it is found. if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then lt_cv_path_SED=$lt_ac_sed break fi while true; do cat conftest.in conftest.in >conftest.tmp mv conftest.tmp conftest.in cp conftest.in conftest.nl echo >>conftest.nl $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break cmp -s conftest.out conftest.nl || break # 10000 chars as input seems more than enough test $lt_ac_count -gt 10 && break lt_ac_count=`expr $lt_ac_count + 1` if test $lt_ac_count -gt $lt_ac_max; then lt_ac_max=$lt_ac_count lt_cv_path_SED=$lt_ac_sed fi done done ]) SED=$lt_cv_path_SED AC_SUBST([SED]) AC_MSG_RESULT([$SED]) ])#AC_PROG_SED ])#m4_ifndef # Old name: AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED]) dnl aclocal-1.4 backwards compatibility: dnl AC_DEFUN([LT_AC_PROG_SED], []) # _LT_CHECK_SHELL_FEATURES # ------------------------ # Find out whether the shell is Bourne or XSI compatible, # or has some other useful features. m4_defun([_LT_CHECK_SHELL_FEATURES], [AC_MSG_CHECKING([whether the shell understands some XSI constructs]) # Try some XSI features xsi_shell=no ( _lt_dummy="a/b/c" test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \ = c,a/b,b/c, \ && eval 'test $(( 1 + 1 )) -eq 2 \ && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \ && xsi_shell=yes AC_MSG_RESULT([$xsi_shell]) _LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell']) AC_MSG_CHECKING([whether the shell understands "+="]) lt_shell_append=no ( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \ >/dev/null 2>&1 \ && lt_shell_append=yes AC_MSG_RESULT([$lt_shell_append]) _LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append']) if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then lt_unset=unset else lt_unset=false fi _LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl # test EBCDIC or ASCII case `echo X|tr X '\101'` in A) # ASCII based system # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr lt_SP2NL='tr \040 \012' lt_NL2SP='tr \015\012 \040\040' ;; *) # EBCDIC based system lt_SP2NL='tr \100 \n' lt_NL2SP='tr \r\n \100\100' ;; esac _LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl ])# _LT_CHECK_SHELL_FEATURES # _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY) # ------------------------------------------------------ # In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and # '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY. m4_defun([_LT_PROG_FUNCTION_REPLACE], [dnl { sed -e '/^$1 ()$/,/^} # $1 /c\ $1 ()\ {\ m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1]) } # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: ]) # _LT_PROG_REPLACE_SHELLFNS # ------------------------- # Replace existing portable implementations of several shell functions with # equivalent extended shell implementations where those features are available.. m4_defun([_LT_PROG_REPLACE_SHELLFNS], [if test x"$xsi_shell" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl case ${1} in */*) func_dirname_result="${1%/*}${2}" ;; * ) func_dirname_result="${3}" ;; esac func_basename_result="${1##*/}"]) _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are # positional parameters, so assign one to ordinary parameter first. func_stripname_result=${3} func_stripname_result=${func_stripname_result#"${1}"} func_stripname_result=${func_stripname_result%"${2}"}]) _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl func_split_long_opt_name=${1%%=*} func_split_long_opt_arg=${1#*=}]) _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl func_split_short_opt_arg=${1#??} func_split_short_opt_name=${1%"$func_split_short_opt_arg"}]) _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl case ${1} in *.lo) func_lo2o_result=${1%.lo}.${objext} ;; *) func_lo2o_result=${1} ;; esac]) _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo]) _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))]) _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}]) fi if test x"$lt_shell_append" = xyes; then _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"]) _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl func_quote_for_eval "${2}" dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \ eval "${1}+=\\\\ \\$func_quote_for_eval_result"]) # Save a `func_append' function call where possible by direct use of '+=' sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: else # Save a `func_append' function call even when '+=' is not available sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \ && mv -f "$cfgfile.tmp" "$cfgfile" \ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp") test 0 -eq $? || _lt_function_replace_fail=: fi if test x"$_lt_function_replace_fail" = x":"; then AC_MSG_WARN([Unable to substitute extended shell functions in $ofile]) fi ]) # _LT_PATH_CONVERSION_FUNCTIONS # ----------------------------- # Determine which file name conversion functions should be used by # func_to_host_file (and, implicitly, by func_to_host_path). These are needed # for certain cross-compile configurations and native mingw. m4_defun([_LT_PATH_CONVERSION_FUNCTIONS], [AC_REQUIRE([AC_CANONICAL_HOST])dnl AC_REQUIRE([AC_CANONICAL_BUILD])dnl AC_MSG_CHECKING([how to convert $build file names to $host format]) AC_CACHE_VAL(lt_cv_to_host_file_cmd, [case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32 ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32 ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32 ;; esac ;; *-*-cygwin* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin ;; *-*-cygwin* ) lt_cv_to_host_file_cmd=func_convert_file_noop ;; * ) # otherwise, assume *nix lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin ;; esac ;; * ) # unhandled hosts (and "normal" native builds) lt_cv_to_host_file_cmd=func_convert_file_noop ;; esac ]) to_host_file_cmd=$lt_cv_to_host_file_cmd AC_MSG_RESULT([$lt_cv_to_host_file_cmd]) _LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd], [0], [convert $build file names to $host format])dnl AC_MSG_CHECKING([how to convert $build file names to toolchain format]) AC_CACHE_VAL(lt_cv_to_tool_file_cmd, [#assume ordinary cross tools, or native build. lt_cv_to_tool_file_cmd=func_convert_file_noop case $host in *-*-mingw* ) case $build in *-*-mingw* ) # actually msys lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32 ;; esac ;; esac ]) to_tool_file_cmd=$lt_cv_to_tool_file_cmd AC_MSG_RESULT([$lt_cv_to_tool_file_cmd]) _LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd], [0], [convert $build files to toolchain format])dnl ])# _LT_PATH_CONVERSION_FUNCTIONS ming-0.4.5/macros/ltsugar.m40000644000175000017500000001042412154727020012603 00000000000000# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*- # # Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc. # Written by Gary V. Vaughan, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # serial 6 ltsugar.m4 # This is to help aclocal find these macros, as it can't see m4_define. AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])]) # lt_join(SEP, ARG1, [ARG2...]) # ----------------------------- # Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their # associated separator. # Needed until we can rely on m4_join from Autoconf 2.62, since all earlier # versions in m4sugar had bugs. m4_define([lt_join], [m4_if([$#], [1], [], [$#], [2], [[$2]], [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])]) m4_define([_lt_join], [m4_if([$#$2], [2], [], [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])]) # lt_car(LIST) # lt_cdr(LIST) # ------------ # Manipulate m4 lists. # These macros are necessary as long as will still need to support # Autoconf-2.59 which quotes differently. m4_define([lt_car], [[$1]]) m4_define([lt_cdr], [m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])], [$#], 1, [], [m4_dquote(m4_shift($@))])]) m4_define([lt_unquote], $1) # lt_append(MACRO-NAME, STRING, [SEPARATOR]) # ------------------------------------------ # Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'. # Note that neither SEPARATOR nor STRING are expanded; they are appended # to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked). # No SEPARATOR is output if MACRO-NAME was previously undefined (different # than defined and empty). # # This macro is needed until we can rely on Autoconf 2.62, since earlier # versions of m4sugar mistakenly expanded SEPARATOR but not STRING. m4_define([lt_append], [m4_define([$1], m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])]) # lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...]) # ---------------------------------------------------------- # Produce a SEP delimited list of all paired combinations of elements of # PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list # has the form PREFIXmINFIXSUFFIXn. # Needed until we can rely on m4_combine added in Autoconf 2.62. m4_define([lt_combine], [m4_if(m4_eval([$# > 3]), [1], [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl [[m4_foreach([_Lt_prefix], [$2], [m4_foreach([_Lt_suffix], ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[, [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])]) # lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ]) # ----------------------------------------------------------------------- # Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited # by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ. m4_define([lt_if_append_uniq], [m4_ifdef([$1], [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1], [lt_append([$1], [$2], [$3])$4], [$5])], [lt_append([$1], [$2], [$3])$4])]) # lt_dict_add(DICT, KEY, VALUE) # ----------------------------- m4_define([lt_dict_add], [m4_define([$1($2)], [$3])]) # lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE) # -------------------------------------------- m4_define([lt_dict_add_subkey], [m4_define([$1($2:$3)], [$4])]) # lt_dict_fetch(DICT, KEY, [SUBKEY]) # ---------------------------------- m4_define([lt_dict_fetch], [m4_ifval([$3], m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]), m4_ifdef([$1($2)], [m4_defn([$1($2)])]))]) # lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE]) # ----------------------------------------------------------------- m4_define([lt_if_dict_fetch], [m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4], [$5], [$6])]) # lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...]) # -------------------------------------------------------------- m4_define([lt_dict_filter], [m4_if([$5], [], [], [lt_join(m4_quote(m4_default([$4], [[, ]])), lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]), [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl ]) ming-0.4.5/macros/ltversion.m40000644000175000017500000000126212154727020013147 00000000000000# ltversion.m4 -- version numbers -*- Autoconf -*- # # Copyright (C) 2004 Free Software Foundation, Inc. # Written by Scott James Remnant, 2004 # # This file is free software; the Free Software Foundation gives # unlimited permission to copy and/or distribute it, with or without # modifications, as long as this notice is preserved. # @configure_input@ # serial 3337 ltversion.m4 # This file is part of GNU Libtool m4_define([LT_PACKAGE_VERSION], [2.4.2]) m4_define([LT_PACKAGE_REVISION], [1.3337]) AC_DEFUN([LTVERSION_VERSION], [macro_version='2.4.2' macro_revision='1.3337' _LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?]) _LT_DECL(, macro_revision, 0) ]) ming-0.4.5/macros/python.m40000644000175000017500000002157312154635363012462 00000000000000##### http://autoconf-archive.cryp.to/ac_python_devel.html # # SYNOPSIS # # AC_PYTHON_DEVEL([version]) # # DESCRIPTION # # Note: Defines as a precious variable "PYTHON_VERSION". Don't # override it in your configure.ac. # # This macro checks for Python and tries to get the include path to # 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and # $(PYTHON_LDFLAGS) output variables. It also exports # $(PYTHON_EXTRA_LIBS) and $(PYTHON_EXTRA_LDFLAGS) for embedding # Python in your code. # # You can search for some particular version of Python by passing a # parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". # Please note that you *have* to pass also an operator along with the # version to match, and pay special attention to the single quotes # surrounding the version number. Don't use "PYTHON_VERSION" for # this: that environment variable is declared as precious and thus # reserved for the end-user. # # This macro should work for all versions of Python >= 2.1.0. As an # end user, you can disable the check for the python version by # setting the PYTHON_NOVERSIONCHECK environment variable to something # else than the empty string. # # If you need to use this macro for an older Python version, please # contact the authors. We're always open for feedback. # # LAST MODIFICATION # # 2006-10-22 # # COPYLEFT # # Copyright (c) 2006 Sebastian Huber # Copyright (c) 2006 Alan W. Irwin # Copyright (c) 2006 Rafael Laboissiere # Copyright (c) 2006 Andrew Collier # Copyright (c) 2006 Matteo Settenvini # Copyright (c) 2006 Horst Knorr # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License as # published by the Free Software Foundation; either version 2 of the # License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # # As a special exception, the respective Autoconf Macro's copyright # owner gives unlimited permission to copy, distribute and modify the # configure scripts that are the output of Autoconf when processing # the Macro. You need not follow the terms of the GNU General Public # License when using or distributing such scripts, even though # portions of the text of the Macro appear in them. The GNU General # Public License (GPL) does govern all other use of the material that # constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the # Autoconf Macro released by the Autoconf Macro Archive. When you # make and distribute a modified version of the Autoconf Macro, you # may extend this special exception to the GPL to apply to your # modified version as well. AC_DEFUN([AC_PYTHON_DEVEL],[ # # Allow the use of a (user set) custom python version # AC_ARG_VAR([PYTHON_VERSION],[The installed Python version to use, for example '2.3'. This string will be appended to the Python interpreter canonical name.]) AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) if test -z "$PYTHON"; then AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) PYTHON_VERSION="" fi # # Check for a version of Python >= 2.1.0 # AC_MSG_CHECKING([for a version of Python >= '2.1.0']) ac_supports_python_ver=`$PYTHON -c "import sys, string; \ ver = string.split(sys.version)[[0]]; \ print ver >= '2.1.0'"` if test "$ac_supports_python_ver" != "True"; then if test -z "$PYTHON_NOVERSIONCHECK"; then AC_MSG_RESULT([no]) AC_MSG_FAILURE([ This version of the AC@&t@_PYTHON_DEVEL macro doesn't work properly with versions of Python before 2.1.0. You may need to re-run configure, setting the variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. Moreover, to disable this check, set PYTHON_NOVERSIONCHECK to something else than an empty string. ]) else AC_MSG_RESULT([skip at user request]) fi else AC_MSG_RESULT([yes]) fi # # if the macro parameter ``version'' is set, honour it # if test -n "$1"; then AC_MSG_CHECKING([for a version of Python $1]) ac_supports_python_ver=`$PYTHON -c "import sys, string; \ ver = string.split(sys.version)[[0]]; \ print ver $1"` if test "$ac_supports_python_ver" = "True"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([this package requires Python $1. If you have it installed, but it isn't the default Python interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See ``configure --help'' for reference. ]) PYTHON_VERSION="" fi fi # # Check if you have distutils, else fail # AC_MSG_CHECKING([for the distutils Python package]) ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` if test -z "$ac_distutils_result"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot import Python module "distutils". Please check your Python installation. The error was: $ac_distutils_result]) PYTHON_VERSION="" fi # # Check for Python include path # AC_MSG_CHECKING([for Python include path]) if test -z "$PYTHON_CPPFLAGS"; then python_path=`$PYTHON -c "import distutils.sysconfig; \ print distutils.sysconfig.get_python_inc();"` if test -n "${python_path}"; then python_path="-I$python_path" fi PYTHON_CPPFLAGS=$python_path fi AC_MSG_RESULT([$PYTHON_CPPFLAGS]) AC_SUBST([PYTHON_CPPFLAGS]) # # Check for Python library path # AC_MSG_CHECKING([for Python library path]) if test -z "$PYTHON_LDFLAGS"; then # (makes two attempts to ensure we've got a version number # from the interpreter) py_version=`$PYTHON -c "from distutils.sysconfig import *; \ from string import join; \ print join(get_config_vars('VERSION'))"` if test "$py_version" = "[None]"; then if test -n "$PYTHON_VERSION"; then py_version=$PYTHON_VERSION else py_version=`$PYTHON -c "import sys; \ print sys.version[[:3]]"` fi fi PYTHON_LDFLAGS=`$PYTHON -c "from distutils.sysconfig import *; \ from string import join; \ print '-L' + get_python_lib(0,1), \ '-lpython';"`$py_version fi AC_MSG_RESULT([$PYTHON_LDFLAGS]) AC_SUBST([PYTHON_LDFLAGS]) # # Check for site packages # AC_MSG_CHECKING([for Python site-packages path]) if test -z "$PYTHON_SITE_PKG"; then PYTHON_SITE_PKG=`$PYTHON -c "import distutils.sysconfig; \ print distutils.sysconfig.get_python_lib(0,0);"` fi AC_MSG_RESULT([$PYTHON_SITE_PKG]) AC_SUBST([PYTHON_SITE_PKG]) # # libraries which must be linked in when embedding # AC_MSG_CHECKING(python extra libraries) if test -z "$PYTHON_EXTRA_LIBS"; then PYTHON_EXTRA_LIBS=`$PYTHON -c "import distutils.sysconfig; \ conf = distutils.sysconfig.get_config_var; \ print conf('LOCALMODLIBS'), conf('LIBS')"` fi AC_MSG_RESULT([$PYTHON_EXTRA_LIBS]) AC_SUBST(PYTHON_EXTRA_LIBS) # # linking flags needed when embedding # AC_MSG_CHECKING(python extra linking flags) if test -z "$PYTHON_EXTRA_LDFLAGS"; then PYTHON_EXTRA_LDFLAGS=`$PYTHON -c "import distutils.sysconfig; \ conf = distutils.sysconfig.get_config_var; \ print conf('LINKFORSHARED')"` fi AC_MSG_RESULT([$PYTHON_EXTRA_LDFLAGS]) AC_SUBST(PYTHON_EXTRA_LDFLAGS) # # final check to see if everything compiles alright # AC_MSG_CHECKING([consistency of all components of python development environment]) AC_LANG_PUSH([C]) # save current global flags LIBS="$ac_save_LIBS $PYTHON_LDFLAGS" CPPFLAGS="$ac_save_CPPFLAGS $PYTHON_CPPFLAGS" AC_TRY_LINK([ #include ],[ Py_Initialize(); ],[pythonexists=yes],[pythonexists=no]) AC_MSG_RESULT([$pythonexists]) if test ! "$pythonexists" = "yes"; then AC_MSG_ERROR([ Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" ============================================================================ ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them. ============================================================================ ]) PYTHON_VERSION="" fi AC_LANG_POP # turn back to default flags CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" # # all done! # ]) ming-0.4.5/perl_ext/0000755000175000017500000000000012154727176011311 500000000000000ming-0.4.5/perl_ext/Morph.xs0000644000175000017500000000270711454264373012675 00000000000000/* ==================================================================== * Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * Author: soheil * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Morph PACKAGE = SWF::Morph PREFIX = SWFMorph_ PROTOTYPES: ENABLE SWF::Morph SWFMorph_new(package="SWF::Morph") char *package CODE: RETVAL = newSWFMorphShape(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFMorph(morph) SWF::Morph morph ALIAS: SWF::Morph::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Morph DESTROY CALLED\n")); destroySWFMorph(morph); SWF::Shape SWFMorph_getShape1(morph) SWF::Morph morph PREINIT: SV *sv; CODE: sv = (SV*)SvRV(ST(0)); RETVAL = SWFMorph_getShape1(morph); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Shape", (void*)RETVAL); swf_stash_refcnt_inc(sv, (SV*)SvRV(ST(0))); SWF::Shape SWFMorph_getShape2(morph) SWF::Morph morph PREINIT: SV *sv; CODE: sv = (SV*)SvRV(ST(0)); RETVAL = SWFMorph_getShape2(morph); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Shape", (void*)RETVAL); swf_stash_refcnt_inc(sv, (SV*)SvRV(ST(0))); ming-0.4.5/perl_ext/FilterMatrix.xs0000644000175000017500000000242111454264373014213 00000000000000/* ==================================================================== * Copyright (c) 2008 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::FilterMatrix PACKAGE = SWF::FilterMatrix PREFIX = SWFFilterMatrix_ PROTOTYPES: ENABLE SWF::FilterMatrix SWFFilterMatrix_new(package="SWF::FilterMatrix", cols, rows, vals) char *package int cols int rows SV * vals INIT: int i; I32 count = cols * rows; if(!SvROK(vals) || (av_len((AV *)SvRV(vals)) + 1) != count) XSRETURN_UNDEF; CODE: float *f_vals = (float *)malloc(count * sizeof(float)); for(i = 0; i < count; i++) { float f = (float)SvNV(*av_fetch((AV *)SvRV(vals), i, 0)); f_vals[i] = f; } RETVAL = newSWFFilterMatrix(cols, rows, f_vals); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); free(f_vals); void SWFFilterMatrix_DESTROY(fm) SWF::FilterMatrix fm CODE: destroySWFFilterMatrix(fm); S_DEBUG(2, fprintf(stderr, "SWFFilterMatrix DESTROY CALLED\n")); ming-0.4.5/perl_ext/Shape.xs0000644000175000017500000001600611454264373012645 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Shape PACKAGE = SWF::Shape PREFIX = SWFShape_ PROTOTYPES: ENABLE SWF::Shape SWFShape_new(package="SWF::Shape") char *package CODE: RETVAL = newSWFShape(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFShape(shape) SWF::Shape shape ALIAS: SWF::Shape::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Shape DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFShape(shape); void SWFShape_movePenTo(shape, x, y) SWF::Shape shape double x double y void SWFShape_movePen(shape, x, y) SWF::Shape shape double x double y float SWFShape_getPenX(shape) SWF::Shape shape float SWFShape_getPenY(shape) SWF::Shape shape void SWFShape_getPen(shape) SWF::Shape shape PREINIT: double x; double y; PPCODE: SWFShape_getPen(shape, &x, &y); EXTEND(SP, 2); PUSHs(sv_2mortal(newSVnv(x))); PUSHs(sv_2mortal(newSVnv(y))); void SWFShape_drawLineTo(shape, x, y) SWF::Shape shape double x double y void SWFShape_drawLine(shape, dx, dy) SWF::Shape shape double dx double dy void SWFShape_drawCurveTo(shape, controlx, controly, anchorx, anchory) SWF::Shape shape double controlx double controly double anchorx double anchory void SWFShape_drawCurve(shape, controldx, controldy, anchordx, anchordy) SWF::Shape shape double controldx double controldy double anchordx double anchordy void SWFShape_drawCubicTo(shape, bx, by, cx, cy, dx, dy) SWF::Shape shape double bx double by double cx double cy double dx double dy void SWFShape_drawCubic(shape, bx, by, cx, cy, dx, dy) SWF::Shape shape double bx double by double cx double cy double dx double dy void SWFShape_end(shape) SWF::Shape shape void SWFShape_setLineStyle(shape, width, r, g, b, a=0xff) SWF::Shape shape unsigned short width byte r byte g byte b byte a CODE: warn("Using setLineStyle() is deprecated. Use setLine() instead!"); SWFShape_setLineStyle(shape, width, r, g, b, a); void SWFShape_setLineStyle2(shape, width, r, g, b, a, flags, miterLimit) SWF::Shape shape unsigned short width byte r byte g byte b byte a int flags float miterLimit CODE: warn("Using setLineStyle2() is deprecated. Use setLine2() instead!"); SWFShape_setLineStyle2(shape, width, r, g, b, a, flags, miterLimit); void SWFShape_setLineStyle2filled(shape, width, fill, flags, miterLimit) SWF::Shape shape unsigned short width SWF::Fill fill int flags float miterLimit CODE: warn("Using setLineStyle2filled() is deprecated. Use setLine2Filled() instead!"); SWFShape_setLineStyle2filled(shape, width, SWFFill_getFillStyle(fill), flags, miterLimit); SWF::Fill SWFShape_addFill(shape, ...) SWF::Shape shape PREINIT: CV *cv; char *my_sub; CODE: PUSHMARK(mark); if (sv_derived_from(ST(1), "SWF::Gradient")) my_sub = "SWF::Shape::addGradientFill"; else if(sv_derived_from(ST(1), "SWF::Bitmap")) my_sub = "SWF::Shape::addBitmapFill"; else my_sub = "SWF::Shape::addSolidFill"; cv = GvCV(gv_fetchpv(my_sub, FALSE, SVt_PVCV)); #ifdef PERL_OBJECT (void)(*CvXSUB(cv))(cv, pPerl); #else (void)(*CvXSUB(cv))(aTHXo_ cv); #endif SWF::Fill SWFShape_addSolidFill(shape, r, g, b, a=0xff) SWF::Shape shape byte r byte g byte b byte a PREINIT: SV *sv; CODE: sv = (SV*)SvRV(ST(0)); RETVAL = SWFShape_addSolidFill(shape, r, g, b, a); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Fill", (void*)RETVAL); swf_stash_refcnt_inc(sv, (SV*)SvRV(ST(0))); SWF::Fill SWFShape_addGradientFill(shape, gradient, flags=SWFFILL_LINEAR_GRADIENT) SWF::Shape shape SWF::Gradient gradient byte flags CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFShape_addGradientFill(shape, gradient, flags); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Fill", (void*)RETVAL); SWF::Fill SWFShape_addBitmapFill(shape, bitmap, flags=SWFFILL_TILED_BITMAP) SWF::Shape shape SWF::Bitmap bitmap byte flags CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFShape_addBitmapFill(shape, bitmap, flags); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Fill", (void*)RETVAL); void SWFShape_xs_setLeftFill(shape, fill=NULL) SWF::Shape shape SWF::Fill fill CODE: SWFShape_setLeftFill(shape, fill); void SWFShape_xs_setRightFill(shape, fill=NULL) SWF::Shape shape SWF::Fill fill CODE: SWFShape_setRightFill(shape, fill); void SWFShape_drawGlyph(shape, font, c, size=0) SWF::Shape shape SWF::Font font int c int size CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFShape_drawSizedGlyph(shape, font, c, size); void SWFShape_drawArc(shape, r, startAngle, endAngle) SWF::Shape shape int r float startAngle float endAngle void SWFShape_drawCircle(shape, r) SWF::Shape shape float r void SWFShape_setLine(shape, w, r, g, b, a=0xff) SWF::Shape shape int w unsigned char r unsigned char g unsigned char b unsigned char a void SWFShape_setLine2(shape, width, r, g, b, a, flags, miterLimit) SWF::Shape shape unsigned short width byte r byte g byte b byte a int flags float miterLimit void SWFShape_setLine2Filled(shape, width, fill, flags, miterLimit) SWF::Shape shape unsigned short width SWF::Fill fill int flags float miterLimit CODE: SWFShape_setLine2Filled(shape, width, SWFFill_getFillStyle(fill), flags, miterLimit); void SWFShape_useVersion(shape, version) SWF::Shape shape int version int SWFShape_getVersion(shape) SWF::Shape shape void SWFShape_setRenderHintingFlags(shape, flags) SWF::Shape shape int flags void SWFShape_hideLine(shape) SWF::Shape shape void SWFShape_drawCharacterBounds(shape, character) SWF::Shape shape SWF::Character character = NO_INIT PREINIT: IV tmp; CODE: tmp = SvIV((SV*)SvRV(ST(1))); character = INT2PTR(SWF__Character, tmp); SWFShape_drawCharacterBounds(shape, character); SV * SWFShape_dumpOutline(shape) SWF::Shape shape PREINIT: char *buf; CODE: buf=SWFShape_dumpOutline(shape); RETVAL=newSVpv(buf,0); free(buf); OUTPUT: RETVAL ming-0.4.5/perl_ext/common/0000755000175000017500000000000012154727176012601 500000000000000ming-0.4.5/perl_ext/common/README0000644000175000017500000000026611454264373013402 00000000000000The files in this directory are used by build tests (../t/*) examples (../examples/*) This directory is temporary. There should be one common directory for ming and all wrappers ming-0.4.5/perl_ext/common/_sans.fdb0000644000175000017500000005017611454264373014307 00000000000000fdb0_sansàÂÄä d½dx¨×5Vdr„îoó|2Õd ~ « Å á û _ s ¤ ( “ ð  - ¬ Ì Û <P~ TÜ@Þö=^ŸÓ÷0BYs‚“.ŒèJ©ãi©Äø,”Õ0–ó$°î6V…²ñŽSpªË"c‰©Ùñõ©À2Ol‰¦Èê, n – ¥ ´ ï *!Ì!ã!•"²"Ï" # #.#­#5$§$è$%Õ%ð%Â&='h'{'‰'\(k(º(æ(4)©)º)*0*>*t**ä*+a+×+€,ã,$-e-­-.b.Ò. /¤/Ó/090r00®0Ó0ú0f1¼162°223×3[4…45s5É5&6…6·67›7E8ï8¡9u:); <ìÇ>>?\?z?Ÿ?Æ?<@¶@ AŠAûABC)C¦CüCRD°DE^EÄEF5,L×e›bcfka )\~Ióv»°áº£ãó0š‘€5dòÍ÷úš’·ùî›1 û/¬Ò=†}—þ”f¤þ{¦Ì@5h¶ööRö&·öÖ»ˆ½”½Ë6þ£Wb×x®W¹cßÕjìZïÊö+6mv÷‰i{—›]ľñd«a/Q­¸žÞ+•l&oê5¶ÁRùnX·öÖ»‰ÝâjX5fnæåñ/>Isd©ß…Ú´7*¢FÍÊhÐô²ŽH\À ¸‡óbŸP‚ì­êKÙ¦š÷ß[®Zº±O›‡Cîëj×|ÁiDR¦`Ô7 Ã,žÑ¯ËWFšÒèªTÀ˜³l,ûêÕÔkª®dðrâyŽÌCvч±t%¸ÑùMzOv,Á‘K…À©‹å¥Edy@OÑŠnŽ+~žJV¾QY5j΋ùç ±mÌÈÏÍ„V6*¬·Àj;7HèlÀâã²–8„¨€Ç0·œÀ=<’êÇx+ u:bŒ”° ‘@ Lf-1`˜wLÊm#+Ð ¯@53æÔΜ˜ÈŸ$«=­-àŽÍÒ:›00¸ì¥Ž¡*0±Ì-Æg0ÏW$ºqß Ùɘ´Ä‚`Ý#)´Œ¯@&½ÔÏ›S8r` |©Š2RÀ&E.15g¦Ùçn¤­èE<¥ª µtRn† séŒÐÐ ¶á£Í•»y-63 Ë,Ì0H_ZM•„g0áfTÅ™*úÒÎÂì»î¿0ñ¦„Æ™éÀ%€L`\€ ÈEýÖ¡|®®’Í"3  -hÓ.@Kl‚òè0€"Jr’J‚¥§¤•^sV7Öæs[–s’Ë™(²€X‘„Äf ©¯85B$Oßé»ìÂì3ì½ïô"u$5DÝïœñJ¼60&µ¢Í‚Ÿ™‚^f‰'“˜¶za~Á)7/r\ÝkÀ À5/ßælÇëeí‹ùÒÑ>` .ªI»íx®÷ëí[3/>–¿ÌLÚï8Í?5b®Éæö¦ÞØHÛêù1Ÿ2VÑty°pÁæ7D×\Ü{7“m£òë‹Vc«‘ž°¼›EîfP$5eZÒ÷YŒ}•MÉÎë'b¯vo¹8Ù¬ÜdnÎ6@5,,×ešPv#—b*„õçµ#¹›D£´¥©7fkaœ5"'f›ÙZà»5,L×e›bgfkaœ5dv‹ùòÅí±oÌjЭ„€5gâõf@mœò“ææOË,›,®Ài` ;I÷@Êpø7±˜jÀ×Vc]U ]€XbU¦­˜t°A‹k??D†ZÎZ Ç’ªxø¯€*‰8«ˆ¦N¥õ¸’Ö‹°€[h5eúyWÅ7-Öùù‡å–~°ýš™’÷Nseq8Å G@5höe³r©w+¬¾mbùõ-³ ší1àZ6U¸!¹àŠRS”И§A7gyâ¬yUG6P­\–Õ¸@&¿Ù'›dœm´ÁS'ÙSd´LÔzw1ñи5gžïå¿:ys'œ^dòC ‰ Àæ`ºCšé Tj y°1½év­zL ˜JE*TM€JüÊ“j_Ê{د¸"¶…Xçpetv)Wb P¯`–ýù`%–ê·H}¶ÓxL#Lu1Þr¸¯25+3FÖJih@5J]ýá­¸ãjV㔃j;5¼Tø—a'…ÛØcÙSØÝWìSnÔx, 5gºÁø-Íý†,ÈZI 0!!Ì„„Ó02L×+0ÀN`äMƒ‘ïGµ{â`´Rb9S#ldÜù‹sÀ+æ³ÕÓ›WRèZ€.”–é=ˆ6Özñè~³eX5gúëöÓËÒ^­ܳ(µ@`1-SúMÎwþÝ*ëôJ¿C0- !L~„Ó0/ä¸Ì?6aðÒ5³îu  à a;?2-c ÊÀ3˜«¤‚t– Ë&Õ,G”âŠå(©yRNW Ò˜§HÆ` M}IlT„5`ÆÁöj¸­”i®’¯'ÝžûH9¹W>[v(æª …˜†ö:cÈä[. d5g¾ðeÏ*ir¥”Vd1bCˆÌ@&^½@šùLi@ Ü ¯¯À(&¹$И“=¾YòÚ—- æ°:ʘç%€f£‰ŽÎX£»R€h‰ ¨P¶+@pJ†ø €Ÿzô·¯M,ÀËyÀ©¦¥‚²©k*þP ‰¤”’D…%HQH @ µ¦*×À˜ÿWVmMkð5bÒÎfÓ1N˜¬²UJß•ð5f(Ô²˜Ï_JZÔã– ŒAY”¨ó“¤N#€ó€ž¤ÜJx…sa–W€MT•¡6N‡­VÕ‰E½>nSç•Pûe?´¦ J`*Q²€HѺ\ªè›–‰¹@&¥Á¾›øR` +ÉoÀ&H;'5,<×e›bkfka˜ ²¦ÌÎÃ6Ë>ÄÐ5,,×ešPv#—b*„õçµ#¹›D£´¥©7fkaœ r¦ÌÎÃ>Ë>ÄÈ5AÅÙ¬âóf{+o4ù¶[<ÙlÀ³=¬Ìj°ÊW3)SÐè0g©2Æ¡fÂܹšBo6µYÕDH€QqÍEÉ}5ö6ý´ÚÔ sCHÎ=¼œ7œ7 Ï€ f`©c²eà̹€H ¥B™P ûå?¼åùN_%:RS@M˜ój[Ö瀗 „%ÈC*Is$àÐ5F•§Ü|ïÙÍfݤïÄ›É~½® VÒ-ûöÄÏ23Höy’Å»±#¿W"à³@5fºÂvÈûn[w[»‰ý«Ÿ¥êO4¤ó€³( ›²K¿%þÀ­×éN.ÎP ó©—2©¦fB$/˜¼P õ-—RÌ%Àb€Í±AœG-#àDæT3•™c«J³U¸·Ú…ù*EùH¶GÍ(ì .ʾ¼RëÃo¤Û~—@•m×à5hÇfÐܶš°¢lrž”IºQf]F˜mäŠc¢40 ”@tf8Ñ£ÚÂ37½‰üÖñÀD€[hMmŸ³K6Í ¼ÀÅ•sU(êL¡¨Â3pYÄÉgÌ»hæç°ÏÛ5g"ÄæÙñ©Ü³r£ ÄìÉ^R©æc<¨ï0ž(lÀ»xrÚ…+X+GUŠc£ÔÙ‡¦SíA›±ˆ®\*®–ባvÅp^ü´qû½ •øå©€5i޽x$ý×-²­Á5n¾¸-•nK»ËHù–ʸ5E­gáSv'ùiß²¯Á9n¸ø•n  5fšµf¾Ï–LHe悉¹æb"B˜… ‚d _€y¢WšäݼnJ6j¸¦ÿÿ !5ÁÍ ìÖƒ¶JTiMQ£§S6@¤À¥´“QªiÌ©¦Ü2xÔÈ$…Ó— ¥m¨—„Œø%Ñ‚–Ùií5EOáVv'ùià [À¾ðÚ{ <«wb†§à À5c‘ùVîÄÿ-#Øa5!é‡j¿¤ÀŠƒƒòœ>Ä©@á#w•¢±€ƒÃì0ð¾“.uK¥Sh ߀M>›‘6nH5*Èuý±?ËHöxVÎ+e)¸„ãf%Yd9S†Å-#ÜIsÈinÒx®%|¸ƒ5jB‘ùVîÄç<ÿp9RÅ-#Ødæ`R-ÀØ]5hRÇæÆÛ·šdÙ}±¦œ„#“fGLl™´Îr>Ìr˜ŸŠönÜmÀV±.tÅjà Ó7é¬M¦±Z]5qmÓ ÙÓWçkTÍ­T?8”bÌÎbÌ&À2€)Ì¢`V®5gÀvÓ}nQ8PmÅôËÀû³n€`J–œè¿k¨+EÕ6T†K­”²à ¦^ÄAŸŠ@²7(œ)VÄÿ-#àEv·ƒÊØJS@5h>ÇæÅÛ¸šLå*}Á(”œ#“&GMn• Û%¥Žw=¢÷S* ›—ÎUÙ,sSñ_MÅ{¸ ÕýΘ©X¶`¾T‰¹2M¦C.9Ûȇ5%ŽÕåÓ N€WèM_¡©S6¥HœÀe”óS©iL£¢È30‰ŒÊFjà5fjºw#¯=Æ„È`¾R¦äO¥1¹( –¯Íµ½^ Ñ]7•™CÌ¥>ÈÉ€³M¦Î5–•9"„¥T3½è>Ä6üý£mÔÞ¹óõÓÙ®W݉b–‘ð(³1Š5gBÈfÕÜ«š `†[-”ƒ†fw™Øh°RdáâÙO­îPï4–û8'fÁ²šp÷ŽkÞ=¬i¶q­ö®|J¹„r˜FÈ´¬‹>+€ ·Ê¯\r”Æô /lÍ.ÌÔ·ï¿w&›è×ê–f\ÕåÍ\é@HABSôç˜ó(e á©_DÎb04´`ó|]jî€5e®½yT6Äÿ-z܇lÔò$]•}Èp5jF‘øZ‰€¹ÐfçA¿)šü¦Xi íɯ÷y/f伌á–6xZy€‹e"µa™U˜|f°í żðÛ†YØa5jŽ‘ùî»±;ÏrR=†žbù í'xÚOÌc^½†05g:éyöD]±;ÏŸR=†>#ƒÃ¼>–Þ!¼q"á‡^#Jç8¡=oØ8ŽqNÃ>n·v(ùö[¥·¦«oZ°5jF‘øßÊ×YƒØˆã£ßzðO×u¾úCÿb3Š7AqÁª‡MèUæÓµ­§U»Òs݆ 5Ký•áM¶'øl®7,³°í½"ÝÚ”ù¼¡ÞŽ”l8ñ·p5i2½yã„aÀêl«r[Ýšn+¼Wµ2§‚gÙ©äA»*à5b‚·yXžÃfÊ^äë–+î1¶Rö%5a&‹ùEí±qϕЭ„5cj‘ù]Näëf×a³–vìJlÚî1€5CÅOØ£âXÎ K&Cb— kqâ 5ify-fÍÿ"TÙA5c¦Õö-÷ãn›ȈÀ5fNøåT@¡™J—h*žËÄÀ ÄR…BDöż²|·,åT‰KHŒ°ThëM£ª{( $°JKÝ’œÚ“¶Õ)›|Í;´i”œúfÝâ¼– E¥Â[“µ’ŒŽnô§.´Û1§j È€b¥C®”Ù†€%hN™Ti'fQø@EÕ¿6x¤ðvÛ))+DäÍ0”C†5bv‘øPiŽn@%baIU”:’SˆÈ3”ƒ §"7„¹¯R¨@&¢Ë²ÙBجå¤{ @¨–¼æ_+˜©$W`͘¯4j` |ùkNŒX *´›TÌ„5djðæW7,˜Ü°=CmHt¼åaË. ´ÀMxªc6±ˆLÀ e&3˜!JÔ<o„ÞíY ›ÅsÒlC: ¤À/®gÞî@¹€*‡oæÀ;à˜ë}5g‘ùVîÅfÍìÙÉóÀ`eîË.î8Sq`€WLb70Õù®ôÆ»¨@°”¬©ŠAÃ|ì-¤2,– fØ1i˜˜¬ÎUl•ØT&)ИO[6ZÓa5DE‰àJ&ú½äÞ›W2ðX@+*›T§ñ/D¨óµt2n¥RÙ± i&‹¼¹Ÿy¸_§^ˆ»i‘m›€&jDIœ†H!4Xà&W,/˜´¹V@æ5bÎöööQ¶&x\ÝŠnÏbÇfëa?VD % Í(Û¨uʃS°Uvù§k—îZà7’—y 5X€5gÖöø\¹€9Í%ÎÒIé²G¬&¡ÆÕ›T «jÀl¡T™%*#.€Jø,ò¢Î2œÀü b¢ÔM$‰c6%ˆ”Àƒ˜ ßšîÌiºŒ2ðêfΘ*®Ù€JL%TÁð _UBb­ ©€'õs¥«> b¬Æmc5bz‘øPyíØ%vY‰V&¦a"îCb›†°˜óŠ\xe–À ¥eºSŠIx£ÿ…"ئå¤{ @5bzöùPžÅ7-íØZaÅìÌl-l´lS5bvöùQ„À \äóo™Z€m¹öÚ#i­Xyë¦ í·åº[ @¬!ØÍ™}…­–Š`5)éwu¥±MËHö¸Z-íYFîù«‰¾§lHñÔo¸ 5br‘ùVîÅ7-#ØZ5k§æ*,[á[6)øk)@Jï¢Mè§))Æ%Úi¶É@¸SMŠnžP5b—V)À%´Ipâžo"`žOb›–öì(l¥ÊfÊ­©ÐÔ®À&3*cÖLFÊ2xY`5bVööS&:¨o•€¥PD¡ÉJ›h*Ç ±MÃ^ÊOl²k,ØK—}ÀÆ],ÚÄ€ Ü)Å7-íØQ5Cý°ÎbÓ$0 À sf,͘˜wS:m<ÛÐ ¯@4̦Ô3fC¤92.+ÍÀ©#$?LÏÂw.QÍŠAt4ˆÝÌû½Àõ8ØRÜ€5bZööQe;a&ÉRëhd@B9Æ&@L˜G n$’9d"„Z`.í–æÝ8øP=ŠnZC°¤ ‰[ê`b£T±vW€Θ¯4V` ½lÙkNŒXà*6›LÔœ5gÂöùVþÅ7 ù.³¶ÊKhPQ^ZÏ»Ú/³X`Jr [ò´¾üÌ` {7; ¨½fg+3•[7€%rU ŠsÀ'&–ÕË–¤¨ %ŠÃ)µÌ€@5bRööTe?ÖéMn@U Û©-ý—ÀI%%)lü¼Xs‹lSrÞÝ…5e‚ùå^H¹ùKÏm@d¾«ãÓ.=3KR²L H%!g®NÕ}èQT©ˆ?)càJneåQ<´³ŠÂ4ÀV¬ÙZ¾5›V|¥ÕÙQzWÀg”öp¤¯›·Òß¶iÞ}®élîÛ‚]—ÀY”Ò¤B,”¯½v¦úÊüò@5d"ööQ¶)¸Sy@& .2-g±”Z»CSöÞK<^2K†³ÍëÎ_Ãgl_lÝl!nßv­en®v€5gÂöùPžÅ†Í”ØKR Ñctµ÷lË.̾,Kï0Ü5¾Â× O00(Ì¢Q›+)ŠJ¤=r¤Ö>ìÁÛ€œ7ÂÐ5gÒöùót'±YÏ›^Ý…þ#’}´‰¯ißÚ¼Ø\5kröùõ¤'±EÇ—š8ò¬ÆÅ>»{vxŽ.ÑÉ."¥“°»Äjf¸36ÂÀ5böö¨¾ëJïZ˜ÛV`¶7Ò\LdgbG}Ú_¾êÑØ“âa]›é‡5gÞöùód97Çq ºa+.µ@k×oµ^¶b5°í¥é6Þé"®|Þöl0ñ“M¤ïr„Z/ÆÊØZ5K4gÛ6¹'Ù·àlµ^qªXí®_›]”Þ«fߊ¥>5dú‹öS³#,ÀÉÍÞ&ƒ8úKݶ³²ê;D´­Ë™a0Éx^Ð'IB" :RXÌ~Ê~„›n~%ÁÓ^yuæõbo­Ÿúi€)¾7eñ{FÉsìµÿfºTßÌí”ÆÁfÞ¬Ú%(ZÃ3ÈdÉc"X¹Æ·Þô5b¶‹ù^Å,?ØO5`Ò‹ö£„J€YSR•4>ð: ` ‚)D"2RSÙR–Ð%ÎSÂ)¾€6þ·KíWCRhÍÇÉqò®m 6ls+@wL#Ú}0.ü¢$¿)‹ë6Ë.šstiJíþ‹—åþåáÊ€ ÈìÙh85LE Öˆ$¨@#Û*-†ñìµK€ö²ß\¸þeÉæ.Ybæ°\2— ÚÊvff5ÄVÖüNÕâ=m €5)‡àå´*`jÀr¨LË`95)‡àå´*`jÀr¨LË`95)‡àå´*`jÀr¨LË`95)ÿV`?éu¨¤W^«’7©ÔÊ7@Ú”vf6vT€5fZ¼eä7»]}™ì3môFØšçèÞi\C²á9 Ù=¢V[Säl²”!9…‹ï±9´2ëa“heô¢â Ó!ð»|§w.µ°OornÛ?I$#€5I?Õ˜Äz]J)•תäêm2Ð ¶¥™† • RŒõL‡â=.¥ÊëÕrFõ6™Fè[RŽÌÆÃÊ5hÓÍvY¶&vf¶ÁK{5²Í±5³5°Ì ÜOšÙfؙٚØg5c²ÿ÷f» [¬½ÆNʆäß•/lSrÚ-ÉÎ͆ã5e"ô÷;*“~¯q“²¡¹7Ý\ìSnÑ÷&û6ŒžWro³a¸ÉÝ¢l-n¯5b²«vä*ìLï6]67œ›[rjÀ5h:‹ùíF ±}Ì–ÏÍ„VnüÀ ‚ƒR“6„Ž€…3 qYÌiÕÁ%ôÄzóu€'°uR¦'ÓA™ ¶b‚à€·L¦Ý1·›cJm ©€' ôÁS½wÍÔ>0` Ü¤Í!# !TÂÜ sZtðÉ}$ ^¸+Ašjd’éŠ @fbÝ2›tÆÜl )¶4€&f'Ó˜ŸI¬þ±0é>œÄúH  LPZÃ0é”Û¦6à`liM±¤2 Ù~|:`ÁA¹IšBG@B©…¸@,æ´êá’ú"H@½p5gBÈfÕÜ«š `†[-”ƒ†fw™Øh°RdáâÙO­îPï4–û8'fÁ²šp÷ŽkÞ=¬i¶q­ö®|J¹„r˜FÈ´¬‹>+€ ·Ê¯\r”Æô /lÍ.ÌÔ·ï¿w&›è×ê–f\ÕåÍ\é@HABSôç˜ó(e á©_DÎb04´`ó|]j‘0¶›Õì3oÇ£6(7å.› ûNU@5D•óÞ„qì[o±Gw§£{ [ïŽP5hÆ‘øý•~ ïuÁÀ–l«pZ›¯®We[‚QÙ–Ÿxw¾'´€6xÉ÷™~p|“œ”M'B†ý™ÐVA¬4Úèst!6ÎLˆó¤(L¢ss8çp®N³ñ÷3c\ØK8 5)‡àå´*`jÀr¨LË`95)‡àå´*`jÀr¨LË`95)‡àå´*`jÀr¨LË`95)‡àå´*`jÀr¨LË`95b†ÏvZv'ökf½â”­…Û5–G$…æ¼¼ËÿW¨¼5b~·fCð—ZŠEuê¹#zL£t­©Gfca‡eH5cÚf½â”­…»5–G$¥æ¼¼ËþW¨¿e§bƒf´ˆ«=²Ó±A³[0臥l-Ù¬²9%/5åæ_ò½Eà5cŽv6T¦Cñ—RŠeuê¹#z›L£t­©Gf`ˆÊÝ0ˆôº”S+¯UÉÔÚe mJ;3 *@5A½3”ĶåKm  Z€J–T©@4”[ie¶–X f·n[vÀK5hãù.6ÍÇ":ÙH5@§è@ ”ŽŒÙ¸5`Ïåÿ0îNáXSà‘ÓÒD#y Ü9¶eþç)Ùr¬\ &d–þî$¼ Œ“Scbø5i>‘øŒê7’ºØbáf5!pÕ\yu[RN¥áVõ ðÍ €¬ßV Ëß ·±yÃRî_5að)º¯@5cúºv›Õì3oÇ£6(7å.› ûNUAY`¾r¯$\ü¥‰g¶ 2_Uñé—™€%„)Y&P$γ×'j€¾ô(ªTÄ Ÿ”±ð ¥·2‰r¨žZYÅaš`+Vl­_Í«>R‡jŒì¨Ž=+à³Ê{8 Ò ×ÍÛéoÛ4ï>×t¶wmÁ.Ëà,Êé R! –JWŠ^»S}e~y 5Eïß{Žì%ïL87ڻб°5j²ðænDLœˆKÿ¥ø'‰€TËL&-0C•ˆ™eI„«A³u)ãÍŠYL5è_4²óa£-¦3ÌË8Ì0H]ÜÏ»Ü0V^Ì;zy¿1ÞúHÈ ƒ²³:ed¨(³Ë+,€¤†+–  †e¶ck v°ê`Ò3 ‹Ò€&@.˘»,v` Ý<Ù´ó/€Zؼ 4ßV›2س±WS6±OÒ@5)‡àå´*`jÀr¨LË`95)‡àå´*`jÀr¨LË`95g~{v(¶f¶¶YZ2¤{ÒX™hìÊc³Õ­´áÀ5hFîvÝ"J‘¸Ò€q¾ÔdMqžmºº›0’økà ½Í·hÚãDÚy-É ÊI;n¯5º‰µc]Ä € 6£]ktð#P¤²ÀZM-¤ÀʲdÒ¦LÔ­€&µ*k@%J]«RÚµ(5hÞ‘øæ«&â¯e+re²¸ÎÙFÜ™n¨¶)·kÛ“ ›­Æ†ÍÎäÃfÛqWÇ5§68’(ÒdÝ¥5ûÑ0-†°5*Úg…ŒØ±á6ÁX­¢ü,^Å ë°ž5g‚âvÑ…KÖmæÑL´€d3$Œô€4’Ó>¦Lœ`8/*3ÄPJE²€smDºËÈ/*ƒåÊQ€Y<¹ÓÑ+-²@MB‘¡6F‡­^Õ¯9ƒGÆåDN| R€7¶Fì&Ma&m –˜~CAXQ¦³q#€L¤D=*àn¥¦Cض“k?¢l3[Ð d¿Š[ø@P ºB.C)Éõ²íµ'×[Ò€»ç¦š+×G¼¶m#%ˆxöÛ¾ùCSMŒ5Ig¹Ø·ß`ŽoPG6·ß\›ÐN@TøB›ïŽMèG&Ŧûszv9°˜5hw–v*÷d¼ŽÍgÉ—€5"'f›ÙZà»5gòþå&p @,À†\f‘RM6S&¸Úd¡±a·sm[NnÙwr¼RÎê·bÿ†jÜEíh •²gZ¯ÓZkØ€MbjS5¡N²dÚ©` S)%ÌT”–U2YRˆÊ@ zÓ%ëÛLUj]0vµ¬Ú¶–ºà­a]9Œ–À¦bÏZ›9j˜Êjcà §€)óæ¦ÎΦ›:˜z` ã:YŒ©Vô&ZÏ_™|lÆe£5°T‹À[/[ ¹W|Š^’vÙi–½·ß; 5ixù-fÎ"TÙ@5aÞÐåŒÉ™LFT` ç”ÆpewF‰sçº[ 4—9€ÁX@´2€Ž¦¼ªl9+  J¥H2€u]LµÔG,pìK^¸À5eÍwXûŒ}•MÉÎë'b¯vo¹8Ù¬ÜdnÎvAZ õ›*œæÍgÈ5`^Ãe%&iˆùPÀ&L#•Ð å«YºG,¥®{q-Æ«Þ &@ãRIˆ5R36ªÞH€U ]Œ»ø^-ðK¼gd;m>5b¢fH!• ° $»–—q[â¥X,©™J™ŠP 좛`ŽÜk  ¾Imäí7jOÄ…[¥i–° åÑÓ¾bŸ–ì,î¸f{ $”jCÅe:U0 T?ªT†Þ˜7tv;°°5dv½yZ–Åw-õš‹ï+&l¬€ ™€(1æ<ÆtàOvUö.9Z–Å_,®Ø5Bí—Ù™ØfÙgØš5,Ÿ¯_²ª X´ŠªR€KpìÛƒ·n>µ…‹­x)W€'Î7ØÓÖë1Þ¹ž¶Tl!€5E5%áºåš¢ X{QvåM˜¾FÜ+ÆÅÀ5bî¬å®AÙ¹ÇeüÉÙLPU ã˜gŒúPóã—6; Y1©3,L¯¤e6‘•À×Yóig€TÌL]1nrHÉÆ@5Jœ)Þ ro°96-÷ £›ï±Í„ TIB›Ó®Mö7&Ŧô$s}ò9°˜5k΋ùݦ ±cÍÏ­„àV ­®¬=¨»r¦Ì_£nãbã†ë–jˆdZËñ»·ÍøÔ&Ø+b~7Q¦«mI›)»6{”X[ÙQ=G»¯P5kž‹ùݦ ±cÍÏ­„àV ­®¬=¨»r¦Ì_£nãbã†ë–jˆd[ÖÒ£:\ cK7Hå‰Ö¸Œ7:¯x,™‘XæÕHÌÚ«y"vT€Q~2îãx·Àp.ñ}í´ù”|„™¦$åB™0Œx5k΋ùݦ ±cÍÏ­„àV*(ÔÉ#r¡6D€7rÒî+|T«•3)S J}”SlÛ€Mt·É-¼¦íIø§.EOx Q€-¶ElYžìeÝÆ° 1ƒ¬\™T'ÆD±©»äÇ8À’@0.L ÕÝ·’•–\§õ¼ Ö_ݾoÆ¡6Á[ñº5[jLÙMظٳܠêÂÞʉê=Ýz€5e¾ööYö&vfvÁRÓQh³(üSÉ«´;¶üþZ*y˜“&@vP T§•J‡`%r=ɉ÷-6®MæÍ†o6¼ØÒ€³`cVÊy{ l ãkuC® ö[ à5ef5wÑ›ñ—M‡V`i2X·v$wêä\nýƒ{bg™¤{ ¬¥W ¼‘ùÑwëÚûû9¬Û´ø€5d>{w®›ÛòHÍ‹`V`i2X·v$wêä\nýƒ{bg™¤{ ¬¥W ¼‘ùÑwëÚûû9¬Û´ø€5e2Pöä*ìLï6]67œ›[rjÁY¤|ÉbÝØ‘ß«‘pY»ö 퉞df‘ì4‚²•\&òGçE߯kî>wìæ³nÒwâ5fnzåÂfIoîàKÀØÉ50ö/¥ÿ0îNáXSà‘ÓÒD#‰ Ü9¶eþç)Ér¬’;ù¿^×Ü|ïÙÍfݤïěɘGÌ–-݉ú¹›¿`ÞØ™æFiÃH5gZ{v(¶f¶¶YX¾žÛ3[ Û,Û@¬ÀÒ>d±nìHïÕȸ,ÝûöÄÏ23HöAYJ®y#ó¢ï×µ÷;ösY·i;ñ5d^pd„ôE@C À d¬0“*J€Å 0<Y ”2šÊ”©@7)³`J6Syi¹’•¯±#¿W"à³wìÛ<ȵ,ÏkË›( €¶o0+)UÂo$~t]úö¾ãç~Îk6í'~ 5G½¯ÜypÔ{üuut³¥»ó=‰~e‚‘ò%­•~ ?uÃÀ«ì«pU;¯žûe[‚!Ý–ð\ 5hÇfÐܶš°¢lrž”IºQf]F˜mäŠc¢40 ”@tf8Ñ£ÚÂ37½‰üÖñÀwvUAK‘U@jP n›pvàmÇÖ°±u¯*ðùÆûZzÂ=f;×3ÖÑKÉ­}³7¦¶ÏÙ¥›f^`âʹ‹*”u&PÔa™¸,âd³æ]´ósØgí€5i޽x$ý×-²­Á5n¾¸-•nK»ËHù–ʸ+,Ñ«y ±q¿tØy5i޽x$ý×-²­Á5n¾¸-•nK»ËHù–ʸ+#3Ûyé°í¿$ŒØµ5ff{väÕíÇUØ™Þlºl0o8£6&Zc¯\~냖ÙVàš·_\Ê·%Ýå¤|ˆKe\5g¶{v(¶f¶¶YZc¯\~냖ÙVàš·_\Ê·%Ýå¤|ˆKe\Yí³5°½²Í±D5c^{v.7ã.›;ÈhÀV0i*ÝØŸå¤{ 5a{w®›ÛòHÍ‹`V0i*ÝØŸå¤{ 5bBPöãªìLï6]67œQ›[rjÁXÁ¤|«wb–‘ì0€5dn{v(¶f¶¶YXžÛ3[ Û,Û@¬`Ò>U»±?ËHö@5fþÃvÅúnY·^ûŒ­”-ɶëßq;2HO”ªy˜Ñ*+¥#L'Œ[0Wnd»fáÃ.6º´uX¦:1M˜q0Š` Õ·3ÉfÎ$ÀÛ*Á{ðÖ{7Û 5–ã÷z+ñËS5gzåÀnMs÷Ix™&¦¾Åì &Ã)Ì+@J|SrÌr˜ŸŠönÜmÀV±.tÅjà Ó7é¬M¦±Z]5qmÓ ÙÓWçkTÍ­T?8”bÌÎbÌ&À2€)Ì¢`V® ÌØŒSNBɳ#¦6LÚg9f¹LOÅ{7 î6à+X—:bµpé€ôÖ&ÓX­.š¸¶€i ìé«óµªfÖªŸœJ1fg1f` ™@ŒfQ0+W5gZzåÀnIonâKÀÔÉ50ö/e0îNaZSà›‘ãÑD'‰ÜI¶eüç)Ér¬¡K66ݸÓ ÈóíˆÀ4à!›2:c`Í ös‘ö` ”ÀüW³pÞãnµ‰s¦+Wn˜¿Mbm5ŠÒé«‹h&™®Îš¿;Z¦mj  ùÀ£fsa6™”HÆeµp5fö{vf¶¶Y¶(Z±ócmÛ€M2l>ØŒSNBɳ#¦6LÚg9f¹LOÅ{7 î6à+X—:bµpé€ôÖ&ÓX­.š¸¶€i ìé«óµªfÖªŸœJ1fg1f` ™@ŒfQ0+Wd {lÍl/l³lQ5hü÷Ù»Ó©ÝpÞï±Ø÷Ø“ºâDÞ±o±Øõ½‡½:Þ²kxð5gŽ»öÖùÍ&p•>ä”JJе²ˆBeÖ_–»¼Zq¬ÛU(µ²U¶¡Žb´ó …À¦qÒX›Mb¸¶jÒÚ@ ®À2;%«Æ5mµ‹ÚçÖÚ±;6}·~\Þ`ÓG–ÔL[P£¥2Ž› È`BR²"é`*c»©›@ìç#ìÀY€&5l8Ñ­©!*¢,€5jF‘øZ‰€¹ÐfçA¿)šü¦Xi íɯ÷y/f伌á–6xZy€‹e"µa™U˜|f°í żðÛ†YØae¢5o!£6.7ã.› 5jF‘øZ‰€¹ÐfçA¿)šü¦Xi íɯ÷y/f伌á–6xZy€‹e"µa™U˜|f°í żðÛ†YØadÎ{o!Ý6·ä‘› 5fž{väÕíÈUØ™Þlºl0o8#6&Z‘¤|-DÀ Üè3s ß”Í~S,4Èöä×û¼—³r^FpË <-<À E²‘Z°ÌªÌ>3Xv„âÞxíÃ,ì0€5fz{vf¶¶Y¶(Z‘¤|-DÀ Üè3s ß”Í~S,4Èöä×û¼—³r^FpË <-<À E²‘Z°ÌªÌ>3Xv„âÞxíÃ,ì0‚±Ç=¶f¶¶Y¶(€5hÊ‘öxÛ? m±?Ãeq¹e‡méîÔ§Íå þôt ‘ií¼…tØvß’Fl[5hºñeJd²éK-Þ`ÜDø¤ r‰º•ØŸå¤{ ;©]Ŧ×y[ Hd ¸¾™xŸvU@A”-7åÓ~×m´¿;”@5grÓd­ÛÛÀ‡¯‰:@$Ï”QHfD,•p &FÍ1›0ÊÀX (Þ–…í2ö¦îJey’R2“€J˜¼Ò›Ìì€I…šäTš·³ŽK$)°{%°ÕM¤7ÒPÈ2Ó.]€K,ä3o€7p½ûÜ0lÀ‚Ùò–žÓ$Æœˆ +€•ÊÉX 5ešÕö-÷ãn›ȈÀVdˆ3)CíSÙx˜ôŠP¨HžØ¢—–O–圪‘)i–j€ i´u@/ed– I`;²S›RvÚ¡å3o™§v2€“ŸLÛ¼W€Áˆ´¸Krs¶£ÒQ‘ÍÞ”åÖ›f4íD™¬@¨uÒ›0Э)Ó*$ìÊ?º·æÏžÛb%%%hœ™¦€HpÀ5c¢Õ÷®›ÛòHÍ‹`Vdˆ3)CíSÙx˜ôŠP¨HžØ¢—–O–圪‘)i–j€ i´u@/ed– I`;²S›RvÚ¡å3o™§v2€“ŸLÛ¼W€Áˆ´¸Krs¶£ÒQ‘ÍÞ”åÖ›f4íD™¬@¨uÒ›0Э)Ó*$ìÊ?º·æÏžÛb%%%hœ™¦€HpÀ5dn«vä*ìLï6]67œ›[rjÁY“¾2ª PÌ¥ K´Oeâ`Ðb)B¡"{bŠ^Y>[–rªD¥¤FX ª4u¦ÑÕ½”’X%%€îÉNmIÛj‡”;fÚ4ÊN}3nñ^K"Òá-ÉÎÚIFG7zS—Zm˜Óµd@±R¡×JlÃ@´§Lª4“³(ü "êß›™·x¯%‚ip–äçmG¤£#›½)Ë­6ÌiÚˆ2 X€)Pë¥6a  ZS¦UIÙ”~uoÍž)<¶ÄJJJÑ93L%á€5eŸdÇ €’ 1BLi]$=€‘PÂD0©§ Yt¬²€O”Ô¹Û-°rË›( €¸o,¦³%*PÊlÐÀ¬ÉßU(fR†%Ú §²ñ0è1¡P‘=±E/,Ÿ-Ë9U"RÒ#,Õ:Óhê€^ÊÉ,’Àwd§6¤íµCÊfß3Níe'>™·x¯%‚ip–äçmG¤£#›½)Ë­6ÌiÚˆ2 X€)Pë¥6a  ZS¦UIÙ”~uoÍž)<¶ÄJJJÑ93L%á€5kÿæ5'@˜aûOïðP3¤JA RÒ¥*°¬À$Ç*LCeí^ ›OºlBÚp `€¡¢Z-M–c9f%”b ª€45&ÐÔÀ”S6å3ifÉ‹;X|æKö3òÒ r€ƒ›<ܼ÷àm‚¤ˆ¼“—‘>ÊöÔúÊ:1«ÒšºÇlÆ=ˆ@)€ŒÊxyD º£tªv¹2ˆ©@)Nke6a ]W’UXÆÖ˜#˜ºmq9d‰ÔF\eÀ&”CFZÜÊÚ¹ °@XQ6¹GâGI7ÍŽÖØ5djðæW7,˜Ü°=CmHt¼åaË. ´ÀMxªc6±ˆLÀ e&3˜!JÔ<o„ÞíY ›ÅsÒlcà-<©*°¥KH² 5(·͸;n¶ãëXhº×‚•x|ãu-=á'\áÞ¹¾µ’‰5׎ŽlûÝÈ÷0PíüØ|o¢5e^Õö.7ã.›;ÈhÀTDXœ DßW¼›Ójæ^KeSj”þ#¥ã¨•b‘ö®†MÔ£Š[6!m Ñ`—3ï7 ôà Ñm2-³pÍ@‰3É&‹¤Àªå…ó—!JÈ<À5c¦Õ÷®›ÛòHÍ‹`TDXœ DßW¼›Ójæ^KeSj”þ#¥ã¨•b‘ö®†MÔ£Š[6!m Ñ`—3ï7 ôà Ñm2-³pÍ@‰3É&‹¤Àªå…ó—!JÈ<À5dr«vãªìLï6]67œQ›[rjÁQbp%}^òoM«™x, •MªSøŒ —Ž¢TyŠGÚº7RŽ)lØ…´€E€^\ϼÜ/Ó€/D]´È¶ÍÀ5"$ÎC$š,pN“«–ÌZ\„+ ó5fžÂö(¶f¶¶YXް»3[ Û,Û@¨ˆ±8‰¾¯y7¦Õ̼– ʦÕ)üFKÇQ*<Å#í] ›©G¶lBÚ@ ¢À/.gÞnéÀ¢.Úd[fà š€g!’M8'IUË æ-.B•y€5c:Õö-÷ãn›ȈÀV/oo*ئ彻 @5a~Õ÷®›ÛòHÍ‹`V/oo*ئ彻 @5b^«vä*ìLï6]67œ›[rjÁX½½¼¨Ob›–öì-5bþö¶Y¶(¶fX°»3[ Û,Û@¬^ÞÞT'±MË{v€5g«vÕN \“?]%Mv“(4ÄüÚXS€/¤ ÌÈ7, Ù†ÖÜÆ¼õÙ¾ì@תf׌­³» ºß3Ú×›¬»0TÃòfNLA§›6žmð×à¦sk€4LÂXc1YŠÈ¹ 5fÖÀåÊr° p›’[Û¸€’ð52ML‹Ù@L;†S˜V€”ø¦äxô@‘ ÞB7m„9Êt‰[Û²™1ÕCx¬(%*‚%JPà„ÛAV8TmŠnöP{e“YfÂ\»î–0 éfÖ$fáH¶)¹onˆ5ebÕö-÷ãn›ȈÀT?Þó3ÌZd†2nlÅ™ NêgM§›z5è™”Ú†` À¨t‡&EÅb™¸"dd€é€øNåÂê2±H.€&‘»¹Ÿw¸^§[ [5c¦Õ÷î›ÛòHÍ‹PT?Þó3ÌZd†2nlÅ™ NêgM§›z5è™”Ú†` À¨t‡&EÅb™¸"dd€é€øNåÂê2±H.€&‘»¹Ÿw¸^§[ [5dr«vä*ìLï6]67œ›[rjÁPÿ{ÌÌXg1i’È`¹³f€LL;©6žmè× fSj€3¡Ò™ˆfàT‰‘’¦gá;— ¨ÈfÅ ºšDîæ}Þàzœl)n@5fšÀåÈr° p€™’[û¸’ð62ML‹éÌ;†S¸V”øÆätô€‘ÞBwm„¹Êt÷¼À ņs™!€L†[›1fhÄÀº™ÓiæÞ€Mz¦e6¡˜0*!É‘qX€&nEH™ ú`~¹pºŒ†lR   ¤@.îgÝî©À–ä5fžÂö(¶f¶¶YX°»3[ Û,Û@¨½æf,3˜´É d0ÜÙ‹3@&&ÔΛO6ôkÐ 3)µ ÀPéL‹ŠÄ3p*DÈÉÓ3ðË…Ôd3b]M"ws>ïp½N¶· 5e2æöY¶&¶f¶KšÃ³3°Í²Ï±4 ‚y·äÙTà‡6k5göæõ°G·-SêÆ#˜<È p[XGšìâ€k =¹ˆšèÜÚmu.+Ý/MÙ’w8ÔIÞÌ•xƵ,.Tb“—Úc€ “o d`ÜÙ‹s@&¶ý_kß/Ž>’Jœû¥otâq[rÓ»8× fsi™€2Ì–4d5gÂöùPžÅ†Í”ØKR Ñctµ÷lË.̾,Kï0Ü5¾Â× O00(Ì¢Q›+)ŠJ¤=r¤Ö>ìÁÛ€œ7ÂÐ+-–¯bã~2é°ó¼†Œ5gÂöùPžÅ†Í”ØKR Ñctµ÷lË.̾,Kï0Ü5¾Â× O00(Ì¢Q›+)ŠJ¤=r¤Ö>ìÁÛ€œ7ÂÐ+v¯y é°í¿$ŒØ¶5gÂöùPžÅ†Í”ØKR Ñctµ÷lË.̾,Kï0Ü5¾Â× O00(Ì¢Q›+)ŠJ¤=r¤Ö>ìÁÛ€œ7ÂÐ+#U[nB®ÄÎóeÓaƒyÁ±5·&¬5f–Âö(¶f¶¶YY𽼨ObÃfÊl%©P h€±ºZû¶e—f_%÷˜nßak…'˜fQ(Í•”áE%R¹Rkv`íÀ ÎahˆÛ ³5°½²Í±D5gÞöùód97Çq ºa+.µ@k×oµ^¶b5°í¥é6Þé"®|Þöl0ñ“M¤ïr„Z/ÆÊØZcJÕï!Ý6·ä‘› 5bz‘øP)RZ9ÎT›×™ÐŽcB1¤ †Ð&RãA›‰$ŽY¡€–° ¼%ËÎå®b›–+ì-¢Vú˜˜¨ÆU,]€•às¦+Í•˜o[6ZÓ£–8 ¦Ó5g5gÞöùód97Çq ºa+.µ@k×oµ^¶b5°í¥é6Þé"®|Þöl0ñ“M¤ïr„Z/ÆÊØZaêì/l³lQlͲiGö¶Y¶(¶f€ !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~€‚ƒ„…†‡ˆ‰Š‹ŒŽ‘’“”•–—˜™š›œžŸ ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾¿ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖרÙÚÛÜÝÞßàáâãäåæçèéêëìíîïðñòóôõö÷øùúûüýþÿŸÙxl::«ÄUUVU::::::::::VVV:««ää«rä«:Uä«ä«rä«Ç««rá:U::::::äääU::::U:äV VVä:U::U«UääUUg:UUÇ«U:::: :Uó{:VUó6š2UUUN&UUv:VVVr««««««ä««««ääVääää««r:::::::::::::::::2r:::::XXŒX/'”€X E´\€X%AS€5X&\lX>&\lX -t_'€X9C¶—ÅIU…šH€PBšÙY Iu‰šX#´\€X+A4€€Xp/Ô€X@”€X+At€€X AŒX+B4´€X'At€€X1At´X*A´€€X+A´€€X]w´XUW´H€X8CÖÇ€X9C·÷˜X8CÖÇ€X-@Ô\X8}tXl_ÿU´ŒXKN´ŒX3Wt\€XOU´ŒXQN”ŒXTHtŒX7[´\€XRR4ŒX`4ŒX64Œ€XKU4ŒXKB´ŒXLaŒXNRŒX2]ôX€XOOôŒX,^ôX€XQZôŒX.NÔ\€XK´ŒXQR4Œ€XTtŒX wtŒXT´ŒXTtŒXKŒXF!”ŒfX#´\€XTŒfX8Ô_S€_ñH¢,fX-4~Õ€X%AׄXCBŒX(>÷„X#>ŒX&A÷„X (\X!>·„lXD>”ŒXDÔŒ_Ñ´ŒlXD?”ŒXB”ŒXDbw„XD>w„X"B—„XDB7„fX$>„fXC,w„X ;7„X"´Ð€XB>´X >—´X[—´X?7´X>÷´lX=W´X'Ô\lX^´\lX'4\lX,EyuX€PX€PX€PHÙ?˜DXCôXlPH“ó@Xxq>hX%AôÐV€X%B4´V€X )4~Õ€X}Ô\ €X.NÑ´€P\‹BžàXA|\€X€PX€PX€PX€PX@4_€X6ôsX*%´_€X$$ôsPnšCxÀ_þGO€` iøØX*T®Ï€Xqo”]€X ;4|P\ˆÂžàX)t7„X€PX€PXTr@Xt—´eX6@´Œf€XC´\X%B6ƒÅ€_ÿFôŒX^´\lX)At\lX&ô~€X^”\€X,ô_E€P†øBžàX9C·÷–PBšÙY X^”\€_ñH²Æx€X@*Ô_X'AvhX (”kIX(tkM€Xo%~Õ€XP?·´fXETŒfPºaÌ–XPl‡~¦˜X6ÔkIX+ô_GPŒùžàX6hô\€X6h”\€Xhô\€XOE´k€_ÿU±¨_ÿU±¨_ÿU±¨_ÿU² _ÿU²@_ÿU²XyŒX3Wt\i€XQN‘¨XQN‘¨XQN‘¨XQN’@Xñ¨XGñ¨_ð%±¨X#r@_ÿU´ŒXNR X2]ñ¨€X2]ñ¨€X2]ñ¨€X2]ò €X2]ò@€XQ@¶ó¸X*^ô XQR1¨€XQR1¨€XQR1¨€XQR2@€XTq¨XOOôŒXMJT\€X%AÔ|X%AÔ|X%AÔ|X%AÔ¬X%AÔ|X%AÔ(X"l·„X(>÷„d€X&Aô|X&Aô|X&Aô|X&Aô|XÔ|X_"ô|_ø&”|X#´|X%B4Œ€XD>t¬X"B”|X"B”|X"B”|X"B”¬X"B”|X'Aw7°€XAFW4XB>|XB>|XB>|XB>|X>ô|lXDB4ŒfX>ô|li11´ÿAT´ÿAV´ÿAWÚÿAY´ÿAvíÿAwíÿAyíÿA’´ÿA ÇÿF,ŽÿF.ŽÿFAÇÿLT´ÿLV´ÿLW´ÿLY´ÿLyÚÿL’ÇÿL ÚÿP,|ÿP.|ÿPA´ÿP íÿRTíÿRVíÿRWíÿRYíÿT,ŽÿT.ŽÿT:ŽÿT;ŽÿTA´ÿTOíÿTaŽÿTcŽÿTeŽÿTiÚÿToŽÿTrÚÿTsŽÿTuÚÿTwÇÿTyÇÿT íÿT­ÇÿV,¢ÿV.¢ÿV:ÚÿV;ÚÿVA´ÿVa´ÿVeÇÿViíÿVoÇÿVrÚÿVuÚÿVyÚÿV­ÇÿW,ÇÿW.ÇÿW:íÿW;íÿWAÚÿWaÚÿWeíÿWiWoíÿWríÿWuíÿWy÷ÿW­íÿY,|ÿY.|ÿY:ÇÿY;½ÿYA´ÿYa´ÿYe¢ÿYiÚÿYo¢ÿYp´ÿYq¢ÿYuÇÿYvÇÿY íÿY­¢ÿffíÿf’r,Çÿr.Çÿr’&v,´ÿv.´ÿw,Çÿw.Çÿy,´ÿy.´ÿ‘‘íÿ’síÿ’’íÿ’ Úÿ AÇÿ Tíÿ Yíÿming-0.4.5/perl_ext/common/beep.wav0000644000175000017500000000433611454264373014156 00000000000000RIFFÖWAVEfmt ñVñVdata²ÃÀ¸¬œŠweTH?<>EQar…˜¨¶¿ÃÁ»°¡|jYKA==CN\m”¥´¾ÄÄ¿µ¦”n\MB;;?IWh{¡±¼ÃÅÁ¹«š†s_OB:8;DQcvŠ®»ÄÇļ¯ŸŒxdSE<88?L]p…™«ºÄÉÈÁµ¥‘}hVG<77=IYl•§·ÂÈÈø©–mYH<559DTf{¤µÁÉËǽ®›‡r^L?648?N`u‹ ²ÀÊÍÊÁ³¢wbO@624/&$*6H^x‘©¿ÏØÛÖ˺£‹qYC3($(3CXq‹¤»ÍØÝÚÐÀª’w^G5("$-=Qj„žµÈÕÜÛÕÆ²™~dL8)!!)7Jc}˜°ÅÔÝÞØË· †kR<,#$1D\v‘«ÁÓÞáÜѾ§qW@.""->UoŠ¥¼ÑÝãàÖÅ®”x]D1#'8NgƒŸ¸ÌÛâáÙʵ›€dJ5&"1F`|˜³ÉÚãåÞм£‡kP9' -AXt‘¬ÃÖáçãÖërV=)':Qm‰¦¿ÓáçäÚȰ•x\B,"3Kf„¡»Ñàèçßθœ€cG1 .D^{™µÌÝçéãÕÀ¥‡jM4"(=Vt’¯ÇÛæëæÙƬqT:&"6OlŠ¨ÃØçíêßÍ´˜y[@*0Hd‚ ½ÔåîîäÔ¼ bE-)@\z™·ÏâìïèÙè‰jM3"7Sq‘°Êßìñìßʰ‘qS7"1Li‰¨ÄÚéóðåÒ¹šzZ=& *Ca¡¾×èòòé×À¢‚cE* #;Xx™¸ÒæòõîÞÇ«‹jK0 4Pp‘°ÌáðõòåÏ´”rR4 -IhŠ«Èßï÷ôéÕ»›zY;#&@_£ÁÛíøøîÜä‚aB' 9Wxšº×ëøûôãË­‹iH, 0No’³ÐæöûöèÒ¶•rP3 (Dfˆ«ÊãôýûïÙ¾ž{Y:!#>^€¡ÁÜï÷øïÝĦ„bC(7Vw˜¹ÔéöùòáÊ­kK0  2Nn¯Ìãñ÷óæÐµ•tT8! -Gf‡§ÄÜìôóèÕ»}\?( )A^~ž¼ÕçñòêÙÂ¥…eF-%;Wv–³ÎáíñëÝȬŽnP6"#7QoެÇÜéïëß˱”uV;' 2Kg†¤¿ÕåìëáÏ·›}_B,/E`~œ¸ÏàéêâÓ½¢…gJ3!)@Yv”°ÈÛåéäÖéoS:'':So¨ÁÕâçãÙǯ”wZA-%7Mh„ ºÎÝäãÚʵ›~bI3$#2Ga}™²ÈØáâÜι¡†jP9)"/C[v‘¬ÁÓÞáÜѾ§qW@.""->UoŠ¥¼ÏÛßÝÓ­“y_G4' "+;Phƒž¶É×ÞÝÖű™€fN:+$#*8Kb|–¯ÃÒÙÛÔȶŸ†mT@0&$)5G\u¨½ÎØÛÖʹ£‹rZE5*&*4DXp‰¢·ÉÔÙ×yaK:.(*2@Tjƒ›±ÃÐÖÕÏÁ®˜€gR@2,+1>Oe|”«½ËÓÕÏó†nWD5.,1;L_vޤ·ÆÐÓÐŶ¢Œt^J:0,/:H[q‡ž±ÁÌÑÏǹ§‘zdP?6119EWl—¬¼ÈÎÎǼ«—jVE8118CSg|‘¦·ÄËÍȾ®œ†p\J<526@Nbv‹ ±¿ÈËÈ¿± ‹vbOA846>K]q†š¬ºÄÉÇÀ´¤|hUF<77>IYl•§·ÀÆÆÁ¶§•n[K@99=GVg{¡±¼ÃÅÁ·ª™†r`OC<:=FSdwЬ¸ÀÃÀ¸¬œŠweTH?<>EQar…˜¨¶¿Á¿¹® Ž|jZLC??EO]n“£±»ÀÀ»°£“p_QGAAEN[j|Žž­·¾¿¼³§—…tdVKDBELXgw‰™¨³»½»²§šŠyiZOGDEKVcs„”£¯·»º´«žŽ}m_SJFGKTap€ž«´¸¹µ¬ ’‚qdWNIHLS^l|‹š¦°¶·´­¢•†vgZPLJLS\iw‡•¢¬³µ³­¤˜‰zl_TMJKR[gtƒ‘ž¨¯³²­¥š~pcXPLLQYcq𤬰±­¦œ‚tg\SONSZco|‰–¡©®¯­§’…wk`WRPRX`ly†’¦«­¬§ž”ˆ{ocZTRSX_ju‚Ž™¢¨«ª¦Ÿ–‹~rg^XTTX_hs‹— ¥©©¦ —vkb[WVX^fp|ˆ“œ¤¨©¥ ™…yoe^YXY^eoy…™Ÿ£¥¤ š‘‡|ria\Z[^dmwŒ•¢¥£ š’‰ule_\\_dlu‰’šŸ££¡œ“‹‚xohb_^`dks|†–œ ¡ œ•„{rkea`aejrzƒŒ“šžŸŸ›–†}umhdbbejqx‰–›š–‡€xqkfddfjpw‡Ž”˜››™•‰ysmiffgkpv}„‹‘–˜™˜•Šƒ|uojihikpu{‚‰Ž“–——”‹„~wqmihhlpuz€†Œ”••“‹†€ytoljjkosy„ŠŽ‘€ming-0.4.5/perl_ext/MovieClip.xs0000644000175000017500000000542611454264373013500 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::MovieClip PACKAGE = SWF::MovieClip PREFIX = SWFMovieClip_ PROTOTYPES: ENABLE SWF::MovieClip SWFMovieClip_new(package="SWF::MovieClip") char *package CODE: RETVAL = newSWFMovieClip(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); if (!strcmp(package,"SWF::Sprite")) warn("Using SWF::Sprite is deprecated. Use SWF::MovieClip instead!"); SWF::DisplayItem SWFMovieClip_add(clip, block) SWF::MovieClip clip SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(1))); CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovieClip_add(clip, block); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::DisplayItem", (void*)RETVAL); void SWFMovieClip_remove(clip, item) SWF::MovieClip clip SWF::DisplayItem item void SWFMovieClip_nextFrame(clip) SWF::MovieClip clip void SWFMovieClip_labelFrame(clip, label) SWF::MovieClip clip char *label void SWFMovieClip_setNumberOfFrames(clip, frames) SWF::MovieClip clip int frames ALIAS: SWF::MovieClip::setFrames = 1 void destroySWFMovieClip(clip) SWF::MovieClip clip ALIAS: SWF::MovieClip::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "MovieClip DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFMovieClip(clip); SWF::SoundInstance SWFMovieClip_startSound(movieclip, sound) SWF::MovieClip movieclip SWF::Sound sound CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovieClip_startSound(movieclip, sound); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::SoundInstance", (void*)RETVAL); void SWFMovieClip_stopSound(movieclip, sound) SWF::MovieClip movieclip SWF::Sound sound CODE: SWFMovieClip_stopSound(movieclip, sound); void SWFMovieClip_setScalingGrid(movieclip, x, y, w, h) SWF::MovieClip movieclip int x int y int w int h void SWFMovieClip_removeScalingGrid(movieclip) SWF::MovieClip movieclip void SWFMovieClip_addInitAction(movieclip, action) SWF::MovieClip movieclip SWF::Action action void SWFMovieClip_setSoundStream(movie, sound, rate, skip=0.0) SWF::MovieClip movie SWF::SoundStream sound float rate float skip CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFMovieClip_setSoundStreamAt(movie, sound, rate, skip); ming-0.4.5/perl_ext/SWF.pm.in0000644000175000017500000000557711454264373012646 00000000000000# ==================================================================== # Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Id$ package SWF; use strict; use Carp 'croak'; require DynaLoader; @SWF::ISA = qw(DynaLoader); $SWF::VERSION = '@MING_VERSION@'; my @EXPORT_OK = qw(Action Bitmap Button Constants DisplayItem Fill Font Gradient Morph Movie MovieClip PrebuiltClip Shape Sound Text TextField FontCharacter ButtonRecord BinaryData InitAction Matrix Blur Shadow FilterMatrix Filter CXform Sprite BrowserFont FontCollection Character); bootstrap SWF $SWF::VERSION; sub import{ my $self = shift; my @modules = @_; my $package = (caller())[0]; my @failed; foreach my $module (@modules) { my $code = "package $package; "; if($module eq ':ALL'){ map{$code .= "use SWF::$_; "} @EXPORT_OK; }else{ $code .= "use SWF::$module;"; } eval($code); if ($@) { warn $@; push(@failed, $module); } } @failed and croak "could not import qw(" . join(' ', @failed) . ")"; } 1; __END__ =head1 NAME SWF - an autoloadable interface module for Ming - a library for generating ShockWave Flash format movies. =head1 SYNOPSIS # Don't import other modules use SWF; # import all SWF modules use SWF qw(:ALL); # import SWF::Shape and SWF::Movie only. use SWF qw(Shape Movie); =head1 DESCRIPTION By default, SWF doesn't import other SWF classes. You may, however, instruct SWF to import all modules by using the following syntax: use SWF qw(:ALL); =head1 METHODS =over 4 =item SWF::setScale($scale); Sets scale to $scale. =item SWF::getScale(); Get the current scale. 20 means 20 twips (1/20 of a pixel) and is the default value. =item SWF::setVersion($version); Sets SWF version for the header of flashfiles. Choose a value between 4 and 7 for your flashmovies. If you are unsure take 5. =item SWF::setCubicThreshold($num) Sets the threshold error for drawing cubic beziers. Lower is more accurate, hence larger file size. =item SWF::setSWFCompression($level); Set output compression level. Returns previous value. $level is integer between 0 and 9. Note: This function is called automatic too by $movie->save($filename[,$level]) and $movie->output([$level]) if the optional parameter $level is given. =item SWF::useConstants($flags); ? =back =head1 AUTHOR Soheil Seyfaie (soheil at users.sourceforge.net). =head1 SEE ALSO SWF.pm related modules: SWF::Action, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill, SWF::Font, SWF::Gradient, SWF::Morph, SWF::Movie, SWF::MovieClip, SWF::PrebuiltClip, SWF::Shape, SWF::Sound, SWF::TextField, SWF::Text, SWF::VideoStream, SWF::Sprite other projects: SWF::Builder - a pure perl alternative to Ming =cut ming-0.4.5/perl_ext/Character.xs0000644000175000017500000000137311454264373013502 00000000000000/* ==================================================================== * Copyright (c) 2008 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Character PACKAGE = SWF::Character PREFIX = SWFCharacter_ PROTOTYPES: ENABLE float SWFCharacter_getWidth(c) SWF::Character c float SWFCharacter_getHeight(c) SWF::Character c void SWFCharacter_DESTROY(c) SWF::Character c CODE: S_DEBUG(2, fprintf(stderr, "Character DESTROY CALLED\n")); ming-0.4.5/perl_ext/FontCollection.xs0000644000175000017500000000237311454264373014531 00000000000000/* ==================================================================== * Copyright (c) 2008 Klaus Rechert All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::FontCollection PACKAGE = SWF::FontCollection PREFIX = SWFFontCollection_ PROTOTYPES: ENABLE SWF::FontCollection SWFFontCollection_new(package="SWF::FontCollection", filename) char *package char *filename CODE: RETVAL = newSWFFontCollection_fromFile(filename); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFFontCollection(block) SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(0))); ALIAS: SWF::FontCollection::DESTROY = 1 CODE: destroySWFFontCollection((SWFFontCollection)block); int SWFFontCollection_getFontCount(fc) SWF::FontCollection fc SWF::Font SWFFontCollection_getFont(fc, index) SWF::FontCollection fc int index CODE: RETVAL = SWFFontCollection_getFont(fc, index); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Font", (void*)RETVAL); ming-0.4.5/perl_ext/BrowserFont.xs0000644000175000017500000000203011454264373014047 00000000000000/* ==================================================================== * Copyright (c) 2007 Klaus Rechert All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::BrowserFont PACKAGE = SWF::BrowserFont PREFIX = SWFBrowserFont_ PROTOTYPES: ENABLE SWF::BrowserFont SWFBrowserFont_new(package="SWF::BrowserFont", name) char *package char *name CODE: RETVAL = newSWFBrowserFont(name); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFBrowserFont(block) SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(0))); ALIAS: SWF::BrowserFont::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "BROWSERFONT DESTROY CALLED\n")); destroySWFBrowserFont((SWFBrowserFont)block); ming-0.4.5/perl_ext/Makefile.in0000644000175000017500000003300112154727025013264 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = perl_ext DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \ $(srcdir)/SWF.pm.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/python.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/ming_config.h CONFIG_CLEAN_FILES = SWF.pm CONFIG_CLEAN_VPATH_FILES = AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ SOURCES = DIST_SOURCES = am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GIFLIB = @GIFLIB@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERFACE_AGE = @INTERFACE_AGE@ INTERFACE_CURRENT = @INTERFACE_CURRENT@ INTERFACE_REVISION = @INTERFACE_REVISION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATHLIB = @MATHLIB@ MICRO_VERSION = @MICRO_VERSION@ MING_VERSION = @MING_VERSION@ MINOR_VERSION = @MINOR_VERSION@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PHP = @PHP@ PHPIZE = @PHPIZE@ PNGLIB = @PNGLIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHCFLAGS = @SHCFLAGS@ SHELL = @SHELL@ STRIP = @STRIP@ TCL = @TCL@ TCL_INC_DIR = @TCL_INC_DIR@ TCL_LIB_DIR = @TCL_LIB_DIR@ VERSION = @VERSION@ XLIB = @XLIB@ YACC = @YACC@ ZLIB = @ZLIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = SWF/Action.pm SWF/BinaryData.pm SWF/Bitmap.pm SWF/Blur.pm \ SWF/Button.pm SWF/ButtonRecord.pm SWF/Constants.pm \ SWF/CXform.pm SWF/DisplayItem.pm SWF/Fill.pm \ SWF/FilterMatrix.pm SWF/Filter.pm SWF/Font.pm \ SWF/FontCharacter.pm SWF/Gradient.pm SWF/InitAction.pm \ SWF/Matrix.pm SWF/Morph.pm SWF/Movie.pm SWF/PrebuiltClip.pm \ SWF/Shape.pm SWF/Shadow.pm SWF/Sound.pm \ SWF/SoundInstance.pm SWF/SoundStream.pm SWF/MovieClip.pm \ SWF/Text.pm SWF/TextField.pm SWF/VideoStream.pm SWF/Sprite.pm \ SWF/BrowserFont.pm SWF/FontCollection.pm SWF/Character.pm\ t/00_basic.t t/01_shape.t t/03_movie.t t/button.t t/drag.t \ t/fill.t t/filljpeg.t t/gradient.t t/movieclip.t t/png.t \ t/sound.t \ Action.xs BinaryData.xs Bitmap.xs Blur.xs Button.xs CREDITS \ Changes Constants.xs CXform.xs BrowserFont.xs FontCollection.xs\ DisplayItem.xs Exports.c Fill.xs FilterMatrix.xs Filter.xs \ Font.xs Gradient.xs InitAction.xs MANIFEST Makefile.PL \ Matrix.xs Morph.xs Movie.xs MovieClip.xs PrebuiltClip.xs \ README SUPPORT SWF.pm.in SWF.xs Shadow.xs Shape.xs Sound.xs \ SoundInstance.xs SoundStream.xs TODO Text.xs TextField.xs \ VideoStream.xs FontCharacter.xs ButtonRecord.xs Character.xs\ perl_swf.h swf_util.c typemap examples/action.cgi \ examples/alphafill.cgi examples/animation.cgi \ examples/glyph.cgi examples/jpegfill.cgi \ examples/keypress.cgi examples/morph.cgi examples/shape.cgi \ examples/sound.cgi examples/sprite.cgi examples/text.cgi \ examples/textfield.cgi examples/video.cgi \ common/_sans.fdb common/README common/beep.wav \ mkdoc all: all-am .SUFFIXES: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu perl_ext/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu perl_ext/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): SWF.pm: $(top_builddir)/config.status $(srcdir)/SWF.pm.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs tags: TAGS TAGS: ctags: CTAGS CTAGS: distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile installdirs: install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-generic clean-libtool clean-local mostlyclean-am distclean: distclean-am -rm -f Makefile distclean-am: clean-am distclean-generic distclean-local dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-generic mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: .MAKE: install-am install-strip .PHONY: all all-am check check-am clean clean-generic clean-libtool \ clean-local distclean distclean-generic distclean-libtool \ distclean-local distdir dvi dvi-am html html-am info info-am \ install install-am install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \ uninstall uninstall-am #TMP_DIR=$(top_builddir)/perl_ext #abs_builddir=`cd $(TMP_DIR); pwd` all: Makefile.perl $(MAKE) -f Makefile.perl install: Makefile.perl $(MAKE) -f Makefile.perl install PREFIX=$(prefix) Makefile.perl: Makefile.PL srcdir=$(srcdir) builddir=$(abs_builddir) $(PERL) $< PREFIX=$(prefix) FIRST_MAKEFILE=Makefile.perl clean-local: Makefile.perl $(MAKE) -f Makefile.perl realclean rm -f Makefile.perl distclean-local: rm -f t/config.pl check: all # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ming-0.4.5/perl_ext/Bitmap.xs0000644000175000017500000001077211454264373013025 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Bitmap PACKAGE = SWF::Bitmap PREFIX = SWFBitmap_ PROTOTYPES: ENABLE # ** ToDo: also handle alpha file ** SWF::Bitmap SWFBitmap_new(package="SWF::Bitmap", filename, alpha=NULL) char *package char *filename = NO_INIT char *alpha PREINIT: CV *cv; STRLEN len; char *my_sub; CODE: filename = (char *) SvPV(ST(1), len); my_sub = alpha ? "SWF::Bitmap::newSWFJpegWithAlpha" : "SWF::Bitmap::newSWFBitmap"; #if 0 if( strncasecmp(filename+len-4, ".jpg", 4) == 0 || strncasecmp(filename+len-5, ".jpeg", 5) == 0) my_sub = alpha ? "SWF::Bitmap::newSWFJpegWithAlpha" : "SWF::Bitmap::newSWFJpegBitmap"; else if(strncasecmp(filename+len-4, ".dbl", 4) == 0) my_sub = "SWF::Bitmap::newSWFDBLBitmap"; else croak("argument to SWF::Bitmap::New must be a JPG or dbl filename"); #endif PUSHMARK(mark); cv = GvCV(gv_fetchpv(my_sub, FALSE, SVt_PVCV)); #ifdef PERL_OBJECT (void)(*CvXSUB(cv))(cv, pPerl); #else (void)(*CvXSUB(cv))(aTHXo_ cv); #endif SWF::Bitmap newBitmapFromFileHandle(package="SWF::Bitmap", fh) char *package FILE *fh CODE: RETVAL = newSWFBitmap_fromInput(newSWFInput_file(fh)); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); SWF::Bitmap newSWFDBLBitmap(package="SWF::Bitmap", filename) char *package char *filename PREINIT: FILE *dbl; CODE: if ( !(dbl = fopen(filename, "rb")) ){ fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; }else{ RETVAL = (SWFBitmap)newSWFDBLBitmap(dbl); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } SWF::Bitmap newSWFBitmap(package="SWF::Bitmap", filename) char *package char *filename PREINIT: FILE *f; SWFInput in; CODE: if ( !(f = fopen(filename, "rb")) ){ fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; }else{ in = newSWFInput_file(f); if ( ! in ) { fprintf(stderr, "Unable to create SWFInput from %s\n", filename); ST(0) = &sv_undef; }else{ RETVAL = (SWFBitmap)newSWFBitmap_fromInput(in); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } } SWF::Bitmap newSWFJpegWithAlpha(package="SWF::Bitmap", filename, mask) char *package char *filename char *mask PREINIT: FILE *f; FILE *alpha; CODE: if ( !(f = fopen(filename, "rb")) ){ fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; } else{ if ( !(alpha = fopen(mask, "rb")) ){ fprintf(stderr, "Unable to open %s\n", mask); ST(0) = &sv_undef; } else{ RETVAL = (SWFBitmap)newSWFJpegWithAlpha(f, alpha); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } } # obsoleted, not used anymore SWF::Bitmap newSWFJpegBitmap(package="SWF::Bitmap", filename) char *package char *filename PREINIT: FILE *f; CODE: if (!(f = fopen(filename, "rb"))) { fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; }else{ RETVAL = (SWFBitmap)newSWFJpegBitmap(f); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } int SWFBitmap_getWidth(b) SWF::Bitmap b int SWFBitmap_getHeight(b) SWF::Bitmap b void destroySWFBitmap(bitmap) SWF::Bitmap bitmap ALIAS: SWF::Bitmap::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Bitmap DESTROY CALLED\n")); destroySWFBitmap(bitmap); ming-0.4.5/perl_ext/Action.xs0000644000175000017500000000204311454264373013016 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Action PACKAGE = SWF::Action PREFIX = SWFAction_ PROTOTYPES: ENABLE SWF::Action SWFAction_new(package="SWF::Action", script) char *package char *script CODE: RETVAL = newSWFAction(script); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void SWFAction_DESTROY(action) SWF::Action action CODE: S_DEBUG(2, fprintf(stderr, "Action DESTROY CALLED\n")); int SWFAction_compile(action, version) SWF::Action action int version PREINIT: int len; CODE: RETVAL = SWFAction_compile(action, version, &len); OUTPUT: RETVAL ming-0.4.5/perl_ext/README0000644000175000017500000000654511454264373012120 00000000000000SWF.pm -- A perl interface for creating SWF files. ABSTRACT: --------- This is an auto-loadable interface module for Ming - a library for generating SWF ("Flash") format movies. With this library you can create Flash movies on the fly with Perl. INSTALLATION using CPAN ----------------------- This is currently not finished. So skip to 'INSTALLATION using automake' It is more a stub on CPAN to say 'Hey, here I am'. In future it should contain ming releases (c and perl parts) like DBD::SQLite, so it can directly be installed over CPAN without extra efforts. INSTALLATION using automake --------------------------- 1. Get the sources from http://sourceforge.net/projects/ming 2. Unpack the sources tar xvzf ming-perl-XXX.tar.gz or tar xvzf ming-perl-XXX.tar.bz2 3. Change to ming root directory, not ming-perl-XXX/perl_ext: cd ming-perl-XXX 3b. When using CVS sources create the configure script if it not exists by ./autogen.sh 4. Run the configure script ./configure --enable-perl --disable-cpp Hints: - type ./configure --help for all available options - c++ is currently enabled by default Wait until this script finished successfully, else post to ming-users mailing list or bug report or install missing packages when this is the reason for the failure. 5. Run make make This compiles first ming itself, then language extensions and utils. Wait until this finished successfully, else post to ming-users mailing list or bug report 6. Run make check make check This runs all existing tests for ming and the enabled extensions. When all tests pass without error go to next step, else post to ming-users mailing list or bug report 7. make install INSTALLATION (old): --------------------- Read these instructions all the way through before you start! 1. Make sure you have downloaded Ming ( http://sourceforge.net/projects/ming ). If you haven't compiled Ming, it will be compiled during SWF.pm installation process (step 3 below). 2. Unpack the tar file. (If you are reading this you have probably done this. :-)) Under Unix type: tar xvzf ming-perl-XXX.tar.gz 3. Compile: a. cd ming-perl-XXX/perl-ext b. perl Makefile.PL c. make d. make test (optional but recommended) e. make install During step (b), Makefile.PL will try to find your Ming distribution. If it fails, you will be asked to provide the Ming directory. If you want to install SWF into your home directory, replace step (b) with: b. perl Makefile.PL PREFIX=/path/to/your/directory AFTER INSTALLATION ------------------ There are a growing number of tests in several languages under the test/ directory. This is a good source for what can be done with ming. There are some cgi demos in the perl_ext/examples directory. THE EXAMPLES ARE NOT PERLIASH (you can write it more succinctly in Perl). After install there is too some (still incomplete) documentation accessible by manpages. E.g. type man SWF or man SWF::Shape Hint: The KDE file and web browser Konqueror formats manpages automatic as nice HTML-files. COPYRIGHT INFO -------------- Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. AUTHOR: _______ Soheil Seyfaie soheil at users.sourceforge.net and many others (see http://sourceforge.net/projects/ming/ ) ming-0.4.5/perl_ext/Text.xs0000644000175000017500000000431411454264373012530 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Text PACKAGE = SWF::Text PREFIX = SWFText_ PROTOTYPES: ENABLE SWF::Text SWFText_new(package="SWF::Text", version=1) char *package int version CODE: if(version == 2) RETVAL = newSWFText2(); else RETVAL = newSWFText(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFText(text) SWF::Text text ALIAS: SWF::Text::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Text DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFText(text); void SWFText_setFont(text, font) SWF::Text text SWF::Font font CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFText_setFont(text, font); void SWFText_setHeight(text, height) SWF::Text text float height void SWFText_moveTo(text, x, y) SWF::Text text float x float y void SWFText_setColor(text, r, g, b, a=0xff) SWF::Text text byte r byte g byte b byte a void SWFText_addString(text, string, advance=NULL) SWF::Text text char * string int * advance void SWFText_addUTF8String(text, string, advance=NULL) SWF::Text text char * string int * advance void SWFText_addWideString(text, string, strlen, advance=NULL) SWF::Text text short * string int strlen int * advance void SWFText_setSpacing(text, spacing) SWF::Text text float spacing float SWFText_getStringWidth(text, string) SWF::Text text char * string ALIAS: SWF::Text::getWidth = 1 float SWFText_getUTF8StringWidth(text, string) SWF::Text text char * string float SWFText_getWideStringWidth(text, string) SWF::Text text short * string float SWFText_getAscent(text) SWF::Text text float SWFText_getDescent(text) SWF::Text text float SWFText_getLeading(text) SWF::Text text ming-0.4.5/perl_ext/Makefile.am0000644000175000017500000000401211454264373013257 00000000000000EXTRA_DIST = SWF/Action.pm SWF/BinaryData.pm SWF/Bitmap.pm SWF/Blur.pm \ SWF/Button.pm SWF/ButtonRecord.pm SWF/Constants.pm \ SWF/CXform.pm SWF/DisplayItem.pm SWF/Fill.pm \ SWF/FilterMatrix.pm SWF/Filter.pm SWF/Font.pm \ SWF/FontCharacter.pm SWF/Gradient.pm SWF/InitAction.pm \ SWF/Matrix.pm SWF/Morph.pm SWF/Movie.pm SWF/PrebuiltClip.pm \ SWF/Shape.pm SWF/Shadow.pm SWF/Sound.pm \ SWF/SoundInstance.pm SWF/SoundStream.pm SWF/MovieClip.pm \ SWF/Text.pm SWF/TextField.pm SWF/VideoStream.pm SWF/Sprite.pm \ SWF/BrowserFont.pm SWF/FontCollection.pm SWF/Character.pm\ t/00_basic.t t/01_shape.t t/03_movie.t t/button.t t/drag.t \ t/fill.t t/filljpeg.t t/gradient.t t/movieclip.t t/png.t \ t/sound.t \ Action.xs BinaryData.xs Bitmap.xs Blur.xs Button.xs CREDITS \ Changes Constants.xs CXform.xs BrowserFont.xs FontCollection.xs\ DisplayItem.xs Exports.c Fill.xs FilterMatrix.xs Filter.xs \ Font.xs Gradient.xs InitAction.xs MANIFEST Makefile.PL \ Matrix.xs Morph.xs Movie.xs MovieClip.xs PrebuiltClip.xs \ README SUPPORT SWF.pm.in SWF.xs Shadow.xs Shape.xs Sound.xs \ SoundInstance.xs SoundStream.xs TODO Text.xs TextField.xs \ VideoStream.xs FontCharacter.xs ButtonRecord.xs Character.xs\ perl_swf.h swf_util.c typemap examples/action.cgi \ examples/alphafill.cgi examples/animation.cgi \ examples/glyph.cgi examples/jpegfill.cgi \ examples/keypress.cgi examples/morph.cgi examples/shape.cgi \ examples/sound.cgi examples/sprite.cgi examples/text.cgi \ examples/textfield.cgi examples/video.cgi \ common/_sans.fdb common/README common/beep.wav \ mkdoc #TMP_DIR=$(top_builddir)/perl_ext #abs_builddir=`cd $(TMP_DIR); pwd` all: Makefile.perl $(MAKE) -f Makefile.perl install: Makefile.perl $(MAKE) -f Makefile.perl install PREFIX=$(prefix) Makefile.perl: Makefile.PL srcdir=$(srcdir) builddir=$(abs_builddir) $(PERL) $< PREFIX=$(prefix) FIRST_MAKEFILE=Makefile.perl clean-local: Makefile.perl $(MAKE) -f Makefile.perl realclean rm -f Makefile.perl distclean-local: rm -f t/config.pl check: all ming-0.4.5/perl_ext/CREDITS0000644000175000017500000000125111454264373012245 00000000000000=head1 NAME CREDITS - perl-ming contributors This file doesn't full reflect the contributors. Please see the file AUTHORS in the distribution of ming (ming.sf.net) and CVS Repository there. =head1 MAJOR CONTRIBUTORS Thanks to the following people for their contribution (sorted by name): =over =item Dave Hayden (opaque_ndst at users.sourceforge.net) For creating the Ming library =item Erich Schubert (erich at users.sourceforge.net) For Debian packaging =item Klaus Rechert =item Peter Liscovius (peterdd at users.sourceforge.net) =item Sandro Santilli =item Wolfgang Hamann (whamann at users.sourceforge.net) For fixing and maintaining the Ming library =back ming-0.4.5/perl_ext/Changes0000644000175000017500000000161611454264373012525 00000000000000Revision history for Perl extension SWF. 2007-09-29 This file were never serious maintained. Please see CVS on sourceforge project page: http://sourceforge.net/cvs/?group_id=18365 or look at the ChangeLog and NEWS file of the ming distribution where all changes are condensed. Tue Sep 25, 2001 - added DisplayItem accessor methods - fixed SWF::Font::new method to accept browser fonts (reported by Zbigniew). 0.09-dev Sun Sep 23 - added SWF::Constants (this makes using SWF easier but it changes interface a bit :( Now you need to say, for example: use SWF::Constants ':Button'; - Splitted the SWF.xs - it's now easier to maintain and debug 0.01b Fri Aug 10 - updated the CVS version - fixed DESTROY - Loads of other changes. 0.01b Mon Jan 15 23:23:02 2001 - beta version ming-0.4.5/perl_ext/InitAction.xs0000644000175000017500000000176411454264373013653 00000000000000/* ==================================================================== * Copyright (c) 2008 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::InitAction PACKAGE = SWF::InitAction PREFIX = SWFInitAction_ PROTOTYPES: ENABLE SWF::InitAction SWFInitAction_new(package="SWF::Action", action, id=-1) char *package SWF::Action action int id CODE: if (id==-1) { RETVAL = newSWFInitAction(action); } else { RETVAL = newSWFInitAction_withId(action, id); } ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void SWFInitAction_DESTROY(action) SWF::InitAction action CODE: S_DEBUG(2, fprintf(stderr, "InitAction DESTROY CALLED\n")); ming-0.4.5/perl_ext/Exports.c0000644000175000017500000001277612154643236013050 00000000000000/* ==================================================================== * Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Id$ */ #include "perl_swf.h" static char *SWF_Fill_tag[] = { "SWFFILL_SOLID", "SWFFILL_GRADIENT", "SWFFILL_LINEAR_GRADIENT", "SWFFILL_RADIAL_GRADIENT", "SWFFILL_FOCAL_GRADIENT", "SWFFILL_BITMAP", "SWFFILL_TILED_BITMAP", "SWFFILL_CLIPPED_BITMAP", "SWFFILL_NONSMOOTHED_TILED_BITMAP", "SWFFILL_NONSMOOTHED_CLIPPED_BITMAP", NULL, }; static char *SWF_Button_tag[] = { "SWFBUTTON_HIT", "SWFBUTTON_DOWN", "SWFBUTTON_OVER", "SWFBUTTON_UP", "SWFBUTTON_MOUSEUPOUTSIDE", "SWFBUTTON_DRAGOVER", "SWFBUTTON_DRAGOUT", "SWFBUTTON_MOUSEUP", "SWFBUTTON_MOUSEDOWN", "SWFBUTTON_MOUSEOUT", "SWFBUTTON_MOUSEOVER", "SWFBUTTON_KEYPRESS", "SWFBUTTON_ONKEYPRESS", NULL, }; static char *SWF_Sound_tag[] = { "SWF_SOUND_NOT_COMPRESSED", "SWF_SOUND_ADPCM_COMPRESSED", "SWF_SOUND_MP3_COMPRESSED", "SWF_SOUND_NOT_COMPRESSED_LE", "SWF_SOUND_NELLY_COMPRESSED", "SWF_SOUND_5KHZ", "SWF_SOUND_11KHZ", "SWF_SOUND_22KHZ", "SWF_SOUND_44KHZ", "SWF_SOUND_8BITS", "SWF_SOUND_16BITS", "SWF_SOUND_MONO", "SWF_SOUND_STEREO", NULL, }; static char *SWF_TextField_tag[] = { "SWFTEXTFIELD_NOEDIT", "SWFTEXTFIELD_PASSWORD", "SWFTEXTFIELD_DRAWBOX", "SWFTEXTFIELD_MULTILINE", "SWFTEXTFIELD_WORDWRAP", "SWFTEXTFIELD_NOSELECT", "SWFTEXTFIELD_ALIGN_LEFT", "SWFTEXTFIELD_ALIGN_RIGHT", "SWFTEXTFIELD_ALIGN_CENTER", "SWFTEXTFIELD_ALIGN_JUSTIFY", "SWFTEXTFIELD_HTML", "SWFTEXTFIELD_HASLENGTH", "SWFTEXTFIELD_USEFONT", "SWFTEXTFIELD_AUTOSIZE", NULL, }; static char *SWF_DisplayItem_tag[] = { "SWFACTION_ONLOAD", "SWFACTION_ENTERFRAME", "SWFACTION_UNLOAD", "SWFACTION_MOUSEMOVE", "SWFACTION_MOUSEDOWN", "SWFACTION_MOUSEUP", "SWFACTION_KEYDOWN", "SWFACTION_KEYUP", "SWFACTION_DATA", "SWFBLEND_MODE_NULL", "SWFBLEND_MODE_NORMAL", "SWFBLEND_MODE_LAYER", "SWFBLEND_MODE_MULT", "SWFBLEND_MODE_SCREEN", "SWFBLEND_MODE_DARKEN", "SWFBLEND_MODE_LIGHTEN", "SWFBLEND_MODE_ADD", "SWFBLEND_MODE_SUB", "SWFBLEND_MODE_DIFF", "SWFBLEND_MODE_INV", "SWFBLEND_MODE_ALPHA", "SWFBLEND_MODE_ERASE", "SWFBLEND_MODE_OVERLAY", "SWFBLEND_MODE_HARDLIGHT", NULL, }; static char *SWF_Filter_tag[] = { "SWF_FILTER_MODE_INNER", "SWF_FILTER_MODE_KO", "SWF_FILTER_MODE_COMPOSITE", "SWF_FILTER_MODE_ONTOP", "SWF_FILTER_CLAMP", "SWF_FILTER_FLAG_PRESERVE_ALPHA", NULL, }; static char *SWF_Gradient_tag[] = { "SWF_GRADIENT_PAD", "SWF_GRADIENT_REFLECT", "SWF_GRADIENT_REPEAT", "SWF_GRADIENT_NORMAL", "SWF_GRADIENT_LINEAR", NULL, }; static char *SWF_Shape_tag[] = { "SWF_SHAPE_USESCALINGSTROKES", "SWF_SHAPE_USENONSCALINGSTROKES", "SWF_LINESTYLE_CAP_ROUND", "SWF_LINESTYLE_CAP_NONE", "SWF_LINESTYLE_CAP_SQUARE", "SWF_LINESTYLE_JOIN_ROUND", "SWF_LINESTYLE_JOIN_BEVEL", "SWF_LINESTYLE_JOIN_MITER", "SWF_LINESTYLE_FLAG_NOHSCALE", "SWF_LINESTYLE_FLAG_NOVSCALE", "SWF_LINESTYLE_FLAG_HINTING", "SWF_LINESTYLE_FLAG_NOCLOSE", "SWF_LINESTYLE_FLAG_ENDCAP_ROUND", "SWF_LINESTYLE_FLAG_ENDCAP_NONE", "SWF_LINESTYLE_FLAG_ENDCAP_SQUARE", NULL, }; static char *SWF_Video_tag[] = { "SWFVIDEOSTREAM_MODE_AUTO", "SWFVIDEOSTREAM_MODE_MANUAL", NULL, }; static char **export_tags(char *tag) { switch (*tag) { case 'B': if(strEQ("Button", tag)) return SWF_Button_tag; case 'D': if(strEQ("DisplayItem", tag)) return SWF_DisplayItem_tag; case 'F': if(strEQ("Fill", tag)) return SWF_Fill_tag; if(strEQ("Filter", tag)) return SWF_Filter_tag; case 'G': if(strEQ("Gradient", tag)) return SWF_Gradient_tag; case 'S': if(strEQ("Sound", tag)) return SWF_Sound_tag; if(strEQ("Shape", tag)) return SWF_Shape_tag; case 'T': if(strEQ("Text", tag)) return SWF_TextField_tag; case 'V': if(strEQ("Video", tag)) return SWF_Video_tag; default: croak("unknown tag `%s'", tag); } } void export_cv(SV *class, SV *caller, char *sub) { GV *gv; #if 0 fprintf(stderr, "Here is the result: *%s::%s = \\&%s::%s\n", SvPVX(caller), sub, SvPVX(class), sub); #endif gv = gv_fetchpv(form("%s::%s",SvPVX( caller), sub), TRUE, SVt_PVCV); GvCV_set(gv, perl_get_cv(form("%s::%s", SvPVX(class), sub), TRUE)); GvIMPORTED_CV_on(gv); GvMULTI_on(gv); } static void my_import(SV *pclass, SV *caller, SV *sv) { char *sym = SvPV(sv,na), **tags; int i; switch (*sym) { case ':': ++sym; tags = export_tags(sym); for(i=0; tags[i]; i++) { export_cv(pclass, caller, tags[i]); } break; case '$': case '%': case '*': case '@': croak("\"%s\" is not exported by the SWF module", sym); case '&': ++sym; default: if(isALPHA(sym[0])) { export_cv(pclass, caller, sym); break; } else { croak("Can't export symbol: %s", sym); } } } ming-0.4.5/perl_ext/Font.xs0000644000175000017500000000266211454264373012516 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Font PACKAGE = SWF::Font PREFIX = SWFFont_ PROTOTYPES: ENABLE SWF::Font SWFFont_new(package="SWF::Font", filename) char *package char *filename CODE: RETVAL = newSWFFont_fromFile(filename); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFFont(block) SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(0))); ALIAS: SWF::Font::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "FONT DESTROY CALLED\n")); destroySWFBlock((SWFBlock)block); float SWFFont_getStringWidth(font, string) SWF::Font font char * string ALIAS: SWF::Font::getWidth = 1 float SWFFont_getUTF8StringWidth(font, string) SWF::Font font char * string short SWFFont_getAscent(font) SWF::Font font short SWFFont_getDescent(font) SWF::Font font short SWFFont_getLeading(font) SWF::Font font const char * SWFFont_getName(font) SWF::Font font int SWFFont_getGlyphCount(font) SWF::Font font ming-0.4.5/perl_ext/Button.xs0000644000175000017500000000741011454264373013057 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * (c) 2009 Albrecht Kleine * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Button PACKAGE = SWF::Button PREFIX = SWFButton_ PROTOTYPES: ENABLE SWF::Button SWFButton_new(package="SWF::Button") char *package CODE: RETVAL = newSWFButton(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFButton(button) SWF::Button button ALIAS: SWF::Button::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Button DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFButton(button); void SWFButton_addShape(button, character, flags=0) SWF::Button button SWF::Character character = NO_INIT byte flags # /* ALIAS: */ # /* SWF::Button::setOver ..... */ # /* 4 ALIASes removed by akleine (2009) */ # /* because all of them were used twice, */ # /* only these in addCharacter() remain. */ # /* See next function declaration below. */ CODE: character = (SWF__Character) SvIV((SV*)SvRV(ST(1))); swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFButton_addCharacter(button, character, flags); SWF::ButtonRecord SWFButton_addCharacter(button, character, flags=0) SWF::Button button SWF::Character character = NO_INIT byte flags ALIAS: SWF::Button::setOver = 1 SWF::Button::setHit = 2 SWF::Button::setUp = 3 SWF::Button::setDown = 4 CODE: character = (SWF__Character) SvIV((SV*)SvRV(ST(1))); swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); switch((ix = XSANY.any_i32)) { case 0: RETVAL = SWFButton_addCharacter(button, character, flags); break; case 1: RETVAL = SWFButton_addCharacter(button, character, SWFBUTTON_OVER); break; case 2: RETVAL = SWFButton_addCharacter(button, character, SWFBUTTON_HIT); break; case 3: RETVAL = SWFButton_addCharacter(button, character, SWFBUTTON_UP); break; case 4: RETVAL = SWFButton_addCharacter(button, character, SWFBUTTON_DOWN); break; default: /* this should never be ... */ RETVAL = (void*)&PL_sv_undef; /* ... but avoids a gcc 4.x warning: ... */ croak("internal error Button.xs"); /* ... "RETVAL may be used uninitialized" */ break; } ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::ButtonRecord", (void*)RETVAL); void SWFButton_addAction(button, action, flags=SWFBUTTON_MOUSEUP) SWF::Button button SWF::Action action int flags ALIAS: SWF::Button::setAction = 1 SWF::SoundInstance SWFButton_addSound(button, sound, flags) SWF::Button button SWF::Sound sound int flags CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFButton_addSound(button, sound, flags); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::SoundInstance", (void*)RETVAL); void SWFButton_setMenu(button, flag=1) SWF::Button button int flag; void SWFButton_setScalingGrid(button, x, y, w, h) SWF::Button button int x int y int w int h void SWFButton_removeScalingGrid(button) SWF::Button button ming-0.4.5/perl_ext/MANIFEST0000644000175000017500000000250611454264373012362 00000000000000SWF/Action.pm SWF/Bitmap.pm SWF/Button.pm SWF/ButtonRecord.pm SWF/Constants.pm SWF/DisplayItem.pm SWF/Fill.pm SWF/Font.pm SWF/Gradient.pm SWF/Morph.pm SWF/Movie.pm SWF/MovieClip.pm SWF/PrebuiltClip.pm SWF/Shape.pm SWF/Sound.pm SWF/SoundInstance.pm SWF/SoundStream.pm SWF/Text.pm SWF/TextField.pm SWF/VideoStream.pm SWF/FontCharacter.pm SWF/BinaryData.pm SWF/InitAction.pm SWF/Shadow.pm SWF/Blur.pm SWF/Matrix.pm SWF/FilterMatrix.pm SWF/Filter.pm SWF/CXform.pm SWF/Sprite.pm SWF/BrowserFont.pm SWF/FontCollection.pm SWF/Character.pm t/00_basic.t t/01_shape.t t/03_movie.t t/button.t t/drag.t t/fill.t t/filljpeg.t t/gradient.t t/png.t t/sound.t Action.xs Bitmap.xs Button.xs ButtonRecord.xs CREDITS Changes Constants.xs DisplayItem.xs Exports.c Fill.xs Font.xs Gradient.xs MANIFEST Makefile.PL Morph.xs Movie.xs MovieClip.xs README SUPPORT PrebuiltClip.xs SWF.pm SWF.xs Shape.xs Sound.xs SoundInstance.xs SoundStream.xs TODO Text.xs TextField.xs VideoStream.xs FontCharacter.xs BinaryData.xs InitAction.xs Matrix.xs Shadow.xs Blur.xs FilterMatrix.xs Filter.xs CXform.xs BrowserFont.xs FontCollection.xs Character.xs perl_swf.h swf_util.c typemap examples/action.cgi examples/alphafill.cgi examples/animation.cgi examples/glyph.cgi examples/jpegfill.cgi examples/keypress.cgi examples/morph.cgi examples/shape.cgi examples/sprite.cgi examples/text.cgi ming-0.4.5/perl_ext/FontCharacter.xs0000644000175000017500000000166311454264373014333 00000000000000/* ==================================================================== * Copyright (c) 2000-2002 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::FontCharacter PACKAGE = SWF::FontCharacter PREFIX = SWFFontCharacter_ PROTOTYPES: ENABLE void SWFFontCharacter_addChars(font, string) SWF::FontCharacter font const char *string void SWFFontCharacter_addUTF8Chars(font, string) SWF::FontCharacter font const char *string void SWFFontCharacter_addAllChars(font) SWF::FontCharacter font void SWFFontCharacter_DESTROY(fc) SWF::FontCharacter fc CODE: S_DEBUG(2, fprintf(stderr, "FontCharacter DESTROY CALLED\n")); ming-0.4.5/perl_ext/BinaryData.xs0000644000175000017500000000110011454264373013610 00000000000000#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::BinaryData PACKAGE = SWF::BinaryData PREFIX = SWFBinaryData_ PROTOTYPES: ENABLE SWF::BinaryData SWFBinaryData_new(package="SWF::BinaryData", data, length) char *package char *data int length CODE: RETVAL = newSWFBinaryData(data, length); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFBinaryData(bd) SWF::BinaryData bd ALIAS: SWF::BinaryData::DESTROY = 1 CODE: destroySWFBinaryData(bd); ming-0.4.5/perl_ext/CXform.xs0000644000175000017500000000274411454264373013007 00000000000000/* ==================================================================== * Copyright (c) 2008 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::CXform PACKAGE = SWF::CXform PREFIX = SWFCXform_ PROTOTYPES: ENABLE SWF::CXform SWFCXform_new(package="SWF::CXform", rAdd=0, gAdd=0, bAdd=0, aAdd=0, rMult=1.0, gMult=1.0, bMult=1.0, aMult=1.0) char *package float rAdd float gAdd float bAdd float aAdd float rMult float gMult float bMult float aMult CODE: RETVAL = newSWFCXform(rAdd, gAdd, bAdd, aAdd, rMult, gMult, bMult, aMult); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void SWFCXform_setColorAdd(cx, rAdd, gAdd, bAdd, aAdd) SWF::CXform cx float rAdd float gAdd float bAdd float aAdd void SWFCXform_setColorMult(cx, rMult, gMult, bMult, aMult) SWF::CXform cx float rMult float gMult float bMult float aMult void SWFCXform_DESTROY(cx) SWF::CXform cx CODE: /* destroySWFCXform(cx); */ /* removed March 07th, 2009 */ /* because could be destroyed twice (and segfaults later) */ /* see destroySWFPlaceObject2Block() in placeobject.c */ S_DEBUG(2, fprintf(stderr, "CXform DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); ming-0.4.5/perl_ext/Makefile.PL0000644000175000017500000002052312154643021013167 00000000000000# $Id$ use ExtUtils::MakeMaker; use Cwd qw(abs_path cwd); use strict; my $SRCDIR=$ENV{'srcdir'}; $SRCDIR="." unless $SRCDIR; my $BUILDDIR=$ENV{'builddir'}; $BUILDDIR="." unless $BUILDDIR; my $MING_TOP_SRCDIR=abs_path($SRCDIR."/../"); my $MING_TOP_BUILDDIR=abs_path($BUILDDIR."/../"); print "SRCDIR: ".$SRCDIR."\n"; print "BUILDDIR: ".$BUILDDIR."\n"; print "MING_TOP_SRCDIR: ".$MING_TOP_SRCDIR."\n"; print "MING_TOP_BUILDDIR: ".$MING_TOP_BUILDDIR."\n"; my $CONFIG_PL = ${BUILDDIR}.'/t/config.pl'; my @DEFAULT_DIR = qw(..); my @do_clean = qw { SWF.h Boot.xsh ${CONFIG_PL} ${BUILDDIR}/t/gradient.swf SWF/MyConfig.pm }; for(@do_clean) { unlink $_ } my @SWF_MODULES_NAMES = ( 'Action', 'Bitmap', 'Button', 'Constants', 'DisplayItem', 'Fill', 'Font', 'Gradient', 'Morph', 'Movie', 'MovieClip', 'Shape', 'Sound', 'SoundInstance', 'SoundStream', 'Text', 'TextField', 'VideoStream', 'PrebuiltClip', 'FontCharacter', 'ButtonRecord', 'BinaryData', 'InitAction', 'Matrix', 'Shadow', 'Blur', 'FilterMatrix', 'Filter', 'CXform', 'BrowserFont', 'FontCollection', 'Character' ); my @XS_OBJECTS = map "${BUILDDIR}/$_", @SWF_MODULES_NAMES; push @XS_OBJECTS, "${SRCDIR}/swf_util"; push @XS_OBJECTS, "${BUILDDIR}/SWF"; my $XS_OBJECTS = join ('$(OBJ_EXT) ' , (@XS_OBJECTS)) . '$(OBJ_EXT)'; my $XS_DEP_FILES = ""; foreach my $val ( @SWF_MODULES_NAMES ) { $XS_DEP_FILES .= "$BUILDDIR/$val.xs: \n\tln -s $SRCDIR/$val.xs .\n"; } $XS_DEP_FILES .= "$BUILDDIR/SWF.xs: \n\tln -s $SRCDIR/SWF.xs .\n"; my @LD_OBJECTS = map "${BUILDDIR}/$_", @SWF_MODULES_NAMES; push @LD_OBJECTS, "${BUILDDIR}/swf_util", "${BUILDDIR}/SWF"; my $LD_OBJECTS = join ('$(OBJ_EXT) ' , (@LD_OBJECTS)) . '$(OBJ_EXT)'; my $PM_HASH; foreach my $val ( @SWF_MODULES_NAMES ) { $PM_HASH->{"${SRCDIR}/SWF/$val.pm"} = "blib/lib/SWF/$val.pm"; } $PM_HASH->{"${BUILDDIR}/SWF.pm"} = "blib/lib/SWF.pm"; #also install Sprite.pm (deprecated) for compat reasons $PM_HASH->{"${SRCDIR}/SWF/Sprite.pm"} = "blib/lib/SWF/Sprite.pm"; my $MAN3_HASH; foreach my $val ( @SWF_MODULES_NAMES ) { $MAN3_HASH->{"${SRCDIR}/SWF/$val.pm"} = "blib/man3/SWF::$val.3pm"; } $MAN3_HASH->{"${BUILDDIR}/SWF.pm"} = "blib/man3/SWF.3pm"; #also install Sprite.3pm (deprecated) for compat reasons $MAN3_HASH->{"${SRCDIR}/SWF/Sprite.pm"} = "blib/man3/SWF::Sprite.3pm"; #$MING_DIR is not the src-dir my ($MING_DIR, $ming_version); #foreach my $dir (@DEFAULT_DIR) { # next unless -d $dir; # my $abs_dir = abs_path($dir); # $ming_version = get_ming_version($dir); # # if( $ming_version ){ # $MING_DIR = $abs_dir; # print STDERR $MING_DIR."\n"; # last; # } #} # #$MING_DIR="../"; #ask_ming_dir() unless ($MING_DIR); $MING_DIR=$MING_TOP_BUILDDIR; my $ming_version = get_ming_version($MING_TOP_SRCDIR); print "\nUsing ming version $ming_version with source dir ". $MING_TOP_SRCDIR ." and build dir ". $MING_TOP_BUILDDIR .".\n\n"; #compile() unless ming_is_compiled(); print "ming library isn't compiled, it is needed for the perl module\n" unless ming_is_compiled(); # 2006/01/24 (peterdd) now we can look into ming_config.h to get some info. my $libs=get_mingconfig($MING_TOP_BUILDDIR."/src/ming_config.h"); write_swf_h($MING_DIR."/src/"); write_config_test ($MING_DIR."/src/"); write_bootxs(); sub MY::postamble { "Makefile.PL: $SRCDIR/Makefile.PL\n\tln -s $SRCDIR/Makefile.PL .\n" . "$XS_DEP_FILES"; } WriteMakefile( 'NAME' => 'SWF', 'VERSION_FROM' => $BUILDDIR.'/SWF.pm', ( $] < 5.005 ? () : ( ABSTRACT => 'Perl interface to Ming - a library for generating SWF ("Flash") format movies.', AUTHOR => 'Soheil Seyfaie (soheil at users.sourceforge.net)', ) ), clean => { FILES => "@do_clean", }, 'OBJECT' => "$XS_OBJECTS", 'LDFROM' => "$LD_OBJECTS", 'INC' => "-I$MING_TOP_SRCDIR/src -I$BUILDDIR -I$MING_TOP_BUILDDIR/src -I$SRCDIR", 'LIBS' => [ '-L'.$MING_TOP_BUILDDIR . '/src/.libs -lming '.$libs ], 'PM' => $PM_HASH, 'MAN3PODS' => $MAN3_HASH, 'TYPEMAPS' => ["$SRCDIR/typemap"], ); sub MY::install { my $self = shift; write_myconfig_file($self->{INSTALLSITEARCH}); return $self->MM::install; } sub ming_is_compiled { my $libming = $MING_TOP_BUILDDIR."/src/.libs/libming.a"; if ( -e $libming ) { return 1; } else { print "$libming doesn't exist.\n"; return undef; } } # unused. At least it should take into account the configure flags by # running ./config.status sub compile{ print "Compiling ming ...\n"; my $cur_dir = cwd; chdir $MING_TOP_BUILDDIR; system $MING_TOP_SRCDIR."./configure"; system "make"; chdir $cur_dir; } sub ask_ming_dir{ while(1) { print <) { if($i =~ /^MAJOR_VERSION=/) { $i =~ s/^MAJOR_VERSION=(.*)/$1/; chomp($majorversion=$i);} elsif($i =~ /^MINOR_VERSION=/) { $i =~ s/^MINOR_VERSION=(.*)/$1/; chomp($minorversion=$i);} elsif($i =~ /^MICRO_VERSION=/) { $i =~ s/^MICRO_VERSION=(.*)/$1/; chomp($microversion=$i);} } close(FH); my $version=$majorversion.'.'.$minorversion.'.'.$microversion; print "SWF::VERSION = $version\n"; if( $version =~ /^\./ ) {return undef;} else {return $version;} } # peterdd: Someone should provide a better approach to detect the needed libs sub get_mingconfig{ my $file=shift; my $lib=""; print "Checking ming config $file :\n"; open(FH, "$file") or die "can't open $file $!"; while(){ next unless /^#define/; if (/USE_ZLIB/ and /1$/) { $lib.=" -lz"}; if (/USE_GIF/ and /1$/) {$lib.=" -lungif"}; if (/USE_PNG/ and /1$/) {$lib.=" -lpng"}; if (/USE_FREETYPE/ and /1$/) {$lib.=" -lfreetype"}; } close(FH); return $lib; } sub write_myconfig_file{ my $dir = shift; local *FH; mkdir "SWF"; open FH, ">SWF/MyConfig.pm" or die "can't open MyConfig $!"; print FH< '$dir', ); 1; EOConf } sub write_bootxs (){ local *FH; open FH, ">${BUILDDIR}/Boot.xsh" or die "can't open Boot.xsh $!"; print FH "BOOT:\n{\n"; print FH join "\n", map "extern void boot_SWF__$_(CV *cv);", @SWF_MODULES_NAMES; print FH "\n", join "\n", map "callXS(boot_SWF__$_, cv, mark);", @SWF_MODULES_NAMES; print FH "\n}\n"; close FH; } # We don't really need this function anymore. # We may add $dir to INC of WriteMakefile() sub write_swf_h { local *FH; open FH, ">SWF.h" or die "can't open SWF.h $!"; print FH <${CONFIG_PL}" or die "can't open ${CONFIG_PL} $!"; print FH < 2) ? (float)SvNV(ST(2)) : x; SWFFill_scaleXYTo(fill, x, y); void SWFFill_scale(fill, x, ...) SWF::Fill fill float x float y = NO_INIT CODE: y = (items > 2) ? (float)SvNV(ST(2)) : x; SWFFill_scaleXYTo(fill, x, y); void SWFFill_rotateTo(fill, degrees) SWF::Fill fill float degrees void SWFFill_rotate(fill, degrees) SWF::Fill fill float degrees void SWFFill_skewXTo(fill, x) SWF::Fill fill float x void SWFFill_skewX(fill, x) SWF::Fill fill float x void SWFFill_skewYTo(fill, y) SWF::Fill fill float y void SWFFill_skewY(fill, y) SWF::Fill fill float y void SWFFill_setMatrix(fill, a, b, c, d, x, y) SWF::Fill fill float a float b float c float d float x float y void SWFFill_DESTROY(fill) SWF::Fill fill CODE: S_DEBUG(2, fprintf(stderr, "Fill DESTROY CALLED\n")); ming-0.4.5/perl_ext/TextField.xs0000644000175000017500000000613611454264373013500 00000000000000/* ==================================================================== * Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::TextField PACKAGE = SWF::TextField PREFIX = SWFTextField_ PROTOTYPES: ENABLE SWF::TextField SWFTextField_new(package="SWF::TextField", ...) char *package PREINIT: int flags; CODE: RETVAL = newSWFTextField(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); if(items>1){ flags = (int)SvIV(ST(1)); SWFTextField_setFlags(RETVAL, flags); } void destroySWFTextField(field) SWF::TextField field ALIAS: SWF::TextField::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "TextField DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFTextField(field); void SWFTextField_setFont(field, font) SWF::TextField field SWF::Block font = (SWF__Block) SvIV((SV*)SvRV(ST(1))); CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFTextField_setFont(field, font); void SWFTextField_setBounds(field, width, height) SWF::TextField field int width int height void SWFTextField_setFlags(field, flags) SWF::TextField field int flags void SWFTextField_setColor(field, r, g, b, a=0xff) SWF::TextField field byte r byte g byte b byte a void SWFTextField_setVariableName(field, name) SWF::TextField field char * name ALIAS: SWF::TextField::setName = 1 void SWFTextField_addString(field, string) SWF::TextField field char * string void SWFTextField_addUTF8String(field, string) SWF::TextField field char * string void SWFTextField_setHeight(field, height) SWF::TextField field int height void SWFTextField_setPadding(field, padding) SWF::TextField field int padding void SWFTextField_setMargins(field, left, right) SWF::TextField field int left int right CODE: SWFTextField_setLeftMargin(field, left); SWFTextField_setRightMargin(field, right); void SWFTextField_setLeftMargin(field, leftMargin) SWF::TextField field int leftMargin void SWFTextField_setRightMargin(field, rightMargin) SWF::TextField field int rightMargin void SWFTextField_setIndentation(field, indentation) SWF::TextField field int indentation void SWFTextField_setLineSpacing(field, lineSpacing) SWF::TextField field int lineSpacing void SWFTextField_setAlignment(field, alignment) SWF::TextField field int alignment ALIAS: SWF::TextField::align = 1 void SWFTextField_addChars(field, string) SWF::TextField field char * string void SWFTextField_addUTF8Chars(field, string) SWF::TextField field char * string void SWFTextField_setLength(field, len) SWF::TextField field int len void SWFTextField_setFieldHeight(field, height) SWF::TextField field int height ming-0.4.5/perl_ext/ButtonRecord.xs0000644000175000017500000000346011454264373014217 00000000000000/* ==================================================================== * Copyright (c) 2007 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::ButtonRecord PACKAGE = SWF::ButtonRecord PREFIX = SWFButtonRecord_ PROTOTYPES: ENABLE void SWFButtonRecord_setDepth(record, depth) SWF::ButtonRecord record int depth void SWFButtonRecord_setBlendMode(record, mode) SWF::ButtonRecord record int mode void SWFButtonRecord_move(record, x, y) SWF::ButtonRecord record double x double y void SWFButtonRecord_moveTo(record, x, y) SWF::ButtonRecord record double x double y void SWFButtonRecord_rotate(record, deg) SWF::ButtonRecord record double deg void SWFButtonRecord_rotateTo(record, deg) SWF::ButtonRecord record double deg void SWFButtonRecord_scale(record, scaleX, scaleY) SWF::ButtonRecord record double scaleX double scaleY void SWFButtonRecord_scaleTo(record, scaleX, scaleY) SWF::ButtonRecord record double scaleX double scaleY void SWFButtonRecord_skewX(record, skewX) SWF::ButtonRecord record double skewX void SWFButtonRecord_skewXTo(record, skewX) SWF::ButtonRecord record double skewX void SWFButtonRecord_skewY(record, skewY) SWF::ButtonRecord record double skewY void SWFButtonRecord_skewYTo(record, skewY) SWF::ButtonRecord record double skewY void SWFButtonRecord_addFilter(record, filter) SWF::ButtonRecord record SWF::Filter filter void SWFButtonRecord_DESTROY(br) SWF::ButtonRecord br CODE: S_DEBUG(2, fprintf(stderr, "ButtonRecord DESTROY CALLED\n")); ming-0.4.5/perl_ext/mkdoc0000755000175000017500000000054311454264373012253 00000000000000#!/bin/sh for f in *.pm SWF/*.pm do file=`basename $f .pm` dir=`dirname $f` echo "making HTML for $f" if [ "x$dir" != "x." ] then pod2html --infile=$f --outfile=../docs/perl/$dir::$file.html pod2man $f ../docs/perlman/$dir::$file.3pm else pod2html --infile=$f --outfile=../docs/perl/$file.html pod2man $f ../docs/perlman/$file.3pm fi done ming-0.4.5/perl_ext/SWF/0000755000175000017500000000000012154727176011750 500000000000000ming-0.4.5/perl_ext/SWF/BrowserFont.pm0000644000175000017500000000214111454264373014473 00000000000000# ==================================================================== # Copyright (c) 2008 by Klaus Rechert. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::BrowserFont; use SWF(); $SWF::BrowserFont::VERSION = $SWF::VERSION; 1; =head1 NAME SWF::BrowserFont - SWF BrowserFont class =head1 SYNOPSIS use SWF::BrowserFont; $font = new SWF::BrowserFont('_sans'); =head1 DESCRIPTION Browser built-in font object for later usage in TextField objects. Not available for Text objects. Using BrowserFont objects will save memory in output file. Consider that not every font might be available in any environment. =head1 METHODS =over =item $bf = new SWF::BrowserFont($name) Creates a BrowserFont object, name selects a built-in font, like '_sans' or '_typewriter'. =back =head1 AUTHOR developers of ming ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Font, SWF::Text, SWF::TextField =cut ming-0.4.5/perl_ext/SWF/ButtonRecord.pm0000644000175000017500000000527111454264373014642 00000000000000# ==================================================================== # Copyright (c) 2002 by Klaus Rechert. All rights reserved. # (c) 2009 Albrecht Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::ButtonRecord; use SWF(); use strict; $SWF::ButtonRecord::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::ButtonRecord - SWF Button Helper Class =head1 SYNOPSIS use SWF::ButtonRecord; use SWF::Button; use SWF::Constants qw(:Button); # create button and a shape here.. # and then: $buttonrecord = $button->addCharacter($my_shape, SWFBUTTON_DOWN); $buttonrecord->scale(0.5,0.5); $buttonrecord->move(50,50); =head1 DESCRIPTION Adding a character shape to an object of SWF::Button class will give you access to an SWF::ButtonRecord object. This is useful for further changes by using the declared methods below. So SWF::ButtonRecord objects are a comparable counterpart to SWF::Displayitem objects. Just like them there is no constructor method available. =head1 METHODS =over =item $buttonRecord->moveTo($x, $y) Move ButtonRecord to ($x, $y). =item $buttonRecord->move($x, $y) Displace ButtonRecord by ($x, $y). =item $buttonRecord->scaleTo($x ,$y) Set ButtonRecord scale to $x in the x-direction and $y in the y-direction. =item $buttonRecord->scale($x ,$y) Multiply ButtonRecord scale by $x in the x-direction and $y in the y-direction. =item $buttonRecord->rotateTo($degrees) Set ButtonRecord rotation to $degrees. =item $buttonRecord->rotate($degrees) Rotate ButtonRecord by $degrees. =item $buttonRecord->skewX($x) Add $x to the current x-skew. =item $buttonRecord->skewXTo($x) Set x-skew to $x. 1.0 is 45-degree forward slant. More is more forward while less is more backward. =item $buttonRecord->skewY($y) Add $y to the current y-skew. =item $buttonRecord->skewYTo($y) Set y-skew to $y. 1.0 is 45-degree upward slant. More is more upward while less is more downward. =item $buttonRecord->setDepth($depth) Set Z-order of ButtonRecord to $depth. =item $buttonRecord->setBlendMode($mode) Set an alternative blend mode instead of default alpha blend. Possible modes are SWFBLEND_MODE_NORMAL, SWFBLEND_MODE_LAYER etc. =item $buttonRecord->addFilter($filter) Process the ButtonRecord object thru a prepared filter: an object of SWF::Filter class, e.g. BlurFilter or DropShadowFilter. Filters are available since player version 8. =back =head1 AUTHOR developers of ming ming.sourceforge.net, Albrecht Kleine =head1 SEE ALSO SWF, SWF::Button, SWF::DisplayItem, SWF::Filter, SWF::Movie, SWF::MovieClip =cut ming-0.4.5/perl_ext/SWF/SoundInstance.pm0000644000175000017500000000366511454264373015012 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::SoundInstance; use SWF(); use strict; $SWF::SoundInstance::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::SoundInstance - SWF Sound Instance class =head1 SYNOPSIS use SWF::Sound; use SWF::SoundInstance; $sound = new SWF::Sound("test.mp3"); $snd_instance = $movie->startSound($sound); $snd_instance->loopInPoint(4000); $snd_instance->loopOutPoint(8000); $snd_instance->loopCount(2); =head1 DESCRIPTION SWF::SoundStream is a helper class useful for setting information about a sound instance. There is no constructor method, SWF::SoundStream objects are available only thru: =over =item startSound() method of SWF::Movie, =item startSound() method of SWF::MovieClip, =item addSound() method of SWF::Button. =back =head1 METHODS =over =item $snd_instance->noMultiple() Prohibits starting sound if sound is already playing. =item $snd_instance->loopInPoint($point) Sets the loop start $point counted in samples. =item $snd_instance->loopOutPoint($point) Sets the loop's last sample to play. =item $snd_instance->loopCount($count) Sets loop count. The default value is 1 loop. =item $snd_instance->addEnvelope($mark44, $left, $right) Adds a SoundEnvelope to event sound. Parameters are $mark44, the Position in 44khz samples, and volumes both for left and right stereo channel. Next example will mute the right channel: $snd_instance->addEnvelope(0,10000,0); =back =head1 AUTHOR developers of ming.sourceforge.net, Albrecht Kleine =head1 SEE ALSO SWF, SWF:: Movie, SWF::MovieClip, SWF::Button, SWF::Sound, SWF::SoundStream, SWF::Constants =cut ming-0.4.5/perl_ext/SWF/BinaryData.pm0000644000175000017500000000174611454264373014251 00000000000000# ==================================================================== # Copyright (c) 2009 Albrecht Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::BinaryData; use SWF (); $SWF::BinaryData::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::BinaryData - SWF binary data class =head1 SYNOPSIS use SWF::BinaryData; $binarydata = new SWF::BinaryData($data, $length); =head1 DESCRIPTION SWF::BinaryData is a helper class useful in ActionScript. =head1 METHODS =over =item new SWF::BinaryData($data, $length) This constructor method allows to embed arbitrary binary data into a SWF file. This data later can be used as a byte array in AS3 classes. [ToDo: add demo code here !] =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Action, SWF::InitAction, SWF::Movie =cut ming-0.4.5/perl_ext/SWF/CXform.pm0000644000175000017500000000303611454264373013423 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::CXform; use SWF (); $SWF::CXform::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::CXform - SWF CXform class =head1 SYNOPSIS use SWF::CXform; $cxf = new SWF::CXform(); $cxf->setColorAdd(100, 200, 30.5 , -50); $dispitem->setCXform($cxf); =head1 DESCRIPTION SWF::CXform is a helper class useful for color transformations on SWF::DisplayItem objects. =head1 METHODS =over =item new SWF::CXform( [ $rAdd ], [ $gAdd ], [ $bAdd ], [ $aAdd ], [ $rMult ], [ $gMult ], [ $bMult ], [$aMult] ) Creates a CXform object. The object is controlled by a parameter list of RGBA values both for addition and multiplication. All of them are optional, but could be set later via setColorAdd() and setColorMult() methods. Default values for the xAdd parameters are 0, and for xMult defaults are 1. Use the created object as parameter for transformations on SWF::DisplayItem objects. =item setColorAdd($rAdd, $gAdd, $bAdd, $aAdd) Set addition values of a CXform object. =item setColorMult($rMult, $gMult, $bMult, $aMult) Set multiplication values of a CXform object. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::DisplayItem, SWF::Filter =cut ming-0.4.5/perl_ext/SWF/MovieClip.pm0000644000175000017500000000660211454264373014116 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::MovieClip; use SWF(); use strict; $SWF::MovieClip::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::MovieClip - MovieClip Class =head1 SYNOPSIS use SWF::MovieClip; my $movieclip = new SWF::MovieClip(); =head1 DESCRIPTION SWF::MovieClip allows you to add animated objects to your Flash movies. =head1 METHODS =over 4 =item $mc= new SWF::MovieClip() Returns an SWF::MovieClip object. =item $item = $mc->add($swfobject) When you add following types of objects to the $mc they will return a SWF::DisplayItem: =over =item SWF::Button =item SWF::PrebuiltClip (a whole external swf file) =item SWF::MovieClip (you can nest them like a tree) =item SWF::Shape =item SWF::Text =item SWF::TextField =item SWF::VideoStream =back [ToDo: to be verified: When you add a SWF::Sound the return value is a SWF::SoundInstance: $si = $mc->add($sound); ] =item $si = $mc->startSound($sound) Starts making noise and returns an object of SWF::SoundInstance class. =item $mc->stopSound($sound) Stops sound started by startSound() method. =item $mc->remove($di) Removes SWF::DisplayItem $di from the display list. =item $mc->nextFrame() Move to the next frame in the timeline of SWF::MovieClip $mc =item $mc->setNumberOfFrames($i) =item $mc->setFrames($i) Sets total number of $mc frames to $i This is an optional autofiller, e.g. when you want to be sure that 2 different movieclips have 100 frames when playing, but the number of nextFrame() calls in these 2 movieclips is unknown or dynamic (dependent on data from databases, whatever). By default a movieclip the number of frames in the timeline is how often you called $mc->nextFrame for this clip. =item $mc->labelFrame($name) Sets frame name to $name. You are then able to access this frame by name in ActionScript, not just by frame number. =item $mc->setScalingGrid($x, $y, $w, $h) This function (available from SWF>=8) sets a 9 slice scaling grid: 1 2 3 4 5 6 7 8 9 X, y, w and h define a rectangle, which is the dimension of the center slice (5). All other slices are determined out of the characters bounds and the defined rect. While slice 5 is scaled vertical and horizontal, slice 2 and 8 are only scaled horizontal. Slice 4 and 6 only vertical. The 4 corner slices are not scaled (1, 3, 7, 9). [ToDo: to be verified] =item $mc->removeScalingGrid() Removes scaling grid rectangles. =item $mc->addInitAction($action) Adds an initial ActionScript block to MovieClip $mc. These actions are executed before the MovieClip is available as a script object. [ToDo: to be verified] =item $mc->setSoundStream($sound, $rate, [$skip]) Includes streaming sound to a movie. [ToDo: add more doc and a demo here.] =back =head1 AUTHOR Soheil Seyfaie (soheil@netcom.ca) Peter Liscovius see AUTHORS of ming distribution (ming.sf.net) =head1 SEE ALSO SWF::DisplayItem for how you can modify the instances in a SWF::MovieClip or SWF::Movie SWF, SWF::Action, SWF::InitAction, SWF::Button, SWF::Movie, SWF::Shape, SWF::Sound, SWF::SoundStream, SWF::Text, SWF::TextField, SWF::VideoStream =cut ming-0.4.5/perl_ext/SWF/FontCharacter.pm0000644000175000017500000000261111454264373014746 00000000000000# ==================================================================== # Copyright (c) 2006 by Peter Liscovius. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::FontCharacter; use SWF(); use strict; $SWF::FontCharacter::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::FontCharacter - SWF Font Helper Class =head1 SYNOPSIS use SWF::FontCharacter; $font = new SWF::Font('Arial.fdb'); $fontcharacter = $movie->addFont($font); $fontcharacter = $movie->importFont('textField.swf', 'Arial337a'); =head1 DESCRIPTION SWF::FontCharacter is a font helper class. The objects are available thru SWF::Movie methods(), so no constructor is present here. =head1 METHODS =over =item $fontcharacter->addChars($string) Adds characters from string. =item $fontcharacter->addUTF8Chars($string) Adds UTF8 characters from string and will throw an error message like "Character not found 12345" if any needed glyphs are not present inside font definition. =item $fontcharacter->addAllChars() Adds all characters... [ToDo: add some demo code here] =back =head1 AUTHOR developers of ming ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Movie, SWF::Font, SWF::Text, SWF::TextField =cut ming-0.4.5/perl_ext/SWF/Action.pm0000644000175000017500000000257511454264373013451 00000000000000# ==================================================================== # Copyright (c) 2000 by Soheil Seyfaie. All rights reserved. # (c) 2009 Albrecht Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Action; use SWF (); $SWF::Action::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Action - SWF action class =head1 SYNOPSIS use SWF::Action; my $action = new SWF::Action($script); =head1 DESCRIPTION SWF::Action is an object for storing an action. =head1 METHODS =over 4 =item new SWF::Action($script) Compiles $script and returns an SWF::Action object. The script is a text string expected, according ActionScript syntax. =item $result = $actionObject->compile($versionX) Recompile object using syntax of versionX. (Some differences exists between values 4 and 5.) The result return value will be 0 on successful compiling. =back =head1 AUTHOR Soheil Seyfaie (soheil@netcom.ca) and developers of ming at ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Button, SWF::Movie, SWF::MovieClip, SWF::InitAction =cut ming-0.4.5/perl_ext/SWF/Bitmap.pm0000644000175000017500000000574411454264373013451 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Bitmap; use SWF(); $SWF::Bitmap::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Bitmap - Bitmap class =head1 SYNOPSIS use SWF::Bitmap; $bitmap = new SWF::Bitmap('filename'); $fill = $shape->addBitmapFill($bitmap); =head1 DESCRIPTION SWF::Bitmap enables you to add JPG, PNG, GIF and DBL files. It is a helper class most useful for filling shapes (i.e. SWF::Shape objects). DBL files ('Define Bitmap Lossless') may be produced from PNG or GIF files by using png2dbl or gif2dbl tools. =head1 METHODS =over 4 =item $bitmap = new SWF::Bitmap($filename, [$alpha]) Creates a new SWF::Bitmap object using 'filename'. The alpha parameter represents a filename for opacity data ('alpha' channel), but only for JPG files. Alpha data files are produced by tool gif2mask. The original GIF used for gif2mask input file containing alpha information should have same dimensions (width x height) as the JPG file. =item $bitmap = newBitmapFromFileHandle($filehandle) Creates a new SWF::Bitmap object using an open file handle $filehandle . This way you could use STDIN, piped data etc. etc. for input. A simple example: open (PICT,'flowers.jpg') or die; $bmp = newBitmapFromFileHandle SWF::Bitmap(PICT); # ..... $m->save("my_flowers.swf"); close (PICT); # Please note: do not close the PICT file too early. =item $bitmap = newSWFDBLBitmap SWF::Bitmap($filename) Creates a new SWF::Bitmap object using DBL file. Use this constructor if you have a file with DBL data, but not with .dbl filename extension. =item $bitmap = newSWFJpegBitmap SWF::Bitmap($filename) Creates a new SWF::Bitmap object using JPG file. Use this constructor if you have a file with JPG data, but not with .jpg or .jpeg filename extension. =item $bitmap = newSWFJpegWithAlpha SWF::Bitmap($filename,$alpha_filename) Creates a new SWF::Bitmap object using JPG file similar newSWFJpegBitmap() with additional opacity information in 'alpha' file. Use this constructor if you have a file with JPG data, but not with .jpg or .jpeg filename extension and if there is opacity information available in 'alpha_filename' file. Alpha data files are produced by gif2mask tool. The original GIF file containing alpha information used for gif2mask input should have same dimensions as the JPG file. =item $width = $bitmap->getWidth(); Returns width of bitmap in pixels. =item $height = $bitmap->getHeight(); Returns height of bitmap in pixels. =back =head1 AUTHOR Soheil Seyfaie (soheil@netcom.ca), Albrecht Kleine and developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Fill, SWF::Shape, SWF::Button, SWF::Constants, png2dbl, gif2dbl, gif2mask =cut ming-0.4.5/perl_ext/SWF/Matrix.pm0000644000175000017500000000257511454264373013500 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Matrix; use SWF (); $SWF::Matrix::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Matrix - SWF matrix class =head1 SYNOPSIS use SWF::Matrix; $matrix = $displayItem->getMatrix(); $scaleX = $matrix->getScaleX(); =head1 DESCRIPTION SWF::Matrix is a helper class useful for getting information about a display items's matrix. There is no constructor method, SWF::Matrix objects are available only thru SWF::DisplayItem's getMatrix() method. The methods below give you read access to the six matrix elements. =head1 METHODS =over 4 =item $scaleX = $matrix->getScaleX() Returns X scale. =item $scaleY = $matrix->getScaleY() Returns Y scale. =item $rot0 = $matrix->getRotate0() Returns rotation value 0. =item $rot1 = $matrix->getRotate1() Returns rotation value 1. =item $trX = $matrix->getTranslateX() Returns X translation value. =item $trY = $matrix->getTranslateY() Returns Y translation value. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::DisplayItem =cut ming-0.4.5/perl_ext/SWF/Sound.pm0000644000175000017500000000304411454264373013314 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Sound; use SWF(); use strict; $SWF::Sound::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Sound - SWF Sound class =head1 SYNOPSIS use SWF::Sound; $sound = new SWF::Sound("test.mp3"); # also via SWF::SoundStream: $sstr = new SWF::SoundStream("test.mp3"); $sound = new SWF::Sound($sstr); # $movie->startSound($sound); =head1 DESCRIPTION SWF::Sound is a helper class useful for making noise of every kind... =head1 METHODS =over =item $sound = new SWF::Sound($filename, [$flags]) =item $sound = new SWF::Sound($soundstream) Both types of constructor method are creating a Sound object. The first one uses a filename (e.g. of mp3 file), the second one is operating on an already created SWF::SoundStream object. The first constructor type also accepts flags for file description, SWF_SOUND_MP3_COMPRESSED is one of them. More flags are part of SWF::Constant class. The created object can be used for example as parameter in SWF::Movie's startSound() method. =back =head1 AUTHOR developers of ming.sourceforge.net, Albrecht Kleine =head1 SEE ALSO SWF, SWF:: Movie, SWF::MovieClip, SWF::Button, SWF::SoundInstance, SWF::SoundStream, SWF::Constants =cut ming-0.4.5/perl_ext/SWF/Character.pm0000644000175000017500000000232111454264373014115 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Character; use SWF(); use strict; $SWF::Character::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Character - SWF Character Class =head1 SYNOPSIS use SWF::Character; $character=$displayItem->getCharacter(); print $character->getWidth(); =head1 DESCRIPTION SWF::Character is a helper class, objects are available thru SWF::DisplayItem's getCharacter() and SWF::Movie's importCharacter() methods, so there is no constructor here. =head1 METHODS =over =item $width = $character->getWidth() This method returrns the character's width in px. If a character has no bounds -1 is returned. =item $height = $character->getHeight() This method returrns the character's height in px. If a character has no bounds -1 is returned. =back =head1 AUTHOR developers of ming ming.sourceforge.net =head1 SEE ALSO SWF, SWF::DisplayItem =cut ming-0.4.5/perl_ext/SWF/Morph.pm0000644000175000017500000000245211454264373013313 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Morph; use SWF (); $SWF::Morph::VERSION = $SWF::VERSION; sub getShapes{ my $self = shift; return ($self->getShape1(), $self->getShape2()); } 1; __END__ =head1 NAME SWF::Morph - SWF Morph Class =head1 SYNOPSIS use SWF::Morph; my $morph = new SWF::Morph(); =head1 DESCRIPTION SWF::Morph twist from one shape to another. =head1 METHODS =over 4 =item new SWF::Morph(); Returns an SWF::Morph object. =item ($shape1, $shape2) = $morph->getShapes(); Returns two SWF::Shape objects. The first one (shape1) is the morph's starting shape while shape2 is its final shape. You may also use "getShape1()" and "getShape2()" methods to get a handle of these shapes. =item $shape1 = $morph->getShape1(); Returns the morph's starting shape. =item $shape2 = $morph->getShape2(); Returns the morph's final shape. =back =head1 AUTHOR Soheil Seyfaie (soheil@netcom.ca). =head1 SEE ALSO SWF, SWF::DisplayItem, SWF::Shape, SWF::Movie, SWF::MovieClip =cut ming-0.4.5/perl_ext/SWF/SoundStream.pm0000644000175000017500000000357311454264373014477 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::SoundStream; use SWF(); use strict; $SWF::SoundStream::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::SoundStream - SWF Sound Stream class =head1 SYNOPSIS use SWF::SoundStream; my $soundstream = new SWF::SoundStream("wau.mp3"); print $soundstream->getDuration(); ## print $soundstream->getFrames(); # won't work until it belongs to movie $movie->setSoundStream($soundstream); print $soundstream->getFrames(); # but _now_ it is okay (but anyway deprecated) =head1 DESCRIPTION SWF::SoundStream is a helper class useful for adding sound into SWF applications. =head1 METHODS =over =item $soundstream = new SWF::SoundStream($filename) Creates a SWF::SoundStream object. If the file can't be opened the constructor will return an undef value of course. The filename is the valid name of any mp3 or flv file. =item $dura = $soundstream->getDuration() This function returns the duration of a given stream in ms. Works for streams of mp3, flv types only. On other cases it returns 0. =item $frames = $soundstream->getFrames() Using getFrames() is deprecated, better use getDuration(). getFrames() returns the number of movie frames necessary to play the full sound stream. For this reason it works only if the sound stream object was added to a movie, and also only for streams of mp3 -files. =back =head1 AUTHOR developers of ming.sourceforge.net, Albrecht Kleine =head1 SEE ALSO SWF, SWF:: Movie, SWF::MovieClip, SWF::Button, SWF::Sound, SWF::SoundInstance, SWF::Constants, SWF::Videostream =cut ming-0.4.5/perl_ext/SWF/VideoStream.pm0000644000175000017500000000625211454264373014452 00000000000000# ==================================================================== # Copyright (c) 2006 by Peter Liscovius. All rights reserved. # (c) 2009 Albrecht Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::VideoStream; use SWF(); use strict; $SWF::VideoStream::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::VideoStream - SWF Video class =head1 SYNOPSIS use SWF::VideoStream; $videostream = new SWF::VideoStream("test.flv"); =head1 DESCRIPTION SWF::VideoStream is a helper class useful for playing videos via SWF applications, either via embedded video data, or controlled by ActionScript. =head1 METHODS =over =item $videostream = new SWF::VideoStream($filename) Creates a SWF::VideoStream object. If the file can't be opened the constructor will return an empty object. The filename is not limited to 'flv' extension. =item $frames = $videostream->getNumFrames() This method returns the number of video-frames of an object of SWF::VideoStream, this works only for embedded streams. In case of error you will get result of -1. =item $videostream->setDimension(width, height) This method sets width and height for streamed videos, this works only on streamed videos (progressive download or rtmp). =item $bool = $videostream->hasAudio() A test whether the embedded FLV stream also has audio data. =item $videostream->setFrameMode($mode) If the mode == SWFVIDEOSTREAM_MODE_AUTO (default) on every SWF movie frame a video frame is added. In SWFVIDEOSTREAM_MODE_MANUAL mode, the user needs to call the nextFrame() method to change the video's frame. This works only with embedded video streams. Does return the previous mode or -1 if an invalid mode was passed. =item $result = $videostream->nextFrame() Switch to next video frame. Works only with embedded video streams. Returns -1 if an error happend. Here follows some demo code how to use SWF::VideoStream objects (without ActionScript): use SWF qw(:ALL); # to be lazy $movie = new SWF::Movie(); $movie->setRate( 25 ); # $movie->setRate( 5 ); # e.g. 5 for slow motion # here movie set background etc. etc. # $video=new SWF::VideoStream('MyTestVideo.flv'); die if (-1 == $v->getNumFrames()); # abort if something went wrong # $video->setFrameMode(SWF::Constants::SWFVIDEOSTREAM_MODE_MANUAL); $video->seek(1000, 0); # for example only $displayitem = $movie->add($video); # # 250 for a 10 seconds movie part (at rate of 25 per minute) for(my $n = 0; $n < 250; ++$n) { $video->nextFrame(); $movie->nextFrame(); } $movie->save("MyTestVideo.swf",9); # that's all, folks =item $result = $videostream->seek($frame, $whence) This functions allows seeking $frame in video stream, returning the old video frame position. As value of $whence use one of the following: 0 for seeking from beginning 1 for seeking from current position 2 for seeking from end of file =back =head1 AUTHOR developers of ming ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Action, SWF::Movie, SWF::MovieClip, SWF::Sound, SWF::SoundStream, SWF::Constants =cut ming-0.4.5/perl_ext/SWF/Shadow.pm0000644000175000017500000000222211454264373013446 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Shadow; use SWF (); $SWF::Shadow::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Shadow - SWF shadow class =head1 SYNOPSIS use SWF::Shadow; $shadow = new SWF::Shadow(2.5, 12, 2); $filter = SWF::Filter::newDropShadowFilter( \@colors, $blur, $shadow, 0); =head1 DESCRIPTION SWF::Shadow is a helper class useful for SWF::Filter. =head1 METHODS =over =item new SWF::Shadow($angle, $distance, $strength) Creates a Shadow object. The object is controlled by angle (in radians), distance (in px) and strength. Useful values for strength are between 1 and 10. Use the created object as parameter for construction of some of the SWF::Filter objects. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Filter, SWF::Blur, SWF::DisplayItem =cut ming-0.4.5/perl_ext/SWF/TextField.pm0000644000175000017500000001056511454264373014122 00000000000000# ==================================================================== # Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::TextField; use SWF (); $SWF::TextField::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::TextField - SWF TextField class =head1 SYNOPSIS use SWF::TextField; $textfield = new SWF::TextField([$flags]); =head1 DESCRIPTION Unlike SWF::Text objects, TextFields cannot be rotated, scaled non-proportionally, or skewed. However, TextFields can be used as form entries and they can use browser-defined fonts. =head1 NOTES: TextField is implemented into Flash since Flash3. Most of features for TextFields are available since Flash4. Simple HTML-tags in TextField are possible since Flash5. =head1 METHODS =over =item new SWF::TextField([$flags]); Creates a TextField object whose behaviour is dictated by C (see also SWF::Constants): SWFTEXTFIELD_NOEDIT: Non-editable Textfiled SWFTEXTFIELD_PASSWORD: Obscure user input with astricts. SWFTEXTFIELD_DRAWBOX: Draw a border around TextField SWFTEXTFIELD_MULTILINE: TextFiels may contain multiple lines SWFTEXTFIELD_WORDWRAP: Warp text when text reaches TextField border SWFTEXTFIELD_NOSELECT: TextField is not selected when user clicks on it SWFTEXTFIELD_ALIGN_LEFT: Align text to the left SWFTEXTFIELD_ALIGN_RIGHT: Align text to the right SWFTEXTFIELD_ALIGN_CENTER: Align text to the center SWFTEXTFIELD_ALIGN_JUSTIFY: Justify text SWFTEXTFIELD_HTML: Add HTML markup string SWFTEXTFIELD_HASLENGTH: SWFTEXTFIELD_USEFONT: Want to embed font SWFTEXTFIELD_AUTOSIZE: Flags may be combined with the bitwise OR operation. For example: my $t = new SWF::TextField(SWFTEXTFIELD_MULTILINE | SWFTEXTFIELD_WORDWRAP); =item $textfield->addString($string) =item $textfield->addUTF8String($UTF8string) Add $string to TextField. Text is appended to the existing text. =item $textfield->align($alignment) =item $textfield->setAlignment($alignment) Set the alignment of the text in the textfield. Possible values are SWFTEXTFIELD_ALIGN_LEFT SWFTEXTFIELD_ALIGN_RIGHT SWFTEXTFIELD_ALIGN_CENTER SWFTEXTFIELD_ALIGN_JUSTIFY By default a SWF::TextField ist left aligned. =item $textfield->setBounds($width, $height) Sets the width and height of the textfield. =item $textfield->setColor($red, $green, $blue [, $alpha]) Set the color of the text. An 8 bit value for each parameter. You can use the hex or decimal notation. Even mixed. $tf->setColor(0xcc,0,0x33); $tf->setColor(204,0,51,255); =item $textfield->setFont($font) Sets an SWF::Font object -$font- to be used in the TextField. =item $textfield->setPadding($padding) Set TextField padding. =item $textfield->setHeight($height) Set the height of font in your textfield. =item $textfield->setIndentation($indentation) Set the indentation of the first line of a paragraph. =item $textfield->setLeftMargin($left) Sets the left margin of the textfield. =item $textfield->setRightMargin($right) Sets the right margin of the textfield. =item $textfield->setMargins($left, $right) Sets left and right margins of $textfield. =item $textfield->setLineSpacing($linespacing) Sets the space between lines. =item $textfield->setName($name) =item $textfield->setVariableName($name) Assigns a name to the TextField which could be used to reference the TextField within ActionScript. =item $textfield->addChars($string) =item $textfield->addUTF8Chars($UTF8string) Adds characters to a font that will be available within a textfield. =item $textfield->setFlags($flags) Set TextField behaviour by C (see above new SWF::TextField) For example: $textfield->setFlags(SWFTEXTFIELD_PASSWORD); =item $textfield->setLength($length) Sets limit for user input size to $length. =item $textfield->setFieldHeight($height) Sets height limit for visible part of text field. If $height is set to 0, the height is calculated by used font, see I method. =back =head1 AUTHOR Soheil Seyfaie (soheil at users.sourceforge.net). =head1 SEE ALSO SWF, SWF::Action, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Font, SWF::Movie, SWF::MovieCip, SWF::Text =cut ming-0.4.5/perl_ext/SWF/Constants.pm0000644000175000017500000001066411454264373014206 00000000000000# ==================================================================== # Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. # (c) 2009 Albrecht Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Id$ package SWF::Constants; use SWF(); $SWF::Constants::VERSION = $SWF::VERSION; 1; =head1 NAME SWF::Constants - Constants defined in ming =head1 SYNOPSIS use SWF::Constants 'SWFBUTTON_MOUSEUP'; # import SWFBUTTON_MOUSEUP use SWF::Constants ':Button'; # import all constants for SWF::Button =head1 DESCRIPTION SWF::Constants allows importing constants defined in ming. =head1 EXPORT TAGS =over 4 =item Button This tag imports constants most commonly used by SWF::Button. SWFBUTTON_MOUSEUP SWFBUTTON_HIT SWFBUTTON_DOWN SWFBUTTON_OVER SWFBUTTON_UP SWFBUTTON_MOUSEOVER SWFBUTTON_MOUSEOUT SWFBUTTON_MOUSEDOWN SWFBUTTON_DRAGOUT SWFBUTTON_DRAGOVER SWFBUTTON_MOUSEUPOUTSIDE SWFBUTTON_KEYPRESS SWFBUTTON_ONKEYPRESS =item DisplayItem This tag imports constants most commonly used by SWF::DisplayItem. SWFACTION_ONLOAD SWFACTION_ENTERFRAME SWFACTION_UNLOAD SWFACTION_MOUSEMOVE SWFACTION_MOUSEDOWN SWFACTION_MOUSEUP SWFACTION_KEYDOWN SWFACTION_KEYUP SWFACTION_DATA SWFBLEND_MODE_NULL SWFBLEND_MODE_NORMAL SWFBLEND_MODE_LAYER SWFBLEND_MODE_MULT SWFBLEND_MODE_SCREEN SWFBLEND_MODE_DARKEN SWFBLEND_MODE_LIGHTEN SWFBLEND_MODE_ADD SWFBLEND_MODE_SUB SWFBLEND_MODE_DIFF SWFBLEND_MODE_INV SWFBLEND_MODE_ALPHA SWFBLEND_MODE_ERASE SWFBLEND_MODE_OVERLAY SWFBLEND_MODE_HARDLIGHT =item Fill This tag imports constants most commonly used by SWF::Fill. SWFFILL_SOLID SWFFILL_GRADIENT SWFFILL_LINEAR_GRADIENT SWFFILL_RADIAL_GRADIENT SWFFILL_FOCAL_GRADIENT SWFFILL_BITMAP SWFFILL_TILED_BITMAP SWFFILL_CLIPPED_BITMAP available since SWF8: SWFFILL_FOCAL_GRADIENT SWFFILL_NONSMOOTHED_TILED_BITMAP SWFFILL_NONSMOOTHED_CLIPPED_BITMAP =item Sound This tag imports constants most commonly used by SWF::Sound. SWF_SOUND_NOT_COMPRESSED SWF_SOUND_NOT_COMPRESSED_LE SWF_SOUND_ADPCM_COMPRESSED SWF_SOUND_MP3_COMPRESSED SWF_SOUND_NELLY_COMPRESSED SWF_SOUND_5KHZ SWF_SOUND_11KHZ SWF_SOUND_22KHZ SWF_SOUND_44KHZ SWF_SOUND_8BITS SWF_SOUND_16BITS SWF_SOUND_MONO SWF_SOUND_STEREO This tag imports constants most commonly used by SWF::Video. SWFVIDEOSTREAM_MODE_AUTO SWFVIDEOSTREAM_MODE_MANUAL =item Text This tag imports constants most commonly used by SWF::TextField. SWFTEXTFIELD_NOEDIT SWFTEXTFIELD_PASSWORD SWFTEXTFIELD_DRAWBOX SWFTEXTFIELD_MULTILINE SWFTEXTFIELD_WORDWRAP SWFTEXTFIELD_NOSELECT SWFTEXTFIELD_ALIGN_LEFT SWFTEXTFIELD_ALIGN_RIGHT SWFTEXTFIELD_ALIGN_CENTER SWFTEXTFIELD_ALIGN_JUSTIFY SWFTEXTFIELD_HTML SWFTEXTFIELD_HASLENGTH SWFTEXTFIELD_USEFONT SWFTEXTFIELD_AUTOSIZE = item Shape This tag imports constants most commonly used by SWF::Shape. SWF_SHAPE_USESCALINGSTROKES SWF_SHAPE_USENONSCALINGSTROKES SWF_LINESTYLE_CAP_ROUND SWF_LINESTYLE_CAP_NONE SWF_LINESTYLE_CAP_SQUARE SWF_LINESTYLE_JOIN_ROUND SWF_LINESTYLE_JOIN_BEVEL SWF_LINESTYLE_JOIN_MITER SWF_LINESTYLE_FLAG_NOHSCALE SWF_LINESTYLE_FLAG_NOVSCALE SWF_LINESTYLE_FLAG_HINTING SWF_LINESTYLE_FLAG_NOCLOSE SWF_LINESTYLE_FLAG_ENDCAP_ROUND SWF_LINESTYLE_FLAG_ENDCAP_NONE SWF_LINESTYLE_FLAG_ENDCAP_SQUARE =item Filter This tag imports constants most commonly used by SWF::Filter, all available since SWF8: SWF_FILTER_MODE_INNER SWF_FILTER_MODE_KO SWF_FILTER_MODE_COMPOSITE SWF_FILTER_MODE_ONTOP SWF_FILTER_CLAMP SWF_FILTER_FLAG_PRESERVE_ALPHA =item Gradient This tag imports constants most commonly used by SWF::Gradient, all available since SWF8: SWF_GRADIENT_PAD SWF_GRADIENT_REFLECT SWF_GRADIENT_REPEAT SWF_GRADIENT_NORMAL SWF_GRADIENT_LINEAR =back =head1 AUTHOR Soheil Seyfaie (soheil at users.sourceforge.net). Peter Liscovius Albrecht Kleine and see AUTHORS in ming lib distribution (ming.sf.net) =head1 SEE ALSO SWF, SWF::Action, SWF::Bitmap, SWF::Button, SWF::Fill, SWF::Gradient, SWF::Movie, SWF::MovieClip, SWF::Shape, SWF::Sound, SWF::TextField, SWF::Filter =cut ming-0.4.5/perl_ext/SWF/Filter.pm0000644000175000017500000000575611454264373013465 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Filter; use SWF (); $SWF::Filter::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Filter - SWF filter class =head1 SYNOPSIS use SWF::Blur; use SWF::Shadow; use SWF::Constants qw(:Filter); @color= (12,45,99); $blur = new SWF::Blur(15, 15, 2); $shadow = new SWF::Shadow(2.5, 12, 2); $filter = SWF::Filter::newDropShadowFilter( \@color, $blur, $shadow, SWF_FILTER_MODE_KO); $displayitem->addFilter( $filter); =head1 DESCRIPTION Filter objects are available since player version 8. They can be applied to buttons, movieclips and text instances by the addFilter() method of SWF::DisplayItem objects. Several types of filters exist. Each of them has its own method of construction, see below. =head1 METHODS =over =item newDropShadowFilter($colorref, $blur, $shadow, $flags) Creates a DropShadowFilter object. The object is controlled by color, blur object, shadow object and flags (SWF_FILTER_MODE_INNER, SWF_FILTER_MODE_KO). =item newBlurFilter($blur) Creates a BlurFilter object. The object is controlled by the blur object. =item newGlowFilter($colorref, $blur, $strength, $flags) Creates a GlowFilter object, a simple variant of DropShadowFilter. Use SWF_FILTER_MODE_INNER, SWF_FILTER_MODE_KO as flag values. =item newBevelFilter($shadow_colorref, $highlight_colorref, $blur, $shadow, $flags) Just another (complex) variant of DropShadowFilter. Use SWF_FILTER_MODE_INNER, SWF_FILTER_MODE_KO or FILTER_MODE_ONTOP as flag values. =item newGradientGlowFilter($gradient, $blur, $shadow, $flags) Just another (more complex) variant of DropShadowFilter. As flag use SWF_FILTER_MODE_INNER, SWF_FILTER_MODE_KO or SWF_FILTER_MODE_ONTOP . =item newGradientBevelFilter($gradient, $blur, $shadow, $flags) Just another (slightly more complex) variant of DropShadowFilter, extending newBevelFilter() by using a gradient instead of simple colors. Use SWF_FILTER_MODE_INNER, SWF_FILTER_MODE_KO or FILTER_MODE_ONTOP as flag values. =item newColorMatrixFilter($filtermatrix) The filtermatrix is an object of SWF::FilterMatrix class sized 5 columns x 4 rows for RGBA values, useful for transformations like color conversion to greyscale pictures. =item newConvolutionFilter($filtermatrix, $divisor, $bias, $colorref, $flags) Another filter for nice picture effects like blur etc. The filtermatrix is an object of SWF::FilterMatrix class. As flag use either use SWF_FILTER_FLAG_CLAMP or SWF_FILTER_FLAG_PRESERVE_ALPHA. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Filter, SWF::Blur, SWF::Shadow, SWG::Gradient, SWF::FilterMatrix, SWF::DisplayItem, SWF::Constants, SWF::MovieClip, SWF::Button =cut ming-0.4.5/perl_ext/SWF/Button.pm0000644000175000017500000000716511454264373013507 00000000000000# ==================================================================== # Copyright (c) 2000 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Button; use SWF(); $SWF::Button::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Button - SWF button class =head1 SYNOPSIS use SWF::Button; $button = new SWF::Button(); $button->setUp($shape1); $button->setDown($shape2); =head1 DESCRIPTION Creates buttons for flash movies. Buttons are controlled by various methods for visible design and triggered actions, see below: =head1 METHODS =over 4 =item new SWF::Button() Creates a new Button object. =item $button->addShape($shape, FLAG) Adds $shape to the button. Using this method is not recommended, better use addCharacter(), see next item for details. Also unlike addCharacter() this method does not return any SWF::ButtonRecord objects =item $buttonrecord = $button->addCharacter($character [, $flags]) Adds character $shape to the button. Valid FLAGs are: SWFBUTTON_HIT SWFBUTTON_UP SWFBUTTON_DOWN SWFBUTTON_OVER Unlike addShape() this method returns an object of SWF::ButtonRecord class. The flag states can be combined using the binary or operator. =item $buttonrecord = $button->setOver($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_OVER); =item $buttonrecord = $button->setHit($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_HIT); =item $buttonrecord = $button->setUp($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_UP); =item $buttonrecord = $button->setDown($shape) Shortcut for $button->addCharacter($shape, SWFBUTTON_DOWN); =item $button->addAction($action [,FLAG]) =item $button->setAction($action [,FLAG]) Adds $action object (see SWF::Action). Valid FLAGs are: SWFBUTTON_MOUSEUP SWFBUTTON_MOUSEOVER SWFBUTTON_MOUSEOUT SWFBUTTON_MOUSEDOWN SWFBUTTON_DRAGOVER SWFBUTTON_DRAGOUT SWFBUTTON_MOUSEUP is the default value of FLAG. =item $button->setMenu(0|1) Parameter is 0 (off) or 1(on). Can be used for a slight different behavior of buttons. =item $soundinstance = $button->addSound($sound, $flags) Plays a prepared SWF::Sound object and returns an object of SWF::SoundInstance. Once more valid flags are: SWFBUTTON_MOUSEUP SWFBUTTON_MOUSEOVER SWFBUTTON_MOUSEOUT SWFBUTTON_MOUSEDOWN For example: $sound = new SWF::Sound("wow.mp3", SWF_SOUND_MP3_COMPRESSED ); $soundinstance = $button->addSound($sound, SWFBUTTON_MOUSEDOWN ); =item $button->setScalingGrid($x, $y, $w, $h) This function (available from SWF>=8) sets a 9 slice scaling grid: 1 2 3 4 5 6 7 8 9 X, y, w and h define a rectangle, which is the dimension of the center slice (5). All other slices are determined out of the characters bounds and the defined rect. While slice 5 is scaled vertical and horizontal, slice 2 and 8 are only scaled horizontal. Slice 4 and 6 only vertical. The 4 corner slices are not scaled (1, 3, 7, 9). =item $button->removeScalingGrid() Removes scaling grid rectangles. =back =head1 AUTHOR wrapper written by Soheil Seyfaie (soheil at users dot sourceforge dot net) Peter Liscovius (peterdd at users dot sourceforge dot net) and many others. =head1 SEE ALSO SWF, SWF::Action, SWF::Shape, SWF::Movie, SWF::MovieClip, SWF::Constants, SWF::Sound, SWF::SoundInstance =cut ming-0.4.5/perl_ext/SWF/InitAction.pm0000644000175000017500000000173211454264373014267 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::InitAction; use SWF (); $SWF::InitAction::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::InitAction - SWF init action class =head1 SYNOPSIS use SWF::InitAction; $initaction = new SWF::InitAction( $action ); =head1 DESCRIPTION SWF::InitAction is an action helper class. =head1 METHODS =over =item new SWF::InitAction( $action ) This method creates an InitAction object and defines an empty MovieClip which is not placed. Parameter $action is an object of SWF::Action class. [ToDo: add demo code here!] =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Action, SWF::MovieClip =cut ming-0.4.5/perl_ext/SWF/Gradient.pm0000644000175000017500000000554411454264373013770 00000000000000# ==================================================================== # Copyright (c) 2000 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Gradient; use SWF(); $SWF::Gradient::VERSION = $SWF::VERSION; 1; =head1 NAME SWF::Gradient - SWF gradient class =head1 SYNOPSIS use SWF::Gradient; use SWF::Constants qw(:Gradient); use SWF::Shape; $g = new SWF::Gradient(); $g->addEntry(0.0,255,0,0,200); $g->addEntry(0.16,255,255,0,200); $g->addEntry(0.32,0,255,0,200); $g->addEntry(0.5,0,255,255,200); $g->addEntry(0.66,0,50,255,200); $g->addEntry(0.83 ,255,0,255,200); $g->addEntry(1.0,255,0,0,200); # ..make some kind of rainbow.. $sh = new SWF::Shape(); $fill = $sh->addGradientFill($g,SWFFILL_LINEAR_GRADIENT); =head1 DESCRIPTION SWF::Gradient is a helper class most useful for filling shapes (i.e. SWF::Shape objects), and also for filtering via SWF::DisplayItem methods using GradientGlowFilter or GradientBevelFilter, both are SWF::Filter objects. =head1 METHODS =over =item new SWF::Gradient() Creates and returns a gradient object. This object is an 'empty' gradient, to be filled with control point entries via up to 15 addEntry() method calls. (For SWF version 7 are only 8 control points possible.) For gradients used for filters also only 8 control points are possible. =item addEntry($ratio, $r, $g, $b [, $a]) Adds a gradient control point. The ratio parameter is a floating point value for controlling the position of the following RGBA-color value (consiting of red, green, blue and optional alpha parts) in an increasing row between 0.0 and 1.0 . Adding more than 15 entries will be useless and ignored. =item setSpreadMode($mode) For version >= 8 only: set a gradient spread mode: one of SWF_GRADIENT_PAD (default), SWF_GRADIENT_REPEAT, SWF_GRADIENT_REFLECT . =item setInterpolationMode($mode) For version >= 8 only: set a gradient interpolation mode: one of SWF_GRADIENT_NORMAL (default), SWF_GRADIENT_LINEAR . =item setFocalPoint($focalpoint) Makes a focal gradient 'asymetric'. A focalpoint value of -1.0 means the focal point is close to the left border, 0.0 is in the center and 1.0 is close to the right border. Also this feature is available for version >= 8 only. For best results use the SWFFILL_FOCAL_GRADIENT flag when adding to v4 shapes, i.e. like $g = new SWF::Gradient(); $g->setFocalPoint(-0.9); $g->addEntry(0.000000,0xff,0x00,0x00,0xff); $g->addEntry(1.000000,0x00,0xff,0x00,0xff); $shape->useVersion(4); $shape->addGradientFill($g,SWFFILL_FOCAL_GRADIENT); =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Shape, SWF::Fill, SWF::Filter, SWF::Constants =cut ming-0.4.5/perl_ext/SWF/Blur.pm0000644000175000017500000000220111454264373013122 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Blur; use SWF (); $SWF::Blur::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Blur - SWF blur class =head1 SYNOPSIS use SWF::Blur; $blur = new SWF::Blur(15, 15, 2); $filter = SWF::Filter::newDropShadowFilter( \@colors, $blur, $shadow, 0); =head1 DESCRIPTION SWF::Blur is a helper class useful for SWF::Filter. =head1 METHODS =over =item new SWF::Blur($blurX, $blurY, $passes) Creates a Blur object. The object is controlled by the horizontal blur amount -blurX-, the vertical blur amount -blurY- and the count of passes (use 1, 2 or 3). Use the created object as parameter for construction of some of the SWF::Filter objects. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Filter, SWF::Blur, SWF::DisplayItem =cut ming-0.4.5/perl_ext/SWF/PrebuiltClip.pm0000644000175000017500000000207111454264373014621 00000000000000# ==================================================================== # Copyright (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::PrebuiltClip; use SWF (); $SWF::PrebuiltClip::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::PrebuiltClip - SWF PrebuiltClip class =head1 SYNOPSIS use SWF::PrebuiltClip; my $prebclip = new SWF::PrebuiltClip("prebuilt.swf"); $displayitem = $movieclip->add($prebclip); =head1 DESCRIPTION SWF::PrebuiltClip is a helper class useful for adding prebuilt clips from SWF-files into movieclips. =head1 METHODS =over =item new SWF::PrebuiltClip($filename); Creates a SWF::PrebuiltClip object using filename. Use the created object to add that object into SWF::MovieClip objects using the MovieClip's add() method. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Movie, SWF::MovieClip, SWF::DisplayItem =cut ming-0.4.5/perl_ext/SWF/FilterMatrix.pm0000644000175000017500000000266611454264373014647 00000000000000# ==================================================================== # Copyright (c) 2008 Klaus Rechert All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::FilterMatrix; use SWF (); $SWF::FilterMatrix::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::FilterMatrix - SWF FilterMatrix class =head1 SYNOPSIS use SWF::FilterMatrix; $valueref = [ 0.5, 0.4, 0.3, 0, 0, 0.5, 0.4, 0.3, 0, 0, 0.5, 0.4, 0.3, 0, 0, 0, 0, 0, 1, 0 ]; $filtermatrix = new SWF::FilterMatrix( 5, 4, $valueref ); $filter = SWF::Filter::newColorMatrixFilter( $filtermatrix ); =head1 DESCRIPTION SWF::FilterMatrix is a helper class useful for construction of some SWF::Filter objects: ColorMatrix filter and Convolution filter. =head1 METHODS =over =item new SWF::FilterMatrix($cols, $rows, $valueref) The only method is a constructor for creation of a FilterMatrix object. The object is controlled by the matrix data dimensions (cols * rows) and the data values: a reference to an array of float values. Note: constructing ColorMatrixFilter needs a 5*4 matrix. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Filter, SWF::Blur, SWF::Shadow =cut ming-0.4.5/perl_ext/SWF/Text.pm0000644000175000017500000000464311454264373013156 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Text; use SWF (); $SWF::Text::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Text - SWF Text class =head1 SYNOPSIS use SWF::Text; $text = new SWF::Text(); =head1 DESCRIPTION Draw simple static texts. =head1 NOTES: None. =head1 METHODS =over =item new SWF::Text() Creates a Text object. =item $text->addString($string) =item $text->addUTF8String($UTF8string) =item $text->addWideString($widestring,$widestring_len) Writes the given $string into this Text object at the current pen position, using the current font, height, spacing, and color: $t->addString("Thai"); $t->addUTF8String("\x{0E44}\x{0E17}\x{0E22}"); $t->addWideString("\x{44}\x{0E}\x{17}\x{0E}\x{22}\x{0E}",3); =item $text->setColor(red, green, blue [, alpha]) Set the color of the text. An 8 bit value for each parameter. You can use he hex or decimal notation. Even mixed. $text->setColor(0xcc,0,0x33); $text->setColor(204,0,51,255); =item $text->setFont($font) Sets an SWF::Font object -$font- to be used in the Text. =item $text->setHeight($height) Sets this Text object's current height to given height. =item $text->moveTo($x, $y) Move the Text's location to ($x, $y). =item $text->setSpacing($spacing) Sets this Text object's current letterspacing to given spacing. =item $text->getWidth($string) =item $text->getStringWidth($string) =item $text->getUTF8StringWidth($UTF8string) =item $text->getWideStringWidth($widestring) Returns width of given string in pixels. =item $text->getAscent() Returns the ascent of the current font at its current size, or 0 if not available. =item $text->getDescent() Returns the descent of the current font at its current size, or 0 if not available. =item $text->getLeading() Returns the leading of the current font at its current size, or 0 if not available. =back =head1 AUTHOR developers of ming ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Font, SWF::TextField, ISO 10646 (Unicode) =cut ming-0.4.5/perl_ext/SWF/Movie.pm0000644000175000017500000002445411454264373013313 00000000000000# ==================================================================== # Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Id$ package SWF::Movie; use SWF(); $SWF::Movie::VERSION = $SWF::VERSION; use strict; sub streamMp3{ my ($movie,$filename) = @_; $movie->setSoundStream(new SWF::SoundStream($filename)); } sub output{ #/xxx/ Should we allow use to specify??? my $output_method = \&xs_output; $output_method = \&Apache::SWF::xs_output if ( $INC{'Apache/SWF.pm'} && substr($ENV{GATEWAY_INTERFACE}||'',0,8) eq 'CGI-Perl'); return &$output_method(@_); } 1; __END__ =head1 NAME SWF::Movie - SWF Movie class =head1 SYNOPSIS use SWF::Movie; $m = new SWF::Movie(); $m = SWF::Movie::newSWFMovieWithVersion(8); =head1 DESCRIPTION SWF::Movie is the root object of your flashfile. It contains all your other objects you want in your movie. Ming supports many Flash4, Flash5 F6,7,8,9.. features. The SWF::Movie object contains information like the flashversion, the size, the frames per second, the background color. Except that, the SWF::Movie behaves like a SWF::MovieClip. It only cannot be added to another SWF::Movie or SWF::MovieClip. Notice: The version of your flashmovie can be set by the object SWF. See SWF for more details. =head1 METHODS =over =item $m = new SWF::Movie() Creates a Movie object. =item $m = newSWFMovieWithVersion(version) Creates a Movie object with version value (e.g. 8) set. =item $displayItem=$m->add($SWFObject) Add an instance of a SWF-object to your current frame. The returnvalue is a SWF::DisplayItem. Some possible SWF-objects are: SWF::Action SWF::MovieClip SWF::Shape SWF::Sound SWF::Text SWF::TextField SWF::Bitmap SWF::PrebuiltClip $m->add($shape); # possible, but not more accessible for us $shape_1 = m->add($shape); # good instance =item $m->addExport($block, $name) Prepare linkage to Action script code. $m->addExport($mc, 'mc'); # and later inside action script....: $ac = new SWF::Action("_root.attachMovie('mc','mc1',11);"); =item $m->writeExports() Export prepared names to Action script. =item remove($displayItem) Removes the given SWF::DisplayItem instance from the current and following frames of the main timeline. $m->remove($shape_i); =item nextFrame() Finish a frame of the main timeline. New added objects will be added in the next frame. $m->nextFrame(); =item setNumberOfFrames($frames) =item setFrames($frames) Preset the number of frames of the main timeline. n not used frames before finishing the movie will filled with n nextFrame() statements. If you inserted more nextFrame() commands than you set with setFrames() the setFrames() will be ignored. $m->setFrames(100); =item $m->setBackground($red,$green,$blue) Set the background in red, green, blue values. Possible value are 0..255 or hexvalues 0x0..0xff. $m-setBackground(0xff,0x99,0x00); # orange bg $m-setBackground(0,200,255) # green bg A transparency level isn't available I asume. (In Flash MX/F6?). A transparent background can be set in the HTML-code for Internet Explorer. Please inform the Authors if that is available for nonIE-browsers. =item $m->namedAnchor($label) This function adds a named anchor to the movie. =item $m->setDimension(x,y) Set the dimension in pixel. #ToDo: #min: (0.0,0.0) # ;-) #max: (?,?) #default: (0.0?,0.0?) #Behavior when values max: ming sets it to max $m->setDimension(200,100); $m->setDimension(123.45,67.89); =item $m->setRate(int) Set the playing speed in frames/second. #ToDo: #min: 0 #max: ? #default: ? #Behavior when value max: ming sets it to max $m->setRate(30); =item $m->protect() A feature that prevents only flashnewbies from importing your movie into Macromedias Flash authoring tools. It cannot protect your content from being loaded by other flashmovies, deleting of the protection with a hexeditor or disassembling with tools. =item $m->setSoundStream($soundstream, [$skip]) Puts an SWF::SoundStream object as streaming sound into the main timeline. The optional skip parameter describes the time in seconds to be skiped. $m->setSoundStream($soundstream); =item $m->streamMp3($filename) Simplifies the setSoundStream(). You only need the filename. $m->streamMp3("iloveyou.mp3"); Hint: If you want to reuse this sound/mp3 later in this movie, create a reusable SWF::SoundStream object and then put it into setSoundstream(). =item $soundinstance = $m->startSound($sound) Play a prepared SWF::Sound object into the main timeline. Returns an object of SWF::SoundInstance. $sound = new SWF::Sound("loveyoutoo.mp3", SWF_SOUND_MP3_COMPRESSED ); $si = $m->startSound($sound); =item $m->stopSound($sound) Stop playing sound. =item $m->labelFrame($string) Gives the current frame a label that can be used by actionscript as anchor. Then you don't have to count your nextFrame() lines anymore. :-) $m->labelFrame("win"); #ToDo: #max characters of a label??? #What happen if we put there a big string?? #Which characters are allowed?? =item $m->setScriptLimits($maxRecursion, $timeout) Set limits for resource usage, related to action script. Setting timeout will protect your computer from too long loops and stack overflow. So endless scripts like "while (1){};" will be interrupted after timeout seconds. The default recursion depth is 265, the default timeout is 15 seconds. =item $m->defineScene($offset, $name) Define scenes for the movies' main timeline using integer value for frame offset and name of the scene. =item $m->setNetworkAccess($flag) Sets network / fileaccess policy. If the flag is set to 0 a localy loaded movie will be unable to access the network but is allowed to access local files. If the flag ist set to 1 a localy loaded movie will be unable to access local files but is allowed to access the network. For SWF >= 8: default is 0, =item $m->addMetadata($xml) Adds Metadata to the movie: this function inserts a metadata-tag into the movie. Only one metadata-tag can be set to a movie. Metadata is specified as an XML string. =item $m->assignSymbol($character, $name) Assigns a symbolic name for a SWF::Character object. Such classes are available for usage in other SWF files and can be referenced from inside the current movie. To assign a symbol to the root movie use NULL as character value. =item $m->setTabIndex($depth, $index) Sets tab index for specified depth level. =item $fontchar = $m->addFont($font) Adds a font to a movie. An object of SWF::FontCharacter class returned. $font = new SWF::Font('Arial.fdb'); $fch = $m->addFont($font); =item $fontchar = $m->importFont($file, $name) Imports a font from an other SWFFile. An object of SWF::FontCharacter class returned. $fch = $m->importFont('textField.swf', 'Arial337a'); =item $m->importCharacter($url, $name) Not yet documented (ToDo!) =item $result = $m->replace($item, $block) This method replaces a displayable character with a new one. Returns 0 on success , -1 else. $dispitem = $movie->add($shape1); $movie->nextFrame(); print $movie->replace($dispitem, $shape2); $movie->nextFrame(); =item $written = $m->xs_output([$compresslevel]) =item $written = $m->output([$compresslevel]) Writes the SWF::Movie to stdout. This is normally used for webservers/cgi-scripts. Don't forget to send the "Content-Type:"-lines before writing out the movie. The parameter compresslevel is optional. compresslevel between 0 and 9. Higher values will be interpreted as 9. Values smaller 0 mean no compression. By default the SWF::Movie will be send without compression. Notice: compression available since Flash MX(Flash 6). Ming does not check this for you if you write flash4 or flash5 movies. Unlike xs_output() the output() method prepared for using via webservers (but not limited to webservers). Both methods return number of bytes written. =item $written = $m->save($filename [, $compresslevel]) Method saves the SWF::Movie to a file and returns the number of bytes written. The parameter compresslevel is optional. compresslevel between 0 and 9. Higher values will be interpreted as 9. Values smaller 0 mean no compression. By default the SWF::Movie will be saved without compression. Notice: compression available since Flash MX(Flash 6). Ming does not check this for you if you write flash4 or flash5 movies. =back =head1 EXAMPLE 3 examples: a regular minimal SWF::Movie, one with all methods and a more interesting. =over =item minimal empty example #!/usr/bin/perl -w use SWF::Movie; $m = new SWF::Movie(); $m->nextFrame(); $m->save("emptyminimal.swf"); =item full empty examples #!/usr/bin/perl -w use SWF::Movie; $m = new SWF::Movie(); $m->setVersion(4); $m->setBackground(0xff,0xcc,0x0); $m->setDimension(200,100); $m->protect(); $m->setRate(30); $m->setFrames(10); # ming fills it automatic with frames $m->nextFrame() $m->save("empty.swf"); =item streaming example #!/usr/bin/perl -w use SWF("Shape"); SWF::setVersion(6); $m = new SWF::Movie(); $m->setBackground(0xff,0xcc,0x0); $m->setDimension(200,100); $m->setFrames(10); $m->streamMp3("forever.mp3"); $s= new SWF::Shape(); $s->setLine(40,0xff,0xff,0); $s->setRightFill(0xff,0,0); $s->drawLine(50,0); $s->drawLine(0,20); $s->drawLineTo(0,0); $s_1= $m->add($s); $s_2= $m->add($s); $s_1->move(50,40); $s_2->move(10,40); for($i=1;$i<5;$i++) { $m->nextFrame(); $s_2->move(0,10); } $m->nextFrame(); print "Content-type: application/x-shockwave-flash\n\n"; $m->output(9); # with compression level 9 (since flash6) =back =head1 AUTHOR Soheil Seyfaie (soheil at users.sourceforge.net), Albrecht Kleine and developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Action, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill, SWF::Font, SWF::FontCharacter, SWF::Gradient, SWF::Morph, SWF::MovieClip, SWF::Shape, SWF::PrebuiltClip, SWF::Sound, SWF::SoundStream, SWF::TextField, SWF::Text, SWF::Filter, SWF::Character =cut ming-0.4.5/perl_ext/SWF/Shape.pm0000644000175000017500000002327111454264373013270 00000000000000# ==================================================================== # Copyright (c) 2000-2003 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Shape; use SWF (); $SWF::Shape::VERSION = $SWF::VERSION; sub setLeftFill{ my $self = shift; return $self->xs_setLeftFill() unless scalar @_; return $self->xs_setLeftFill($_[0]) if ( ref($_[0]) eq 'SWF::Fill'); return $self->xs_setLeftFill($self->addSolidFill(@_)); } sub setRightFill{ my $self = shift; return $self->xs_setRightFill() unless scalar @_; return $self->xs_setRightFill($_[0]) if ( ref($_[0]) eq 'SWF::Fill'); return $self->xs_setRightFill($self->addSolidFill(@_)); } 1; __END__ =head1 NAME SWF::Shape - Shape class =head1 SYNOPSIS use SWF::Shape; $shape = new SWF::Shape(); $dispitem = $movie->add($shape); =head1 DESCRIPTION SWF::Shape is the fundamental object of a flash movie. =head1 METHODS =over 4 =item new SWF::Shape() Creates a new Shape object. =item $shape->movePenTo($x, $y) Move the Shape's (imaginary) pen location to ($x, $y) in the Shape's coordinate space. =item $shape->movePen($dx, $dy) Add ($dx, $dy) to the Shape's pen current location. =item $x = $shape->getPenX() Returns Pen's x-coordinates =item $y = $shape->getPenY() Returns Pen's y-coordinates =item ($x, $y) = $shape->getPen() Returns Pen's (x,y) coordinates =item $shape->drawLineTo($x, $y) Draw a line (using current line style, set by one of the setLine...() methods) from the current position to ($x, $y). =item $shape->drawLine($dx, $dy) Draw a line (using current line style set by one of the setLine...() methods) from the current position to displacement ($dx, $dy). =item $shape->drawCurveTo($controlx, $controly, $anchorx, $anchory) Draw a quadratic curve (using current line style, set by one of the setLine...() methods) from current pen position to ($anchorx, $anchory) using control point ($controlx, $controly). =item $shape->drawCurve($controldx, $controly, $anchorx, $anchory) Draw a quadratic curve (using current line style, set by one of the setLine...() methods) from current pen position to displacement ($anchordx, $anchordy) using displacement control point ($controldx, $controldy). =item $shape->drawCubicTo($bx,$by,$cx,$cx,$dx,$dy) =item $shape->drawCubic($bx,$by,$cx,$cx,$dx,$dy) Draw a cubic curve (using current line style). [ToDo: Add some more details and demo code] =item $shape->setLine($width, $r, $g, $b [,$a]) Sets Shape's line width and color (RGB). To remove the Shape's line style call $shape->hideLine(). The used line width for drawing is a product of $width argument and scale value set, see SWF::setScale($scale). Arguments $r, $g, $b stand for red, green and blue color parts, optional $a for alpha value. =item $shape->setLineStyle($width, $r, $g, $b [,$a]) This OLD deprecated method is documented here only for compatibility reason. The line width -in TWIPS units- is independent of Ming scale value (more bug than feature). =item $shape->setLine2($width, $r, $g, $b ,$a, $flags, $miterLimit) A new method available for SWF version >=8 setting shape's line width and color (RGBA) with additional control flags (see below) and miter limit. To remove the Shape's line style call $shape->hideLine(). The used line width for drawing is a product of $width argument and scale value set, see SWF::setScale($scale). Arguments $r, $g, $b, $a stand for red, green, blue and alpha color parts. $a is not optional here. Available flags are: Line cap style: select one of the following flags (default is round cap style) SWF_LINESTYLE_CAP_ROUND SWF_LINESTYLE_CAP_NONE SWF_LINESTYLE_CAP_SQUARE Line join style: select one of the following flags (default is round join style) SWF_LINESTYLE_JOIN_ROUND SWF_LINESTYLE_JOIN_BEVEL SWF_LINESTYLE_JOIN_MITER Scaling flags: disable horizontal / vertical scaling SWF_LINESTYLE_FLAG_NOHSCALE SWF_LINESTYLE_FLAG_NOVSCALE Enable pixel hinting to correct blurry vertical / horizontal lines: all anchors will be aligned to full pixels SWF_LINESTYLE_FLAG_HINTING Disable stroke closure: if no-close flag is set caps will be applied instead of joins. SWF_LINESTYLE_FLAG_NOCLOSE End-cap style: default round SWF_LINESTYLE_FLAG_ENDCAP_ROUND SWF_LINESTYLE_FLAG_ENDCAP_NONE SWF_LINESTYLE_FLAG_ENDCAP_SQUARE If join style is SWF_LINESTYLE_JOIN_MITER a miter limit factor must be set. Miter max length is then calculated as: max miter len = miter limit * width. If join style is not miter, this value will be ignored. =item $shape->setLineStyle2($width, $r, $g, $b ,$a, $flags, $miterLimit) This OLD deprecated method is mentioned here only for compatibility reason, you'd better use setLine2(). =item $shape->setLine2Filled($width, $fill, $flags, $miterLimit) A new method available for SWF version >=8 setting shape's line width and fill style, $fill is an object of SWF::Fill class. For other argument details see item $shape->setLine2(). =item $shape->setLine2StyleFilled($width, $fill, $flags, $miterLimit) This OLD deprecated method is mentioned here only for compatibility reason, you'd better use setLine2Filled(). =item $shape->hideLine() Remove the Shape's line, i.e. make lines painted after this method call invisible. =item $fill = $shape->addSolidFill($r, $g, $b [,$a]) =item $fill = $shape->addFill($r, $g, $b [,$a]) Adds a solid fill to $shape list of fill styles and returns an SWF::Fill object. This object is used with the "setLine()" method described below. The default value of $a is 0. =item $fill = $shape->addBitmapFill($bitmap [,FLAG]) =item $fill = $shape->addFill($bitmap [,FLAG]) Adds a bitmap fill to $shape list of fill styles and returns an SWF::Fill object. This object is used with the "setLine()" method described below. $bitmap is an SWF::Bitmap object while FLAG argument can be SWFFILL_TILED_BITMAP or SWFFILL_CLIPPED_BITMAP. Make sure to import these constants to your package before useing it, i.e. use the following statement: use SWF::Fill ; The default value of FLAG is SWFFILL_TILED_BITMAP. =item $fill = $shape->addGradientFill($gradient [,FLAG]) =item $fill = $shape->addFill($gradient [,FLAG]) Adds a gradient fill to $shape list of fill styles and returns an SWF::Fill object. This object is used with the "setLine()" method described below. $gradient is an SWF::Gradient object while FLAG argument can be SWFFILL_LINEAR_GRADIENT or SWFFILL_RADIAL_GRADIENT, plus SWFFILL_FOCAL_GRADIENT for V8. Make sure to import these constants to your package before useing it, i.e. use the following statement: use SWF::Fill ; The default value of FLAG is SWFFILL_LINEAR_GRADIENT. =item $shape->xs_setLeftFill($fill) =item $shape->setLeftFill($fill) Sets the fill on the left side of the edge. $fill is an SWF::Fill object returned from "addFill" method. =item $shape->setLeftFill($r, $g, $b [,$a]) This is another way of saying: my $fill = $shape->addSolidFill($r, $g, $b [,$a]); $shape->setLeftFill($fill); =item $shape->xs_setRightFill($fill) =item $shape->setRightFill($fill) Sets the fill on the right side of the edge. $fill is an SWF::Fill object returned from "addFill" method. =item $shape->setRightFill($r, $g, $b [,$a]) This is another way of saying: my $fill = $shape->addSolidFill($r, $g, $b [,$a]); $shape->setRightFill($fill); =item $shape->drawCircle($r) Draws a circle with radious $r, also changes current position. =item $shape->drawArc($r, $startAngle, $endAngle) Draws an arc with radious $r form start to end. =item $shape->useVersion(version) This function allows to set the shapes version information. The version is only a hint. If necessary the version is upgraded. Valid values: are 3 and 4. Value of 3 is default, but 4 if linestyle2 is used. Some shape features are available only for shape version 4 and SWF file version>=8. One example is the usage of focal gradients: $g = new SWF::Gradient(); $g->setFocalPoint(-0.9); $g->addEntry(0.000000,0xff,0x00,0x00,0xff); $g->addEntry(1.000000,0x00,0xff,0x00,0xff); $shape->useVersion(4); $shape->addGradientFill($g,SWFFILL_FOCAL_GRADIENT); =item $version = $shape->getVersion() Gets the current shape object version. =item $shape->dumpOutline() Returns a string describing shape's outline. After drawing in a shape expect getting a multi-line string like: moveto 368,5 curveto 348,5 327,1 curveto 307,-3 284,-15 etc. etc. =item $shape->end() Stops drawing on this shape and make the shape complete. Further method calls won't produce any lines, circles etc. By using this demo code later no circle is painted: $shape->drawLineTo(300,300); $shape->end(); $shape->drawCircle(200); =item $shape->drawGlyph($font, $cnumber [, $size]) Draws character of $cnumber of $font. Also Unicode fonts are possible, if the font does provide that, just like next example: $font=new SWF::Font("Thai-Bold.fdb"); $sh->drawGlyph($font, 0x0E44, 44); =item $shape->drawCharacterBounds($character) Draws an outer rectangle fitting for $character, an object of SWF::Character. =item $shape->setRenderHintingFlags(flags) Set render hinting flags. Possible values are SWF::Constants::SWF_SHAPE_USESCALINGSTROKES and SWF::Constants::SWF_SHAPE_USENONSCALINGSTROKES This method also will set version of this SWF::Shape object to 4. =back =head1 AUTHOR Soheil Seyfaie (soheil at users.sourceforge.net), Albrecht Kleine =head1 SEE ALSO SWF, SWF::Bitmap, SWF::Button, SWF::Constants, SWF::DisplayItem, SWF::Fill, SWF::Font, SWF::Gradient, SWF::Morph, SWF::Movie, SWF::MovieClip, SWF::TextField, SWF::Text, SWF::Character =cut ming-0.4.5/perl_ext/SWF/Fill.pm0000644000175000017500000000476211454264373013122 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # (c) 2009 A.Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Fill; use SWF (); $SWF::Fill::VERSION = $SWF::VERSION; 1; =head1 NAME SWF::Fill - SWF fill class =head1 SYNOPSIS use SWF::Fill; usw SWF::Shape; $shape = new SWF::Shape(); $fill = $shape->addGradientFill($gradient,SWFFILL_LINEAR_GRADIENT); =head1 DESCRIPTION There is no object constructor because SWF::Fill objects are always returned by method calls of SWF::Shape objects, like $fill = $shape->addSolidFill($r, $g, $b, $a); $fill = $shape->addGradientFill($gradient, flags); $fill = $shape->addBitmapFill($bitmap, $flag); You can now modify that SWF::Fill object using following methods. =head1 NOTE None of the following methods is designed or useful for solid fill objects, because it does not make any sense to rotate or scale a solid fill. =head1 METHODS =over =item $fill->moveTo($x, $y) Move $fill to ($x, $y) in global co-ordinates. =item $fill->scaleTo($x [,$y]) Set $fill scale to $x in the x-direction and $y in the y-direction. If $y is not specified, $y=$x is assumed. =item $fill->scale($x [,$y]) Multiply $fill scale by $x in the x-direction and $y in the y-direction. If $y is not specified, $y=$x is assumed. =item $fill->rotateTo($degrees) Set $fill rotation to $degrees. =item $fill->rotate($degrees) Rotate $fill by $degrees. =item $fill->skewX($x) Add $x to the current x-skew. =item $fill->skewXTo($x) Set x-skew to $x. 1.0 is 45-degree forward slant. More is more forward while less is more backward. =item $fill->skewY($y) Add $y to the current y-skew. =item $fill->skewYTo($y) Set y-skew to $y. 1.0 is 45-degree upward slant. More is more upward while less is more downward. =item $fill->setMatrix($a, $b, $c, $d, $e, $f) Do an operation of rotating/skewing (b,c), moving (e,f) and scaling (a,d) at once. The default initial values of an SWF::Fill object's matrix are 1.0, 0, 0, 1.0, 0, 0 . So calling setMatrix with these defaults (I) will reset results of earlier calls of SWF::Fill methods (like rotate(45) etc. etc.) =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Shape, SWF::DisplayItem, SWF::Constants =cut ming-0.4.5/perl_ext/SWF/Font.pm0000644000175000017500000000344711454264373013141 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Font; use SWF(); $SWF::Font::VERSION = $SWF::VERSION; 1; =head1 NAME SWF::Font - SWF Font class =head1 SYNOPSIS use SWF::Font; $font = new SWF::Font(); =head1 DESCRIPTION Font object for later usage in Text and TextField objects. =head1 NOTES Ming 0.3's old getShape($font, $code) has been removed from interface. For getting details of glyph information you could draw a character into a shape and call dumpOutline() method, just like $sh=new SWF::Shape(); $sh->drawGlyph($font, $char_nr); print $sh->dumpOutline(); =head1 METHODS =over =item new SWF::Font($filename) Creates a Font object. $filename selects either True-Type Font '(ttf') file or Font Definition Block ('fdb') file as written by makefdb tool. =item $font->getStringWidth($string) =item $font->getUTF8StringWidth($UTF8string) Returns width of given string in pixels. =item $font->getAscent() Returns the ascent of the current font, or 0 if not available. =item $font->getDescent() Returns the descent of the current font, or 0 if not available. =item $font->getLeading() Returns the leading of the current font, or 0 if not available. =item $font->getName() Returns the name of the current font, do not confuse with font filename. =item $font->getGlyphCount() Returns the glyph count of the current font. =back =head1 AUTHOR developers of ming ming.sourceforge.net =head1 SEE ALSO SWF, SWF::BrowserFont, SWF::Text, SWF::TextField, SWF::Shape, ISO 10646 (Unicode) =cut ming-0.4.5/perl_ext/SWF/DisplayItem.pm0000644000175000017500000001575211454264373014461 00000000000000# ==================================================================== # Copyright (c) 2000 by Soheil Seyfaie. All rights reserved. # (c) 2009 by Albrecht Kleine # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::DisplayItem; use SWF (); $SWF::DisplayItem::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::DisplayItem - SWF DisplayItem class =head1 SYNOPSIS use SWF::DisplayItem; $dispitem = $movie->add($shape); $dispitem->rotate(45); =head1 DESCRIPTION When you place an SWF object (one of the types that can be seen with eyes by user) in a frame of a SWF::Movie or SWF::MovieClip, the return value will be in a SWF::DisplayItem. You can now modify that item in current and every following frames of the clip where you added the SWF object. Further it is accessible by ActionScript too. Just give the DisplayItem a name with method setName($name) after you added the SWF object to a SWF::Movie or SWF::MovieClip =head1 METHODS =over 4 =item $displayItem->moveTo($x, $y); Move $displayItem to ($x, $y) in global co-ordinates. =item $displayItem->move($x, $y); Displace $displayItem by ($x, $y) =item $displayItem->scaleTo($x [,$y]); Set $displayItem scale to $x in the x-direction and $y in the y-direction. If $y is not specified, $y=$x is assumed. =item $displayItem->scale($x [,$y]); Multiply $displayItem scale by $x in the x-direction and $y in the y-direction. If $y is not specified, $y=$x is assumed. =item $displayItem->rotateTo($degrees); Set $displayItem rotation to $degrees. =item $displayItem->rotate($degrees); Rotate $displayItem by $degrees. =item $displayItem->skewX($x); Add $x to the current x-skew. =item $displayItem->skewXTo($x); Set x-skew to $x. 1.0 is 45-degree forward slant. More is more forward while less is more backward. =item $displayItem->skewY($y); Add $y to the current y-skew. =item $displayItem->skewYTo($y); Set y-skew to $y. 1.0 is 45-degree upward slant. More is more upward while less is more downward. =item $displayItem->setMatrix($a, $b, $c, $d, $e, $f) Do an operation of rotating/skewing (b,c), moving (e,f) and scaling (a,d) at once. The default initial values of an SWF::DisplayItem object's matrix are 1.0, 0, 0, 1.0, 0, 0 . So calling setMatrix with these defaults (I) will reset results of earlier calls of SWF::DisplayItem methods (like rotate(45) etc. etc.) =item $displayItem->setDepth($depth); Set Z-order of $displayItem to $depth. =item $displayItem->setRatio($ratio); Useful for SWF::Morph. Sets $displayItem ratio to $ratio. =item $displayItem->setColorAdd($r, $g, $b [,$a])) =item $displayItem->addColor($r, $g, $b [,$a]); Add RGB color to the $displayItem's color transform. Default value of $a is 1.0 =item $displayItem->setColorMult($r, $g, $b [,$a])) =item $displayItem->multColor($r, $g, $b [,$a]); Multiplies the $displayItem's color transform by the given values. Default value of $a is 1.0 =item $displayItem->setName($name); Set $displayItem's name to $name (used for targetting with SWF::Action). =item $displayItem->remove(); Remove $displayItem from the movie display list. =item ($x, $y) = $displayItem->getPosition((); Returns displace coordinates of $displayitem. =item $degrees = $displayItem->getRotation(); Returns rotation of $displayItem. =item ($x, $y) = $displayItem->getScale(); Returns scale of $displayItem in x- and y-direction. =item ($x, $y) = $displayItem->getSkew(); Returns x- and y-skew of $displayItem. =item $depth = $displayItem->getDepth(); Returns Z-order of $displayItem. =item $displayItem->setMask($level); Sets a mask level: display items with lower or equal depth are masked, any other display items are not masked. Use setDepth() to control desired masking. =item $displayItem->endMask() End masking started by prior setMask() call. =item $displayItem->addAction( $action, $flags ) Add $action, an object of SWF::Action class. The flags are exported from SWF::Constants. SWFACTION_ONLOAD SWFACTION_ENTERFRAME SWFACTION_UNLOAD SWFACTION_MOUSEMOVE SWFACTION_MOUSEDOWN SWFACTION_MOUSEUP SWFACTION_KEYDOWN SWFACTION_KEYUP SWFACTION_DATA Using this flags you have control at which events the action will run. =item $displayItem->setBlendMode($mode) Set an alternative blend mode instead of default alpha blend. Possible modes are: SWFBLEND_MODE_NULL SWFBLEND_MODE_NORMAL SWFBLEND_MODE_LAYER SWFBLEND_MODE_MULT SWFBLEND_MODE_SCREEN SWFBLEND_MODE_DARKEN SWFBLEND_MODE_LIGHTEN SWFBLEND_MODE_ADD SWFBLEND_MODE_SUB SWFBLEND_MODE_DIFF SWFBLEND_MODE_INV SWFBLEND_MODE_ALPHA SWFBLEND_MODE_ERASE SWFBLEND_MODE_OVERLAY SWFBLEND_MODE_HARDLIGHT Here comes some demonstration code: use SWF::Constants qw(:DisplayItem); # .... $sh=new SWF::Shape(); $fill = $sh->addFill(255, 0, 0, 255); # red $sh->setRightFill($fill); $sh->drawLine(440, 0); $sh->drawLine(0, 380); $sh->drawLine(-440, 0); $sh->drawLine(0, -380); # $sh2=new SWF::Shape(); $fill2 = $sh2->addFill(0, 255, 0, 255); # green $sh2->setRightFill($fill2); $sh2->drawLine(240, 0); $sh2->drawLine(0, 280); $sh2->drawLine(-240, 0); $sh2->drawLine(0, -280); $di=$m->add($sh); $di2=$m->add($sh2); # $di2->setBlendMode( SWFBLEND_MODE_NORMAL); # would be green ( as you have expected ) $di2->setBlendMode( SWFBLEND_MODE_ADD); # y e l l o w ( surprising, a litle bit ) =item $displayItem->cacheAsBitmap($flag) Set a flag (value 0 or 1) showing the character can be cached as a bitmap. This might improve rendering speed, if the object does no change often. This feature is available for SWF version >= 8 only. =item $displayItem->flush() Writes the SWF::DisplayItem object immediately to the blocklist. Usually MING waits with writing a display item until a frame is closed through a nextFrame() call, because a display items state could be altered for the current frame. By using the flush() method MING does not wait and writes the frame immediately. Therefore an user can influence the swf tag order. Changing a display items state after calling flush() takes effect in the next frame. =item $matrix = $displayItem->getMatrix() Returns an associated SWF::Matrix object. =item $character = $displayItem->getCharacter() Returns the associated SWF::Character object. =item $displayItem->addFilter( $filter ) Process the DisplayItem object thru a prepared filter: an object of SWF::Filter class, e.g. BlurFilter or DropShadowFilter. Filters are available since player version 8. =item $displayItem->setCXform( $cxform ) Process the DisplayItem object thru $cxform: a prepared color transformation object of SWF::CXform class. =back =head1 AUTHOR Soheil Seyfaie (soheil AT users.sourceforge.net) Peter Liscovius Albrecht Kleine =head1 SEE ALSO SWF, SWF::Button, SWF::Movie, SWF::MovieClip, SWF::Shape, SWF::Text, SWF::TextField, SWF::Filter, SWF::CXform, SWF::Matrix, SWF::Action, SWF::Morph, SWF::Character, SWF::Constants =cut ming-0.4.5/perl_ext/SWF/Sprite.pm0000644000175000017500000000311711454264373013473 00000000000000# ==================================================================== # Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::Sprite; use SWF(); use strict; @SWF::Sprite::ISA = qw(SWF::MovieClip); $SWF::Sprite::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::Sprite - Sprite (MovieClip) Class =head1 SYNOPSIS use SWF::Sprite; my $sprite = new SWF::Sprite(); =head1 DESCRIPTION SWF::Sprite allows you to add animated objects to your Fash movies. You may use SWF::MovieClip instead of SWF::Sprite (i.e. SWF::Sprite inherits all it's methods from SWF::MovieClip). In other words: SWF::Sprite is deprecated! Do NOT use anymore. =head1 METHODS =over 4 =item new SWF::Sprite(); Returns an SWF::Sprite object. =item $displayItem = $sprite->add($s); Add $s to the $sprite object and returns an SWF::DisplayItem object, i.e. $displayItem . $s may be an SWF::Shape, SWF::Text, SWF::Button, or another sprite object. =item $sprite->remove($displayItem); Removes $displayItem from the display list. =item $sprite->nextFrame(); Move to the next frame of the animation. =item $sprite->setFrames($i); Sets total number of $sprite frames to $i =item $sprite->labelFrame($name); Sets frame name to $name =back =head1 AUTHOR Soheil Seyfaie (soheil@netcom.ca). =head1 SEE ALSO SWF, SWF::MovieClip, SWF::Button, SWF::DisplayItem, SWF::Shape, SWF::Sprite, SWF::Movie =cut ming-0.4.5/perl_ext/SWF/FontCollection.pm0000644000175000017500000000210411454264373015142 00000000000000# ==================================================================== # Copyright (c) 2008 by Klaus Rechert. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== # $Author$ # $Id$ package SWF::FontCollection; use SWF(); $SWF::FontCollection::VERSION = $SWF::VERSION; 1; __END__ =head1 NAME SWF::FontCollection - SWF font collection class =head1 SYNOPSIS use SWF::SWF::FontCollection; $fontcollection = new SWF::FontCollection("fonts.ttc"); =head1 DESCRIPTION SWF::FontCollection is an experimental helper class useful for font utilities. =head1 METHODS =over =item $fontcollection = new SWF::FontCollection($filename) Creates a SWF::FontCollection object. =item $count = $fontcollection->getFontCount() Returns font count. =item $font = $fontcollection->getFont( $index ) Returns SWF::Font object of number $index. =back =head1 AUTHOR developers of ming.sourceforge.net =head1 SEE ALSO SWF, SWF::Font =cut ming-0.4.5/perl_ext/typemap0000644000175000017500000000267611454264373012643 00000000000000byte T_U_CHAR short * T_PTRSHORT #FILE * T_IN int * T_PTRINT float T_FLOAT SWF::Shape T_PTROBJ SWF::Movie T_PTROBJ SWF::Font T_PTROBJ SWF::Text T_PTROBJ SWF::Fill T_PTROBJ SWF::FillStyle T_PTROBJ SWF::Block T_PTROBJ SWF::DisplayItem T_PTROBJ SWF::Gradient T_PTROBJ SWF::Bitmap T_PTROBJ SWF::Button T_PTROBJ SWF::Character T_PTROBJ SWF::Action T_PTROBJ #SWF::Sprite T_PTROBJ SWF::MovieClip T_PTROBJ SWF::Morph T_PTROBJ SWF::TextField T_PTROBJ SWF::Sound T_PTROBJ SWF::SoundStream T_PTROBJ SWF::SoundInstance T_PTROBJ SWF::VideoStream T_PTROBJ SWF::PrebuiltClip T_PTROBJ SWF::FontCharacter T_PTROBJ SWF::ButtonRecord T_PTROBJ SWF::BinaryData T_PTROBJ SWF::InitAction T_PTROBJ SWF::Matrix T_PTROBJ SWF::Shadow T_PTROBJ SWF::Blur T_PTROBJ SWF::FilterMatrix T_PTROBJ SWF::Filter T_PTROBJ SWF::CXform T_PTROBJ SWF::BrowserFont T_PTROBJ SWF::FontCollection T_PTROBJ INPUT T_PTRINT $var = (int *)SvIV($arg) INPUT T_PTRSHORT $var = (short *)SvPV_nolen($arg) ming-0.4.5/perl_ext/examples/0000755000175000017500000000000012154727176013127 500000000000000ming-0.4.5/perl_ext/examples/shape.cgi0000755000175000017500000000127011454264373014633 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(Movie Shape); SWF::setScale(1.0); my $s = new SWF::Shape(); $s->setLine(40, 0x7f, 0, 0); $s->setRightFill($s->addFill(0xff, 0, 0)); $s->movePenTo(200, 200); $s->drawLineTo(6200, 200); $s->drawLineTo(6200, 4600); $s->drawCurveTo(200, 4600, 200, 200); my $m = new SWF::Movie(); $m->setDimension(6400, 4800); $m->setRate(12.0); $m->add($s); $m->nextFrame(); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/text.cgi0000755000175000017500000000126511454264373014523 00000000000000#!/usr/bin/perl -w use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(Movie Font Text); SWF::setScale(1.0); # Add path to your *.fdb file my $filename = '../common/_sans.fdb'; my $f= new SWF::Font($filename); my $t= new SWF::Text(); $t->setFont($f); $t->moveTo(200, 2400); $t->setColor(0xff, 0x0, 0); $t->setHeight(1200); $t->addString("ming!"); my $m = new SWF::Movie(); $m->setDimension(5400, 3600); $m->add($t); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/alphafill.cgi0000755000175000017500000000220511454264373015466 00000000000000#!/usr/bin/perl -wT use strict; use SWF qw(:ALL); SWF::setScale(20.0); my $dir = '../common/'; print "Content-type: application/x-shockwave-flash\n\n"; my $s = new SWF::Shape(); my $alpha = new SWF::Bitmap($dir."flowers.jpg", $dir."flowers.msk"); my $f = $s->addFill($alpha); $s->setRightFill($f); $s->drawLine(640, 0); $s->drawLine(0, 480); $s->drawLine(-640, 0); $s->drawLine(0, -480); my $c = new SWF::Shape(); $c->setRightFill($c->addFill(0x99, 0x99, 0x99)); $c->drawLine(40, 0); $c->drawLine(0, 40); $c->drawLine(-40, 0); $c->drawLine(0, -40); my $m = new SWF::Movie(); $m->setDimension(640, 480); $m->setBackground(0xcc, 0xcc, 0xcc); # draw checkerboard background my ($x, $y); my $i; for($y=0; $y<480; $y+=40){ for($x=0; $x<640; $x+=80){ $i = $m->add($c); $i->moveTo($x, $y); } $y+=40; for($x=40; $x<640; $x+=80){ $i = $m->add($c); $i->moveTo($x, $y); } } $m->add($s); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/keypress.cgi0000755000175000017500000000336411454264373015406 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(Action Shape TextField Button); use SWF::Constants qw(:Text :Button); SWF::setScale(1.0); SWF::setVersion(4); # Add path to your *.fdb file my $fdb_file = '../common/_sans.fdb'; # sprite has one letter per frame */ my $p = new SWF::MovieClip; $p->add(new SWF::Action("stop();")); my $chars = "abcdefghijklmnopqrstuvwxyz". "1234567890!@#$%^&*()_+-=/[]{}|;:,.<>?`~"; my $f = new SWF::Font($fdb_file); my $n; my $i = undef; for($n=0; $nremove($i) if(defined($i)); my $t = new SWF::TextField(SWFTEXTFIELD_DRAWBOX); $t->setFont($f); $t->setHeight(240); $t->setBounds(600,240); $t->align(SWFTEXTFIELD_ALIGN_CENTER); $t->addString($c); $i = $p->add($t); $p->labelFrame($c); $p->nextFrame(); } # hit region for button - the entire frame my $s = new SWF::Shape(); $s->setRightFill($s->addFill(0, 0, 0)); $s->drawLine(600, 0); $s->drawLine(0, 400); $s->drawLine(-600, 0); $s->drawLine(0, -400); # button checks for pressed key, sends sprite to the right frame */ $b = new SWF::Button(); $b->addShape($s, SWFBUTTON_HIT); for($n=0; $naddAction(new SWF::Action(" setTarget('/char'); gotoFrame('$c'); "), SWFBUTTON_KEYPRESS($c)); } my $m = new SWF::Movie(); $m->setDimension(600,400); $i = $m->add($p); $i->setName('char'); $i->moveTo(0,80); $m->add($b); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/sound.cgi0000755000175000017500000000234411454264373014666 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(:ALL); use SWF::Constants qw(SWF_SOUND_22KHZ SWF_SOUND_11KHZ SWF_SOUND_16BITS SWF_SOUND_8BITS SWF_SOUND_MONO); my $soundfile="../common/beep.wav"; # some misuse of one wavfiles ;-) my $sound = new SWF::Sound($soundfile, SWF_SOUND_22KHZ|SWF_SOUND_8BITS|SWF_SOUND_MONO); my $sound2 = new SWF::Sound($soundfile, SWF_SOUND_11KHZ|SWF_SOUND_8BITS|SWF_SOUND_MONO); my $m = new SWF::Movie(); $m->setDimension(200, 100); $m->setBackground(0xff, 0xff, 0x0); $m->setRate(12.0); # now let's do some funny noisepattern... my $soundinstance=$m->startSound($sound); $soundinstance->loopCount(20); $soundinstance->loopOutPoint(20000); $soundinstance->noMultiple(); $m->nextFrame(); for(0..5){ $m->nextFrame(); } my $soundinstance2=$m->startSound($sound2); $soundinstance2->loopCount(20); $soundinstance2->loopInPoint(0); $soundinstance2->loopOutPoint(4000); $soundinstance2->noMultiple(); for(0..5){ $m->nextFrame(); } # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/sprite.cgi0000755000175000017500000000154011454264373015041 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(Movie Shape); SWF::setScale(1.0); my $s = new SWF::Shape; $s->setRightFill($s->addFill(0xff, 0, 0)); $s->movePenTo(-500,-500); $s->drawLineTo(500,-500); $s->drawLineTo(500,500); $s->drawLineTo(-500,500); $s->drawLineTo(-500,-500); my $p = new SWF::MovieClip; my $i = $p->add($s); for(my $j=0; $j<17; ++$j) { $p->nextFrame(); $i->rotate(5); } $p->nextFrame(); my $m = new SWF::Movie; $i = $m->add($p); $i->moveTo(1500,1000); $i->setName("blah"); $m->setBackground(0xff, 0xff, 0x0); $m->setDimension(3000,2000); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/morph.cgi0000755000175000017500000000202511454264373014657 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(Movie Shape Morph); SWF::setScale(20); my $p = new SWF::Morph(); my $s = $p->getShape1(); $s->setLine(18,0,0xFF,0); $s->setLeftFill(0xff, 0, 0); $s->drawLine(100,0); $s->drawLine(0,100); $s->drawLine(-100,0); $s->drawLineTo(0,0); my $s1 = $p->getShape2(); $s1->setLine(10,0,0,0); $s1->setLeftFill(0, 0, 0x99); $s1->drawLine(100,50); $s1->drawLine(0,50); $s1->drawLine(-150,0); $s1->drawLineTo(0,0); my $m = new SWF::Movie(); $m->setDimension(300,200); $m->setBackground(0xff, 0xff, 0x0); my $i = $m->add($p); $i->moveTo(100,50); for(my $r=0; $r<=10; ++$r){ $i->setRatio($r/10); $m->nextFrame(); } for(my $r=0; $r<=10; ++$r){ $i->setRatio(1-$r/10); $m->nextFrame(); } $m->nextFrame(); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/action.cgi0000755000175000017500000000213411454264373015010 00000000000000#!/usr/bin/perl -wT use strict; use SWF qw(:ALL); SWF::setScale(1.0); SWF::setVersion(4); print "Content-type: application/x-shockwave-flash\n\n"; my $s = new SWF::Shape(); my $f = $s->addFill(0xff, 0, 0); $s->setRightFill($f); $s->movePenTo(-500,-500); $s->drawLineTo(500,-500); $s->drawLineTo(500,500); $s->drawLineTo(-500,500); $s->drawLineTo(-500,-500); my $p = new SWF::MovieClip(); my $i = $p->add($s); $i->setDepth(1); $p->nextFrame(); for(my $n=0; $n<5; ++$n){ $i->rotate(-15); $p->nextFrame(); } my $m = new SWF::Movie(); $m->setBackground(0xff, 0xff, 0xff); $m->setDimension(6000,4000); $i = $m->add($p); $i->setDepth(1); $i->moveTo(-500,2000); $i->setName("box"); $m->add(new SWF::Action("x=-100;")); $m->nextFrame(); $m->add(new SWF::Action("x+=3; /box._x=x;")); $m->nextFrame(); $m->add(new SWF::Action("gotoFrame(1); play();")); $m->nextFrame(); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/animation.cgi0000755000175000017500000000430411454264373015513 00000000000000#!/usr/bin/perl -w use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); use SWF qw(:ALL); $|=1; SWF::setScale(1); # where are the fontfiles? my $dir = '../common/'; my $font= '_sans.fdb'; my $string = "ming!"; my $loc = {}; my $i1 = { r => 0xff, g => 0x33, b => 0x33, a => 0xff, rot => 900, x => 1200, y => 800, scale => 0.03, string => $string, }; my $i2 = { r => 0x00, g => 0x33, b => 0xff, a => 0x7f, rot => -560, x => 1200, y => 800, scale => 0.04, string => $string, }; my $i3 = { r => 0xff, g => 0xff, b => 0xff, a => 0x9f, rot => 180, x => 1200, y => 800, scale => 0.001, string => $string, }; my $f = new SWF::Font($dir.$font); my $m = new SWF::Movie(); $m->setRate(24.0); $m->setDimension(2400, 1600); $m->setBackground(0xff, 0xff, 0x0); sub text{ my $j = shift; my $t = new SWF::Text(); $t->setFont($f); $t->setColor($j->{r}, $j->{g}, $j->{b}, $j->{a}); $t->setHeight(960); $t->moveTo(-($t->getWidth($string))/2, 220); $t->addString($string); my $i = $m->add($t); $j->{x} = $j->{x}; $j->{y} = $j->{y}; $j->{rot} = $j->{rot}; $j->{s} = $j->{scale}; $i->rotateTo($j->{rot}); $i->scale($j->{scale}, $j->{scale}); $j->{item} = $i; return $j; } sub step{ my $j = shift; my $oldrot = $j->{rot}; $j->{rot} = 19*($j->{rot})/20; $j->{x} = (19*$j->{x} + 1200)/20; $j->{y} = (19*$j->{y} + 800)/20; $j->{s} = (19*$j->{s} + 1.0)/20; my $i = $j->{item}; $i->rotateTo($j->{rot}); $i->scaleTo($j->{s}, $j->{s}); $i->moveTo($j->{x}, $j->{y}); return $j; } $i1 = text($i1); $i2 = text($i2); $i3 = text($i3); for(my $i=1; $i<=100; ++$i){ $i1 = step($i1); $i2 = step($i2); $i3 = step($i3); $m->nextFrame(); } # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/video.cgi0000755000175000017500000000112611454264373014641 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(:ALL); my $file = '../common/test.flv'; my $stream=new SWF::VideoStream($file); $stream->setDimension(200,200); my $m=new SWF::Movie(); $m->setDimension(400, 300); $m->setRate(12.0); $m->add($stream); for(1..$stream->getNumFrames()) { $m->nextFrame(); } # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/textfield.cgi0000755000175000017500000000145011454264373015523 00000000000000#!/usr/bin/perl -w use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(Movie Font TextField); use SWF::Constants qw(SWFTEXTFIELD_DRAWBOX); # Add path to your *.fdb file my $filename = '../common/_sans.fdb'; my $f= new SWF::Font($filename); my $tf= new SWF::TextField(SWFTEXTFIELD_DRAWBOX); $tf->setFont($f); $tf->setColor(0xff, 0x0, 0); $tf->setHeight(20); $tf->addString("ming!"); my $m = new SWF::Movie(); $m->setDimension(300, 200); $m->setBackground(0xff, 0xff, 0x0); my $tfi=$m->add($tf); $tfi->moveTo(100,100); $m->nextFrame; # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/glyph.cgi0000755000175000017500000000241311454264373014656 00000000000000#!/usr/bin/perl use strict; #use lib("/home/peter/ming3/lib/perl5/site_perl"); $|=1; use SWF qw(:ALL); SWF::setScale(1.0); # Add path to your *.fdb file my $filename = '../common/_sans.fdb'; my $s = new SWF::Shape(); my $f = new SWF::Font($filename); $s->setRightFill(0xff, 0, 0); $s->setLine(40, 0x7f, 0, 0); $s->drawGlyph($f, unpack('C','!')); $s->movePen($f->getWidth('!'), 0); $s->setRightFill(0xff, 0x7f, 0); $s->setLine(40, 0x7f, 0x3f, 0); $s->drawGlyph($f, unpack('C','#')); $s->movePen($f->getWidth('#'), 0); $s->setRightFill(0xff, 0xff, 0); $s->setLine(40, 0x7f, 0x7f, 0); $s->drawGlyph($f, unpack('C','%')); $s->movePen($f->getWidth('%'), 0); $s->setRightFill(0, 0xff, 0); $s->setLine(40, 0, 0x7f, 0); $s->drawGlyph($f, unpack('C','*')); $s->movePen($f->getWidth('*'), 0); $s->setRightFill(0, 0, 0xff); $s->setLine(40, 0, 0, 0x7f); $s->drawGlyph($f, unpack('C','@')); my $m = new SWF::Movie(); $m->setDimension(3000,2000); $m->setRate(12.0); my $i = $m->add($s); $i->moveTo(1500-$f->getWidth("!#%*@")/2, 1000+$f->getAscent()/2); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/examples/jpegfill.cgi0000755000175000017500000000121111454264373015322 00000000000000#!/usr/bin/perl use strict; use SWF qw(:ALL); SWF::setScale(20.0); print "Content-type: application/x-shockwave-flash\n\n"; my $s = new SWF::Shape(); my $b = new SWF::Bitmap('../common/flowers.jpg'); my $f = $s->addFill($b); $s->setRightFill($f); $s->drawLine(640, 0); $s->drawLine(0, 480); $s->drawLine(-640, 0); $s->drawLine(0, -480); my $m = new SWF::Movie(); $m->setDimension(640, 480); $m->add($s); # decide if its called from commandline or as cgiscript if (exists $ENV{"REQUEST_URI"}){ print "Content-type: application/x-shockwave-flash\n\n"; $m->output(); } else { $m->save("$0.swf"); print "Generated file written to $0.swf\n"; } ming-0.4.5/perl_ext/Shadow.xs0000644000175000017500000000170611454264373013033 00000000000000/* ==================================================================== * Copyright (c) 2008 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Shadow PACKAGE = SWF::Shadow PREFIX = SWFShadow_ PROTOTYPES: ENABLE SWF::Shadow SWFShadow_new(package="SWF::Shadow", angle, distance, strength) char *package float angle float distance float strength CODE: RETVAL = newSWFShadow(angle, distance, strength); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void SWFShadow_DESTROY(shadow) SWF::Shadow shadow CODE: destroySWFShadow(shadow); S_DEBUG(2, fprintf(stderr, "Shadow DESTROY CALLED\n")); ming-0.4.5/perl_ext/SWF.xs0000644000175000017500000000205711454264373012245 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" static void callXS (void (*subaddr)(CV* cv), CV *cv, SV **mark) { int items; dSP; PUSHMARK (mark); (*subaddr)(cv); PUTBACK; } MODULE = SWF PACKAGE = SWF PREFIX = Ming_ PROTOTYPES: ENABLE INCLUDE: Boot.xsh void fileOutputMethod(b, data) byte b void * data void Ming_setScale(scale) float scale float Ming_getScale() void Ming_setCubicThreshold(num) int num void Ming_useSWFVersion(version) int version ALIAS: SWF::setVersion = 1 int Ming_setSWFCompression(level); int level void Ming_useConstants(flag) int flag CODE: Ming_useConstants(flag); ming-0.4.5/perl_ext/VideoStream.xs0000644000175000017500000000227011454264373014025 00000000000000#include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::VideoStream PACKAGE = SWF::VideoStream PREFIX = SWFVideoStream_ PROTOTYPES: ENABLE SWF::VideoStream SWFVideoStream_new(package="SWF::VideoStream", filename=NULL) char *package char *filename PREINIT: FILE *f; CODE: if(filename && (f = fopen(filename, "rb"))) RETVAL = newSWFVideoStream_fromFile(f); else RETVAL = newSWFVideoStream(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void destroySWFVideoStream(stream) SWF::VideoStream stream ALIAS: SWF::VideoStream::DESTROY = 1 CODE: swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFVideoStream(stream); int SWFVideoStream_getNumFrames(stream) SWF::VideoStream stream void SWFVideoStream_setDimension(stream, width, height) SWF::VideoStream stream int width int height int SWFVideoStream_hasAudio(stream) SWF::VideoStream stream int SWFVideoStream_setFrameMode(stream, mode) SWF::VideoStream stream int mode int SWFVideoStream_nextFrame(stream) SWF::VideoStream stream int SWFVideoStream_seek(stream, frame, whence) SWF::VideoStream stream int frame int whence ming-0.4.5/perl_ext/Gradient.xs0000644000175000017500000000253011454264373013337 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Gradient PACKAGE = SWF::Gradient PREFIX = SWFGradient_ PROTOTYPES: ENABLE SWF::Gradient SWFGradient_new(package="SWF::Gradient") char *package CODE: RETVAL = newSWFGradient(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); void SWFGradient_addEntry(gradient, ratio, r, g, b, a=0xff) SWF::Gradient gradient float ratio byte r byte g byte b byte a void SWFGradient_setSpreadMode(gradient, mode) SWF::Gradient gradient int mode void SWFGradient_setInterpolationMode(gradient, mode) SWF::Gradient gradient int mode void SWFGradient_setFocalPoint(gradient, focalPoint) SWF::Gradient gradient float focalPoint void destroySWFGradient(gradient) SWF::Gradient gradient ALIAS: SWF::Gradient::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Gradient DESTROY CALLED\n")); destroySWFGradient(gradient); ming-0.4.5/perl_ext/PrebuiltClip.xs0000644000175000017500000000231711454264373014203 00000000000000/* * Copyright: * I hereby assign copyright of the code listed in the remainder of this post to * the libMing project. I remove my rights to ownership and indemnify myself from * any consquences caused by the use/misuse of the following code. Use at your own * risk. * James Austin . */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::PrebuiltClip PACKAGE = SWF::PrebuiltClip PREFIX = SWFPrebuiltClip_ PROTOTYPES: ENABLE SWF::PrebuiltClip SWFPrebuiltClip_new(package="SWF::PrebuiltClip", filename) char *package char *filename PREINIT: FILE *f; SWFInput input; CODE: if (items < 2) fprintf(stderr, "SWF::PrebuiltClip requires a filename\n\n"); if (!(f = fopen(filename, "rb"))) { fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; } else { input = newSWFInput_file(f); RETVAL = newSWFPrebuiltClip_fromInput(input); destroySWFInput(input); fclose(f); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } void destroySWFPrebuiltClip(clip) SWF::PrebuiltClip clip ALIAS: SWF::PrebuiltClip::DESTROY = 1 CODE: destroySWFPrebuiltClip(clip); ming-0.4.5/perl_ext/perl_swf.h0000644000175000017500000000427312154643261013221 00000000000000/* ==================================================================== * Copyright (c) 2000 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== */ #ifndef PERL_SWF_H_INCLUDED #define PERL_SWF_H_INCLUDED typedef SWFMovieClip SWF__MovieClip; typedef SWFMovie SWF__Movie; typedef SWFShape SWF__Shape; typedef SWFBlock SWF__Block; typedef SWFFont SWF__Font; typedef SWFFill SWF__Fill; typedef SWFText SWF__Text; typedef SWFDisplayItem SWF__DisplayItem; typedef SWFFillStyle SWF__FillStyle; typedef SWFGradient SWF__Gradient; typedef SWFBitmap SWF__Bitmap; typedef SWFButton SWF__Button; typedef SWFCharacter SWF__Character; typedef SWFAction SWF__Action; typedef SWFMorph SWF__Morph; typedef SWFTextField SWF__TextField; typedef SWFSound SWF__Sound; typedef SWFSoundInstance SWF__SoundInstance; typedef SWFSoundStream SWF__SoundStream; typedef SWFVideoStream SWF__VideoStream; typedef SWFPrebuiltClip SWF__PrebuiltClip; typedef SWFFontCharacter SWF__FontCharacter; typedef SWFButtonRecord SWF__ButtonRecord; typedef SWFBinaryData SWF__BinaryData; typedef SWFInitAction SWF__InitAction; typedef SWFMatrix SWF__Matrix; typedef SWFBlur SWF__Blur; typedef SWFShadow SWF__Shadow; typedef SWFFilterMatrix SWF__FilterMatrix; typedef SWFFilter SWF__Filter; typedef SWFCXform SWF__CXform; typedef SWFBrowserFont SWF__BrowserFont; typedef SWFFontCollection SWF__FontCollection; #ifndef sv_undef #define sv_undef PL_sv_undef #endif #ifndef na #define na PL_na #endif #ifndef pTHX_ #define aTHXo_ #endif #ifndef GvCV_set # define GvCV_set(G, C) (GvCV(G) = (C)) #endif #ifndef S_DEBUG #define swf_debug 0 /* Should we get this from, say, $SWF::debug? */ #define S_DEBUG(level,code) if (swf_debug >= level) { code; } #endif void swf_stash_refcnt_inc(SV *sv_key, SV *sv_value); void swf_stash_refcnt_dec(SV *sv_key); #endif /* PERL_SWF_H_INCLUDED */ ming-0.4.5/perl_ext/t/0000755000175000017500000000000012154727176011554 500000000000000ming-0.4.5/perl_ext/t/03_movie.t0000644000175000017500000000025011454264373013274 00000000000000BEGIN { $| = 1; print "1..2\n"; } use SWF qw(Movie); require 't/config.pl'; my $m; eval { $m = new SWF::Movie(); }; ok($@); $m->setDimension(640, 480); ok(); ming-0.4.5/perl_ext/t/sound.t0000644000175000017500000000072711454264373013014 00000000000000BEGIN { $| = 1;} use SWF qw(:ALL); #use SWF; require 't/config.pl'; my $filename = ming_dir() . '/examples/common/distortobass.mp3'; skip_test() unless (-e $filename); print "1..3\n"; my $movie = new SWF::Movie(); $movie->setRate(12.0); my $sound = new SWF::Sound($filename); ok(); eval{ $movie->setSoundStream($sound); }; ok($@); my $movie2 = new SWF::Movie(); $movie2->setRate(12.0); $movie2->streamMp3(ming_dir() . '/examples/common/distortobass.mp3'); ok(); ming-0.4.5/perl_ext/t/drag.t0000644000175000017500000000144411454264373012576 00000000000000BEGIN {$| = 1; print "1..4\n"; } use strict; use SWF qw(Button Shape Movie); use SWF::Constants ':Button'; require 't/config.pl'; #$Test::Harness::switches = ''; SWF::setVersion(4); my $s = new SWF::Shape(); $s->setRightFill(0xff, 0, 0); $s->drawLine(1000,0); $s->drawLine(0,1000); $s->drawLine(-1000,0); $s->drawLine(0,-1000); my $b; eval{ $b = new SWF::Button(); }; ok($@); $b->addShape($s, SWFBUTTON_HIT | SWFBUTTON_UP | SWFBUTTON_DOWN | SWFBUTTON_OVER); $b->addAction(new SWF::Action("startDrag('/test', 0);"), SWFBUTTON_MOUSEDOWN); $b->addAction(new SWF::Action("stopDrag();"), SWFBUTTON_MOUSEUP); ok(); my $p; eval{ $p = new SWF::MovieClip(); }; ok(); $p->add($b); $p->nextFrame(); my $m = new SWF::Movie(); my $i = $m->add($p); $i->setName('test'); $i->moveTo(1000,1000); ok(); ming-0.4.5/perl_ext/t/gradient.t0000644000175000017500000000114111454264373013450 00000000000000BEGIN { $| = 1; print "1..4\n"; } use SWF qw(Shape Movie Gradient); require 't/config.pl'; my $m = new SWF::Movie(); $m->setDimension(320, 240); my $s = new SWF::Shape(); # first gradient- black to white my $g; eval{ $g = new SWF::Gradient(); }; ok($@); $g->addEntry(0.0, 0, 0, 0); $g->addEntry(1.0, 0xff, 0xff, 0xff); my $f; eval{ $f = $s->addFill($g); }; ok($@); $f->scaleTo(0.01); $f->moveTo(160, 120); $s->setRightFill($f); $s->drawLine(320, 0); $s->drawLine(0, 240); $s->drawLine(-320, 0); $s->drawLine(0, -240); $m->add($s); ok(); eval{ $m->save('t/gradient.swf'); }; ok($@); ming-0.4.5/perl_ext/t/button.t0000644000175000017500000000047011454264373013172 00000000000000BEGIN {$| = 1; print "1..2\n"; } use SWF qw(Button Action); use SWF::Constants ':Button'; require 't/config.pl'; my $b; eval{ $b = new SWF::Button(); }; print "$@\n"; ok($@); eval{ $b->addAction(new SWF::Action("setTarget('/label'); gotoFrame(1);"), SWFBUTTON_MOUSEUP); }; print "$@\n"; ok($@); ming-0.4.5/perl_ext/t/movieclip.t0000644000175000017500000000032511454264373013645 00000000000000BEGIN {$| = 1; print "1..3\n"; } use SWF qw(MovieClip); require 't/config.pl'; my $p; eval{ $p = new SWF::MovieClip(); }; print "$@\n"; ok($@); $p->setFrames(5); ok(); $p->labelFrame('soheil'); ok(); ming-0.4.5/perl_ext/t/png.t0000644000175000017500000000103211454264373012436 00000000000000BEGIN { $| = 1; } use SWF qw(Shape Bitmap); require 't/config.pl'; my $filename = ming_dir() . "/examples/common/png.dbl"; skip_test() unless (-e $filename); print "1..1\n"; eval{ my $s = new SWF::Shape(); my $b = new SWF::Bitmap($filename); my $f = $s->addFill($b); $s->setRightFill($f); $s->drawLine(32, 0); $s->drawLine(0, 32); $s->drawLine(-32, 0); $s->drawLine(0, -32); my $m = new SWF::Movie(); $m->setDimension(32, 32); $m->add($s); $m->save('t/png.swf'); }; ok($@); ming-0.4.5/perl_ext/t/00_basic.t0000644000175000017500000000016111454264373013234 00000000000000BEGIN { $| = 1; print "1..1\n";} END{ ok(!$loaded); } require 't/config.pl'; $loaded = 0; use SWF; $loaded = 1; ming-0.4.5/perl_ext/t/fill.t0000644000175000017500000000012411454264373012601 00000000000000BEGIN { $| = 1; print "1..1\n"; } use SWF qw(Fill); require 't/config.pl'; ok(); ming-0.4.5/perl_ext/t/filljpeg.t0000644000175000017500000000074611454264373013461 00000000000000BEGIN { $| = 1;} use SWF qw(Shape Bitmap); require 't/config.pl'; my $s = new SWF::Shape(); my $filename = ming_dir() . '/examples/common/backyard.jpg'; skip_test() unless (-e $filename); print "1..2\n"; eval{ my $b = new SWF::Bitmap($filename); my $f = $s->addFill($b); $s->setRightFill($f); }; ok($@); $s->drawLine(640, 0); $s->drawLine(0, 480); $s->drawLine(-640, 0); $s->drawLine(0, -480); $m = new SWF::Movie(); $m->setDimension(640, 480); $m->add($s); ok(); ming-0.4.5/perl_ext/t/01_shape.t0000644000175000017500000000050411454264373013255 00000000000000BEGIN { $| = 1; print "1..3\n"; } use SWF qw(Shape); require 't/config.pl'; my $s; eval { $s = new SWF::Shape(); }; ok($@); $s->setLine(20, 0xff, 0, 0, 0); $s->drawLine(400,0); $s->drawLine(0,400); $s->drawLine(-400,0); #$s->drawLine(0,-400); ok(); $s->setLeftFill($s->addFill(0xff, 0, 0)); ok(); #ok($y!=400); ming-0.4.5/perl_ext/DisplayItem.xs0000644000175000017500000001135111454264373014027 00000000000000/* ==================================================================== * Copyright (c) 2000-2002 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::DisplayItem PACKAGE = SWF::DisplayItem PREFIX = SWFDisplayItem_ PROTOTYPES: ENABLE void SWFDisplayItem_setMaskLevel(item, masklevel) SWF::DisplayItem item int masklevel void SWFDisplayItem_endMask(item) SWF::DisplayItem item void SWFDisplayItem_addAction(item, action, flags) SWF::DisplayItem item SWF::Action action int flags void SWFDisplayItem_moveTo(item, x, y) SWF::DisplayItem item double x double y void SWFDisplayItem_move(item, x, y) SWF::DisplayItem item double x double y void SWFDisplayItem_scaleTo(item, x, ...) SWF::DisplayItem item double x double y = NO_INIT CODE: y = (items > 2) ? (float)SvNV(ST(2)) : x; SWFDisplayItem_scaleTo(item, x, y); void SWFDisplayItem_scale(item, x, ...) SWF::DisplayItem item double x double y = NO_INIT CODE: y = (items > 2) ? (float)SvNV(ST(2)) : x; SWFDisplayItem_scale(item, x, y); void SWFDisplayItem_rotate(item, degrees) SWF::DisplayItem item double degrees void SWFDisplayItem_rotateTo(item, degrees) SWF::DisplayItem item double degrees void SWFDisplayItem_skewX(item, x) SWF::DisplayItem item double x void SWFDisplayItem_skewXTo(item, x) SWF::DisplayItem item double x void SWFDisplayItem_skewY(item, y) SWF::DisplayItem item double y void SWFDisplayItem_skewYTo(item, y) SWF::DisplayItem item double y void SWFDisplayItem_setDepth(item, depth) SWF::DisplayItem item int depth void SWFDisplayItem_setRatio(item, ratio) SWF::DisplayItem item float ratio void SWFDisplayItem_setBlendMode(item, mode) SWF::DisplayItem item int mode void SWFDisplayItem_cacheAsBitmap(item, flag) SWF::DisplayItem item int flag void SWFDisplayItem_setColorAdd(item, r, g, b, a=0) SWF::DisplayItem item int r int g int b int a ALIAS: SWF::DisplayItem::addColor = 1 void SWFDisplayItem_setColorMult(item, r, g, b, a=1.0) SWF::DisplayItem item float r float g float b float a ALIAS: SWF::DisplayItem::multColor = 1 void SWFDisplayItem_setName(item, name) SWF::DisplayItem item char *name void SWFDisplayItem_remove(item) SWF::DisplayItem item void SWFDisplayItem_getPosition(item) SWF::DisplayItem item PREINIT: double x; double y; PPCODE: SWFDisplayItem_getPosition(item, &x, &y); EXTEND(SP, 2); PUSHs(sv_2mortal(newSVnv(x))); PUSHs(sv_2mortal(newSVnv(y))); void SWFDisplayItem_getScale(item) SWF::DisplayItem item PREINIT: double xScale; double yScale; PPCODE: SWFDisplayItem_getScale(item, &xScale, &yScale); EXTEND(SP, 2); PUSHs(sv_2mortal(newSVnv(xScale))); PUSHs(sv_2mortal(newSVnv(yScale))); void SWFDisplayItem_getSkew(item) SWF::DisplayItem item PREINIT: double xSkew; double ySkew; PPCODE: SWFDisplayItem_getSkew(item, &xSkew, &ySkew); EXTEND(SP, 2); PUSHs(sv_2mortal(newSVnv(xSkew))); PUSHs(sv_2mortal(newSVnv(ySkew))); void SWFDisplayItem_getRotation(item) SWF::DisplayItem item PREINIT: double degrees; CODE: SWFDisplayItem_getRotation(item, °rees); ST(0) = sv_newmortal(); sv_setnv(ST(0), degrees); int SWFDisplayItem_getDepth(item) SWF::DisplayItem item void SWFDisplayItem_flush(item) SWF::DisplayItem item void SWFDisplayItem_setMatrix(item, a, b, c, d, x, y) SWF::DisplayItem item double a double b double c double d double x double y SWF::Matrix SWFDisplayItem_getMatrix(item) SWF::DisplayItem item CODE: RETVAL = SWFDisplayItem_getMatrix(item); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Matrix", (void*)RETVAL); SWF::Character SWFDisplayItem_getCharacter(item) SWF::DisplayItem item CODE: RETVAL = SWFDisplayItem_getCharacter(item); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Character", (void*)RETVAL); void SWFDisplayItem_addFilter(item, filter) SWF::DisplayItem item SWF::Filter filter void SWFDisplayItem_setCXform(item, cx) SWF::DisplayItem item SWF::CXform cx void SWFDisplayItem_DESTROY(item) SWF::DisplayItem item CODE: S_DEBUG(2, fprintf(stderr, "DisplayItem DESTROY CALLED\n")); ming-0.4.5/perl_ext/Constants.xs0000644000175000017500000001262311454264373013562 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" #include "Exports.c" MODULE = SWF::Constants PACKAGE = SWF::Constants PROTOTYPES: ENABLE int SWFBUTTON_KEYPRESS(c) char c int SWFBUTTON_ONKEYPRESS(c) char c void import(pclass, ...) SV *pclass PREINIT: I32 i = 0; SV *caller = perl_eval_pv("scalar caller", TRUE); CODE: for(i=1; i For bug-reports and patches, announcements and development discussion send mail to I =back =head1 REPORTING BUG For bug-reports there is a bugtracker on sourceforge: I =over 3 =item Please make sure to include the following: - Perl version (output of C or C) - Your perl-ming version (Output of C) =back ming-0.4.5/perl_ext/Matrix.xs0000644000175000017500000000201011454264373013037 00000000000000/* ==================================================================== * Copyright (c) 2008 by Klaus Rechert. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Matrix PACKAGE = SWF::Matrix PREFIX = SWFMatrix_ PROTOTYPES: ENABLE void SWFMatrix_DESTROY(m) SWF::Matrix m CODE: S_DEBUG(2, fprintf(stderr, "Matrix DESTROY CALLED\n")); /* currently no destroy(m) call here, see destroySWFPlaceObject2Block() in placeobject.c */ double SWFMatrix_getScaleX(m) SWF::Matrix m double SWFMatrix_getScaleY(m) SWF::Matrix m double SWFMatrix_getRotate0(m) SWF::Matrix m double SWFMatrix_getRotate1(m) SWF::Matrix m int SWFMatrix_getTranslateX(m) SWF::Matrix m int SWFMatrix_getTranslateY(m) SWF::Matrix m ming-0.4.5/perl_ext/Sound.xs0000644000175000017500000000310111454264373012665 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Sound PACKAGE = SWF::Sound PREFIX = SWFSound_ PROTOTYPES: ENABLE SWF::Sound SWFSound_new(package="SWF::Sound", arg, flags=0) char *package int flags PREINIT: FILE *f; char *filename; SWFSoundStream stream; CODE: if (items < 1) fprintf(stderr, "SWF::Sound called with one argument\n\n"); if(flags == 0 && sv_derived_from(ST(1), "SWF::SoundStream")) { stream = (SWF__SoundStream) SvIV((SV*)SvRV(ST(1))); RETVAL = newSWFSound_fromSoundStream(stream); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } else { filename = (char *)SvPVX(ST(1)); if (!(f = fopen(filename, "rb"))) { fprintf(stderr, "Unable to open %s\n", filename); ST(0) = &sv_undef; } else { RETVAL = newSWFSound(f, flags); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); } } void SWFSound_setInitialMp3Delay(sound, delay) SWF::Sound sound int delay void destroySWFSound(sound) SWF::Sound sound ALIAS: SWF::Sound::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Sound DESTROY CALLED\n")); destroySWFSound(sound); ming-0.4.5/perl_ext/Movie.xs0000644000175000017500000001302112154635363012655 00000000000000/* ==================================================================== * Copyright (c) 2000-2001 by Soheil Seyfaie. All rights reserved. * This program is free software; you can redistribute it and/or modify * it under the same terms as Perl itself. * ==================================================================== * * $Author$ * $Id$ */ #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "SWF.h" #include "perl_swf.h" MODULE = SWF::Movie PACKAGE = SWF::Movie PREFIX = SWFMovie_ PROTOTYPES: ENABLE void destroySWFMovie(movie) SWF::Movie movie ALIAS: SWF::Movie::DESTROY = 1 CODE: S_DEBUG(2, fprintf(stderr, "Movie DESTROY CALLED\n")); swf_stash_refcnt_dec((SV*)SvRV(ST(0))); destroySWFMovie(movie); SWF::Movie SWFMovie_new(package="SWF::Movie") char *package CODE: RETVAL = newSWFMovie(); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), package, (void*)RETVAL); SWF::Movie newSWFMovieWithVersion(version) int version void SWFMovie_setRate(movie, rate) SWF::Movie movie float rate float SWFMovie_getRate(movie) SWF::Movie movie void SWFMovie_setDimension(movie, x, y) SWF::Movie movie int x int y void SWFMovie_setNumberOfFrames(movie, frames) SWF::Movie movie int frames ALIAS: SWF::Movie::setFrames = 1 void SWFMovie_setBackground(movie, r, g, b) SWF::Movie movie int r int g int b void SWFMovie_protect(movie, password=0) SWF::Movie movie char *password void SWFMovie_nextFrame(movie) SWF::Movie movie void SWFMovie_labelFrame(movie, label) SWF::Movie movie char * label void SWFMovie_namedAnchor(movie, label) SWF::Movie movie char * label int SWFMovie_xs_output(movie, compresslevel=-1) SWF::Movie movie int compresslevel CODE: if(compresslevel >= -1) Ming_setSWFCompression(compresslevel); RETVAL = SWFMovie_output(movie, fileOutputMethod, stdout); OUTPUT: RETVAL int SWFMovie_save(movie, filename, compresslevel=-1) SWF::Movie movie char * filename int compresslevel PREINIT: FILE *f; CODE: if (!(f = fopen(filename, "wb"))) { fprintf(stderr, "Unable to open %s\n", filename); RETVAL=0; /* to avoid a warning ("...may be used uninitialized..") */ ST(0) = &sv_undef; }else{ if(compresslevel >= -1) Ming_setSWFCompression(compresslevel); RETVAL = SWFMovie_output(movie, fileOutputMethod, f); fclose(f); } OUTPUT: RETVAL void SWFMovie_addExport(movie, block, name) SWF::Movie movie SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(1))); char *name CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); if ( block ) SWFMovie_addExport(movie, block, name); void SWFMovie_writeExports(movie) SWF::Movie movie SWF::DisplayItem SWFMovie_add(movie, block) SWF::Movie movie SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(1))); CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovie_add(movie, block); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::DisplayItem", (void*)RETVAL); void SWFMovie_remove(movie, item) SWF::Movie movie SWF::DisplayItem item void SWFMovie_setSoundStream(movie, sound, skip=0.0) SWF::Movie movie SWF::SoundStream sound float skip CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); SWFMovie_setSoundStreamAt(movie, sound, skip); SWF::SoundInstance SWFMovie_startSound(movie, sound) SWF::Movie movie SWF::Sound sound CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovie_startSound(movie, sound); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::SoundInstance", (void*)RETVAL); void SWFMovie_stopSound(movie, sound) SWF::Movie movie SWF::Sound sound CODE: SWFMovie_stopSound(movie, sound); void SWFMovie_setNetworkAccess(movie, flag) SWF::Movie movie int flag void SWFMovie_addMetadata(movie, xml) SWF::Movie movie char *xml void SWFMovie_setScriptLimits(movie, maxRecursion, timeout) SWF::Movie movie int maxRecursion int timeout void SWFMovie_setTabIndex(movie, depth, index) SWF::Movie movie int depth int index SWF::FontCharacter SWFMovie_addFont(movie, font) SWF::Movie movie SWF::Font font = (SWF__Font) SvIV((SV*)SvRV(ST(1))); CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(1))); RETVAL = SWFMovie_addFont(movie, font); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::FontCharacter", (void*)RETVAL); SWF::FontCharacter SWFMovie_importFont(movie, file, name) SWF::Movie movie const char *file const char *name CODE: RETVAL = SWFMovie_importFont(movie, file, name); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::FontCharacter", (void*)RETVAL); SWF::Character SWFMovie_importCharacter(movie, url, name) SWF::Movie movie const char *url const char *name CODE: RETVAL = SWFMovie_importCharacter(movie, url, name); ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "SWF::Character", (void*)RETVAL); void SWFMovie_assignSymbol(movie, character, name) SWF::Movie movie SWF::Character character = NO_INIT const char *name CODE: character = (SWF__Character) SvIV((SV*)SvRV(ST(1))); SWFMovie_assignSymbol(movie, character, name); void SWFMovie_defineScene(movie, offset, name) SWF::Movie movie unsigned int offset const char *name int SWFMovie_replace(movie, item, block) SWF::Movie movie SWF::DisplayItem item SWF::Block block = (SWF__Block) SvIV((SV*)SvRV(ST(2))); PREINIT: SWFMovieBlockType ublock; CODE: swf_stash_refcnt_inc((SV*)SvRV(ST(0)), (SV*)SvRV(ST(2))); ublock.block = block; RETVAL = SWFMovie_replace_internal(movie, item, ublock); OUTPUT: RETVAL ming-0.4.5/util/0000755000175000017500000000000012154727171010437 500000000000000ming-0.4.5/util/outputdecl.h0000644000175000017500000001667212154635363012735 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ /* outputXXX.c */ extern char *methodcall(char *varname, char *method); extern char *newobj(char *varname, char *obj); extern OUTPUTRET outputSWF_RGBA(SWF_RGBA *color, char *pname); extern OUTPUTRET outputSWF_MATRIX(SWF_MATRIX *matrix, char *fname); extern OUTPUTRET outputSWF_GRADIENT(SWF_GRADIENT *gradient, char *gname); extern OUTPUTRET outputSWF_FILLSTYLE(SWF_FILLSTYLE *fillstyle, char *parentname, int i); extern OUTPUTRET outputSWF_FILLSTYLEARRAY(SWF_FILLSTYLEARRAY *fillstylearray, char *parentname); extern OUTPUTRET outputSWF_LINESTYLE(SWF_LINESTYLE *linestyle, char *parentname, int i); extern OUTPUTRET outputSWF_LINESTYLE2(SWF_LINESTYLE2 *linestyle, char *parentname, int i); extern OUTPUTRET outputSWF_LINESTYLEARRAY(SWF_LINESTYLEARRAY *linestylearray, char *parentname); extern OUTPUTRET outputSWF_SHAPERECORD(SWF_SHAPERECORD *shaperec, char *parentname); extern OUTPUTRET outputSWF_SHAPE(SWF_SHAPE *shape, char *name); extern OUTPUTRET outputSWF_SHAPEWITHSTYLE(SWF_SHAPEWITHSTYLE *shape, int level, char *name); extern OUTPUTRET outputSWF_CHARACTERSET(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBITS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBITSJPEG2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBITSJPEG3(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBITSPTR(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBUTTON(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBUTTON2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBUTTONCXFORM(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBUTTONSOUND(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINECOMMANDOBJ(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEEDITTEXT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONT2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONT3(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONTINFO(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONTINFO2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_CSMTEXTSETTINGS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONTALIGNZONES(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEFONTNAME(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINELOSSLESS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINELOSSLESS2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEMORPHSHAPE(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEMORPHSHAPE2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESHAPE(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESHAPE2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESHAPE3(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESHAPE4(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESOUND(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESPRITE(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINETEXT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINETEXT2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINETEXTFORMAT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEVIDEO(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEVIDEOSTREAM(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DOACTION(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_ENABLEDEBUGGER(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_ENABLEDEBUGGER2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_END(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_EXPORTASSETS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_FONTREF(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_FRAMELABEL(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_FRAMETAG(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_FREEALL(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_FREECHARACTER(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_GENCOMMAND(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_IMPORTASSETS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_IMPORTASSETS2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_JPEGTABLES(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_NAMECHARACTER(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PATHSAREPOSTSCRIPT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PLACEOBJECT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PLACEOBJECT2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PLACEOBJECT3(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PREBUILT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PREBUILTCLIP(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_PROTECT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_REMOVEOBJECT(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_REMOVEOBJECT2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SERIALNUMBER(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SETBACKGROUNDCOLOR(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SHOWFRAME(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SOUNDSTREAMBLOCK(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SOUNDSTREAMHEAD(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SOUNDSTREAMHEAD2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_STARTSOUND(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_STARTSOUND2(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SYNCFRAME(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_INITACTION(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_VIDEOFRAME(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_REFLEX(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_FILEATTRIBUTES(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_METADATA(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SCRIPTLIMITS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESCALINGGRID(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SETTABINDEX(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DOABC(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_SYMBOLCLASS(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINEBINARYDATA(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEFINESCENEANDFRAMEDATA(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_DEBUGID(SWF_Parserstruct *pblock); extern OUTPUTRET outputSWF_UNKNOWNBLOCK(SWF_Parserstruct *pblock); extern void outputHeader(struct Movie *m); extern void outputTrailer(struct Movie *m); extern void outputBlock(int type, SWF_Parserstruct *blockp, FILE *stream); ming-0.4.5/util/swftypes.h0000644000175000017500000011751212154635363012424 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #ifndef _SWFTYPES_H_ #define _SWFTYPES_H_ typedef signed char SI8; /* Signed 8-bit integer value */ typedef signed short SI16; /* Signed 16-bit integer value */ typedef signed long SI32; /* Signed 32-bit integer value */ typedef unsigned char UI8; /* Unsigned 8-bit integer value */ typedef unsigned short UI16; /* Unsigned 16-bit integer value */ typedef unsigned long UI32; /* Unsigned 32-bit integer value */ typedef unsigned long U30; /* Unsigned 30-bit variable-length encoded integer value */ typedef unsigned long U32; /* Unsigned 32-bit variable-length encoded integer value */ typedef signed long S32; /* Signed 32-bit variable-length encoded integer value */ typedef unsigned long FIXED; /* 32-bit 16.16 fixed-point number */ typedef unsigned short FIXED8; /* 16-bit 8.8 fixed-point number */ typedef unsigned long SB32; /* Signed bit value */ typedef unsigned long UB32; /* Unsigned bit value */ typedef float FB32; /* Signed fixed-point bit value */ typedef char *STRING;/* String */ typedef UI8 LANGCODE; typedef UI8 BYTE; typedef SI16 WORD; typedef UI8 BOOLEAN; typedef float FLOAT; /* 32-bit IEEE single-precision little endian fp value */ typedef double DOUBLE; /* 64-bit IEEE double-precision little endian double value */ typedef float FLOAT16; /* 16-bit IEEE double-precision little endian double value */ /* Types to represent Actions */ struct SWF_ACTIONRECORD { UI8 ActionCode; UI16 Length; UI32 Offset; }; /* v3 actions */ struct SWF_ACTIONGOTOFRAME { UI8 ActionCode; UI16 Length; UI32 Offset; WORD Frame; }; struct SWF_ACTIONGETURL { UI8 ActionCode; UI16 Length; UI32 Offset; STRING UrlString; STRING TargetString; }; struct SWF_ACTIONNEXTFRAME { UI8 ActionCode; }; struct SWF_ACTIONPREVIOUSFRAME { UI8 ActionCode; }; struct SWF_ACTIONPLAY { UI8 ActionCode; }; struct SWF_ACTIONSTOP { UI8 ActionCode; }; struct SWF_ACTIONTOGGLEQUALITY { UI8 ActionCode; }; struct SWF_ACTIONSTOPSOUNDS { UI8 ActionCode; }; struct SWF_ACTIONWAITFORFRAME { UI8 ActionCode; UI16 Length; UI32 Offset; WORD Frame; BYTE SkipCount; }; struct SWF_ACTIONSETTARGET { UI8 ActionCode; UI16 Length; UI32 Offset; STRING TargetName; }; struct SWF_ACTIONGOTOLABEL { UI8 ActionCode; UI16 Length; UI32 Offset; STRING FrameLabel; }; /* v4 actions */ struct SWF_ACTIONPUSHPARAM { UI8 ActionCode; UI16 Length; UI32 Offset; UI8 Type; union { STRING String; FLOAT Float; int RegisterNumber; int Boolean; DOUBLE Double; SI32 Integer; UI8 Constant8; UI16 Constant16; } p; }; struct SWF_ACTIONPUSH { UI8 ActionCode; UI16 Length; UI32 Offset; UI16 NumParam; struct SWF_ACTIONPUSHPARAM *Params; }; struct SWF_ACTIONPOP { UI8 ActionCode; }; struct SWF_ACTIONADD { UI8 ActionCode; }; struct SWF_ACTIONSUBTRACT { UI8 ActionCode; }; struct SWF_ACTIONMULTIPLY { UI8 ActionCode; }; struct SWF_ACTIONDIVIDE { UI8 ActionCode; }; struct SWF_ACTIONEQUALS { UI8 ActionCode; }; struct SWF_ACTIONLESS { UI8 ActionCode; }; struct SWF_ACTIONAND { UI8 ActionCode; }; struct SWF_ACTIONOR { UI8 ActionCode; }; struct SWF_ACTIONNOT { UI8 ActionCode; BOOLEAN Boolean; }; struct SWF_ACTIONSTRINGEQUALS { UI8 ActionCode; }; struct SWF_ACTIONSTRINGLENGTH { UI8 ActionCode; }; struct SWF_ACTIONSTRINGADD { UI8 ActionCode; }; struct SWF_ACTIONSTRINGEXTRACT { UI8 ActionCode; }; struct SWF_ACTIONSTRINGLESS { UI8 ActionCode; }; struct SWF_ACTIONMBSTRINGLEN { UI8 ActionCode; }; struct SWF_ACTIONMBSTRINGEXTRACT { UI8 ActionCode; }; struct SWF_ACTIONTOINTEGER { UI8 ActionCode; }; struct SWF_ACTIONCHARTOASCII { UI8 ActionCode; }; struct SWF_ACTIONASCIITOCHAR { UI8 ActionCode; }; struct SWF_ACTIONMBCHARTOASCII { UI8 ActionCode; }; struct SWF_ACTIONMBASCIITOCHAR { UI8 ActionCode; }; struct SWF_ACTIONJUMP { UI8 ActionCode; UI16 Length; UI32 Offset; WORD BranchOffset; }; struct SWF_ACTIONIF { UI8 ActionCode; UI16 Length; UI32 Offset; WORD BranchOffset; int numActions; union SWF_ACTION *Actions; }; struct SWF_ACTIONCALL { UI8 ActionCode; UI16 Length; UI32 Offset; }; struct SWF_ACTIONGETVARIABLE { UI8 ActionCode; }; struct SWF_ACTIONSETVARIABLE { UI8 ActionCode; }; struct SWF_ACTIONGETURL2 { UI8 ActionCode; UI16 Length; UI32 Offset; union { struct { UI8 SendVarsMethod:2; UI8 Reserved:4; UI8 LoadTargetFlag:1; UI8 LoadVariableFlag:1; } FlagBits; UI8 Flags; } f; }; struct SWF_ACTIONGOTOFRAME2 { UI8 ActionCode; UI16 Length; UI32 Offset; union { struct { UI8 Reserved:6; UI8 SceneBiasFlag:1; UI8 PlayFlag:1; } FlagBits; UI8 Flags; } f; UI16 SceneBias; }; struct SWF_ACTIONSETTARGET2 { UI8 ActionCode; }; struct SWF_ACTIONGETPROPERTY { UI8 ActionCode; }; struct SWF_ACTIONSETPROPERTY { UI8 ActionCode; }; struct SWF_ACTIONCLONESPRITE { UI8 ActionCode; }; struct SWF_ACTIONREMOVESPRITE { UI8 ActionCode; }; struct SWF_ACTIONSTARTDRAG { UI8 ActionCode; }; struct SWF_ACTIONENDDRAG { UI8 ActionCode; }; struct SWF_ACTIONWAITFORFRAME2 { UI8 ActionCode; UI16 Length; UI32 Offset; UI8 SkipCount; }; struct SWF_ACTIONTRACE { UI8 ActionCode; }; struct SWF_ACTIONGETTIME { UI8 ActionCode; }; struct SWF_ACTIONRANDOMNUMBER { UI8 ActionCode; }; /* v5 actions */ struct SWF_ACTIONCALLFUNCTION { UI8 ActionCode; }; struct SWF_ACTIONCALLMETHOD { UI8 ActionCode; }; struct SWF_ACTIONCONSTANTPOOL { UI8 ActionCode; UI16 Length; UI32 Offset; UI16 Count; STRING *ConstantPool; }; struct SWF_ACTIONDEFINEFUNCTION { UI8 ActionCode; UI16 Length; UI32 Offset; STRING FunctionName; WORD NumParams; STRING *Params; WORD CodeSize; int numActions; union SWF_ACTION *Actions; }; struct SWF_ACTIONWITH { UI8 ActionCode; UI16 Length; UI32 Offset; UI16 Size; int numActions; union SWF_ACTION *Actions; }; struct SWF_ACTIONSTOREREGISTER { UI8 ActionCode; UI16 Length; UI32 Offset; UI8 Register; }; /* v6 actions */ struct SWF_ACTIONINSTANCEOF { UI8 ActionCode; }; struct SWF_ACTIONENUMERATE2 { UI8 ActionCode; }; struct SWF_ACTIONSTRICTEQUALS { UI8 ActionCode; }; struct SWF_ACTIONGREATER { UI8 ActionCode; }; struct SWF_ACTIONSTRINGGREATER { UI8 ActionCode; }; /* v7 actions */ struct REGISTERPARAM { UI8 Register; STRING ParamName; }; struct SWF_ACTIONDEFINEFUNCTION2 { UI8 ActionCode; UI16 Length; UI32 Offset; STRING FunctionName; UI16 NumParams; UI8 RegisterCount; UI16 PreloadParentFlag:1; UI16 PreloadRootFlag:1; UI16 SuppressSuperFlag:1; UI16 PreloadSuperFlag:1; UI16 SuppressArgumentsFlag:1; UI16 PreloadArgumentsFlag:1; UI16 SuppressThisFlag:1; UI16 PreloadThisFlag:1; UI16 Reserved:7; UI16 PreloadGlobalFlag:1; struct REGISTERPARAM *Params; UI16 CodeSize; int numActions; union SWF_ACTION *Actions; }; struct SWF_ACTIONTRY { UI8 ActionCode; UI16 Length; UI32 Offset; UI8 Reserved:5; UI8 CatchInRegisterFlag:1; UI8 FinallyBlockFlag:1; UI8 CatchBlockFlag:1; UI16 TrySize; UI16 CatchSize; UI16 FinallySize; STRING CatchName; UI8 CatchRegister; int numTryActs; union SWF_ACTION *TryActs; int numCatchActs; union SWF_ACTION *CatchActs; int numFinallyActs; union SWF_ACTION *FinallyActs; }; typedef union SWF_ACTION { /* v3 actions */ struct SWF_ACTIONRECORD SWF_ACTIONRECORD; struct SWF_ACTIONGOTOFRAME SWF_ACTIONGOTOFRAME; struct SWF_ACTIONGETURL SWF_ACTIONGETURL; struct SWF_ACTIONNEXTFRAME SWF_ACTIONNEXTFRAME; struct SWF_ACTIONPREVIOUSFRAME SWF_ACTIONPREVIOUSFRAME; struct SWF_ACTIONPLAY SWF_ACTIONPLAY; struct SWF_ACTIONSTOP SWF_ACTIONSTOP; struct SWF_ACTIONTOGGLEQUALITY SWF_ACTIONTOGLEQUALITY; struct SWF_ACTIONSTOPSOUNDS SWF_ACTIONSTOPSOUNDS; struct SWF_ACTIONWAITFORFRAME SWF_ACTIONWAITFORFRAME; struct SWF_ACTIONSETTARGET SWF_ACTIONSETTARGET; struct SWF_ACTIONGOTOLABEL SWF_ACTIONGOTOLABEL; /* v4 actions */ struct SWF_ACTIONPUSH SWF_ACTIONPUSH; struct SWF_ACTIONPOP SWF_ACTIONPOP; struct SWF_ACTIONADD SWF_ACTIONADD; struct SWF_ACTIONSUBTRACT SWF_ACTIONSUBTRACT; struct SWF_ACTIONMULTIPLY SWF_ACTIONMULTIPLY; struct SWF_ACTIONDIVIDE SWF_ACTIONDIVIDE; struct SWF_ACTIONEQUALS SWF_ACTIONEQUALS; struct SWF_ACTIONLESS SWF_ACTIONLESS; struct SWF_ACTIONAND SWF_ACTIONAND; struct SWF_ACTIONOR SWF_ACTIONOR; struct SWF_ACTIONNOT SWF_ACTIONNOT; struct SWF_ACTIONSTRINGEQUALS SWF_ACTIONSTRINGEQUALS; struct SWF_ACTIONSTRINGLENGTH SWF_ACTIONSTRINGLENGTH; struct SWF_ACTIONSTRINGADD SWF_ACTIONSTRINGADD; struct SWF_ACTIONSTRINGEXTRACT SWF_ACTIONSTRINGEXTRACT; struct SWF_ACTIONSTRINGLESS SWF_ACTIONSTRINGLESS; struct SWF_ACTIONMBSTRINGLEN SWF_ACTIONMBSTRINGLEN; struct SWF_ACTIONMBSTRINGEXTRACT SWF_ACTIONMBSTRINGEXTRACT; struct SWF_ACTIONTOINTEGER SWF_ACTIONTOINTEGER; struct SWF_ACTIONCHARTOASCII SWF_ACTIONCHARTOASCII; struct SWF_ACTIONASCIITOCHAR SWF_ACTIONASCIITOCHAR; struct SWF_ACTIONMBCHARTOASCII SWF_ACTIONMBCHARTOASCII; struct SWF_ACTIONMBASCIITOCHAR SWF_ACTIONMBASCIITOCHAR; struct SWF_ACTIONJUMP SWF_ACTIONJUMP; struct SWF_ACTIONIF SWF_ACTIONIF; struct SWF_ACTIONCALL SWF_ACTIONCALL; struct SWF_ACTIONGETVARIABLE SWF_ACTIONGETVARIABLE; struct SWF_ACTIONSETVARIABLE SWF_ACTIONSETVARIABLE; struct SWF_ACTIONGETURL2 SWF_ACTIONGETURL2; struct SWF_ACTIONGOTOFRAME2 SWF_ACTIONGOTOFRAME2; struct SWF_ACTIONSETTARGET2 SWF_ACTIONSETTARGET2; struct SWF_ACTIONGETPROPERTY SWF_ACTIONGETPROPERTY; struct SWF_ACTIONSETPROPERTY SWF_ACTIONSETPROPERTY; struct SWF_ACTIONCLONESPRITE SWF_ACTIONCLONESPRITE; struct SWF_ACTIONREMOVESPRITE SWF_ACTIONREMOVESPRITE; struct SWF_ACTIONSTARTDRAG SWF_ACTIONSTARTDRAG; struct SWF_ACTIONENDDRAG SWF_ACTIONENDDRAG; struct SWF_ACTIONWAITFORFRAME2 SWF_ACTIONWAITFORFRAME2; struct SWF_ACTIONTRACE SWF_ACTIONTRACE; struct SWF_ACTIONGETTIME SWF_ACTIONGETTIME; struct SWF_ACTIONRANDOMNUMBER SWF_ACTIONRANDOMNUMBER; /* v5 actions */ struct SWF_ACTIONCALLFUNCTION SWF_ACTIONCALLFUNCTION; struct SWF_ACTIONCALLMETHOD SWF_ACTIONCALLMETHOD; struct SWF_ACTIONCONSTANTPOOL SWF_ACTIONCONSTANTPOOL; struct SWF_ACTIONDEFINEFUNCTION SWF_ACTIONDEFINEFUNCTION; struct SWF_ACTIONWITH SWF_ACTIONWITH; struct SWF_ACTIONSTOREREGISTER SWF_ACTIONSTOREREGISTER; /* v6 actions */ struct SWF_ACTIONINSTANCEOF SWF_ACTIONINSTANCEOF; struct SWF_ACTIONENUMERATE2 SWF_ACTIONENUMERATE2; struct SWF_ACTIONSTRICTEQUALS SWF_ACTIONSTRICTEQUALS; struct SWF_ACTIONGREATER SWF_ACTIONGREATER; struct SWF_ACTIONSTRINGGREATER SWF_ACTIONSTRINGGREATER; /* v7 actions */ struct SWF_ACTIONDEFINEFUNCTION2 SWF_ACTIONDEFINEFUNCTION2; struct SWF_ACTIONTRY SWF_ACTIONTRY; } SWF_ACTION; /* Types Flash Types */ typedef struct SWF_RGBA { UI8 red; UI8 green; UI8 blue; UI8 alpha; } SWF_RGBA; typedef struct SWF_RECT { UI8 Nbits:5; SB32 Xmin; SB32 Xmax; SB32 Ymin; SB32 Ymax; } SWF_RECT; typedef struct SWF_GRADIENTRECORD { UI8 Ratio; SWF_RGBA Color; } SWF_GRADIENTRECORD; typedef struct SWF_GRADIENT { UI8 SpreadMode:2; UI8 InterpolationMode:2; UI8 NumGradients:4; SWF_GRADIENTRECORD GradientRecords[15]; } SWF_GRADIENT; typedef struct SWF_FOCALGRADIENT { UI8 SpreadMode:2; UI8 InterpolationMode:2; UI8 NumGradients:4; SWF_GRADIENTRECORD GradientRecords[15]; FIXED8 FocalPoint; } SWF_FOCALGRADIENT; typedef struct SWF_MATRIX { UI8 HasScale:1; UI8 NScaleBits:5; FB32 ScaleX; FB32 ScaleY; UI8 HasRotate:1; UI8 NRotateBits:5; FB32 RotateSkew0; FB32 RotateSkew1; UI8 NTranslateBits:5; SB32 TranslateX; SB32 TranslateY; } SWF_MATRIX; typedef struct SWF_CXFORM { UI8 HasAddTerms:1; UI8 HasMultTerms:1; UI8 Nbits:4; SI32 RedMultTerm; SI32 GreenMultTerm; SI32 BlueMultTerm; SI32 RedAddTerm; SI32 GreenAddTerm; SI32 BlueAddTerm; } SWF_CXFORM; typedef struct SWF_CXFORMWITHALPHA { UI8 HasAddTerms:1; UI8 HasMultTerms:1; UI8 Nbits:4; SI32 RedMultTerm; SI32 GreenMultTerm; SI32 BlueMultTerm; SI32 AlphaMultTerm; SI32 RedAddTerm; SI32 GreenAddTerm; SI32 BlueAddTerm; SI32 AlphaAddTerm; } SWF_CXFORMWITHALPHA; typedef struct SWF_BLURFILTER { FIXED BlurX; FIXED BlurY; UI8 Passes:5; UI8 Reserved:3; } SWF_BLURFILTER; typedef struct SWF_BEVELFILTER { SWF_RGBA ShadowColor; SWF_RGBA HighlightColor; FIXED BlurX; FIXED BlurY; FIXED Angle; FIXED Distance; FIXED8 Strength; UI8 InnerShadow:1; UI8 Kockout:1; UI8 CompositeSource:1; UI8 OnTop:1; UI8 Passes:4; } SWF_BEVELFILTER; typedef struct SWF_GRADIENTFILTER { UI8 NumColors; SWF_RGBA* GradientColors; UI8* GradientRatio; FIXED BlurX; FIXED BlurY; FIXED Angle; FIXED Distance; FIXED8 Strength; UI8 InnerShadow:1; UI8 Kockout:1; UI8 CompositeSource:1; UI8 OnTop:1; UI8 Passes:4; } SWF_GRADIENTFILTER; typedef struct SWF_GLOWFILTER { SWF_RGBA GlowColor; FIXED BlurX; FIXED BlurY; FIXED8 Strength; UI8 InnerGlow:1; UI8 Kockout:1; UI8 CompositeSource:1; UI8 Passes:5; } SWF_GLOWFILTER; typedef struct SWF_CONVOLUTIONFILTER { UI8 MatrixX; UI8 MatrixY; FLOAT Divisor; FLOAT Bias; FLOAT* Matrix; SWF_RGBA DefaultColor; UI8 Reserved:6; UI8 Clamp:1; UI8 PreserveAlpha:1; } SWF_CONVOLUTIONFILTER; typedef struct SWF_COLORMATRIXFILTER { FLOAT Matrix[20]; } SWF_COLORMATRIXFILTER; typedef struct SWF_DROPSHADOWFILTER { SWF_RGBA DropShadowColor; FIXED BlurX; FIXED BlurY; FIXED Angle; FIXED Distance; FIXED8 Strength; UI8 InnerShadow:1; UI8 Kockout:1; UI8 CompositeSource:1; UI8 Passes:5; } SWF_DROPSHADOWFILTER; enum { FILTER_DROPSHADOW, FILTER_BLUR, FILTER_GLOW, FILTER_BEVEL, FILTER_GRADIENTGLOW, FILTER_CONVOLUTION, FILTER_COLORMATRIX, FILTER_GRADIENTBEVEL }; typedef struct SWF_FILTER { UI8 FilterId; union { SWF_DROPSHADOWFILTER dropShadow; SWF_BLURFILTER blur; SWF_GLOWFILTER glow; SWF_BEVELFILTER bevel; SWF_GRADIENTFILTER gradientGlow; SWF_CONVOLUTIONFILTER convolution; SWF_COLORMATRIXFILTER colorMatrix; SWF_GRADIENTFILTER gradientBevel; } filter; } SWF_FILTER; typedef struct SWF_FILTERLIST { UI8 NumberOfFilters; SWF_FILTER *Filter; } SWF_FILTERLIST; typedef struct SWF_BUTTONRECORD { UI8 ButtonReserved:2; UI8 ButtonHasBlendMode:1; UI8 ButtonHasFilterList:1; UI8 ButtonStateHitTest:1; UI8 ButtonStateDown:1; UI8 ButtonStateOver:1; UI8 ButtonStateUp:1; UI16 CharacterId; UI16 PlaceDepth; SWF_MATRIX PlaceMatrix; SWF_CXFORMWITHALPHA ColorTransform; SWF_FILTERLIST FilterList; UI8 BlendMode; } SWF_BUTTONRECORD; typedef struct SWF_BUTTONCONDACTION { UI16 CondActionSize; UI16 CondIdleToOverDown:1; UI16 CondOutDownToIdle:1; UI16 CondOutDownToOverDown:1; UI16 CondOverDownToOutDown:1; UI16 CondOverDownToOverUp:1; UI16 CondOverUpToOverDown:1; UI16 CondOverUpToIdle:1; UI16 CondIdleToOverUp:1; UI16 CondKeyPress:7; UI16 CondOverDownToIdle:1; int numActions; SWF_ACTION *Actions; } SWF_BUTTONCONDACTION; typedef struct SWF_CLIPEVENTFLAGS { UI8 ClipEventKeyUp:1; UI8 ClipEventKeyDown:1; UI8 ClipEventMouseUp:1; UI8 ClipEventMouseDown:1; UI8 ClipEventMouseMove:1; UI8 ClipEventUnload:1; UI8 ClipEventEnterFrame:1; UI8 ClipEventLoad:1; UI8 ClipEventDragOver:1; UI8 ClipEventRollOut:1; UI8 ClipEventRollOver:1; UI8 ClipEventReleaseOutside:1; UI8 ClipEventRelease:1; UI8 ClipEventPress:1; UI8 ClipEventInitialize:1; UI8 ClipEventData:1; UI8 Reserved:5; UI8 ClipEventConstruct:1; UI8 ClipEventKeyPress:1; UI8 ClipEventDragOut:1; UI8 Reserved2:8; } SWF_CLIPEVENTFLAGS; typedef struct SWF_CLIPACTIONRECORD { SWF_CLIPEVENTFLAGS EventFlag; UI32 ActionRecordSize; UI8 KeyCode; int numActions; SWF_ACTION *Actions; } SWF_CLIPACTIONRECORD; typedef struct SWF_CLIPACTIONS { UI16 Reserved; SWF_CLIPEVENTFLAGS AllEventFlags; int NumClipRecords; SWF_CLIPACTIONRECORD *ClipActionRecords; UI32 ClipActionEndFlag; } SWF_CLIPACTIONS; typedef struct SWF_FILLSTYLE { UI8 FillStyleType; SWF_RGBA Color; SWF_MATRIX GradientMatrix; SWF_GRADIENT Gradient; SWF_FOCALGRADIENT FocalGradient; UI16 BitmapId; SWF_MATRIX BitmapMatrix; } SWF_FILLSTYLE; typedef struct SWF_FILLSTYLEARRAY { UI8 FillStyleCount; UI16 FillStyleCountExtended; SWF_FILLSTYLE *FillStyles; } SWF_FILLSTYLEARRAY; typedef struct SWF_LINESTYLE { UI16 Width; SWF_RGBA Color; } SWF_LINESTYLE; typedef struct SWF_LINESTYLE2 { UI16 Width; UI8 StartCapStyle:2; UI8 JoinStyle:2; UI8 HasFillFlag:1; UI8 NoHScaleFlag:1; UI8 NoVScaleFlag:1; UI8 PixelHintingFlag:1; UI8 Reserved:5; UI8 NoClose:1; UI8 EndCapStyle:2; UI16 MiterLimitFactor; SWF_RGBA Color; SWF_FILLSTYLE FillType; } SWF_LINESTYLE2; typedef struct SWF_LINESTYLEARRAY { UI16 LineStyleCount; SWF_LINESTYLE *LineStyles; SWF_LINESTYLE2 *LineStyles2; } SWF_LINESTYLEARRAY; typedef struct SWF_ENDSHAPERECORD { UI16 TypeFlag:1; UI16 EndOfShape:5; } SWF_ENDSHAPERECORD; typedef struct SWF_STYLECHANGERECORD { UI16 TypeFlag:1; UI16 StateNewStyles:1; UI16 StateLineStyle:1; UI16 StateFillStyle1:1; UI16 StateFillStyle0:1; UI16 StateMoveTo:1; UI16 MoveBits:5; SB32 MoveDeltaX; SB32 MoveDeltaY; UB32 FillStyle0; UB32 FillStyle1; UB32 LineStyle; SWF_FILLSTYLEARRAY FillStyles; SWF_LINESTYLEARRAY LineStyles; UI8 NumFillBits:4; UI8 NumLineBits:4; } SWF_STYLECHANGERECORD; typedef struct SWF_CURVEDEDGERECORD { UI16 TypeFlag:1; UI16 StraightFlag:1; UI16 NumBits:4; SB32 ControlDeltaX; SB32 ControlDeltaY; SB32 AnchorDeltaX; SB32 AnchorDeltaY; } SWF_CURVEDEDGERECORD; typedef struct SWF_STRAIGHTEDGERECORD { UI16 TypeFlag:1; UI16 StraightEdge:1; UI16 NumBits:4; UI16 GeneralLineFlag:1; SB32 DeltaX; SB32 DeltaY; SI8 VertLineFlag:1; SB32 VLDeltaX; SB32 VLDeltaY; } SWF_STRAIGHTEDGERECORD; typedef union SWF_SHAPERECORD { SWF_ENDSHAPERECORD EndShape; SWF_STYLECHANGERECORD StyleChange; SWF_STRAIGHTEDGERECORD StraightEdge; SWF_CURVEDEDGERECORD CurvedEdge; } SWF_SHAPERECORD; typedef struct SWF_MORPHGRADIENTRECORD { UI8 StartRatio; SWF_RGBA StartColor; UI8 EndRatio; SWF_RGBA EndColor; } SWF_MORPHGRADIENTRECORD; typedef struct SWF_MORPHGRADIENT { UI8 NumGradients; SWF_MORPHGRADIENTRECORD GradientRecords[8]; } SWF_MORPHGRADIENT; typedef struct SWF_MORPHFILLSTYLE { UI8 FillStyleType; SWF_RGBA StartColor; SWF_RGBA EndColor; SWF_MATRIX StartGradientMatrix; SWF_MATRIX EndGradientMatrix; SWF_MORPHGRADIENT Gradient; UI16 BitmapId; SWF_MATRIX StartBitmapMatrix; SWF_MATRIX EndBitmapMatrix; } SWF_MORPHFILLSTYLE; typedef struct SWF_MORPHFILLSTYLES { UI8 FillStyleCount; UI16 FillStyleCountExtended; SWF_MORPHFILLSTYLE *FillStyles; } SWF_MORPHFILLSTYLES; typedef struct SWF_MORPHLINESTYLE { UI16 StartWidth; UI16 EndWidth; SWF_RGBA StartColor; SWF_RGBA EndColor; } SWF_MORPHLINESTYLE; typedef struct SWF_MORPHLINESTYLE2 { UI16 StartWidth; UI16 EndWidth; UI16 StartCapStyle:2; UI16 JoinStyle:2; UI16 HasFillFlag:2; UI16 NoHScaleFlag:1; UI16 NoVScaleFlag:1; UI16 PixelHintingFlag:1; UI16 Reserved:5; UI16 NoClose:1; UI16 EndCapStyle:2; UI16 MiterLimitFactor; SWF_RGBA StartColor; SWF_RGBA EndColor; SWF_MORPHFILLSTYLE FillType; } SWF_MORPHLINESTYLE2; typedef struct SWF_MORPHLINESTYLES { UI8 LineStyleCount; UI16 LineStyleCountExtended; SWF_MORPHLINESTYLE *LineStyles; SWF_MORPHLINESTYLE2 *LineStyles2; } SWF_MORPHLINESTYLES; typedef struct SWF_SHAPE { UI8 NumFillBits:4; UI8 NumLineBits:4; int NumShapeRecords; SWF_SHAPERECORD *ShapeRecords; } SWF_SHAPE; typedef struct SWF_SHAPEWITHSTYLE { SWF_FILLSTYLEARRAY FillStyles; SWF_LINESTYLEARRAY LineStyles; UI8 NumFillBits:4; UI8 NumLineBits:4; int NumShapeRecords; SWF_SHAPERECORD *ShapeRecords; } SWF_SHAPEWITHSTYLE; typedef struct SWF_GLYPHENTRY { UI32 *GlyphIndex; UI32 *GlyphAdvance; } SWF_GLYPHENTRY; typedef struct SWF_TEXTRECORD { UI8 TextRecordType:1; UI8 StyleFlagsReserved:3; UI8 StyleFlagHasFont:1; UI8 StyleFlagHasColor:1; UI8 StyleFlagHasYOffset:1; UI8 StyleFlagHasXOffset:1; UI16 FontID; SWF_RGBA TextColor; SI16 XOffset; SI16 YOffset; UI16 TextHeight; UI8 GlyphCount; SWF_GLYPHENTRY *GlyphEntries; } SWF_TEXTRECORD; typedef struct SWF_SOUNDENVELOPE { UI32 Pos44; UI16 LeftLevel; UI16 RightLevel; } SWF_SOUNDENVELOPE; typedef struct SWF_SOUNDINFO { UI8 Reserved:2; UI8 SyncStop:1; UI8 SyncNoMultiple:1; UI8 HasEnvelope:1; UI8 HasLoops:1; UI8 HasOutPoint:1; UI8 HasInPoint:1; UI32 InPoint; UI32 OutPoint; UI16 LoopCount; UI8 EnvPoints; SWF_SOUNDENVELOPE *EnvelopeRecords; } SWF_SOUNDINFO; /* Types to represent Blocks */ struct SWF_CHARACTERSET { int chid; }; struct SWF_DEFINEBITS { UI16 CharacterID; int JPEGDataSize; UI8 *JPEGData; }; struct SWF_DEFINEBITSJPEG2 { UI16 CharacterID; int JPEGDataSize; UI8 *JPEGData; }; struct SWF_DEFINEBITSJPEG3 { UI16 CharacterID; UI32 AlphaDataOffset; UI8 *JPEGData; int AlphaDataSize; UI8 *BitmapAlphaData; }; // XXX: obsolete struct SWF_DEFINEBITSPTR { int chid; }; struct SWF_DEFINEBUTTON { UI16 ButtonId; SWF_BUTTONRECORD *Characters; int numCharacters; UI8 CharacterEndFlag; int numActions; SWF_ACTION *Actions; UI8 ActionEndFlag; }; struct SWF_DEFINEBUTTON2 { UI16 Buttonid; UI8 ReservedFlags:7; UI8 TrackAsMenu:1; UI16 ActionOffset; int numCharacters; SWF_BUTTONRECORD *Characters; UI8 CharacterEndFlag; int numActions; SWF_BUTTONCONDACTION *Actions; }; struct SWF_DEFINEBUTTONCXFORM { UI16 ButtonId; SWF_CXFORM ButtonColorTransform; }; struct SWF_DEFINEBUTTONSOUND { UI16 CharacterID; UI16 ButtonSoundChar0; SWF_SOUNDINFO ButtonSoundInfo0; UI16 ButtonSoundChar1; SWF_SOUNDINFO ButtonSoundInfo1; UI16 ButtonSoundChar2; SWF_SOUNDINFO ButtonSoundInfo2; UI16 ButtonSoundChar3; SWF_SOUNDINFO ButtonSoundInfo3; }; // XXX: obsolete ? struct SWF_DEFINECOMMANDOBJ { int chid; }; struct SWF_DEFINEEDITTEXT { UI16 CharacterID; SWF_RECT Bounds; UI8 HasText:1; UI8 WordWrap:1; UI8 Multiline:1; UI8 Password:1; UI8 ReadOnly:1; UI8 HasTextColor:1; UI8 HasMaxLength:1; UI8 HasFont:1; UI8 HasFontClass:1; UI8 AutoSize:1; UI8 HasLayout:1; UI8 NoSelect:1; UI8 Border:1; UI8 WasStatic:1; UI8 HTML:1; UI8 UseOutlines:1; UI16 FontID; STRING FontClass; UI16 FontHeight; SWF_RGBA TextColor; UI16 MaxLength; UI8 Align; UI16 LeftMargin; UI16 RightMargin; UI16 Indent; UI16 Leading; STRING VariableName; STRING InitialText; }; struct SWF_DEFINEFONT { UI16 FontID; int NumGlyphs; UI16 *OffsetTable; SWF_SHAPE *GlyphShapeTable; }; struct SWF_KERNINGRECORD { UI16 FontKerningCode1; UI16 FontKerningCode2; SI16 FontKerningAdjustment; }; struct SWF_DEFINEFONT2 { UI16 FontID; UI8 FontFlagsHasLayout:1; UI8 FontFlagsShiftJis:1; UI8 FontFlagsSmallText:1; UI8 FontFlagsFlagANSI:1; UI8 FontFlagsWideOffsets:1; UI8 FontFlagsWideCodes:1; UI8 FontFlagsFlagsItalics:1; UI8 FontFlagsFlagsBold:1; LANGCODE LanguageCode; UI8 FontNameLen; STRING FontName; UI16 NumGlyphs; union { UI16 *UI16; UI32 *UI32; } OffsetTable; union { UI16 UI16; UI32 UI32; } CodeTableOffset; SWF_SHAPE *GlyphShapeTable; int *CodeTable; SI16 FontAscent; SI16 FontDecent; SI16 FontLeading; SI16 *FontAdvanceTable; SWF_RECT *FontBoundsTable; UI16 KerningCount; struct SWF_KERNINGRECORD *FontKerningTable; }; struct SWF_DEFINEFONT3 { UI16 FontID; UI8 FontFlagsHasLayout:1; UI8 FontFlagsShiftJis:1; UI8 FontFlagsSmallText:1; UI8 FontFlagsFlagANSI:1; UI8 FontFlagsWideOffsets:1; UI8 FontFlagsWideCodes:1; UI8 FontFlagsFlagsItalics:1; UI8 FontFlagsFlagsBold:1; LANGCODE LanguageCode; UI8 FontNameLen; STRING FontName; UI16 NumGlyphs; union { UI16 *UI16; UI32 *UI32; } OffsetTable; union { UI16 UI16; UI32 UI32; } CodeTableOffset; SWF_SHAPE *GlyphShapeTable; UI16 *CodeTable; SI16 FontAscent; SI16 FontDecent; SI16 FontLeading; SI16 *FontAdvanceTable; SWF_RECT *FontBoundsTable; UI16 KerningCount; struct SWF_KERNINGRECORD *FontKerningTable; }; struct SWF_DEFINEFONTINFO { UI16 FontID; UI8 FontNameLen; STRING FontName; UI8 FontFlagsReserved:2; UI8 FontFlagsSmallText:1; UI8 FontFlagsShiftJIS:1; UI8 FontFlagsANSI:1; UI8 FontFlagsItalic:1; UI8 FontFlagsBold:1; UI8 FontFlagsWideCodes:1; int nGlyph; UI16 *CodeTable; }; struct SWF_DEFINEFONTINFO2 { UI16 FontID; UI8 FontNameLen; STRING FontName; UI8 FontFlagsReserved:2; UI8 FontFlagsSmallText:1; UI8 FontFlagsShiftJIS:1; UI8 FontFlagsANSI:1; UI8 FontFlagsItalic:1; UI8 FontFlagsBold:1; UI8 FontFlagsWideCodes:1; LANGCODE LanguageCode; int nGlyph; UI16 *CodeTable; }; struct SWF_ZONEDATA { FLOAT16 AlignmentCoordinate; FLOAT16 Range; }; struct SWF_ZONERECORD { UI8 NumZoneData; struct SWF_ZONEDATA *ZoneData; UI8 ZoneMaskX:1; UI8 ZoneMaskY:1; UI8 Reserved:6; }; struct SWF_DEFINEFONTALIGNZONES { UI16 FontID; UI8 CSMTableHint:2; UI8 Reserved:6; int GlyphCount; struct SWF_ZONERECORD *ZoneTable; }; struct SWF_CSMTEXTSETTINGS { UI16 TextID; UI8 UseFlashType:2; UI8 GridFit:3; UI8 Reserved:3; FB32 Thickness; FB32 Sharpness; UI8 Reserved2; }; struct SWF_DEFINEFONTNAME { UI16 FontId; STRING FontName; STRING FontCopyright; }; struct SWF_DEFINELOSSLESS { UI16 CharacterID; UI8 BitmapFormat; UI16 BitmapWidth; UI16 BitmapHeight; UI8 BitmapColorTableSize; UI8 *ZlibBitmapData; }; struct SWF_DEFINELOSSLESS2 { UI16 CharacterID; UI8 BitmapFormat; UI16 BitmapWidth; UI16 BitmapHeight; UI8 BitmapColorTableSize; UI8 *ZlibBitmapData; }; struct SWF_DEFINEMORPHSHAPE { UI16 CharacterID; SWF_RECT StartBounds; SWF_RECT EndBounds; UI32 Offset; SWF_MORPHFILLSTYLES MorphFillStyles; SWF_MORPHLINESTYLES MorphLineStyles; SWF_SHAPE StartEdges; SWF_SHAPE EndEdges; }; struct SWF_DEFINEMORPHSHAPE2 { UI16 CharacterID; SWF_RECT StartBounds; SWF_RECT EndBounds; SWF_RECT StartEdgeBounds; SWF_RECT EndEdgeBounds; UI8 Reserved:6; UI8 UsesNonScalingStrokes:1; UI8 UsesScalingStrokes:1; UI32 Offset; SWF_MORPHFILLSTYLES MorphFillStyles; SWF_MORPHLINESTYLES MorphLineStyles; SWF_SHAPE StartEdges; SWF_SHAPE EndEdges; }; struct SWF_DEFINESHAPE { UI16 ShapeID; SWF_RECT ShapeBounds; SWF_SHAPEWITHSTYLE Shapes; }; struct SWF_DEFINESHAPE2 { UI16 ShapeID; SWF_RECT ShapeBounds; SWF_SHAPEWITHSTYLE Shapes; }; struct SWF_DEFINESHAPE3 { UI16 ShapeID; SWF_RECT ShapeBounds; SWF_SHAPEWITHSTYLE Shapes; }; struct SWF_DEFINESHAPE4 { UI16 ShapeID; SWF_RECT ShapeBounds; SWF_RECT EdgeBounds; UI8 Reserved:6; UI8 UsesNonScalingStrokes:1; UI8 UsesScalingStrokes:1; SWF_SHAPEWITHSTYLE Shapes; }; struct SWF_DEFINESPRITE { UI16 SpriteId; UI16 FrameCount; UI16 BlockCount; UI16 *tagTypes; struct SWF_Parserstruct_s **Tags; }; struct SWF_DEFINETEXT { UI16 CharacterID; SWF_RECT TextBounds; SWF_MATRIX TextMatrix; UI8 GlyphBits; UI8 AdvanceBits; int numTextRecords; SWF_TEXTRECORD *TextRecords; }; struct SWF_DEFINETEXT2 { UI16 CharacterID; SWF_RECT TextBounds; SWF_MATRIX TextMatrix; UI8 GlyphBits; UI8 AdvanceBits; int numTextRecords; SWF_TEXTRECORD *TextRecords; }; // XXX obsolete ? struct SWF_DEFINETEXTFORMAT { int chid; }; // XXX obsolete ? struct SWF_DEFINEVIDEO { int chid; }; struct SWF_DEFINEVIDEOSTREAM { UI16 CharacterID; UI16 NumFrames; UI16 Width; UI16 Height; UI8 Reserved:5; UI8 VideoFlagsDeblocking:2; UI8 VideoFlagsSmoothing:1; UI8 CodecID; }; struct SWF_DOACTION { int numActions; SWF_ACTION *Actions; }; struct SWF_ENABLEDEBUGGER { STRING Password; }; struct SWF_ENABLEDEBUGGER2 { UI16 Reserved; STRING Password; }; struct SWF_END { #if defined(__SUNPRO_C) int empty; // See http://bugs.libming.org/show_bug.cgi?id=103 #endif }; struct SWF_EXPORTASSETS { UI16 Count; UI16 *Tags; STRING *Names; }; // XXX obsolete ? struct SWF_FONTREF { int chid; }; struct SWF_FRAMELABEL { STRING Name; UI8 IsAnchor; }; // XXX obsolete ? struct SWF_FRAMETAG { int chid; }; // XXX obsolete ? struct SWF_FREEALL { int chid; }; // XXX obsolete ? struct SWF_FREECHARACTER { int chid; }; // XXX obsolete ? struct SWF_GENCOMMAND { int chid; }; struct SWF_IMPORTASSETS { STRING URL; UI16 Count; UI16 *Tags; STRING *Names; }; struct SWF_IMPORTASSETS2 { STRING URL; UI8 Reserved; UI8 Reserved2; UI16 Count; UI16 *Tags; STRING *Names; }; struct SWF_JPEGTABLES { int JPEGDataSize; UI8 *JPEGData; }; struct SWF_NAMECHARACTER { UI16 Id; STRING Name; }; // XXX: obsolete? struct SWF_PATHSAREPOSTSCRIPT { int chid; }; struct SWF_PLACEOBJECT { UI16 CharacterId; UI16 Depth; SWF_MATRIX Matrix; SWF_CXFORMWITHALPHA ColorTransform; }; struct SWF_PLACEOBJECT2 { UI8 PlaceFlagHasClipActions:1; UI8 PlaceFlagHasClipDepth:1; UI8 PlaceFlagHasName:1; UI8 PlaceFlagHasRatio:1; UI8 PlaceFlagHasColorTransform:1; UI8 PlaceFlagHasMatrix:1; UI8 PlaceFlagHasCharacter:1; UI8 PlaceFlagMove:1; UI16 Depth; UI16 CharacterId; SWF_MATRIX Matrix; SWF_CXFORMWITHALPHA ColorTransform; UI16 Ratio; STRING Name; UI16 ClipDepth; SWF_CLIPACTIONS ClipActions; }; struct SWF_PLACEOBJECT3 { UI8 PlaceFlagHasClipActions:1; UI8 PlaceFlagHasClipDepth:1; UI8 PlaceFlagHasName:1; UI8 PlaceFlagHasRatio:1; UI8 PlaceFlagHasColorTransform:1; UI8 PlaceFlagHasMatrix:1; UI8 PlaceFlagHasCharacter:1; UI8 PlaceFlagMove:1; UI8 Reserved:3; UI8 PlaceFlagHasImage:1; UI8 PlaceFlagHasClassName:1; UI8 PlaceFlagHasCacheAsBitmap:1; UI8 PlaceFlagHasBlendMode:1; UI8 PlaceFlagHasFilterList:1; UI16 Depth; STRING ClassName; UI16 CharacterId; SWF_MATRIX Matrix; SWF_CXFORMWITHALPHA ColorTransform; UI16 Ratio; STRING Name; UI16 ClipDepth; SWF_FILTERLIST SurfaceFilterList; UI8 BlendMode; SWF_CLIPACTIONS ClipActions; }; struct SWF_PREBUILT { int chid; }; struct SWF_PREBUILTCLIP { int chid; }; struct SWF_PROTECT { STRING Password; }; struct SWF_REMOVEOBJECT { UI16 CharacterId; UI16 Depth; }; struct SWF_REMOVEOBJECT2 { UI16 Depth; }; struct SWF_SERIALNUMBER { UI32 Id; UI32 Edition; UI8 Major; UI8 Minor; UI32 BuildL; UI32 BuildH; UI32 TimestampL; UI32 TimestampH; }; struct SWF_SETBACKGROUNDCOLOR { SWF_RGBA rgb; }; struct SWF_SHOWFRAME { int chid; }; struct MP3STREAMSOUNDDATA { UI16 SampleCount; SI16 SeekSamples; UI8 *frames; }; struct SWF_SOUNDSTREAMBLOCK { union { struct MP3STREAMSOUNDDATA mp3; UI8 *data; } StreamData; }; struct SWF_SOUNDSTREAMHEAD { UI16 Reserved:4; UI16 PlaybackSoundRate:2; UI16 PlaybackSoundSize:1; UI16 PlaybackSoundType:1; UI16 StreamSoundCompression:4; UI16 StreamSoundRate:2; UI16 StreamSoundSize:1; UI16 StreamSoundType:1; UI16 StreamSoundSampleCount; UI16 LatencySeek; }; struct SWF_SOUNDSTREAMHEAD2 { UI16 Reserved:4; UI16 PlaybackSoundRate:2; UI16 PlaybackSoundSize:1; UI16 PlaybackSoundType:1; UI16 StreamSoundCompression:4; UI16 StreamSoundRate:2; UI16 StreamSoundSize:1; UI16 StreamSoundType:1; UI16 StreamSoundSampleCount; UI16 LatencySeek; }; struct SWF_DEFINESOUND { UI16 SoundId; UI8 SoundFormat:4; UI8 SoundRate:2; UI8 SoundSize:1; UI8 SoundType:1; UI32 SoundSampleCount; union { struct MP3STREAMSOUNDDATA mp3; UI8 *data; } SoundData; }; struct SWF_STARTSOUND { UI16 SoundId; SWF_SOUNDINFO SoundInfo; }; struct SWF_STARTSOUND2 { STRING SoundClassName; SWF_SOUNDINFO SoundInfo; }; // XXX: obsolete? struct SWF_SYNCFRAME { int chid; }; struct SWF_INITACTION { UI16 SpriteId; int numActions; SWF_ACTION *Actions; }; struct SWF_VIDEOFRAME { UI16 StreamID; UI16 FrameNum; UI8 *VideoData; }; struct SWF_REFLEX { UI8 rfx[3]; }; struct SWF_FILEATTRIBUTES { UI8 Reserved:3; UI8 HasMetadata:1; UI8 ActionScript3:1; UI8 Reserved2:2; UI8 UseNetwork:1; UI16 Reserved3; UI8 Reserved4; }; struct SWF_METADATA { STRING Metadata; }; struct SWF_SCRIPTLIMITS { UI16 MaxRecursionDepth; UI16 ScriptTimeoutSeconds; }; struct SWF_DEFINESCALINGGRID { UI16 CharacterId; SWF_RECT Splitter; }; struct SWF_SETTABINDEX { UI16 Depth; UI16 TabIndex; }; struct ABC_OPTION_DETAIL { U30 Val; UI8 Kind; }; struct ABC_OPTION_INFO { U30 OptionCount; struct ABC_OPTION_DETAIL *Option; }; struct ABC_PARAM_INFO { U30 *ParamNames; }; struct ABC_METHOD_INFO { U30 ParamCount; U30 ReturnType; U30 *ParamType; U30 Name; UI8 Flags; struct ABC_OPTION_INFO Options; struct ABC_PARAM_INFO ParamNames; }; struct ABC_STRING_INFO { U30 Size; UI8 *UTF8String; }; struct ABC_NS_INFO { UI8 Kind; U30 Name; }; struct ABC_NS_SET_INFO { U30 Count; U30 *NS; }; struct ABC_QNAME { U30 NS; U30 Name; }; struct ABC_RTQNAME { U30 Name; }; struct ABC_RTQNAME_L { #if defined(__SUNPRO_C) int empty; // See http://bugs.libming.org/show_bug.cgi?id=103 #endif }; struct ABC_MULTINAME { U30 Name; U30 NSSet; }; struct ABC_MULTINAME_L { U30 NSSet; }; struct ABC_MULTINAME_INFO { UI8 Kind; union { struct ABC_QNAME QName; struct ABC_QNAME QNameA; struct ABC_RTQNAME RTQName; struct ABC_RTQNAME RTQNameA; struct ABC_RTQNAME_L RTQNameL; struct ABC_RTQNAME_L RTQNameLA; struct ABC_MULTINAME Multiname; struct ABC_MULTINAME MultinameA; struct ABC_MULTINAME_L MultinameL; struct ABC_MULTINAME_L MultinameLA; } Data; }; struct ABC_CONSTANT_POOL { U30 IntCount; S32 *Integers; U30 UIntCount; U32 *UIntegers; U30 DoubleCount; DOUBLE *Doubles; U30 StringCount; struct ABC_STRING_INFO *Strings; U30 NamespaceCount; struct ABC_NS_INFO *Namespaces; U30 NamespaceSetCount; struct ABC_NS_SET_INFO *NsSets; U30 MultinameCount; struct ABC_MULTINAME_INFO *Multinames; }; struct ABC_ITEM_INFO { U30 Key; U30 Value; }; struct ABC_METADATA_INFO { U30 Name; U30 ItemCount; struct ABC_ITEM_INFO *Items; }; struct ABC_TRAIT_SLOT { U30 SlotId; U30 TypeName; U30 VIndex; UI8 VKind; }; struct ABC_TRAIT_CLASS { U30 SlotId; U30 ClassIndex; }; struct ABC_TRAIT_FUNCTION { U30 SlotId; U30 Function; }; struct ABC_TRAIT_METHOD { U30 DispId; U30 Method; }; struct ABC_TRAITS_INFO { U30 Name; UI8 Kind; UI8 Attr; union { struct ABC_TRAIT_SLOT Slot; struct ABC_TRAIT_CLASS Class; struct ABC_TRAIT_FUNCTION Function; struct ABC_TRAIT_METHOD Method; } Data; U30 MetadataCount; U30 *Metadata; }; struct ABC_INSTANCE_INFO { U30 Name; U30 SuperName; UI8 Flags; U30 ProtectedNs; U30 InterfaceCount; U30 *Interfaces; U30 IInit; U30 TraitCount; struct ABC_TRAITS_INFO *Traits; }; struct ABC_CLASS_INFO { U30 CInit; U30 TraitCount; struct ABC_TRAITS_INFO *Traits; }; struct ABC_SCRIPT_INFO { U30 Init; U30 TraitCount; struct ABC_TRAITS_INFO *Traits; }; struct ABC_EXCEPTION_INFO { U30 From; U30 To; U30 Target; U30 ExcType; U30 VarName; }; struct ABC_METHOD_BODY_INFO { U30 Method; U30 MaxStack; U30 LocalCount; U30 InitScopeDepth; U30 MaxScopeDepth; U30 CodeLength; UI8 *Code; U30 ExceptionCount; struct ABC_EXCEPTION_INFO *Exceptions; U30 TraitCount; struct ABC_TRAITS_INFO *Traits; }; struct ABC_FILE { UI16 Minor; UI16 Major; struct ABC_CONSTANT_POOL ConstantPool; U30 MethodCount; struct ABC_METHOD_INFO *Methods; U30 MetadataCount; struct ABC_METADATA_INFO *Metadata; U30 ClassCount; struct ABC_INSTANCE_INFO *Instances; struct ABC_CLASS_INFO *Classes; U30 ScriptCount; struct ABC_SCRIPT_INFO *Scripts; U30 MethodBodyCount; struct ABC_METHOD_BODY_INFO *MethodBodies; }; struct SWF_DOABC { UI32 Flags; STRING Name; struct ABC_FILE AbcFile; }; struct AS_SYMBOL { UI16 SymbolId; STRING SymbolName; }; struct SWF_SYMBOLCLASS { UI16 SymbolCount; struct AS_SYMBOL *SymbolList; }; struct SWF_DEFINEBINARYDATA { UI32 Reserved; int DataLength; UI8 *Data; }; struct SCENE_DATA { U32 Offset; STRING Name; }; struct FRAME_DATA { U32 FrameNum; STRING FrameLabel; }; struct SWF_DEFINESCENEANDFRAMEDATA { U32 SceneCount; struct SCENE_DATA *Scenes; U32 FrameLabelCount; struct FRAME_DATA *Frames; }; struct SWF_DEBUGID { UI8* UUID; }; struct SWF_UNKNOWNBLOCK { UI8 *Data; }; typedef union _inline_SWF_Parserstruct { struct SWF_CHARACTERSET SWF_CHARACTERSET; struct SWF_DEFINEBITS SWF_DEFINEBITS; struct SWF_DEFINEBITSJPEG2 SWF_DEFINEBITSJPEG2; struct SWF_DEFINEBITSJPEG3 SWF_DEFINEBITSJPEG3; struct SWF_DEFINEBITSPTR SWF_DEFINEBITSPTR; struct SWF_DEFINEBUTTON SWF_DEFINEBUTTON; struct SWF_DEFINEBUTTON2 SWF_DEFINEBUTTON2; struct SWF_DEFINEBUTTONCXFORM SWF_DEFINEBUTTONCXFORM; struct SWF_DEFINEBUTTONSOUND SWF_DEFINEBUTTONSOUND; struct SWF_DEFINECOMMANDOBJ SWF_DEFINECOMMANDOBJ; struct SWF_DEFINEEDITTEXT SWF_DEFINEEDITTEXT; struct SWF_DEFINEFONT SWF_DEFINEFONT; struct SWF_DEFINEFONT2 SWF_DEFINEFONT2; struct SWF_DEFINEFONT3 SWF_DEFINEFONT3; struct SWF_DEFINEFONTINFO SWF_DEFINEFONTINFO; struct SWF_DEFINEFONTINFO2 SWF_DEFINEFONTINFO2; struct SWF_DEFINEFONTALIGNZONES SWF_DEFINEFONTALIGNZONES; struct SWF_CSMTEXTSETTINGS SWF_CSMTEXTSETTINGS; struct SWF_DEFINEFONTNAME SWF_DEFINEFONTNAME; struct SWF_DEFINELOSSLESS SWF_DEFINELOSSLESS; struct SWF_DEFINELOSSLESS2 SWF_DEFINELOSSLESS2; struct SWF_DEFINEMORPHSHAPE SWF_DEFINEMORPHSHAPE; struct SWF_DEFINEMORPHSHAPE2 SWF_DEFINEMORPHSHAPE2; struct SWF_DEFINESHAPE SWF_DEFINESHAPE; struct SWF_DEFINESHAPE2 SWF_DEFINESHAPE2; struct SWF_DEFINESHAPE3 SWF_DEFINESHAPE3; struct SWF_DEFINESHAPE4 SWF_DEFINESHAPE4; struct SWF_DEFINESOUND SWF_DEFINESOUND; struct SWF_DEFINESPRITE SWF_DEFINESPRITE; struct SWF_DEFINETEXT SWF_DEFINETEXT; struct SWF_DEFINETEXT2 SWF_DEFINETEXT2; struct SWF_DEFINETEXTFORMAT SWF_DEFINETEXTFORMAT; struct SWF_DEFINEVIDEO SWF_DEFINEVIDEO; struct SWF_DEFINEVIDEOSTREAM SWF_DEFINEVIDEOSTREAM; struct SWF_DOACTION SWF_DOACTION; struct SWF_ENABLEDEBUGGER SWF_ENABLEDEBUGGER; struct SWF_ENABLEDEBUGGER2 SWF_ENABLEDEBUGGER2; struct SWF_END SWF_END; struct SWF_EXPORTASSETS SWF_EXPORTASSETS; struct SWF_FONTREF SWF_FONTREF; struct SWF_FRAMELABEL SWF_FRAMELABEL; struct SWF_FRAMETAG SWF_FRAMETAG; struct SWF_FREEALL SWF_FREEALL; struct SWF_FREECHARACTER SWF_FREECHARACTER; struct SWF_GENCOMMAND SWF_GENCOMMAND; struct SWF_IMPORTASSETS SWF_IMPORTASSETS; struct SWF_IMPORTASSETS2 SWF_IMPORTASSETS2; struct SWF_JPEGTABLES SWF_JPEGTABLES; struct SWF_NAMECHARACTER SWF_NAMECHARACTER; struct SWF_PATHSAREPOSTSCRIPT SWF_PATHSAREPOSTSCRIPT; struct SWF_PLACEOBJECT SWF_PLACEOBJECT; struct SWF_PLACEOBJECT2 SWF_PLACEOBJECT2; struct SWF_PLACEOBJECT3 SWF_PLACEOBJECT3; struct SWF_PREBUILT SWF_PREBUILT; struct SWF_PREBUILTCLIP SWF_PREBUILTCLIP; struct SWF_PROTECT SWF_PROTECT; struct SWF_REMOVEOBJECT SWF_REMOVEOBJECT; struct SWF_REMOVEOBJECT2 SWF_REMOVEOBJECT2; struct SWF_SERIALNUMBER SWF_SERIALNUMBER; struct SWF_SETBACKGROUNDCOLOR SWF_SETBACKGROUNDCOLOR; struct SWF_SHOWFRAME SWF_SHOWFRAME; struct SWF_SOUNDSTREAMBLOCK SWF_SOUNDSTREAMBLOCK; struct SWF_SOUNDSTREAMHEAD SWF_SOUNDSTREAMHEAD; struct SWF_SOUNDSTREAMHEAD2 SWF_SOUNDSTREAMHEAD2; struct SWF_STARTSOUND SWF_STARTSOUND; struct SWF_STARTSOUND2 SWF_STARTSOUND2; struct SWF_SYNCFRAME SWF_SYNCFRAME; struct SWF_INITACTION SWF_INITACTION; struct SWF_VIDEOFRAME SWF_VIDEOFRAME; struct SWF_REFLEX SWF_REFLEX; struct SWF_FILEATTRIBUTES SWF_FILEATTRIBUTES; struct SWF_METADATA SWF_METADATA; struct SWF_SCRIPTLIMITS SWF_SCRIPTLIMITS; struct SWF_DEFINESCALINGGRID SWF_DEFINESCALINGGRID; struct SWF_SETTABINDEX SWF_SETTABINDEX; struct SWF_DOABC SWF_DOABC; struct SWF_SYMBOLCLASS SWF_SYMBOLCLASS; struct SWF_DEFINEBINARYDATA SWF_DEFINEBINARYDATA; struct SWF_DEFINESCENEANDFRAMEDATA SWF_DEFINESCENEANDFRAMEDATA; struct SWF_DEBUGID SWF_DEBUGID; struct SWF_UNKNOWNBLOCK SWF_UNKNOWNBLOCK; } _inline_SWF_Parserstruct; struct SWF_Parserstruct_s { _inline_SWF_Parserstruct block; int offset; int length; }; typedef struct SWF_Parserstruct_s SWF_Parserstruct; #endif /* _SWFTYPES_H_ */ ming-0.4.5/util/listfdb.c0000644000175000017500000002125611454264373012162 00000000000000#include #include #include "blocks/blocktypes.h" #include "action.h" #define error(x) {puts(x); exit(1);} #define print(x) {fputs(x,stdout);} #define println(x) {fputs(indent(),stdout);fputs(x,stdout);putchar('\n');} int fileOffset = 0; int gIndent = 0; char indentBuf[256]; int lastIndent = 0; typedef unsigned char boolean; #define true (boolean)1 #define false (boolean)0 //char *blockName(Blocktype type); char *indent() { int i; if(gIndent>63) error("indent level > 63!"); if(lastIndent != gIndent) { for(i=0; i<3*gIndent; ++i) indentBuf[i] = ' '; indentBuf[i] = '\0'; lastIndent = gIndent; } return indentBuf; } int buffer; int bufbits = 0; /* # of bits in buffer */ void byteAlign() { if(bufbits > 0) { bufbits = 0; buffer = 0; } } int readBits(FILE *f, int number) { int ret = buffer; if(number == bufbits) { bufbits = 0; buffer = 0; return ret; } if(number > bufbits) { number -= bufbits; while(number>8) { ret <<= 8; ret += fgetc(f); ++fileOffset; number -= 8; } ++fileOffset; buffer = fgetc(f); if(number>0) { ret <<= number; bufbits = 8-number; ret += buffer >> (8-number); buffer &= (1<> (bufbits-number); bufbits -= number; buffer &= (1< 31) && (buf[k] < 128)) putchar(buf[k]); else putchar('.'); } putchar('\n'); if(j==length) break; } putchar('\n'); putchar('\n'); } void printMatrix(FILE *f) { int nBits; float num; byteAlign(); if(readBits(f, 1)) /* has scale */ { nBits = readBits(f, 5); num = (float)readSBits(f, nBits)/0x10000; printf("%sxScale: %f\n", indent(), num); num = (float)readSBits(f, nBits)/0x10000; printf("%syScale: %f\n", indent(), num); } if(readBits(f, 1)) /* has rotate */ { nBits = readBits(f, 5); num = (float)readSBits(f, nBits)/0x10000; printf("%srotate0: %f\n", indent(), num); num = (float)readSBits(f, nBits)/0x10000; printf("%srotate1: %f\n", indent(), num); } nBits = readBits(f, 5); printf("%sx: %i\n", indent(), readSBits(f, nBits)); printf("%sy: %i\n", indent(), readSBits(f, nBits)); } void printRect(FILE *f) { int nBits, xMin, xMax, yMin, yMax; byteAlign(); nBits = readBits(f, 5); xMin = readSBits(f, nBits); xMax = readSBits(f, nBits); yMin = readSBits(f, nBits); yMax = readSBits(f, nBits); printf("(%i,%i)x(%i,%i)", xMin, xMax, yMin, yMax); } int printShapeRec(FILE *f, int *lineBits, int *fillBits, int shapeType) { int type; printf("(%i:%i)",fileOffset,bufbits); type = readBits(f, 1); if(type==0) /* state change */ { int newStyles = readBits(f, 1); int lineStyle = readBits(f, 1); int fillStyle1 = readBits(f, 1); int fillStyle0 = readBits(f, 1); int moveTo = readBits(f, 1); if(newStyles==0 && lineStyle==0 && fillStyle1==0 && fillStyle0==0 && moveTo==0) { println("EndShape"); return 0; } if(moveTo==1) { int moveBits = readBits(f, 5); int x = readSBits(f, moveBits); int y = readSBits(f, moveBits); printf("%sMoveTo (%i) - (%i,%i)\n", indent(), moveBits, x, y); } if(fillStyle0==1) printf("%sFillStyle0: %i\n", indent(), readBits(f, *fillBits)); if(fillStyle1==1) printf("%sFillStyle1: %i\n", indent(), readBits(f, *fillBits)); if(lineStyle==1) printf("%sLineStyle1: %i\n", indent(), readBits(f, *lineBits)); } else /* it's an edge record */ { int straight = readBits(f, 1); int numBits = readBits(f, 4)+2; if(straight==1) { if(readBits(f, 1)) /* general line */ { int x = readSBits(f, numBits); int y = readSBits(f, numBits); printf("%sStraightEdge: (%i) - (%i,%i)\n", indent(), numBits, x, y); } else if(readBits(f, 1)) /* vert = 1 */ printf("%sStraightEdge: (%i) - (0,%i)\n", indent(), numBits, readSBits(f, numBits)); else printf("%sStraightEdge: (%i) - (%i,0)\n", indent(), numBits, readSBits(f, numBits)); } else { int controlX = readSBits(f, numBits); int controlY = readSBits(f, numBits); int anchorX = readSBits(f, numBits); int anchorY = readSBits(f, numBits); printf("%sCurvedEdge: (%i) - (%i,%i)->(%i,%i)\n", indent(), numBits, controlX, controlY, anchorX, anchorY); } } return 1; } #define FONTINFO2_HASLAYOUT (1<<7) #define FONTINFO2_SHIFTJIS (1<<6) #define FONTINFO2_UNICODE (1<<5) #define FONTINFO2_ANSI (1<<4) #define FONTINFO2_WIDEOFFSETS (1<<3) #define FONTINFO2_WIDECODES (1<<2) #define FONTINFO2_ITALIC (1<<1) #define FONTINFO2_BOLD (1<<0) void printDefineFont2(FILE *f) { int flags, nGlyphs, namelen, off, i, fillBits, lineBits; int here = fileOffset; unsigned int *offset; flags = readUInt8(f); readUInt8(f); /* "reserved" */ namelen = readUInt8(f); printf("%sFont Name: ", indent()); for(; namelen>0; --namelen) putchar((unsigned char)readUInt8(f)); putchar('\n'); nGlyphs = readUInt16(f); printf("%snumber of glyphs: %i\n\n", indent(), nGlyphs); offset = (unsigned int *)malloc(nGlyphs*sizeof(int)); /* offset table */ here = fileOffset; for(i=0; i<=nGlyphs; ++i) { if(flags & FONTINFO2_WIDEOFFSETS) off = readUInt32(f); else off = readUInt16(f); offset[i] = off-nGlyphs*4-4; printf("%sOffset%i: %i\n", indent(), i, offset[i]); } here = fileOffset; /* shape table */ for(i=0; i * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include #include #include #include "blocks/blocktypes.h" #include "abctypes.h" #include "action.h" #include "decompile.h" #include "parser.h" #include "read.h" #include "blocks/error.h" extern struct Movie m; extern SWF_Parserstruct *blockParse (FILE *f, int length, SWFBlocktype header); const char *blockName (SWFBlocktype header); void silentSkipBytes(FILE *f, int length); #define PAR_BEGIN(block) \ struct block *parserrec; \ SWF_Parserstruct *pstruct; \ pstruct = calloc(1, sizeof(SWF_Parserstruct)); \ pstruct->length = length; \ pstruct->offset = fileOffset - ( (length >= 63 ) ? 6 : 2) ; \ parserrec= (struct block *)pstruct; \ #define PAR_END \ return (SWF_Parserstruct *)parserrec; #define SKIP \ printf("skipping %i bytes\n", length); \ readBytes(f, length); /* Parse Basic Flash types */ void parseSWF_RGB (FILE * f, struct SWF_RGBA *rgb) { rgb->red = readUInt8 (f); rgb->green = readUInt8 (f); rgb->blue = readUInt8 (f); rgb->alpha = 255; } void parseSWF_RGBA (FILE * f, struct SWF_RGBA *rgb) { rgb->red = readUInt8 (f); rgb->green = readUInt8 (f); rgb->blue = readUInt8 (f); rgb->alpha = readUInt8 (f); } void parseSWF_RECT (FILE * f, struct SWF_RECT *rect) { byteAlign (); rect->Nbits = readBits (f, 5); rect->Xmin = readSBits (f, rect->Nbits); rect->Xmax = readSBits (f, rect->Nbits); rect->Ymin = readSBits (f, rect->Nbits); rect->Ymax = readSBits (f, rect->Nbits); } void parseSWF_MATRIX (FILE * f, struct SWF_MATRIX *matrix) { byteAlign (); matrix->HasScale = readBits (f, 1); if (matrix->HasScale) { matrix->NScaleBits = readBits (f, 5); matrix->ScaleX = (float) readSBits (f, matrix->NScaleBits) / 0x10000; matrix->ScaleY = (float) readSBits (f, matrix->NScaleBits) / 0x10000; } matrix->HasRotate = readBits (f, 1); if (matrix->HasRotate) { matrix->NRotateBits = readBits (f, 5); matrix->RotateSkew0 = (float) readSBits (f, matrix->NRotateBits) / 0x10000; matrix->RotateSkew1 = (float) readSBits (f, matrix->NRotateBits) / 0x10000; } matrix->NTranslateBits = readBits (f, 5); matrix->TranslateX = readSBits (f, matrix->NTranslateBits); matrix->TranslateY = readSBits (f, matrix->NTranslateBits); byteAlign(); } void parseSWF_FILTERLIST(FILE *f, SWF_FILTERLIST *list); int parseSWF_BUTTONRECORD (FILE * f, struct SWF_BUTTONRECORD *brec, int level) { byteAlign (); brec->ButtonReserved = readBits (f, 2); brec->ButtonHasBlendMode = readBits(f, 1); brec->ButtonHasFilterList = readBits(f, 1); brec->ButtonStateHitTest = readBits (f, 1); brec->ButtonStateDown = readBits (f, 1); brec->ButtonStateOver = readBits (f, 1); brec->ButtonStateUp = readBits (f, 1); if( brec->ButtonStateHitTest == 0 && brec->ButtonStateDown == 0 && brec->ButtonStateOver == 0 && brec->ButtonStateUp == 0 && brec->ButtonHasBlendMode == 0 && brec->ButtonHasFilterList == 0 && brec->ButtonReserved == 0) return 0; // CharacterEndFlag brec->CharacterId = readUInt16 (f); brec->PlaceDepth = readUInt16 (f); parseSWF_MATRIX (f, &brec->PlaceMatrix); if( level > 1 ) parseSWF_CXFORMWITHALPHA (f, &brec->ColorTransform); if ( brec->ButtonHasFilterList ) parseSWF_FILTERLIST(f, &brec->FilterList); if ( brec->ButtonHasBlendMode ) brec->BlendMode = readUInt8(f); return 1; } int parseSWF_BUTTONCONDACTION (FILE * f, struct SWF_BUTTONCONDACTION *bcarec, int end) { int actionEnd, start; byteAlign (); start = fileOffset; bcarec->CondActionSize = readUInt16 (f); bcarec->CondIdleToOverDown = readBits (f, 1); bcarec->CondOutDownToIdle = readBits (f, 1); bcarec->CondOutDownToOverDown = readBits (f, 1); bcarec->CondOverDownToOutDown = readBits (f, 1); bcarec->CondOverDownToOverUp = readBits (f, 1); bcarec->CondOverUpToOverDown = readBits (f, 1); bcarec->CondOverUpToIdle = readBits (f, 1); bcarec->CondIdleToOverUp = readBits (f, 1); bcarec->CondKeyPress = readBits (f, 7); bcarec->CondOverDownToIdle = readBits (f, 1); bcarec->Actions = (SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); bcarec->numActions = 0; while ( parseSWF_ACTIONRECORD (f, &(bcarec->numActions), bcarec->Actions) ) { bcarec->Actions = (SWF_ACTION *) realloc (bcarec->Actions, (++bcarec-> numActions + 1) * sizeof (SWF_ACTION)); } if(bcarec->CondActionSize > 0) actionEnd = start + bcarec->CondActionSize; else actionEnd = end; if(fileOffset >= actionEnd) { SWF_warn("parseSWF_BUTTONCONDACTION: expected actionEnd flag\n"); return bcarec->CondActionSize; } /* read end action flag only there are realy action records * if there are no actionrecords parseSWF_ACTIONRECORD did already * read end action */ if(bcarec->numActions > 0) readUInt8(f); return bcarec->CondActionSize; } void parseSWF_CXFORM (FILE * f, struct SWF_CXFORM *cxform) { byteAlign (); cxform->HasAddTerms = readBits (f, 1); cxform->HasMultTerms = readBits (f, 1); cxform->Nbits = readBits (f, 4); if( cxform->HasMultTerms ) { cxform->RedMultTerm = readSBits(f, cxform->Nbits ); cxform->GreenMultTerm = readSBits(f, cxform->Nbits ); cxform->BlueMultTerm = readSBits(f, cxform->Nbits ); } if( cxform->HasAddTerms ) { cxform->RedAddTerm = readSBits(f, cxform->Nbits ); cxform->GreenAddTerm = readSBits(f, cxform->Nbits ); cxform->BlueAddTerm = readSBits(f, cxform->Nbits ); } } void parseSWF_CXFORMWITHALPHA (FILE * f, struct SWF_CXFORMWITHALPHA *cxform) { byteAlign (); cxform->HasAddTerms = readBits (f, 1); cxform->HasMultTerms = readBits (f, 1); cxform->Nbits = readBits (f, 4); if( cxform->HasMultTerms ) { cxform->RedMultTerm = readSBits(f, cxform->Nbits ); cxform->GreenMultTerm = readSBits(f, cxform->Nbits ); cxform->BlueMultTerm = readSBits(f, cxform->Nbits ); cxform->AlphaMultTerm = readSBits(f, cxform->Nbits ); } if( cxform->HasAddTerms ) { cxform->RedAddTerm = readSBits(f, cxform->Nbits ); cxform->GreenAddTerm = readSBits(f, cxform->Nbits ); cxform->BlueAddTerm = readSBits(f, cxform->Nbits ); cxform->AlphaAddTerm = readSBits(f, cxform->Nbits ); } } void parseSWF_GLYPHENTRY (FILE * f, SWF_GLYPHENTRY *gerec, int glyphbits, int advancebits) { int i; size_t nmalloc = ( glyphbits < 1 ? 1 : ((glyphbits+31)/32) ) * sizeof(UI32); gerec->GlyphIndex = malloc(nmalloc); gerec->GlyphIndex[0] = 0; /* for glyphbits == 0 */ for( i=0; glyphbits; i++ ) { if( glyphbits > 32 ) { gerec->GlyphIndex[i] = readBits(f, 32); glyphbits -= 32; } else { gerec->GlyphIndex[i] = readBits(f, glyphbits); glyphbits = 0; } } nmalloc = ( advancebits < 1 ? 1 : ((advancebits+31)/32) ) * sizeof(UI32); gerec->GlyphAdvance = malloc(nmalloc); gerec->GlyphAdvance[0] = 0; /* for advancebits == 0 */ for( i=0; advancebits; i++ ) { if( advancebits > 32 ) { gerec->GlyphAdvance[i] = readBits(f, 32); advancebits -= 32; } else { gerec->GlyphAdvance[i] = readBits(f, advancebits); advancebits = 0; } } } int parseSWF_TEXTRECORD (FILE * f, struct SWF_TEXTRECORD *brec, int glyphbits, int advancebits, int level) { int i; byteAlign (); brec->TextRecordType = readBits (f, 1); brec->StyleFlagsReserved = readBits (f, 3); brec->StyleFlagHasFont = readBits (f, 1); brec->StyleFlagHasColor = readBits (f, 1); brec->StyleFlagHasYOffset = readBits (f, 1); brec->StyleFlagHasXOffset = readBits (f, 1); if( brec->TextRecordType == 0 ) return 0; if( brec->StyleFlagHasFont ) brec->FontID = readUInt16 (f); if( brec->StyleFlagHasColor ) { if( level > 1 ) parseSWF_RGBA(f, &brec->TextColor ); else parseSWF_RGB(f, &brec->TextColor ); } if( brec->StyleFlagHasXOffset ) brec->XOffset = readSInt16 (f); if( brec->StyleFlagHasYOffset ) brec->YOffset = readSInt16 (f); if( brec->StyleFlagHasFont ) brec->TextHeight = readUInt16 (f); brec->GlyphCount = readUInt8 (f); brec->GlyphEntries = malloc(brec->GlyphCount * sizeof(SWF_GLYPHENTRY) ); byteAlign (); for(i=0;iGlyphCount;i++) parseSWF_GLYPHENTRY(f, &(brec->GlyphEntries[i]), glyphbits, advancebits ); return 1; } int parseSWF_CLIPEVENTFLAGS (FILE * f, struct SWF_CLIPEVENTFLAGS *cflags) { byteAlign (); cflags->ClipEventKeyUp = readBits (f, 1); cflags->ClipEventKeyDown = readBits (f, 1); cflags->ClipEventMouseUp = readBits (f, 1); cflags->ClipEventMouseDown = readBits (f, 1); cflags->ClipEventMouseMove = readBits (f, 1); cflags->ClipEventUnload = readBits (f, 1); cflags->ClipEventEnterFrame = readBits (f, 1); cflags->ClipEventLoad = readBits (f, 1); cflags->ClipEventDragOver = readBits (f, 1); cflags->ClipEventRollOut = readBits (f, 1); cflags->ClipEventRollOver = readBits (f, 1); cflags->ClipEventReleaseOutside = readBits (f, 1); cflags->ClipEventRelease = readBits (f, 1); cflags->ClipEventPress = readBits (f, 1); cflags->ClipEventInitialize = readBits (f, 1); cflags->ClipEventData = readBits (f, 1); if( m.version >= 6 ) { cflags->Reserved = readBits (f, 5); cflags->ClipEventConstruct = readBits (f, 1); cflags->ClipEventKeyPress = readBits (f, 1); cflags->ClipEventDragOut = readBits (f, 1); cflags->Reserved2 = readBits (f, 8); } else { cflags->Reserved = 0; cflags->ClipEventConstruct = 0; cflags->ClipEventKeyPress = 0; cflags->ClipEventDragOut = 0; cflags->Reserved2 = 0; } return cflags->ClipEventKeyUp|cflags->ClipEventKeyDown|cflags->ClipEventMouseUp|cflags->ClipEventMouseDown|cflags->ClipEventMouseMove|cflags->ClipEventUnload|cflags->ClipEventEnterFrame|cflags->ClipEventLoad|cflags->ClipEventDragOver|cflags->ClipEventRollOut|cflags->ClipEventRollOver|cflags->ClipEventReleaseOutside|cflags->ClipEventRelease|cflags->ClipEventPress|cflags->ClipEventInitialize|cflags->ClipEventData|cflags->ClipEventConstruct|cflags->ClipEventKeyPress|cflags->ClipEventDragOut; } int parseSWF_CLIPACTIONRECORD (FILE * f, struct SWF_CLIPACTIONRECORD *carec) { int length,end; byteAlign (); if( parseSWF_CLIPEVENTFLAGS( f, &(carec->EventFlag) ) == 0 ) return 0; carec->ActionRecordSize = readUInt32 (f); if( carec->EventFlag.ClipEventKeyPress ) { carec->KeyCode = readUInt8 (f); length = carec->ActionRecordSize-1; } else { length = carec->ActionRecordSize; } end = fileOffset + length; /* carec->Actions = decompile5Action (f, length, 1); */ carec->Actions = (SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); carec->numActions = 0; while ( fileOffset < end ) { parseSWF_ACTIONRECORD (f, &(carec->numActions), carec->Actions); carec->Actions = (SWF_ACTION *) realloc (carec->Actions, (++carec-> numActions + 1) * sizeof (SWF_ACTION)); } return 1; } void parseSWF_CLIPACTIONS (FILE * f, struct SWF_CLIPACTIONS *clipact, int end) { byteAlign (); clipact->Reserved = readUInt16 (f); parseSWF_CLIPEVENTFLAGS( f, &(clipact->AllEventFlags) ); clipact->ClipActionRecords = (SWF_CLIPACTIONRECORD *) calloc (1, sizeof (SWF_CLIPACTIONRECORD)); clipact->NumClipRecords = 0; while (parseSWF_CLIPACTIONRECORD (f, &(clipact->ClipActionRecords[clipact->NumClipRecords++]) ) ) { if(fileOffset >= end) return; clipact->ClipActionRecords = (SWF_CLIPACTIONRECORD *) realloc (clipact->ClipActionRecords, (clipact-> NumClipRecords + 1) * sizeof (SWF_CLIPACTIONRECORD)); } clipact->ClipActionEndFlag = readUInt16(f); } void parseSWF_GRADIENTRECORD (FILE * f, struct SWF_GRADIENTRECORD *gradientrec, int level) { gradientrec->Ratio = readUInt8 (f); if (level < 3) parseSWF_RGB (f, &gradientrec->Color); else parseSWF_RGBA (f, &gradientrec->Color); } void parseSWF_FOCALGRADIENT (FILE * f, struct SWF_FOCALGRADIENT *gradient, int level) { int i; gradient->SpreadMode = readBits(f, 2); gradient->InterpolationMode = readBits(f, 2); gradient->NumGradients = readBits (f, 4); if(gradient->NumGradients > 15) { fprintf(stderr, "%d gradients in SWF_FOCALGRADIENT, expected a max of 15\n", gradient->NumGradients ); /*exit(1);*/ } for (i = 0; i < gradient->NumGradients; i++) parseSWF_GRADIENTRECORD (f, &(gradient->GradientRecords[i]), level); gradient->FocalPoint = readUInt16(f); } void parseSWF_GRADIENT (FILE * f, struct SWF_GRADIENT *gradient, int level) { int i; gradient->SpreadMode = readBits(f, 2); gradient->InterpolationMode = readBits(f, 2); gradient->NumGradients = readBits (f, 4); if((gradient->NumGradients > 8 && level < 4) || (gradient->NumGradients > 15 && level == 4)) { fprintf(stderr, "%d gradients in SWF_GRADiENT, expected a max of %d\n", gradient->NumGradients, level<4 ? 8 : 15 ); /*exit(1);*/ } for (i = 0; i < gradient->NumGradients; i++) parseSWF_GRADIENTRECORD (f, &(gradient->GradientRecords[i]), level); } int parseSWF_SHAPERECORD (FILE * f, SWF_SHAPERECORD * shape, int *fillBits, int *lineBits, int level) { UI16 tmpbits; memset (shape, 0, sizeof (SWF_SHAPERECORD)); shape->EndShape.TypeFlag = readBits (f, 1); if (shape->EndShape.TypeFlag) { /* An Edge Record */ shape->StraightEdge.StraightEdge = readBits (f, 1); if (shape->StraightEdge.StraightEdge == 1) { /* A Straight Edge Record */ shape->StraightEdge.NumBits = readBits (f, 4); shape->StraightEdge.GeneralLineFlag = readBits (f, 1); if (shape->StraightEdge.GeneralLineFlag) { shape->StraightEdge.DeltaX = readSBits (f, shape->StraightEdge.NumBits + 2); shape->StraightEdge.DeltaY = readSBits (f, shape->StraightEdge.NumBits + 2); } else { shape->StraightEdge.VertLineFlag = readBits (f, 1); if (shape->StraightEdge.VertLineFlag) { shape->StraightEdge.VLDeltaY = readSBits (f, shape->StraightEdge.NumBits + 2); } else { shape->StraightEdge.VLDeltaX = readSBits (f, shape->StraightEdge.NumBits + 2); } } } else { /* A Curved Edge Record */ shape->CurvedEdge.NumBits = readBits (f, 4); shape->CurvedEdge.ControlDeltaX = readSBits (f, shape->CurvedEdge.NumBits + 2); shape->CurvedEdge.ControlDeltaY = readSBits (f, shape->CurvedEdge.NumBits + 2); shape->CurvedEdge.AnchorDeltaX = readSBits (f, shape->CurvedEdge.NumBits + 2); shape->CurvedEdge.AnchorDeltaY = readSBits (f, shape->CurvedEdge.NumBits + 2); } } else { /* A Non-Edge Record */ tmpbits = readBits (f, 5); if (tmpbits == 0) { /* EndShapeRecord */ shape->EndShape.EndOfShape = 0; return 0; } /* StyleChangeRecord - ie one or more of the next 5 bits are set */ if (tmpbits & (1 << 4)) shape->StyleChange.StateNewStyles = 1; if (tmpbits & (1 << 3)) shape->StyleChange.StateLineStyle = 1; if (tmpbits & (1 << 2)) shape->StyleChange.StateFillStyle1 = 1; if (tmpbits & (1 << 1)) shape->StyleChange.StateFillStyle0 = 1; if (tmpbits & (1 << 0)) shape->StyleChange.StateMoveTo = 1; if (shape->StyleChange.StateMoveTo) { shape->StyleChange.MoveBits = readBits (f, 5); shape->StyleChange.MoveDeltaX = readSBits (f, shape->StyleChange.MoveBits); shape->StyleChange.MoveDeltaY = readSBits (f, shape->StyleChange.MoveBits); } if (shape->StyleChange.StateFillStyle0) { shape->StyleChange.FillStyle0 = readBits (f, *fillBits); } if (shape->StyleChange.StateFillStyle1) { shape->StyleChange.FillStyle1 = readBits (f, *fillBits); } if (shape->StyleChange.StateLineStyle) { shape->StyleChange.LineStyle = readBits (f, *lineBits); } if (shape->StyleChange.StateNewStyles) { parseSWF_FILLSTYLEARRAY (f, &(shape->StyleChange.FillStyles), level); parseSWF_LINESTYLEARRAY (f, &(shape->StyleChange.LineStyles), level); shape->StyleChange.NumFillBits = *fillBits = readBits (f, 4); shape->StyleChange.NumLineBits = *lineBits = readBits (f, 4); } } return 1; } void parseSWF_FILLSTYLE (FILE * f, SWF_FILLSTYLE * fillstyle, int level) { fillstyle->FillStyleType = readUInt8 (f); switch (fillstyle->FillStyleType) { case 0x00: /* Solid Fill */ if (level < 3) parseSWF_RGB (f, &fillstyle->Color); else parseSWF_RGBA (f, &fillstyle->Color); break; case 0x10: /* Linear Gradient Fill */ case 0x12: /* Radial Gradient Fill */ parseSWF_MATRIX (f, &fillstyle->GradientMatrix); parseSWF_GRADIENT (f, &fillstyle->Gradient, level); break; case 0x13: parseSWF_MATRIX (f, &fillstyle->GradientMatrix); parseSWF_FOCALGRADIENT(f, &fillstyle->FocalGradient, level); break; case 0x40: /* Repeating Bitmap Fill */ case 0x41: /* Clipped Bitmap Fill */ case 0x42: /* Non-smoothed Repeating Bitmap Fill */ case 0x43: /* Non-smoothed Clipped Bitmap Fill */ fillstyle->BitmapId = readUInt16 (f); parseSWF_MATRIX (f, &fillstyle->BitmapMatrix); break; } } void parseSWF_FILLSTYLEARRAY (FILE * f, SWF_FILLSTYLEARRAY * fillstyle, int level) { int count, i; fillstyle->FillStyleCount = readUInt8 (f); count = fillstyle->FillStyleCount; if (fillstyle->FillStyleCount == 0xff) { fillstyle->FillStyleCountExtended = readUInt16 (f); count = fillstyle->FillStyleCountExtended; } fillstyle->FillStyles = (SWF_FILLSTYLE *) calloc (count, sizeof (SWF_FILLSTYLE)); for (i = 0; i < count; i++) { parseSWF_FILLSTYLE (f, &(fillstyle->FillStyles[i]), level); } } void parseSWF_LINESTYLE (FILE * f, SWF_LINESTYLE * linestyle, int level) { linestyle->Width = readUInt16 (f); if (level < 3) parseSWF_RGB (f, &linestyle->Color); else parseSWF_RGBA (f, &linestyle->Color); } void parseSWF_LINESTYLE2 (FILE *f, SWF_LINESTYLE2 *linestyle2, int level) { linestyle2->Width = readUInt16(f); linestyle2->StartCapStyle = readBits(f, 2); linestyle2->JoinStyle = readBits(f, 2); linestyle2->HasFillFlag = readBits(f, 1); linestyle2->NoHScaleFlag = readBits(f, 1); linestyle2->NoVScaleFlag = readBits(f, 1); linestyle2->PixelHintingFlag = readBits(f, 1); linestyle2->Reserved = readBits(f, 5); linestyle2->NoClose = readBits(f, 1); linestyle2->EndCapStyle = readBits(f, 2); if(linestyle2->JoinStyle == 2) linestyle2->MiterLimitFactor = readUInt16(f); if(linestyle2->HasFillFlag == 0) parseSWF_RGBA (f, &linestyle2->Color); else parseSWF_FILLSTYLE(f, &linestyle2->FillType, level); } void parseSWF_LINESTYLEARRAY (FILE * f, SWF_LINESTYLEARRAY * linestyle, int level) { int count, i; count = readUInt8 (f); if (count == 0xff) { count = readUInt16(f); } linestyle->LineStyleCount = count; if(level == 4) { linestyle->LineStyles = NULL; linestyle->LineStyles2 = (SWF_LINESTYLE2 *) malloc (count * sizeof (SWF_LINESTYLE2)); } else { linestyle->LineStyles = (SWF_LINESTYLE *) malloc (count * sizeof (SWF_LINESTYLE)); linestyle->LineStyles2 = NULL; } for (i = 0; i < count; i++) { if(level == 4) parseSWF_LINESTYLE2 (f, &(linestyle->LineStyles2[i]), level); else parseSWF_LINESTYLE (f, &(linestyle->LineStyles[i]), level); } } void parseSWF_MORPHLINESTYLE (FILE * f, SWF_MORPHLINESTYLE * linestyle) { linestyle->StartWidth = readUInt16 (f); linestyle->EndWidth = readUInt16 (f); parseSWF_RGBA (f, &linestyle->StartColor); parseSWF_RGBA (f, &linestyle->EndColor); } void parseSWF_MORPHFILLSTYLE (FILE * f, SWF_MORPHFILLSTYLE * fillstyle ); void parseSWF_MORPHLINESTYLE2 (FILE * f, SWF_MORPHLINESTYLE2 * linestyle2) { linestyle2->StartWidth = readUInt16 (f); linestyle2->EndWidth = readUInt16 (f); linestyle2->StartCapStyle = readBits(f, 2); linestyle2->JoinStyle = readBits(f, 2); linestyle2->HasFillFlag = readBits(f, 1); linestyle2->NoHScaleFlag = readBits(f, 1); linestyle2->NoVScaleFlag = readBits(f, 1); linestyle2->PixelHintingFlag = readBits(f, 1); linestyle2->Reserved = readBits(f, 5); linestyle2->NoClose = readBits(f, 1); linestyle2->EndCapStyle = readBits(f, 2); if(linestyle2->JoinStyle == 2) linestyle2->MiterLimitFactor = readUInt16(f); if(linestyle2->HasFillFlag == 0) { parseSWF_RGBA (f, &linestyle2->StartColor); parseSWF_RGBA (f, &linestyle2->EndColor); } else parseSWF_MORPHFILLSTYLE(f, &linestyle2->FillType); } void parseSWF_MORPHLINESTYLES (FILE * f, SWF_MORPHLINESTYLES * linestyle, int version) { int count, i; linestyle->LineStyleCount = readUInt8 (f); count = linestyle->LineStyleCount; if (linestyle->LineStyleCount == 0xff) { linestyle->LineStyleCountExtended = readUInt16 (f); count = linestyle->LineStyleCountExtended; } if(version == 1) linestyle->LineStyles = (SWF_MORPHLINESTYLE *) malloc (count * sizeof (SWF_MORPHLINESTYLE)); else if(version == 2) linestyle->LineStyles2 = (SWF_MORPHLINESTYLE2 *) malloc (count * sizeof (SWF_MORPHLINESTYLE2)); for (i = 0; i < count; i++) { if(version == 1) parseSWF_MORPHLINESTYLE (f, &(linestyle->LineStyles[i])); else if(version == 2) parseSWF_MORPHLINESTYLE2 (f, &(linestyle->LineStyles2[i])); else SWF_error("parseSWF_MORPHLINESTYLES: unknow MORPH version\n"); } } void parseSWF_MORPHGRADIENTRECORD (FILE * f, struct SWF_MORPHGRADIENTRECORD *gradientrec) { gradientrec->StartRatio = readUInt8 (f); parseSWF_RGBA (f, &gradientrec->StartColor); gradientrec->EndRatio = readUInt8 (f); parseSWF_RGBA (f, &gradientrec->EndColor); } void parseSWF_MORPHGRADIENT (FILE * f, struct SWF_MORPHGRADIENT *gradient) { int i; gradient->NumGradients = readUInt8 (f); if( gradient->NumGradients > 8 ) { fprintf(stderr, "%d gradients in SWF_MORPHGRADiENT, expected a max of 8", gradient->NumGradients); /*exit(1);*/ } for (i = 0; i < gradient->NumGradients; i++) parseSWF_MORPHGRADIENTRECORD (f, &(gradient->GradientRecords[i])); } void parseSWF_MORPHFILLSTYLE (FILE * f, SWF_MORPHFILLSTYLE * fillstyle ) { fillstyle->FillStyleType = readUInt8 (f); switch (fillstyle->FillStyleType) { case 0x00: /* Solid Fill */ parseSWF_RGBA (f, &fillstyle->StartColor); parseSWF_RGBA (f, &fillstyle->EndColor); break; case 0x10: /* Linear Gradient Fill */ case 0x12: /* Radial Gradient Fill */ parseSWF_MATRIX (f, &fillstyle->StartGradientMatrix); parseSWF_MATRIX (f, &fillstyle->EndGradientMatrix); parseSWF_MORPHGRADIENT (f, &fillstyle->Gradient); break; case 0x40: /* Repeating Bitmap Fill */ case 0x41: /* Clipped Bitmap Fill */ case 0x42: /* Non-smoothed Repeating Bitmap Fill */ case 0x43: /* Non-smoothed Clipped Bitmap Fill */ fillstyle->BitmapId = readUInt16 (f); parseSWF_MATRIX (f, &fillstyle->StartBitmapMatrix); parseSWF_MATRIX (f, &fillstyle->EndBitmapMatrix); break; } } void parseSWF_MORPHFILLSTYLES (FILE * f, SWF_MORPHFILLSTYLES * fillstyle ) { int count, i; fillstyle->FillStyleCount = readUInt8 (f); count = fillstyle->FillStyleCount; if (fillstyle->FillStyleCount == 0xff) { fillstyle->FillStyleCountExtended = readUInt16 (f); count = fillstyle->FillStyleCountExtended; } fillstyle->FillStyles = (SWF_MORPHFILLSTYLE *) calloc (count, sizeof (SWF_MORPHFILLSTYLE)); for (i = 0; i < count; i++) { parseSWF_MORPHFILLSTYLE (f, &(fillstyle->FillStyles[i])); } } void parseSWF_SHAPE (FILE * f, SWF_SHAPE * shape, int level, int len) { int fillBits, lineBits; int end; byteAlign (); end = fileOffset + len; shape->NumFillBits = fillBits = readBits (f, 4); shape->NumLineBits = lineBits = readBits (f, 4); shape->ShapeRecords = (SWF_SHAPERECORD *) calloc (1, sizeof (SWF_SHAPERECORD)); shape->NumShapeRecords = 0; while (fileOffset < end) { size_t size; SWF_SHAPERECORD *rec = &(shape->ShapeRecords[shape->NumShapeRecords]); int ret = parseSWF_SHAPERECORD(f, rec, &fillBits, &lineBits, level); if(!ret) return; shape->NumShapeRecords++; size = (shape->NumShapeRecords + 1) * sizeof(SWF_SHAPERECORD); shape->ShapeRecords = (SWF_SHAPERECORD *)realloc (shape->ShapeRecords, size); } } void parseSWF_SHAPEWITHSTYLE (FILE * f, SWF_SHAPEWITHSTYLE * shape, int level) { int fillBits, lineBits; memset (shape, 0, sizeof (SWF_SHAPEWITHSTYLE)); parseSWF_FILLSTYLEARRAY (f, &shape->FillStyles, level); parseSWF_LINESTYLEARRAY (f, &shape->LineStyles, level); byteAlign (); shape->NumFillBits = fillBits = readBits (f, 4); shape->NumLineBits = lineBits = readBits (f, 4); shape->ShapeRecords = (SWF_SHAPERECORD *) calloc (1, sizeof (SWF_SHAPERECORD)); shape->NumShapeRecords = 0; while (parseSWF_SHAPERECORD (f, &(shape->ShapeRecords[shape->NumShapeRecords++]), &fillBits, &lineBits, level)) { shape->ShapeRecords = (SWF_SHAPERECORD *) realloc (shape->ShapeRecords, (shape-> NumShapeRecords + 1) * sizeof (SWF_SHAPERECORD)); } } /* Parse Action types */ #define ACT_BEGIN(acttype) \ struct acttype *act;\ act=(struct acttype *)action; \ act->Length = readUInt16(f); #define ACT_BEGIN_NOLEN(acttype) \ struct acttype *act;\ act=(struct acttype *)action; int parseSWF_ACTIONRECORD(FILE * f, int *thisactionp, SWF_ACTION *actions) { int thisaction = *thisactionp; SWF_ACTION *action = &(actions[thisaction]); //fprintf(stderr,"ACTION[%d] Offset %d\n", thisaction, fileOffset ); action->SWF_ACTIONRECORD.Offset = fileOffset; /* remember where it came from */ if( (action->SWF_ACTIONRECORD.ActionCode = readUInt8(f)) == SWFACTION_END ) return 0; /* * Actions without the high bit set take no additional * arguments, so we are done for these types. */ if( !(action->SWF_ACTIONRECORD.ActionCode&0x80) ) { action->SWF_ACTIONRECORD.Length = 1; /* Fill in the size for later use */ return 1; } action->SWF_ACTIONRECORD.Length = 0; /* make valgrind happy */ /* * Actions with the high bit set take additional * arguments, so we have to parse each one uniquely. */ switch( action->SWF_ACTIONRECORD.ActionCode ) { /* v3 actions */ case SWFACTION_GOTOFRAME: { ACT_BEGIN(SWF_ACTIONGOTOFRAME) act->Frame = readUInt16(f); break; } case SWFACTION_GETURL: { ACT_BEGIN(SWF_ACTIONGETURL) act->UrlString = readString(f); act->TargetString = readString(f); break; } case SWFACTION_WAITFORFRAME: { ACT_BEGIN(SWF_ACTIONWAITFORFRAME) act->Frame = readUInt16(f); act->SkipCount = readUInt8(f); break; } case SWFACTION_SETTARGET: { ACT_BEGIN(SWF_ACTIONSETTARGET) act->TargetName = readString(f); break; } case SWFACTION_GOTOLABEL: { ACT_BEGIN(SWF_ACTIONGOTOLABEL) act->FrameLabel = readString(f); break; } /* v4 actions */ case SWFACTION_PUSH: { int end; struct SWF_ACTIONPUSHPARAM *param; ACT_BEGIN(SWF_ACTIONPUSH) end = fileOffset + act->Length; act->Params = (struct SWF_ACTIONPUSHPARAM *) calloc (1, sizeof (struct SWF_ACTIONPUSHPARAM)); act->NumParam = 0; while ( fileOffset < end ) { param = &(act->Params[act->NumParam++]); param->Type = readUInt8(f); switch( param->Type ) { case 0: /* STRING */ param->p.String = readString(f); break; case 1: /* FLOAT */ param->p.Float = readFloat(f); break; case 2: /* NULL */ case 3: /* Undefined */ break; case 4: /* Register */ param->p.RegisterNumber = readUInt8(f); break; case 5: /* BOOLEAN */ param->p.Boolean = readUInt8(f); break; case 6: /* DOUBLE */ param->p.Double = readDouble(f); break; case 7: /* INTEGER */ param->p.Integer = readSInt32(f); break; case 8: /* CONSTANT8 */ param->p.Constant8 = readUInt8(f); break; case 9: /* CONSTANT16 */ param->p.Constant16 = readUInt16(f); break; default: printf("Unknown data type to push %x\n", param->Type ); exit(1); } act->Params = (struct SWF_ACTIONPUSHPARAM *) realloc (act->Params, (act->NumParam + 1) * sizeof (struct SWF_ACTIONPUSHPARAM)); } break; } case SWFACTION_LOGICALNOT: { ACT_BEGIN_NOLEN(SWF_ACTIONNOT) act->Boolean = readUInt32(f); fprintf(stderr,"NOT param: %d\n", act->Boolean ); break; } case SWFACTION_CALLFRAME: { ACT_BEGIN(SWF_ACTIONCALL) // readUInt16(f); /* seems to be an exception: NO reading here */ break; } case SWFACTION_JUMP: { ACT_BEGIN(SWF_ACTIONJUMP) act->BranchOffset = readUInt16(f); break; } case SWFACTION_IF: { int i,j,k, curroffset; ACT_BEGIN(SWF_ACTIONIF) act->BranchOffset = readUInt16(f); /* * Set curroffset to point to the next action so that an * offset of zero matches it. */ curroffset=(action->SWF_ACTIONRECORD.Offset-actions[0].SWF_ACTIONRECORD.Offset)+ action->SWF_ACTIONRECORD.Length+3; /* Action + Length bytes not included in the length */ if( act->BranchOffset < 0 ) { /* * We are branching to records that we already have in the array. Just * allocate new space for the if clause, and copy the records there, and then * fix the count of records in actions[], and put this record at the new * end of actions[]. */ for(i=0;i<=thisaction;i++) { if( (actions[i].SWF_ACTIONRECORD.Offset-actions[0].SWF_ACTIONRECORD.Offset) == curroffset+act->BranchOffset ) break; } if( i>=thisaction ) { SWF_warn("Failed to find branch target!!!\n"); SWF_warn("Looking for: %d\n\n", curroffset + act->BranchOffset); act->BranchOffset=0; /* despite the problem ..*/ i=thisaction; /* ..continue with empty block */ } act->numActions = thisaction-i; act->Actions = (union SWF_ACTION *) calloc (act->numActions, sizeof (SWF_ACTION)); for(j=i,k=0;jActions[k] = actions[j]; actions[i]=*((SWF_ACTION *)act); /* added by ak,2006 */ *thisactionp = i; } else { /* * We are branching to records not yet parsed. Just handle this in the * same manner used for with, try, etc. */ act->Actions = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numActions = 0; while ( (fileOffset-actions[0].SWF_ACTIONRECORD.Offset) < curroffset+act->BranchOffset ) { parseSWF_ACTIONRECORD (f, &(act->numActions), (SWF_ACTION *)act->Actions); act->Actions = (union SWF_ACTION *) realloc (act->Actions, (++act->numActions + 1) * sizeof (SWF_ACTION)); } } break; } case SWFACTION_GETURL2: { ACT_BEGIN(SWF_ACTIONGETURL2) // act->f.Flags = readUInt8(f); act->f.FlagBits.LoadTargetFlag = readBits(f,1); act->f.FlagBits.LoadVariableFlag = readBits(f,1); act->f.FlagBits.Reserved = readBits(f,4); act->f.FlagBits.SendVarsMethod = readBits(f,2); break; } case SWFACTION_GOTOFRAME2: { ACT_BEGIN(SWF_ACTIONGOTOFRAME2) act->f.FlagBits.Reserved = readBits(f,6); act->f.FlagBits.SceneBiasFlag = readBits(f,1); act->f.FlagBits.PlayFlag = readBits(f,1); if( act->f.FlagBits.SceneBiasFlag ) { act->SceneBias = readUInt16(f); } break; } case SWFACTION_WAITFORFRAME2: { ACT_BEGIN(SWF_ACTIONWAITFORFRAME2) act->SkipCount = readUInt8(f); break; } /* v5 actions */ case SWFACTION_CONSTANTPOOL: { int i; ACT_BEGIN(SWF_ACTIONCONSTANTPOOL) act->Count = readUInt16(f); act->ConstantPool = malloc(act->Count*sizeof(char *)); for(i=0;iCount;i++) { act->ConstantPool[i] = readString(f); } break; } case SWFACTION_DEFINEFUNCTION: { int i, end2; ACT_BEGIN(SWF_ACTIONDEFINEFUNCTION) act->FunctionName = readString(f); act->NumParams = readSInt16(f); act->Params = (STRING *)malloc(act->NumParams*sizeof(char *)); for(i=0;iNumParams;i++) { act->Params[i] = readString(f); /* printf("Read %s\n", act->ConstantPool[i] ); */ } act->CodeSize = readSInt16(f); end2 = fileOffset + act->CodeSize; act->Actions = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numActions = 0; while ( fileOffset < end2 ) { parseSWF_ACTIONRECORD (f, &(act->numActions), (SWF_ACTION *)act->Actions); act->Actions = (union SWF_ACTION *) realloc (act->Actions, (++act->numActions + 1) * sizeof (SWF_ACTION)); } break; } case SWFACTION_WITH: { int end; ACT_BEGIN(SWF_ACTIONWITH) act->Size = readUInt16(f); end = fileOffset + act->Size; act->Actions = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numActions = 0; while ( fileOffset < end ) { parseSWF_ACTIONRECORD (f, &(act->numActions), (SWF_ACTION *)act->Actions); act->Actions = (union SWF_ACTION *) realloc (act->Actions, (++act->numActions + 1) * sizeof (SWF_ACTION)); } break; } case SWFACTION_STOREREGISTER: { ACT_BEGIN(SWF_ACTIONSTOREREGISTER) act->Register = readUInt8(f); break; } /* v6 actions */ /* v7 actions */ case SWFACTION_DEFINEFUNCTION2: { int i, end2; ACT_BEGIN(SWF_ACTIONDEFINEFUNCTION2) act->FunctionName = readString(f); act->NumParams = readSInt16(f); act->RegisterCount = readSInt8(f); act->PreloadParentFlag = readBits(f,1); act->PreloadRootFlag = readBits(f,1); act->SuppressSuperFlag = readBits(f,1); act->PreloadSuperFlag = readBits(f,1); act->SuppressArgumentsFlag = readBits(f,1); act->PreloadArgumentsFlag = readBits(f,1); act->SuppressThisFlag = readBits(f,1); act->PreloadThisFlag = readBits(f,1); act->Reserved = readBits(f,7); act->PreloadGlobalFlag = readBits(f,1); act->Params = (struct REGISTERPARAM *)malloc(act->NumParams*sizeof(struct REGISTERPARAM)); for(i=0;iNumParams;i++) { act->Params[i].Register = readUInt8(f); act->Params[i].ParamName = readString(f); } act->CodeSize = readSInt16(f); end2 = fileOffset + act->CodeSize; act->Actions = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numActions = 0; while ( fileOffset < end2 ) { parseSWF_ACTIONRECORD (f, &(act->numActions), (SWF_ACTION *)act->Actions); act->Actions = (union SWF_ACTION *) realloc (act->Actions, (++act->numActions + 1) * sizeof (SWF_ACTION)); } break; } case SWFACTION_TRY: { int end2; ACT_BEGIN(SWF_ACTIONTRY) act->Reserved = readBits(f,5); act->CatchInRegisterFlag = readBits(f,1); act->FinallyBlockFlag = readBits(f,1); act->CatchBlockFlag = readBits(f,1); act->TrySize = readSInt16(f); act->CatchSize = readSInt16(f); act->FinallySize = readSInt16(f); if( act->CatchInRegisterFlag == 0 ) { act->CatchName = readString(f); } else { act->CatchRegister = readUInt8(f); } /* Try Body */ end2 = fileOffset + act->TrySize; act->TryActs = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numTryActs = 0; while ( fileOffset < end2 ) { parseSWF_ACTIONRECORD (f, &(act->numTryActs), (SWF_ACTION *)act->TryActs); act->TryActs = (union SWF_ACTION *) realloc (act->TryActs, (++act->numTryActs + 1) * sizeof (SWF_ACTION)); } /* Catch Body */ end2 = fileOffset + act->CatchSize; act->CatchActs = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numCatchActs = 0; while ( fileOffset < end2 ) { parseSWF_ACTIONRECORD (f, &(act->numCatchActs), (SWF_ACTION *)act->CatchActs); act->CatchActs = (union SWF_ACTION *) realloc (act->CatchActs, (++act->numCatchActs + 1) * sizeof (SWF_ACTION)); } /* Finally Body */ end2 = fileOffset + act->FinallySize; act->FinallyActs = (union SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); act->numFinallyActs = 0; while ( fileOffset < end2 ) { parseSWF_ACTIONRECORD (f, &(act->numFinallyActs), (SWF_ACTION *)act->FinallyActs); act->FinallyActs = (union SWF_ACTION *) realloc (act->FinallyActs, (++act->numFinallyActs + 1) * sizeof (SWF_ACTION)); } break; } default: printf("Not parsing action %x length %x\n", action->SWF_ACTIONRECORD.ActionCode, action->SWF_ACTIONRECORD.Length ); peekBytes(f,100); exit(1); } return 1; } void parseSWF_DROPSHADOWFILTER(FILE *f, SWF_DROPSHADOWFILTER *filter) { parseSWF_RGBA(f, &filter->DropShadowColor); filter->BlurX = readUInt32(f); filter->BlurY = readUInt32(f); filter->Angle = readUInt32(f); filter->Distance = readUInt32(f); filter->Strength = readUInt16(f); filter->InnerShadow = readBits(f, 1); filter->Kockout = readBits(f, 1); filter->CompositeSource = readBits(f, 1); filter->Passes = readBits(f, 5); } void parseSWF_BLURFILTER(FILE *f, SWF_BLURFILTER *filter) { filter->BlurX = readUInt32(f); filter->BlurY = readUInt32(f); filter->Passes = readBits(f, 5); filter->Reserved = readBits(f, 3); } void parseSWF_GLOWFILTER(FILE *f, SWF_GLOWFILTER *filter) { parseSWF_RGBA(f, &filter->GlowColor); filter->BlurX = readUInt32(f); filter->BlurY = readUInt32(f); filter->Strength = readUInt16(f); filter->InnerGlow = readBits(f, 1); filter->Kockout = readBits(f, 1); filter->CompositeSource = readBits(f, 1); filter->Passes = readBits(f, 5); } void parseSWF_BEVELFILTER(FILE *f, SWF_BEVELFILTER *filter) { parseSWF_RGBA(f, &filter->ShadowColor); parseSWF_RGBA(f, &filter->HighlightColor); filter->BlurX = readUInt32(f); filter->BlurY = readUInt32(f); filter->Angle = readUInt32(f); filter->Distance = readUInt32(f); filter->Strength = readUInt16(f); filter->InnerShadow = readBits(f, 1); filter->Kockout = readBits(f, 1); filter->CompositeSource = readBits(f, 1); filter->OnTop = readBits(f, 1); filter->Passes = readBits(f, 4); } void parseSWF_GRADIENTFILTER(FILE *f, SWF_GRADIENTFILTER *filter) { int i, size; filter->NumColors = readUInt8(f); size = filter->NumColors * sizeof(SWF_RGBA); filter->GradientColors = (SWF_RGBA *)malloc(size); for(i = 0; i < filter->NumColors; i++) parseSWF_RGBA(f, filter->GradientColors + i); size = filter->NumColors * sizeof(UI8); filter->GradientRatio = (UI8 *)malloc(size); for(i = 0; i < filter->NumColors; i++) filter->GradientRatio[i] = readUInt8(f); filter->BlurX = readUInt32(f); filter->BlurY = readUInt32(f); filter->Angle = readUInt32(f); filter->Distance = readUInt32(f); filter->Strength = readUInt16(f); filter->InnerShadow = readBits(f, 1); filter->Kockout = readBits(f, 1); filter->CompositeSource = readBits(f, 1); filter->OnTop = readBits(f, 1); filter->Passes = readBits(f, 4); } void parseSWF_CONVOLUTIONFILTER(FILE *f, SWF_CONVOLUTIONFILTER *filter) { int size, i; filter->MatrixX = readUInt8(f); filter->MatrixY = readUInt8(f); filter->Divisor = readUInt32(f); filter->Bias = readUInt32(f); size = filter->MatrixX * filter->MatrixY * sizeof(UI32); filter->Matrix = (FLOAT *)malloc(size); for(i = 0; i < filter->MatrixX * filter->MatrixY; i++) filter->Matrix[i] = readUInt32(f); parseSWF_RGBA(f, &filter->DefaultColor); filter->Reserved = readBits(f, 6); filter->Clamp = readBits(f, 1); filter->PreserveAlpha = readBits(f, 1); } void parseSWF_COLORMATRIXFILTER(FILE *f, SWF_COLORMATRIXFILTER *filter) { int i; for(i = 0; i < 20; i++) filter->Matrix[i] = readFloat(f); } void parseSWF_FILTER(FILE *f, SWF_FILTER *filter) { filter->FilterId = readUInt8(f); switch(filter->FilterId) { case FILTER_DROPSHADOW: parseSWF_DROPSHADOWFILTER(f, &filter->filter.dropShadow); break; case FILTER_BLUR: parseSWF_BLURFILTER(f, &filter->filter.blur); break; case FILTER_GLOW: parseSWF_GLOWFILTER(f, &filter->filter.glow); break; case FILTER_BEVEL: parseSWF_BEVELFILTER(f, &filter->filter.bevel); break; case FILTER_CONVOLUTION: parseSWF_CONVOLUTIONFILTER(f, &filter->filter.convolution); break; case FILTER_COLORMATRIX: parseSWF_COLORMATRIXFILTER(f, &filter->filter.colorMatrix); break; case FILTER_GRADIENTGLOW: parseSWF_GRADIENTFILTER(f, &filter->filter.gradientGlow); break; case FILTER_GRADIENTBEVEL: parseSWF_GRADIENTFILTER(f, &filter->filter.gradientBevel); break; default: printf("unknown filter %i\n", filter->FilterId); } } void parseSWF_FILTERLIST(FILE *f, SWF_FILTERLIST *list) { int i, size; list->NumberOfFilters = readUInt8(f); size = list->NumberOfFilters * sizeof(SWF_FILTER); list->Filter = (SWF_FILTER *)malloc(size); for(i = 0; i < list->NumberOfFilters; i++) parseSWF_FILTER(f, list->Filter + i); } /* Parse Block types */ SWF_Parserstruct * parseSWF_CHARACTERSET (FILE * f, int length) { PAR_BEGIN (SWF_CHARACTERSET); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBITS (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DEFINEBITS); parserrec->CharacterID = readUInt16 (f); parserrec->JPEGDataSize = end-fileOffset; parserrec->JPEGData = (UI8 *)readBytes(f,end-fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBITSJPEG2 (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DEFINEBITSJPEG2); parserrec->CharacterID = readUInt16 (f); parserrec->JPEGDataSize = end-fileOffset; parserrec->JPEGData = (UI8 *)readBytes(f,end-fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBITSJPEG3 (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DEFINEBITSJPEG3); parserrec->CharacterID = readUInt16 (f); parserrec->AlphaDataOffset = readUInt32 (f); parserrec->JPEGData = (UI8 *)readBytes(f,parserrec->AlphaDataOffset); parserrec->AlphaDataSize = end-fileOffset; parserrec->BitmapAlphaData = (UI8 *)readBytes(f,end-fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBITSPTR (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEBITSPTR); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBUTTON (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEBUTTON); parserrec->ButtonId = readUInt16 (f); parserrec->numCharacters = 0; parserrec->Characters = (SWF_BUTTONRECORD *)calloc(1, sizeof (SWF_BUTTONRECORD)); while (parseSWF_BUTTONRECORD (f, &(parserrec->Characters[parserrec->numCharacters++]), 1 )) { int size = (parserrec->numCharacters + 1) * sizeof(SWF_BUTTONRECORD); parserrec->Characters = (SWF_BUTTONRECORD *) realloc (parserrec->Characters, size); } parserrec->CharacterEndFlag = 0; // handled by parseSWF_BUTTONRECORD parserrec->Actions = (SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); parserrec->numActions = 0; while (parseSWF_ACTIONRECORD (f, &(parserrec->numActions), parserrec->Actions)) { int size = (++parserrec->numActions + 1) * sizeof(SWF_ACTION); parserrec->Actions = (SWF_ACTION *) realloc (parserrec->Actions, size); } parserrec->ActionEndFlag = 0; PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBUTTON2 (FILE * f, int length) { int stop; int end = fileOffset + length; PAR_BEGIN (SWF_DEFINEBUTTON2); byteAlign(); parserrec->Buttonid = readUInt16 (f); parserrec->ReservedFlags = readBits (f, 7); parserrec->TrackAsMenu = readBits (f, 1); stop = fileOffset; parserrec->ActionOffset = readUInt16 (f); if( parserrec->ActionOffset ) stop += parserrec->ActionOffset; else stop = end; parserrec->numCharacters = 0; parserrec->Characters = (SWF_BUTTONRECORD *) calloc (1, sizeof (SWF_BUTTONRECORD)); while ( fileOffset < stop-1 ) { parseSWF_BUTTONRECORD (f, &(parserrec->Characters[parserrec->numCharacters++]), 2 ); parserrec->Characters = (SWF_BUTTONRECORD *) realloc (parserrec->Characters, (parserrec->numCharacters + 1) * sizeof (SWF_BUTTONRECORD)); } parserrec->CharacterEndFlag = readUInt8 (f); if ( parserrec->CharacterEndFlag != 0 ) { SWF_warn(" CharacterEndFlag in DefineButton2 != 0"); } parserrec->numActions = 0; parserrec->Actions = (SWF_BUTTONCONDACTION *) calloc (1, sizeof (SWF_BUTTONCONDACTION)); while( fileOffset < end && parseSWF_BUTTONCONDACTION (f, &(parserrec->Actions[parserrec->numActions++]), end)) { parserrec->Actions = (SWF_BUTTONCONDACTION *) realloc (parserrec->Actions, (parserrec->numActions + 1) * sizeof (SWF_BUTTONCONDACTION)); } PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBUTTONCXFORM (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEBUTTONCXFORM); parserrec->ButtonId = readUInt16(f); parseSWF_CXFORM(f, &parserrec->ButtonColorTransform); PAR_END; } void parseSWF_SOUNDINFO(FILE *f, struct SWF_SOUNDINFO *si); SWF_Parserstruct * parseSWF_DEFINEBUTTONSOUND (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEBUTTONSOUND); parserrec->CharacterID = readUInt16 (f); parserrec->ButtonSoundChar0 = readUInt16 (f); if (parserrec->ButtonSoundChar0) parseSWF_SOUNDINFO(f, &parserrec->ButtonSoundInfo0); parserrec->ButtonSoundChar1 = readUInt16 (f); if (parserrec->ButtonSoundChar1) parseSWF_SOUNDINFO(f, &parserrec->ButtonSoundInfo1); parserrec->ButtonSoundChar2 = readUInt16 (f); if (parserrec->ButtonSoundChar2) parseSWF_SOUNDINFO(f, &parserrec->ButtonSoundInfo2); parserrec->ButtonSoundChar3 = readUInt16 (f); if (parserrec->ButtonSoundChar3) parseSWF_SOUNDINFO(f, &parserrec->ButtonSoundInfo3); PAR_END; } SWF_Parserstruct * parseSWF_DEFINECOMMANDOBJ (FILE * f, int length) { PAR_BEGIN (SWF_DEFINECOMMANDOBJ); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_DEFINEEDITTEXT (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEEDITTEXT); parserrec->CharacterID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->Bounds)); byteAlign (); parserrec->HasText = readBits (f, 1); parserrec->WordWrap = readBits (f, 1); parserrec->Multiline = readBits (f, 1); parserrec->Password = readBits (f, 1); parserrec->ReadOnly = readBits (f, 1); parserrec->HasTextColor = readBits (f, 1); parserrec->HasMaxLength = readBits (f, 1); parserrec->HasFont = readBits (f, 1); parserrec->HasFontClass = readBits (f, 1); parserrec->AutoSize = readBits (f, 1); parserrec->HasLayout = readBits (f, 1); parserrec->NoSelect = readBits (f, 1); parserrec->Border = readBits (f, 1); parserrec->WasStatic = readBits (f, 1); parserrec->HTML = readBits (f, 1); parserrec->UseOutlines = readBits (f, 1); if (parserrec->HasFont) parserrec->FontID = readUInt16 (f); if (parserrec->HasFontClass) parserrec->FontClass = readString(f); if (parserrec->HasFont) parserrec->FontHeight = readUInt16 (f); if (parserrec->HasTextColor) { parseSWF_RGBA (f, &parserrec->TextColor); } if (parserrec->HasMaxLength) { parserrec->MaxLength = readUInt16 (f); } if (parserrec->HasLayout) { parserrec->Align = readUInt8 (f); parserrec->LeftMargin = readUInt16 (f); parserrec->RightMargin = readUInt16 (f); parserrec->Indent = readUInt16 (f); parserrec->Leading = readUInt16 (f); } parserrec->VariableName = readString (f); if (parserrec->HasText) { parserrec->InitialText = readString (f); } PAR_END; } SWF_Parserstruct * parseSWF_DEFINEFONT (FILE * f, int length) { int i; UI16 firstOffset; PAR_BEGIN (SWF_DEFINEFONT); parserrec->FontID = readUInt16 (f); firstOffset = readUInt16 (f); parserrec->NumGlyphs = (firstOffset/2); Movie_addFontInfo(&m, parserrec->FontID, parserrec->NumGlyphs); parserrec->OffsetTable = (UI16 *)malloc((firstOffset/2) * sizeof( UI16 ) ); parserrec->OffsetTable[0] = firstOffset; for(i=1;iOffsetTable[i] = readUInt16 (f); } parserrec->GlyphShapeTable = (SWF_SHAPE *)malloc(firstOffset/2 * sizeof( SWF_SHAPE ) ); for(i=0;iOffsetTable[i + 1] - parserrec->OffsetTable[i]; else len = length - parserrec->OffsetTable[i]; parseSWF_SHAPE(f, &(parserrec->GlyphShapeTable[i]), 1, len); } PAR_END; } SWF_Parserstruct * parseSWF_DEFINEFONT2 (FILE * f, int length) { int i; PAR_BEGIN (SWF_DEFINEFONT2); byteAlign (); parserrec->FontID = readUInt16 (f); parserrec->FontFlagsHasLayout = readBits (f, 1); parserrec->FontFlagsShiftJis = readBits (f, 1); parserrec->FontFlagsSmallText = readBits (f, 1); parserrec->FontFlagsFlagANSI = readBits (f, 1); parserrec->FontFlagsWideOffsets = readBits (f, 1); parserrec->FontFlagsWideCodes = readBits (f, 1); parserrec->FontFlagsFlagsItalics = readBits (f, 1); parserrec->FontFlagsFlagsBold = readBits (f, 1); parserrec->LanguageCode = readUInt8 (f); parserrec->FontNameLen = readUInt8 (f); parserrec->FontName = readSizedString (f, parserrec->FontNameLen); parserrec->NumGlyphs = readUInt16 (f); Movie_addFontInfo(&m, parserrec->FontID, parserrec->NumGlyphs); if (parserrec->FontFlagsWideOffsets) { parserrec->OffsetTable.UI32 = (UI32 *) malloc (parserrec->NumGlyphs * sizeof (UI32)); for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->OffsetTable.UI32[i] = readUInt32 (f); } } else { parserrec->OffsetTable.UI16 = (UI16 *) malloc (parserrec->NumGlyphs * sizeof (UI16)); for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->OffsetTable.UI16[i] = readUInt16 (f); } } if (parserrec->FontFlagsWideOffsets) { parserrec->CodeTableOffset.UI32 = readUInt32 (f); } else { parserrec->CodeTableOffset.UI16 = readUInt16 (f); } parserrec->GlyphShapeTable = (SWF_SHAPE *) malloc (parserrec->NumGlyphs * sizeof (SWF_SHAPE)); for (i = 0; i < parserrec->NumGlyphs; i++) { int len; if(parserrec->FontFlagsWideOffsets) { if(i < parserrec->NumGlyphs - 1) len = parserrec->OffsetTable.UI32[i + 1] - parserrec->OffsetTable.UI32[i]; else len = parserrec->CodeTableOffset.UI32 - parserrec->OffsetTable.UI32[i]; } else { if(i < parserrec->NumGlyphs - 1) len = parserrec->OffsetTable.UI16[i + 1] - parserrec->OffsetTable.UI16[i]; else len = parserrec->CodeTableOffset.UI16 - parserrec->OffsetTable.UI16[i]; } parseSWF_SHAPE (f, parserrec->GlyphShapeTable + i, 3, len); } parserrec->CodeTable = (int *) malloc (parserrec->NumGlyphs * sizeof (int)); if (parserrec->FontFlagsWideCodes) { for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->CodeTable[i] = readUInt16 (f); } } else { for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->CodeTable[i] = readUInt8 (f); } } if( parserrec->FontFlagsHasLayout ) { parserrec->FontAscent = readSInt16(f); parserrec->FontDecent = readSInt16(f); parserrec->FontLeading = readSInt16(f); /* FontAdvanceTable */ parserrec->FontAdvanceTable = (SI16 *) malloc (parserrec->NumGlyphs * sizeof (SI16)); for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->FontAdvanceTable[i] = readSInt16 (f); } /* FontBoundsTable */ parserrec->FontBoundsTable = (SWF_RECT *) malloc (parserrec->NumGlyphs * sizeof (SWF_RECT)); for (i = 0; i < parserrec->NumGlyphs; i++) { parseSWF_RECT (f, &(parserrec->FontBoundsTable[i])); } parserrec->KerningCount = readUInt16(f); /* FontKerningTable */ parserrec->FontKerningTable = (struct SWF_KERNINGRECORD *) malloc (parserrec->KerningCount * sizeof (struct SWF_KERNINGRECORD)); for (i = 0; i < parserrec->KerningCount; i++) { if( parserrec->FontFlagsWideCodes ) { parserrec->FontKerningTable[i].FontKerningCode1 = readUInt16 (f); parserrec->FontKerningTable[i].FontKerningCode2 = readUInt16 (f); } else { parserrec->FontKerningTable[i].FontKerningCode1 = readUInt8 (f); parserrec->FontKerningTable[i].FontKerningCode2 = readUInt8 (f); } parserrec->FontKerningTable[i].FontKerningAdjustment = readSInt16 (f); } } PAR_END; } SWF_Parserstruct * parseSWF_DEFINEFONT3 (FILE * f, int length) { int i; PAR_BEGIN (SWF_DEFINEFONT3); byteAlign (); parserrec->FontID = readUInt16 (f); parserrec->FontFlagsHasLayout = readBits (f, 1); parserrec->FontFlagsShiftJis = readBits (f, 1); parserrec->FontFlagsSmallText = readBits (f, 1); parserrec->FontFlagsFlagANSI = readBits (f, 1); parserrec->FontFlagsWideOffsets = readBits (f, 1); parserrec->FontFlagsWideCodes = readBits (f, 1); parserrec->FontFlagsFlagsItalics = readBits (f, 1); parserrec->FontFlagsFlagsBold = readBits (f, 1); parserrec->LanguageCode = readUInt8 (f); parserrec->FontNameLen = readUInt8 (f); parserrec->FontName = readSizedString (f, parserrec->FontNameLen); parserrec->NumGlyphs = readUInt16 (f); Movie_addFontInfo(&m, parserrec->FontID, parserrec->NumGlyphs); if (parserrec->FontFlagsWideOffsets) { parserrec->OffsetTable.UI32 = (UI32 *) malloc (parserrec->NumGlyphs * sizeof (UI32)); for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->OffsetTable.UI32[i] = readUInt32 (f); } } else { parserrec->OffsetTable.UI16 = (UI16 *) malloc (parserrec->NumGlyphs * sizeof (UI16)); for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->OffsetTable.UI16[i] = readUInt16 (f); } } if (parserrec->FontFlagsWideOffsets) { parserrec->CodeTableOffset.UI32 = readUInt32 (f); } else { parserrec->CodeTableOffset.UI16 = readUInt16 (f); } parserrec->GlyphShapeTable = (SWF_SHAPE *) malloc (parserrec->NumGlyphs * sizeof (SWF_SHAPE)); for (i = 0; i < parserrec->NumGlyphs; i++) { int len; if(parserrec->FontFlagsWideOffsets) { if(i < parserrec->NumGlyphs - 1) len = parserrec->OffsetTable.UI32[i + 1] - parserrec->OffsetTable.UI32[i]; else len = parserrec->CodeTableOffset.UI32 - parserrec->OffsetTable.UI32[i]; } else { if(i < parserrec->NumGlyphs - 1) len = parserrec->OffsetTable.UI16[i + 1] - parserrec->OffsetTable.UI16[i]; else len = parserrec->CodeTableOffset.UI16 - parserrec->OffsetTable.UI16[i]; } parseSWF_SHAPE (f, &parserrec->GlyphShapeTable[i], 3, len); } parserrec->CodeTable = (UI16 *) malloc (parserrec->NumGlyphs * sizeof (UI16)); if (parserrec->FontFlagsWideCodes) { for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->CodeTable[i] = readUInt16 (f); } } else { for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->CodeTable[i] = readUInt8 (f); } } if( parserrec->FontFlagsHasLayout ) { parserrec->FontAscent = readSInt16(f); parserrec->FontDecent = readSInt16(f); parserrec->FontLeading = readSInt16(f); /* FontAdvanceTable */ parserrec->FontAdvanceTable = (SI16 *) malloc (parserrec->NumGlyphs * sizeof (SI16)); for (i = 0; i < parserrec->NumGlyphs; i++) { parserrec->FontAdvanceTable[i] = readSInt16 (f); } /* FontBoundsTable */ parserrec->FontBoundsTable = (SWF_RECT *) malloc (parserrec->NumGlyphs * sizeof (SWF_RECT)); for (i = 0; i < parserrec->NumGlyphs; i++) { parseSWF_RECT (f, &(parserrec->FontBoundsTable[i])); } parserrec->KerningCount = readUInt16(f); /* FontKerningTable */ parserrec->FontKerningTable = (struct SWF_KERNINGRECORD *) malloc (parserrec->KerningCount * sizeof (struct SWF_KERNINGRECORD)); for (i = 0; i < parserrec->KerningCount; i++) { if( parserrec->FontFlagsWideCodes ) { parserrec->FontKerningTable[i].FontKerningCode1 = readUInt16 (f); parserrec->FontKerningTable[i].FontKerningCode2 = readUInt16 (f); } else { parserrec->FontKerningTable[i].FontKerningCode1 = readUInt8 (f); parserrec->FontKerningTable[i].FontKerningCode2 = readUInt8 (f); } parserrec->FontKerningTable[i].FontKerningAdjustment = readSInt16 (f); } } PAR_END; } SWF_Parserstruct * parseSWF_DEFINEFONTINFO (FILE * f, int length) { int i, end = fileOffset + length; PAR_BEGIN (SWF_DEFINEFONTINFO); parserrec->FontID = readUInt16 (f); parserrec->FontNameLen = readUInt8 (f); parserrec->FontName = readSizedString (f, parserrec->FontNameLen); byteAlign (); parserrec->FontFlagsReserved = readBits (f, 2); parserrec->FontFlagsSmallText = readBits (f, 1); parserrec->FontFlagsShiftJIS = readBits (f, 1); parserrec->FontFlagsANSI = readBits (f, 1); parserrec->FontFlagsItalic = readBits (f, 1); parserrec->FontFlagsBold = readBits (f, 1); parserrec->FontFlagsWideCodes = readBits (f, 1); if( parserrec->FontFlagsWideCodes ) parserrec->nGlyph = (end-fileOffset)/2; else parserrec->nGlyph = end-fileOffset; parserrec->CodeTable = (UI16 *)malloc(parserrec->nGlyph*sizeof(UI16)); for(i=0;inGlyph;i++) if( parserrec->FontFlagsWideCodes ) parserrec->CodeTable[i] = readUInt16(f); else parserrec->CodeTable[i] = readUInt8(f); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEFONTINFO2 (FILE * f, int length) { int i, end = fileOffset + length; PAR_BEGIN (SWF_DEFINEFONTINFO2); parserrec->FontID = readUInt16 (f); parserrec->FontNameLen = readUInt8 (f); parserrec->FontName = readSizedString (f, parserrec->FontNameLen); byteAlign (); parserrec->FontFlagsReserved = readBits (f, 2); parserrec->FontFlagsSmallText = readBits (f, 1); parserrec->FontFlagsShiftJIS = readBits (f, 1); parserrec->FontFlagsANSI = readBits (f, 1); parserrec->FontFlagsItalic = readBits (f, 1); parserrec->FontFlagsBold = readBits (f, 1); parserrec->FontFlagsWideCodes = readBits (f, 1); parserrec->LanguageCode = readUInt8(f); parserrec->nGlyph = (end-fileOffset)/2; parserrec->CodeTable = (UI16 *)malloc(parserrec->nGlyph*sizeof(UI16)); for(i=0;inGlyph;i++) parserrec->CodeTable[i] = readUInt16(f); PAR_END; } SWF_Parserstruct * parseSWF_CSMTEXTSETTINGS (FILE * f, int length) { PAR_BEGIN (SWF_CSMTEXTSETTINGS); parserrec->TextID = readUInt16(f); parserrec->UseFlashType = readBits(f, 2); parserrec->GridFit = readBits(f, 3); parserrec->Reserved = readBits(f, 3); parserrec->Thickness = readUInt32(f); parserrec->Sharpness = readUInt32(f); parserrec->Reserved = readUInt8(f); PAR_END; } void parseSWF_ZONEDATA(FILE *f, struct SWF_ZONEDATA *data) { data->AlignmentCoordinate = readUInt16(f); // FLOAT16 data->Range = readUInt16(f); // FLOAT16 } void parseSWF_ZONERECORD(FILE *f, struct SWF_ZONERECORD *table) { int i; table->NumZoneData = readUInt8(f); table->ZoneData = (struct SWF_ZONEDATA *) malloc(table->NumZoneData * sizeof(struct SWF_ZONEDATA)); for(i = 0; i < table->NumZoneData; i++) parseSWF_ZONEDATA(f, table->ZoneData + i); table->ZoneMaskX = readBits(f, 1); table->ZoneMaskY = readBits(f, 1); table->Reserved = readBits(f, 6); } SWF_Parserstruct * parseSWF_DEFINEFONTALIGNZONES(FILE *f, int length) { int i; PAR_BEGIN (SWF_DEFINEFONTALIGNZONES); parserrec->FontID = readUInt16(f); parserrec->CSMTableHint = readBits(f, 2); parserrec->Reserved = readBits(f, 6); parserrec->GlyphCount = Movie_getFontGlyphCount(&m, parserrec->FontID); if(parserrec->GlyphCount < 0) SWF_error("SWF_DEFINEFONTALIGNZONES: FontID %i not present\n", parserrec->FontID); parserrec->ZoneTable = malloc(sizeof(struct SWF_ZONERECORD) * parserrec->GlyphCount); for(i = 0; i < parserrec->GlyphCount; i++) parseSWF_ZONERECORD(f, parserrec->ZoneTable + i); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEFONTNAME(FILE * f, int length) { PAR_BEGIN(SWF_DEFINEFONTNAME); parserrec->FontId = readUInt16(f); parserrec->FontName = readString(f); parserrec->FontCopyright = readString(f); PAR_END; } SWF_Parserstruct * parseSWF_DEFINELOSSLESS (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DEFINELOSSLESS); parserrec->CharacterID = readUInt16 (f); parserrec->BitmapFormat = readUInt8 (f); parserrec->BitmapWidth = readUInt16 (f); parserrec->BitmapHeight = readUInt16 (f); if( parserrec->BitmapFormat == 3 /* 8-bit */ ) { parserrec->BitmapColorTableSize = readUInt8 (f); } parserrec->ZlibBitmapData = (UI8 *)readBytes (f,end-fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINELOSSLESS2 (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DEFINELOSSLESS2); parserrec->CharacterID = readUInt16 (f); parserrec->BitmapFormat = readUInt8 (f); parserrec->BitmapWidth = readUInt16 (f); parserrec->BitmapHeight = readUInt16 (f); if( parserrec->BitmapFormat == 3 /* 8-bit */ ) { parserrec->BitmapColorTableSize = readUInt8 (f); } parserrec->ZlibBitmapData = (UI8 *)readBytes (f,end-fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEMORPHSHAPE (FILE * f, int length) { int end, endEdges; PAR_BEGIN (SWF_DEFINEMORPHSHAPE); end = fileOffset + length; parserrec->CharacterID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->StartBounds)); parseSWF_RECT (f, &(parserrec->EndBounds)); parserrec->Offset = readUInt32 (f); endEdges = fileOffset + parserrec->Offset; parseSWF_MORPHFILLSTYLES (f, &(parserrec->MorphFillStyles)); parseSWF_MORPHLINESTYLES (f, &(parserrec->MorphLineStyles), 1); if(parserrec->Offset == 0) SWF_error("parseSWF_DEFINEMORPHSHAPE: offset == 0!\n"); parseSWF_SHAPE (f, &(parserrec->StartEdges), 0, endEdges - fileOffset); parseSWF_SHAPE (f, &(parserrec->EndEdges), 0, end - fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINEMORPHSHAPE2 (FILE * f, int length) { int end, endEdges; PAR_BEGIN (SWF_DEFINEMORPHSHAPE2); end = fileOffset + length; parserrec->CharacterID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->StartBounds)); parseSWF_RECT (f, &(parserrec->EndBounds)); parseSWF_RECT (f, &(parserrec->StartEdgeBounds)); parseSWF_RECT (f, &(parserrec->EndEdgeBounds)); parserrec->Reserved = readBits(f, 6); parserrec->UsesNonScalingStrokes = readBits(f, 1); parserrec->UsesScalingStrokes = readBits(f, 1); parserrec->Offset = readUInt32 (f); endEdges = fileOffset + parserrec->Offset + 4; parseSWF_MORPHFILLSTYLES (f, &(parserrec->MorphFillStyles)); parseSWF_MORPHLINESTYLES (f, &(parserrec->MorphLineStyles), 2); if(parserrec->Offset == 0) SWF_error("parseSWF_DEFINEMORPHSHAPE2: offset == 0!\n"); parseSWF_SHAPE (f, &(parserrec->StartEdges), 0, endEdges - fileOffset); parseSWF_SHAPE (f, &(parserrec->EndEdges), 0, end - fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_DEFINESHAPE (FILE * f, int length) { PAR_BEGIN (SWF_DEFINESHAPE); parserrec->ShapeID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->ShapeBounds)); parseSWF_SHAPEWITHSTYLE (f, &(parserrec->Shapes), 1); PAR_END; } SWF_Parserstruct * parseSWF_DEFINESHAPE2 (FILE * f, int length) { PAR_BEGIN (SWF_DEFINESHAPE2); parserrec->ShapeID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->ShapeBounds)); parseSWF_SHAPEWITHSTYLE (f, &(parserrec->Shapes), 2); PAR_END; } SWF_Parserstruct * parseSWF_DEFINESHAPE3 (FILE * f, int length) { PAR_BEGIN (SWF_DEFINESHAPE3); parserrec->ShapeID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->ShapeBounds)); parseSWF_SHAPEWITHSTYLE (f, &(parserrec->Shapes), 3); PAR_END; } SWF_Parserstruct * parseSWF_DEFINESHAPE4 (FILE * f, int length) { PAR_BEGIN (SWF_DEFINESHAPE4); parserrec->ShapeID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->ShapeBounds)); parseSWF_RECT (f, &(parserrec->EdgeBounds)); parserrec->Reserved = readBits(f, 6); parserrec->UsesNonScalingStrokes = readBits(f, 1); parserrec->UsesScalingStrokes = readBits(f, 1); parseSWF_SHAPEWITHSTYLE (f, &(parserrec->Shapes), 4); PAR_END; } SWF_Parserstruct * parseSWF_DEFINESPRITE (FILE * f, int length) { int block, type, splength, blockstart, nextFrame; int numblocks, start; PAR_BEGIN (SWF_DEFINESPRITE); numblocks=0; start = fileOffset; parserrec->SpriteId = readUInt16 (f); parserrec->FrameCount = readUInt16 (f); parserrec->tagTypes = NULL; parserrec->Tags = NULL; while( fileOffset < start+length ) { /* printf ("Block offset: %d\n", fileOffset); */ block = readUInt16 (f); type = block >> 6; splength = block & ((1 << 6) - 1); if (splength == 63) /* it's a long block. */ splength = readUInt32 (f); blockstart = fileOffset; nextFrame = fileOffset+splength; /* printf ("Found Block: %s, %i bytes @%i\n", blockName (type), splength, blockstart ); */ parserrec->tagTypes = (UI16 *) realloc(parserrec->tagTypes, ((numblocks+1)*sizeof(UI16))); parserrec->Tags = (SWF_Parserstruct **) realloc(parserrec->Tags, ((numblocks+1)*sizeof(SWF_Parserstruct *))); parserrec->tagTypes[numblocks] = type; parserrec->Tags[numblocks++]=blockParse(f,splength,type); if( ftell(f) != nextFrame ) { SWF_warn(" Sprite Stream out of sync...\n"); SWF_warn(" %ld but expecting %d\n", ftell(f),nextFrame); fseek(f,blockstart,SEEK_SET); silentSkipBytes (f, (nextFrame-ftell(f))); fileOffset=ftell(f); } if(type == 0) break; } if(fileOffset < start + length) { SWF_warn("PARSER: parseSWF_DEFINESPRITE (ID %i): skiping excessive bytes after SWF_END.\n", parserrec->SpriteId); readBytes(f, start + length - fileOffset); } parserrec->BlockCount = numblocks; PAR_END; } SWF_Parserstruct * parseSWF_DEFINETEXT (FILE * f, int length) { PAR_BEGIN (SWF_DEFINETEXT); parserrec->CharacterID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->TextBounds)); parseSWF_MATRIX (f, &(parserrec->TextMatrix)); parserrec->GlyphBits = readUInt8 (f); parserrec->AdvanceBits = readUInt8 (f); parserrec->TextRecords = (SWF_TEXTRECORD *) calloc (1, sizeof (SWF_TEXTRECORD)); parserrec->numTextRecords = 0; while ( parseSWF_TEXTRECORD (f, &(parserrec->TextRecords[parserrec->numTextRecords++]), parserrec->GlyphBits, parserrec->AdvanceBits, 1 ) ) { parserrec->TextRecords = (SWF_TEXTRECORD *) realloc (parserrec->TextRecords, (parserrec-> numTextRecords + 1) * sizeof (SWF_TEXTRECORD)); } PAR_END; } SWF_Parserstruct * parseSWF_DEFINETEXT2 (FILE * f, int length) { PAR_BEGIN (SWF_DEFINETEXT2); parserrec->CharacterID = readUInt16 (f); parseSWF_RECT (f, &(parserrec->TextBounds)); parseSWF_MATRIX (f, &(parserrec->TextMatrix)); parserrec->GlyphBits = readUInt8 (f); parserrec->AdvanceBits = readUInt8 (f); parserrec->TextRecords = (SWF_TEXTRECORD *) calloc (1, sizeof (SWF_TEXTRECORD)); parserrec->numTextRecords = 0; while ( parseSWF_TEXTRECORD (f, &(parserrec->TextRecords[parserrec->numTextRecords++]), parserrec->GlyphBits, parserrec->AdvanceBits, 2 ) ) { parserrec->TextRecords = (SWF_TEXTRECORD *) realloc (parserrec->TextRecords, (parserrec-> numTextRecords + 1) * sizeof (SWF_TEXTRECORD)); } PAR_END; } SWF_Parserstruct * parseSWF_DEFINETEXTFORMAT (FILE * f, int length) { PAR_BEGIN (SWF_DEFINETEXTFORMAT); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_DEFINEVIDEO (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEVIDEO); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_DEFINEVIDEOSTREAM (FILE * f, int length) { PAR_BEGIN (SWF_DEFINEVIDEOSTREAM); parserrec->CharacterID = readUInt16 (f); parserrec->NumFrames = readUInt16(f); parserrec->Width = readUInt16(f); parserrec->Height = readUInt16(f); byteAlign (); parserrec->Reserved = readBits (f, 5); parserrec->VideoFlagsDeblocking = readBits (f, 2); parserrec->VideoFlagsSmoothing = readBits(f, 1); parserrec->CodecID = readUInt8(f); PAR_END; } SWF_Parserstruct * parseSWF_DOACTION (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DOACTION); parserrec->Actions = (SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); parserrec->numActions = 0; while ( fileOffset < end ) { parseSWF_ACTIONRECORD (f, &(parserrec->numActions), parserrec->Actions ); parserrec->Actions = (SWF_ACTION *) realloc (parserrec->Actions, (++parserrec-> numActions + 1) * sizeof (SWF_ACTION)); } /* parserrec->AScript = decompile5Action (f, length, 1); */ PAR_END; } SWF_Parserstruct * parseSWF_ENABLEDEBUGGER (FILE * f, int length) { PAR_BEGIN (SWF_ENABLEDEBUGGER); parserrec->Password = readString(f); PAR_END; } SWF_Parserstruct * parseSWF_ENABLEDEBUGGER2 (FILE * f, int length) { PAR_BEGIN (SWF_ENABLEDEBUGGER2); parserrec->Reserved = readUInt16(f); parserrec->Password = readString(f); PAR_END; } SWF_Parserstruct * parseSWF_END (FILE * f, int length) { PAR_BEGIN (SWF_END); PAR_END; } SWF_Parserstruct * parseSWF_EXPORTASSETS (FILE * f, int length) { int i; PAR_BEGIN (SWF_EXPORTASSETS); parserrec->Count = readUInt16 (f); parserrec->Tags = (UI16 *)malloc(parserrec->Count*sizeof(UI16)); parserrec->Names = (STRING *)malloc(parserrec->Count*sizeof(char *)); for(i=0;iCount;i++) { parserrec->Tags[i] = readUInt16(f); parserrec->Names[i] = readString(f); } PAR_END; } SWF_Parserstruct * parseSWF_FONTREF (FILE * f, int length) { PAR_BEGIN (SWF_FONTREF); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_FRAMELABEL (FILE * f, int length) { PAR_BEGIN (SWF_FRAMELABEL); parserrec->Name = readString (f); // SWF6 named anchor if ( strlen(parserrec->Name)+1 == length-1 ) { parserrec->IsAnchor = readUInt8(f); } PAR_END; } SWF_Parserstruct * parseSWF_FRAMETAG (FILE * f, int length) { PAR_BEGIN (SWF_FRAMETAG); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_FREEALL (FILE * f, int length) { PAR_BEGIN (SWF_FREEALL); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_FREECHARACTER (FILE * f, int length) { PAR_BEGIN (SWF_FREECHARACTER); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_GENCOMMAND (FILE * f, int length) { PAR_BEGIN (SWF_GENCOMMAND); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_IMPORTASSETS (FILE * f, int length) { int i; PAR_BEGIN (SWF_IMPORTASSETS); parserrec->URL = readString (f); parserrec->Count = readUInt16 (f); parserrec->Tags = (UI16 *)malloc(parserrec->Count*sizeof(UI16)); parserrec->Names = (STRING *)malloc(parserrec->Count*sizeof(char *)); for(i=0;iCount;i++) { parserrec->Tags[i] = readUInt16(f); parserrec->Names[i] = readString(f); } PAR_END; } SWF_Parserstruct * parseSWF_IMPORTASSETS2 (FILE * f, int length) { int i; PAR_BEGIN (SWF_IMPORTASSETS2); parserrec->URL = readString (f); parserrec->Reserved = readUInt8(f); parserrec->Reserved2 = readUInt8(f); parserrec->Count = readUInt16 (f); parserrec->Tags = (UI16 *)malloc(parserrec->Count*sizeof(UI16)); parserrec->Names = (STRING *)malloc(parserrec->Count*sizeof(char *)); for(i=0;iCount;i++) { parserrec->Tags[i] = readUInt16(f); parserrec->Names[i] = readString(f); } PAR_END; } SWF_Parserstruct * parseSWF_JPEGTABLES (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_JPEGTABLES); parserrec->JPEGDataSize = end-fileOffset; parserrec->JPEGData = (UI8 *)readBytes(f,end-fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_NAMECHARACTER (FILE * f, int length) { PAR_BEGIN (SWF_NAMECHARACTER); parserrec->Id = readUInt16(f); parserrec->Name = readString(f); PAR_END; } SWF_Parserstruct * parseSWF_PATHSAREPOSTSCRIPT (FILE * f, int length) { PAR_BEGIN (SWF_PATHSAREPOSTSCRIPT); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_PLACEOBJECT (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_PLACEOBJECT); parserrec->CharacterId = readUInt16 (f); parserrec->Depth = readUInt16 (f); parseSWF_MATRIX( f, &(parserrec->Matrix) ); if(end > fileOffset) parseSWF_CXFORMWITHALPHA( f, &(parserrec->ColorTransform) ); PAR_END; } SWF_Parserstruct * parseSWF_PLACEOBJECT2 (FILE * f, int length) { PAR_BEGIN (SWF_PLACEOBJECT2); byteAlign(); int end = fileOffset + length; parserrec->PlaceFlagHasClipActions = readBits (f, 1); parserrec->PlaceFlagHasClipDepth = readBits (f, 1); parserrec->PlaceFlagHasName = readBits (f, 1); parserrec->PlaceFlagHasRatio = readBits (f, 1); parserrec->PlaceFlagHasColorTransform = readBits (f, 1); parserrec->PlaceFlagHasMatrix = readBits (f, 1); parserrec->PlaceFlagHasCharacter = readBits (f, 1); parserrec->PlaceFlagMove = readBits (f, 1); parserrec->Depth = readUInt16 (f); if( parserrec->PlaceFlagHasCharacter ) { parserrec->CharacterId = readUInt16 (f); } if( parserrec->PlaceFlagHasMatrix ) { parseSWF_MATRIX( f, &(parserrec->Matrix) ); } if( parserrec->PlaceFlagHasColorTransform ) { parseSWF_CXFORMWITHALPHA( f, &(parserrec->ColorTransform) ); } if( parserrec->PlaceFlagHasRatio ) { parserrec->Ratio = readUInt16 (f); } if( parserrec->PlaceFlagHasName ) { parserrec->Name = readString (f); } if( parserrec->PlaceFlagHasClipDepth ) { parserrec->ClipDepth = readUInt16 (f); } if( parserrec->PlaceFlagHasClipActions ) { parseSWF_CLIPACTIONS( f, &(parserrec->ClipActions), end); } PAR_END; } SWF_Parserstruct * parseSWF_PLACEOBJECT3 (FILE * f, int length) { PAR_BEGIN (SWF_PLACEOBJECT3); byteAlign(); int end = fileOffset + length; parserrec->PlaceFlagHasClipActions = readBits (f, 1); parserrec->PlaceFlagHasClipDepth = readBits (f, 1); parserrec->PlaceFlagHasName = readBits (f, 1); parserrec->PlaceFlagHasRatio = readBits (f, 1); parserrec->PlaceFlagHasColorTransform = readBits (f, 1); parserrec->PlaceFlagHasMatrix = readBits (f, 1); parserrec->PlaceFlagHasCharacter = readBits (f, 1); parserrec->PlaceFlagMove = readBits (f, 1); byteAlign(); parserrec->Reserved = readBits (f, 3); parserrec->PlaceFlagHasImage = readBits (f, 1); parserrec->PlaceFlagHasClassName = readBits (f, 1); parserrec->PlaceFlagHasCacheAsBitmap = readBits (f, 1); parserrec->PlaceFlagHasBlendMode = readBits(f, 1); parserrec->PlaceFlagHasFilterList = readBits(f, 1); parserrec->Depth = readUInt16 (f); if( parserrec->PlaceFlagHasCharacter ) { parserrec->CharacterId = readUInt16 (f); } if(parserrec->PlaceFlagHasClassName || (parserrec->PlaceFlagHasImage && parserrec->PlaceFlagHasCharacter)) { parserrec->ClassName = readString(f); } if( parserrec->PlaceFlagHasMatrix ) { parseSWF_MATRIX( f, &(parserrec->Matrix) ); } if( parserrec->PlaceFlagHasColorTransform ) { parseSWF_CXFORMWITHALPHA( f, &(parserrec->ColorTransform) ); } if( parserrec->PlaceFlagHasRatio ) { parserrec->Ratio = readUInt16 (f); } if( parserrec->PlaceFlagHasName ) { parserrec->Name = readString (f); } if( parserrec->PlaceFlagHasClipDepth ) { parserrec->ClipDepth = readUInt16 (f); } if( parserrec->PlaceFlagHasFilterList ) { parseSWF_FILTERLIST( f, &parserrec->SurfaceFilterList); } if( parserrec->PlaceFlagHasBlendMode ) { parserrec->BlendMode = readUInt8 (f); } if( parserrec->PlaceFlagHasClipActions ) { parseSWF_CLIPACTIONS( f, &(parserrec->ClipActions), end); } PAR_END; } SWF_Parserstruct * parseSWF_PREBUILT (FILE * f, int length) { PAR_BEGIN (SWF_PREBUILT); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_PREBUILTCLIP (FILE * f, int length) { PAR_BEGIN (SWF_PREBUILTCLIP); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_PROTECT (FILE * f, int length) { PAR_BEGIN (SWF_PROTECT); if( length != 0 ) { parserrec->Password = readBytes (f, length); } else { parserrec->Password = NULL; } PAR_END; } SWF_Parserstruct * parseSWF_REMOVEOBJECT (FILE * f, int length) { PAR_BEGIN (SWF_REMOVEOBJECT); parserrec->CharacterId = readUInt16 (f); parserrec->Depth = readUInt16 (f); PAR_END; } SWF_Parserstruct * parseSWF_REMOVEOBJECT2 (FILE * f, int length) { PAR_BEGIN (SWF_REMOVEOBJECT2); parserrec->Depth = readUInt16 (f); PAR_END; } SWF_Parserstruct * parseSWF_SERIALNUMBER (FILE * f, int length) { PAR_BEGIN (SWF_SERIALNUMBER); parserrec->Id = readUInt32(f); parserrec->Edition = readUInt32(f); parserrec->Major = readUInt8(f); parserrec->Minor = readUInt8(f); parserrec->BuildL = readUInt32(f); parserrec->BuildH = readUInt32(f); parserrec->TimestampL = readUInt32(f); parserrec->TimestampH = readUInt32(f); PAR_END; } SWF_Parserstruct * parseSWF_SETBACKGROUNDCOLOR (FILE * f, int length) { PAR_BEGIN (SWF_SETBACKGROUNDCOLOR); parseSWF_RGB (f, &parserrec->rgb); PAR_END; } SWF_Parserstruct * parseSWF_SHOWFRAME (FILE * f, int length) { PAR_BEGIN (SWF_SHOWFRAME); PAR_END; } static inline void parseMp3Stream(FILE *f, struct MP3STREAMSOUNDDATA *data, int blockEnd) { data->SampleCount = readUInt16(f); data->SeekSamples = readSInt16(f); data->frames = (UI8 *)readBytes(f, blockEnd - fileOffset); } SWF_Parserstruct * parseSWF_SOUNDSTREAMBLOCK (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_SOUNDSTREAMBLOCK); switch(m.soundStreamFmt) { case 2: parseMp3Stream(f, &parserrec->StreamData.mp3, end); break; default: parserrec->StreamData.data = (UI8 *)readBytes(f, end - fileOffset); } PAR_END; } SWF_Parserstruct * parseSWF_SOUNDSTREAMHEAD (FILE * f, int length) { PAR_BEGIN (SWF_SOUNDSTREAMHEAD); byteAlign (); parserrec->Reserved = readBits (f, 4); parserrec->PlaybackSoundRate = readBits (f, 2); parserrec->PlaybackSoundSize = readBits (f, 1); parserrec->PlaybackSoundType = readBits (f, 1); parserrec->StreamSoundCompression = readBits (f, 4); parserrec->StreamSoundRate = readBits (f, 2); parserrec->StreamSoundSize = readBits (f, 1); parserrec->StreamSoundType = readBits (f, 1); parserrec->StreamSoundSampleCount = readUInt16 (f); if( parserrec->StreamSoundCompression == 2 /* MP3 */ ) parserrec->LatencySeek = readUInt16 (f); m.soundStreamFmt = parserrec->StreamSoundCompression; PAR_END; } SWF_Parserstruct * parseSWF_SOUNDSTREAMHEAD2 (FILE * f, int length) { PAR_BEGIN (SWF_SOUNDSTREAMHEAD2); byteAlign (); parserrec->Reserved = readBits (f, 4); parserrec->PlaybackSoundRate = readBits (f, 2); parserrec->PlaybackSoundSize = readBits (f, 1); parserrec->PlaybackSoundType = readBits (f, 1); parserrec->StreamSoundCompression = readBits (f, 4); parserrec->StreamSoundRate = readBits (f, 2); parserrec->StreamSoundSize = readBits (f, 1); parserrec->StreamSoundType = readBits (f, 1); parserrec->StreamSoundSampleCount = readUInt16 (f); if( parserrec->StreamSoundCompression == 2 /* MP3 */ ) parserrec->LatencySeek = readUInt16 (f); m.soundStreamFmt = parserrec->StreamSoundCompression; PAR_END; } SWF_Parserstruct * parseSWF_DEFINESOUND (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_DEFINESOUND); parserrec->SoundId = readUInt16 (f); parserrec->SoundFormat = readBits (f, 4); parserrec->SoundRate = readBits (f, 2); parserrec->SoundSize = readBits (f, 1); parserrec->SoundType = readBits (f, 1); byteAlign (); parserrec->SoundSampleCount = readUInt32 (f); switch(parserrec->SoundFormat) { case 2: parserrec->SoundData.mp3.SeekSamples = readSInt16(f); parserrec->SoundData.mp3.frames = (UI8 *)readBytes(f, end - fileOffset); break; default: parserrec->SoundData.data = (UI8 *)readBytes(f, end - fileOffset); } PAR_END; } void parseSWF_SOUNDINFO(FILE *f, struct SWF_SOUNDINFO *si) { int i; si->Reserved = readBits (f, 2); si->SyncStop = readBits (f, 1); si->SyncNoMultiple = readBits (f, 1); si->HasEnvelope = readBits (f, 1); si->HasLoops = readBits (f, 1); si->HasOutPoint = readBits (f, 1); si->HasInPoint = readBits (f, 1); if( si->HasInPoint ) si->InPoint = readUInt32 (f); if( si->HasOutPoint ) si->OutPoint = readUInt32 (f); if( si->HasLoops ) si->LoopCount = readUInt16 (f); if( si->HasEnvelope ) { si->EnvPoints = readUInt8 (f); si->EnvelopeRecords = (SWF_SOUNDENVELOPE *) calloc (si->EnvPoints, sizeof (SWF_SOUNDENVELOPE)); for(i=0;iEnvPoints;i++) { si->EnvelopeRecords[i].Pos44 = readUInt32 (f); si->EnvelopeRecords[i].LeftLevel = readUInt16 (f); si->EnvelopeRecords[i].RightLevel = readUInt16 (f); } } } SWF_Parserstruct * parseSWF_STARTSOUND (FILE * f, int length) { PAR_BEGIN (SWF_STARTSOUND); parserrec->SoundId = readUInt16 (f); parseSWF_SOUNDINFO(f, &parserrec->SoundInfo); PAR_END; } SWF_Parserstruct * parseSWF_STARTSOUND2 (FILE * f, int length) { PAR_BEGIN (SWF_STARTSOUND2); parserrec->SoundClassName = readString (f); parseSWF_SOUNDINFO(f, &parserrec->SoundInfo); PAR_END; } SWF_Parserstruct * parseSWF_SYNCFRAME (FILE * f, int length) { PAR_BEGIN (SWF_SYNCFRAME); SKIP; PAR_END; } SWF_Parserstruct * parseSWF_INITACTION (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_INITACTION); parserrec->SpriteId = readUInt16 (f); parserrec->Actions = (SWF_ACTION *) calloc (1, sizeof (SWF_ACTION)); parserrec->numActions = 0; while ( fileOffset < end ) { parseSWF_ACTIONRECORD (f, &(parserrec->numActions), parserrec->Actions); parserrec->Actions = (SWF_ACTION *) realloc (parserrec->Actions, (++parserrec-> numActions + 1) * sizeof (SWF_ACTION)); } /* parserrec->AScript = decompile5Action (f, length, 1); */ PAR_END; } SWF_Parserstruct * parseSWF_VIDEOFRAME (FILE * f, int length) { int end = fileOffset + length; PAR_BEGIN (SWF_VIDEOFRAME); parserrec->StreamID = readUInt16 (f); parserrec->FrameNum = readUInt16 (f); parserrec->VideoData = (UI8 *)readBytes(f, end - fileOffset); PAR_END; } SWF_Parserstruct * parseSWF_REFLEX (FILE * f, int length) { PAR_BEGIN (SWF_REFLEX); parserrec->rfx[0] = readUInt8 (f); parserrec->rfx[1] = readUInt8 (f); parserrec->rfx[2] = readUInt8 (f); PAR_END; } SWF_Parserstruct * parseSWF_FILEATTRIBUTES (FILE * f, int length) { PAR_BEGIN (SWF_FILEATTRIBUTES); byteAlign(); parserrec->Reserved = readBits(f, 3); parserrec->HasMetadata = readBits(f, 1); parserrec->ActionScript3 = readBits(f, 1); parserrec->Reserved2 = readBits(f, 2); parserrec->UseNetwork = readBits(f, 1); parserrec->Reserved3 = readUInt16(f); parserrec->Reserved4 = readUInt8(f); PAR_END; } SWF_Parserstruct * parseSWF_METADATA (FILE * f, int length) { PAR_BEGIN(SWF_METADATA); parserrec->Metadata = readString(f); PAR_END; } SWF_Parserstruct * parseSWF_SCRIPTLIMITS (FILE * f, int length) { PAR_BEGIN(SWF_SCRIPTLIMITS); parserrec->MaxRecursionDepth = readUInt16(f); parserrec->ScriptTimeoutSeconds = readUInt16(f); PAR_END; } SWF_Parserstruct * parseSWF_DEFINESCALINGGRID (FILE * f, int length) { PAR_BEGIN(SWF_DEFINESCALINGGRID); parserrec->CharacterId = readUInt16(f); parseSWF_RECT(f, &parserrec->Splitter); PAR_END; } SWF_Parserstruct * parseSWF_SETTABINDEX (FILE * f, int length) { PAR_BEGIN(SWF_SETTABINDEX); parserrec->Depth = readUInt16(f); parserrec->TabIndex = readUInt16(f); PAR_END; } void parseABC_STRING_INFO(struct ABC_STRING_INFO *sinfo, FILE *f) { sinfo->Size = readEncUInt30(f); sinfo->UTF8String = (UI8 *)readBytes(f, sinfo->Size); } void parseABC_NS_INFO(struct ABC_NS_INFO *nsinfo, FILE *f) { nsinfo->Kind = readUInt8(f); nsinfo->Name = readEncUInt30(f); } void parseABC_NS_SET_INFO(struct ABC_NS_SET_INFO *nsset, FILE *f) { int i; nsset->Count = readEncUInt30(f); nsset->NS = malloc(sizeof(U30) * nsset->Count); for(i = 0; i < nsset->Count; i++) nsset->NS[i] = readEncUInt30(f); } void parseABC_QNAME(struct ABC_QNAME *qname, FILE *f) { qname->NS = readEncUInt30(f); qname->Name = readEncUInt30(f); } void parseABC_RTQNAME(struct ABC_RTQNAME *rtq, FILE *f) { rtq->Name = readEncUInt30(f); } void parseABC_RTQNAME_L(struct ABC_RTQNAME_L *rtql, FILE *f) { } void parseABC_MULTINAME(struct ABC_MULTINAME *mn, FILE *f) { mn->Name = readEncUInt30(f); mn->NSSet = readEncUInt30(f); } void parseABC_MULTINAME_L(struct ABC_MULTINAME_L *mnl, FILE *f) { mnl->NSSet = readEncUInt30(f); } void parseABC_MULTINAME_INFO(struct ABC_MULTINAME_INFO *minfo, FILE *f) { minfo->Kind = readUInt8(f); switch(minfo->Kind) { case ABC_CONST_QNAME: case ABC_CONST_QNAME_A: parseABC_QNAME(&minfo->Data.QName, f); break; case ABC_CONST_RTQNAME: case ABC_CONST_RTQNAME_A: parseABC_RTQNAME(&minfo->Data.RTQName, f); break; case ABC_CONST_RTQNAME_L: case ABC_CONST_RTQNAME_LA: parseABC_RTQNAME_L(&minfo->Data.RTQNameL, f); break; case ABC_CONST_MULTINAME: case ABC_CONST_MULTINAME_A: parseABC_MULTINAME(&minfo->Data.Multiname, f); break; case ABC_CONST_MULTINAME_L: case ABC_CONST_MULTINAME_LA: parseABC_MULTINAME_L(&minfo->Data.MultinameL, f); break; default: SWF_error("Unknow multiname kind %x\n", minfo->Kind); } } void parseABC_CONSTANT_POOL(struct ABC_CONSTANT_POOL *cpool, FILE *f) { int i; size_t s; cpool->IntCount = readEncUInt30(f); cpool->Integers = malloc(cpool->IntCount * sizeof(S32)); for(i = 1; i < cpool->IntCount; i++) cpool->Integers[i] = readEncSInt32(f); cpool->UIntCount = readEncUInt30(f); cpool->UIntegers = malloc(cpool->UIntCount * sizeof(U32)); for(i = 1; i < cpool->UIntCount; i++) cpool->UIntegers[i] = readEncUInt32(f); cpool->DoubleCount = readEncUInt30(f); cpool->Doubles = malloc(cpool->DoubleCount * sizeof(DOUBLE)); for(i = 1; i < cpool->DoubleCount; i++) cpool->Doubles[i] = readDouble(f); cpool->StringCount = readEncUInt30(f); s = cpool->StringCount * sizeof(struct ABC_STRING_INFO); cpool->Strings = malloc(s); for(i = 1; i < cpool->StringCount; i++) parseABC_STRING_INFO(cpool->Strings + i, f); cpool->NamespaceCount = readEncUInt30(f); s = cpool->NamespaceCount * sizeof(struct ABC_NS_INFO); cpool->Namespaces = malloc(s); for(i = 1; i < cpool->NamespaceCount; i++) parseABC_NS_INFO(cpool->Namespaces + i, f); cpool->NamespaceSetCount = readEncUInt30(f); s = cpool->NamespaceSetCount * sizeof(struct ABC_NS_SET_INFO); cpool->NsSets = malloc(s); for(i = 1; i < cpool->NamespaceSetCount; i++) parseABC_NS_SET_INFO(cpool->NsSets + i, f); cpool->MultinameCount = readEncUInt30(f); s = cpool->MultinameCount * sizeof(struct ABC_MULTINAME_INFO); cpool->Multinames = malloc(s); for(i = 1; i < cpool->MultinameCount; i++) parseABC_MULTINAME_INFO(cpool->Multinames + i, f); } void parseABC_OPTION_INFO(struct ABC_OPTION_INFO *oinfo, FILE *f) { int i; oinfo->OptionCount = readEncUInt30(f); oinfo->Option = malloc(sizeof(struct ABC_OPTION_INFO) * oinfo->OptionCount); for(i = 0; i < oinfo->OptionCount; i++) { oinfo->Option[i].Val = readEncUInt30(f); oinfo->Option[i].Kind = readUInt8(f); } } void parseABC_PARAM_INFO(struct ABC_PARAM_INFO *pinfo, U30 count, FILE *f) { int i; pinfo->ParamNames = malloc(count * sizeof(U30)); for(i = 0; i < count; i++) pinfo->ParamNames[i] = readEncUInt30(f); } void parseABC_METHOD_INFO(struct ABC_METHOD_INFO *method, FILE *f) { int i; method->ParamCount = readEncUInt30(f); method->ReturnType = readEncUInt30(f); method->ParamType = malloc(sizeof(U30) * method->ParamCount); for(i = 0; i < method->ParamCount; i++) method->ParamType[i] = readEncUInt30(f); method->Name = readEncUInt30(f); method->Flags = readUInt8(f); if(method->Flags & ABC_METHOD_HAS_OPTIONAL) parseABC_OPTION_INFO(&method->Options, f); if(method->Flags & ABC_METHOD_HAS_PARAM_NAMES) parseABC_PARAM_INFO(&method->ParamNames, method->ParamCount, f); } void parseABC_METADATA_INFO(struct ABC_METADATA_INFO *meta, FILE *f) { int i; meta->Name = readEncUInt30(f); meta->ItemCount = readEncUInt30(f); meta->Items = malloc(sizeof(struct ABC_ITEM_INFO) * meta->ItemCount); for(i = 0; i < meta->ItemCount; i++) { meta->Items[i].Key = readEncUInt30(f); meta->Items[i].Value = readEncUInt30(f); } } void parseABC_TRAIT_SLOT(struct ABC_TRAIT_SLOT *slot, FILE *f) { slot->SlotId = readEncUInt30(f); slot->TypeName = readEncUInt30(f); slot->VIndex = readEncUInt30(f); if(slot->VIndex) slot->VKind = readUInt8(f); } void parseABC_TRAIT_CLASS(struct ABC_TRAIT_CLASS *class, FILE *f) { class->SlotId = readEncUInt30(f); class->ClassIndex = readEncUInt30(f); } void parseABC_TRAIT_FUNCTION(struct ABC_TRAIT_FUNCTION *func, FILE *f) { func->SlotId = readEncUInt30(f); func->Function = readEncUInt30(f); } void parseABC_TRAIT_METHOD(struct ABC_TRAIT_METHOD *m, FILE *f) { m->DispId = readEncUInt30(f); m->Method = readEncUInt30(f); } void parseABC_TRAITS_INFO(struct ABC_TRAITS_INFO *trait, FILE *f) { int i; trait->Name = readEncUInt30(f); trait->Kind = readUInt8(f); trait->Attr = (trait->Kind & 0xf0) >> 4; switch(trait->Kind & 0x0f) // lower 4-bits for type { case ABC_CONST_TRAIT_SLOT: case ABC_CONST_TRAIT_CONST: parseABC_TRAIT_SLOT(&trait->Data.Slot, f); break; case ABC_CONST_TRAIT_CLASS: parseABC_TRAIT_CLASS(&trait->Data.Class, f); break; case ABC_CONST_TRAIT_FUNCTION: parseABC_TRAIT_FUNCTION(&trait->Data.Function, f); break; case ABC_CONST_TRAIT_METHOD: case ABC_CONST_TRAIT_GETTER: case ABC_CONST_TRAIT_SETTER: parseABC_TRAIT_METHOD(&trait->Data.Method, f); break; default: SWF_error("Unknow trait %x\n", trait->Kind); } if(trait->Attr & ABC_TRAIT_ATTR_METADATA) { trait->MetadataCount = readEncUInt30(f); trait->Metadata = malloc(trait->MetadataCount * sizeof(U30)); for(i = 0; i < trait->MetadataCount; i++) trait->Metadata[i] = readEncUInt30(f); } } void parseABC_CLASS_INFO(struct ABC_CLASS_INFO *cinfo, FILE *f) { int i; cinfo->CInit = readEncUInt30(f); cinfo->TraitCount = readEncUInt30(f); cinfo->Traits = malloc(sizeof(struct ABC_TRAITS_INFO) * cinfo->TraitCount); for(i = 0; i < cinfo->TraitCount; i++) parseABC_TRAITS_INFO(cinfo->Traits + i, f); } void parseABC_SCRIPT_INFO(struct ABC_SCRIPT_INFO *sinfo, FILE *f) { int i; sinfo->Init = readEncUInt30(f); sinfo->TraitCount = readEncUInt30(f); sinfo->Traits = malloc(sizeof(struct ABC_TRAITS_INFO) * sinfo->TraitCount); for(i = 0; i < sinfo->TraitCount; i++) parseABC_TRAITS_INFO(sinfo->Traits + i, f); } void parseABC_INSTANCE_INFO(struct ABC_INSTANCE_INFO *inst, FILE *f) { int i; inst->Name = readEncUInt30(f); inst->SuperName = readEncUInt30(f); inst->Flags = readUInt8(f); if(inst->Flags & ABC_CLASS_PROTECTED_NS) inst->ProtectedNs = readEncUInt30(f); inst->InterfaceCount = readEncUInt30(f); inst->Interfaces = malloc(inst->InterfaceCount * sizeof(U30)); for(i = 0; i < inst->InterfaceCount; i++) inst->Interfaces[i] = readEncUInt30(f); inst->IInit = readEncUInt30(f); inst->TraitCount = readEncUInt30(f); inst->Traits = malloc(inst->TraitCount * sizeof(struct ABC_TRAITS_INFO)); for(i = 0; i < inst->TraitCount; i++) parseABC_TRAITS_INFO(inst->Traits + i, f); } void parseABC_EXCEPTION_INFO(struct ABC_EXCEPTION_INFO *ex, FILE *f) { ex->From = readEncUInt30(f); ex->To = readEncUInt30(f); ex->Target = readEncUInt30(f); ex->ExcType = readEncUInt30(f); ex->VarName = readEncUInt30(f); } void parseABC_METHOD_BODY_INFO(struct ABC_METHOD_BODY_INFO *minfo, FILE *f) { int i; minfo->Method = readEncUInt30(f); minfo->MaxStack = readEncUInt30(f); minfo->LocalCount = readEncUInt30(f); minfo->InitScopeDepth = readEncUInt30(f); minfo->MaxScopeDepth = readEncUInt30(f); minfo->CodeLength = readEncUInt30(f); minfo->Code = (UI8 *)readBytes(f, minfo->CodeLength); minfo->ExceptionCount = readEncUInt30(f); minfo->Exceptions = malloc(minfo->ExceptionCount * sizeof(struct ABC_EXCEPTION_INFO)); for(i = 0; i < minfo->ExceptionCount; i++) parseABC_EXCEPTION_INFO(minfo->Exceptions + i, f); minfo->TraitCount = readEncUInt30(f); minfo->Traits = malloc(sizeof(struct ABC_TRAITS_INFO) * minfo->TraitCount); for(i = 0; i < minfo->TraitCount; i++) parseABC_TRAITS_INFO(minfo->Traits + i, f); } void parseABC_FILE(struct ABC_FILE *abcFile, FILE *f) { int i; size_t size; abcFile->Minor = readUInt16(f); abcFile->Major = readUInt16(f); parseABC_CONSTANT_POOL(&abcFile->ConstantPool, f); abcFile->MethodCount = readEncUInt30(f); size = abcFile->MethodCount * sizeof(struct ABC_METHOD_INFO); abcFile->Methods = malloc(size); for(i = 0; i < abcFile->MethodCount; i++) parseABC_METHOD_INFO(abcFile->Methods + i, f); abcFile->MetadataCount = readEncUInt30(f); size = abcFile->MetadataCount * sizeof(struct ABC_METADATA_INFO); abcFile->Metadata = malloc(size); for(i = 0; i < abcFile->MetadataCount; i++) parseABC_METADATA_INFO(abcFile->Metadata + i, f); abcFile->ClassCount = readEncUInt30(f); size = abcFile->ClassCount * sizeof(struct ABC_INSTANCE_INFO); abcFile->Instances = malloc(size); size = abcFile->ClassCount * sizeof(struct ABC_CLASS_INFO); abcFile->Classes = malloc(size); for(i = 0; i < abcFile->ClassCount; i++) parseABC_INSTANCE_INFO(abcFile->Instances + i, f); for(i = 0; i < abcFile->ClassCount; i++) parseABC_CLASS_INFO(abcFile->Classes + i, f); abcFile->ScriptCount = readEncUInt30(f); size = abcFile->ScriptCount * sizeof(struct ABC_SCRIPT_INFO); abcFile->Scripts = malloc(size); for(i = 0; i < abcFile->ScriptCount; i++) parseABC_SCRIPT_INFO(abcFile->Scripts + i, f); abcFile->MethodBodyCount = readEncUInt30(f); size = abcFile->MethodBodyCount * sizeof(struct ABC_METHOD_BODY_INFO); abcFile->MethodBodies = malloc(size); for(i = 0; i < abcFile->MethodBodyCount; i++) parseABC_METHOD_BODY_INFO(abcFile->MethodBodies + i, f); } SWF_Parserstruct * parseSWF_DOABC (FILE *f, int length) { PAR_BEGIN(SWF_DOABC); parserrec->Flags = readUInt32(f); parserrec->Name = readString(f); parseABC_FILE(&parserrec->AbcFile, f); PAR_END; } SWF_Parserstruct * parseSWF_SYMBOLCLASS (FILE *f, int length) { int i, count; PAR_BEGIN(SWF_SYMBOLCLASS); count = readUInt16(f); parserrec->SymbolCount = count; parserrec->SymbolList = malloc(count * sizeof(struct SWF_SYMBOLCLASS)); for(i = 0; i < count; i++) { parserrec->SymbolList[i].SymbolId = readUInt16(f); parserrec->SymbolList[i].SymbolName = readString(f); } PAR_END; } SWF_Parserstruct * parseSWF_DEFINEBINARYDATA(FILE *f, int length) { PAR_BEGIN(SWF_DEFINEBINARYDATA); parserrec->Reserved = readUInt32(f); parserrec->Data = (UI8 *)readBytes(f, length - 4); parserrec->DataLength = length - 4; PAR_END; } SWF_Parserstruct * parseSWF_DEFINESCENEANDFRAMEDATA(FILE *f, int length) { int i; PAR_BEGIN(SWF_DEFINESCENEANDFRAMEDATA); parserrec->SceneCount = readEncUInt32(f); parserrec->Scenes = malloc(sizeof(struct SCENE_DATA) * parserrec->SceneCount); for(i = 0; i < parserrec->SceneCount; i++) { parserrec->Scenes[i].Offset = readEncUInt32(f); parserrec->Scenes[i].Name = readString(f); } parserrec->FrameLabelCount = readEncUInt32(f); parserrec->Frames = malloc(sizeof(struct FRAME_DATA) * parserrec->FrameLabelCount); for(i = 0; i < parserrec->FrameLabelCount; i++) { parserrec->Frames[i].FrameNum = readEncUInt32(f); parserrec->Frames[i].FrameLabel = readString(f); } PAR_END; } SWF_Parserstruct * parseSWF_DEBUGID(FILE *f, int length) { PAR_BEGIN(SWF_DEBUGID); parserrec->UUID = (UI8 *)readBytes(f, length); PAR_END; } SWF_Parserstruct * parseSWF_UNKNOWNBLOCK(FILE *f, int length) { PAR_BEGIN(SWF_UNKNOWNBLOCK); parserrec->Data = (UI8 *)readBytes(f, length); PAR_END; } ming-0.4.5/util/vasprintf.h0000644000175000017500000000020712154635363012544 00000000000000#include #include "ming_config.h" #ifndef HAVE_VASPRINTF int vasprintf(char **ret, const char *format, va_list ap); #endif ming-0.4.5/util/ming-config.in0000644000175000017500000000106711454264373013112 00000000000000#!/bin/sh prefix=@prefix@ exec_prefix=@exec_prefix@ usage() { cat <&2 fi while test $# -gt 0; do case $1 in --help) usage 0 ;; --version) echo "@MING_VERSION@" ;; --cflags) echo -I@includedir@ ;; --libs) echo -L@libdir@ @ZLIB@ @MATHLIB@ @GIFLIB@ @PNGLIB@ -lming ;; --bindir) echo @bindir@ ;; *) usage 1 1>&2 ;; esac shift done ming-0.4.5/util/libswf.h0000644000175000017500000000030211454264373012013 00000000000000/* libswf.h - global typedefs, etc. */ #ifndef LIBSWF_H_INCLUDED #define LIBSWF_H_INCLUDED #include #include typedef unsigned char byte; #endif /* LIBSWF_H_INCLUDED */ ming-0.4.5/util/Makefile.in0000644000175000017500000021133712154727033012430 00000000000000# Makefile.in generated by automake 1.11.6 from Makefile.am. # @configure_input@ # Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, # 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free Software # Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ VPATH = @srcdir@ am__make_dryrun = \ { \ am__dry=no; \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ echo 'am--echo: ; @echo "AM" OK' | $(MAKE) -f - 2>/dev/null \ | grep '^AM OK$$' >/dev/null || am__dry=yes;; \ *) \ for am__flg in $$MAKEFLAGS; do \ case $$am__flg in \ *=*|--*) ;; \ *n*) am__dry=yes; break;; \ esac; \ done;; \ esac; \ test $$am__dry = yes; \ } pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = listswf$(EXEEXT) listswf_d$(EXEEXT) swftophp$(EXEEXT) \ swftoperl$(EXEEXT) swftopython$(EXEEXT) swftocxx$(EXEEXT) \ swftotcl$(EXEEXT) makeswf$(EXEEXT) listaction$(EXEEXT) \ listaction_d$(EXEEXT) listfdb$(EXEEXT) makefdb$(EXEEXT) \ listjpeg$(EXEEXT) raw2adpcm$(EXEEXT) listmp3$(EXEEXT) \ listmp3$(EXEEXT) $(am__EXEEXT_1) $(am__EXEEXT_2) subdir = util DIST_COMMON = README $(noinst_HEADERS) $(srcdir)/Makefile.am \ $(srcdir)/Makefile.in $(srcdir)/ming-config.in TODO ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/macros/libtool.m4 \ $(top_srcdir)/macros/ltoptions.m4 \ $(top_srcdir)/macros/ltsugar.m4 \ $(top_srcdir)/macros/ltversion.m4 \ $(top_srcdir)/macros/lt~obsolete.m4 \ $(top_srcdir)/macros/python.m4 $(top_srcdir)/configure.in am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/ming_config.h CONFIG_CLEAN_FILES = ming-config CONFIG_CLEAN_VPATH_FILES = LTLIBRARIES = $(noinst_LTLIBRARIES) am__DEPENDENCIES_1 = libutil_la_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_libutil_la_OBJECTS = action.lo blocktypes.lo decompile.lo parser.lo \ read.lo vasprintf.lo libutil_la_OBJECTS = $(am_libutil_la_OBJECTS) AM_V_lt = $(am__v_lt_@AM_V@) am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@) am__v_lt_0 = --silent @USE_PNG_TRUE@@USE_ZLIB_TRUE@am__EXEEXT_1 = png2dbl$(EXEEXT) \ @USE_PNG_TRUE@@USE_ZLIB_TRUE@ dbl2png$(EXEEXT) @USE_GIF_TRUE@@USE_ZLIB_TRUE@am__EXEEXT_2 = gif2mask$(EXEEXT) \ @USE_GIF_TRUE@@USE_ZLIB_TRUE@ gif2dbl$(EXEEXT) am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am_dbl2png_OBJECTS = dbl2png.$(OBJEXT) dbl2png_OBJECTS = $(am_dbl2png_OBJECTS) dbl2png_DEPENDENCIES = $(top_builddir)/src/libming.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) am_gif2dbl_OBJECTS = gif2dbl.$(OBJEXT) gif2dbl_OBJECTS = $(am_gif2dbl_OBJECTS) gif2dbl_DEPENDENCIES = $(top_builddir)/src/libming.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_gif2mask_OBJECTS = gif2mask.$(OBJEXT) gif2mask_OBJECTS = $(am_gif2mask_OBJECTS) gif2mask_DEPENDENCIES = $(top_builddir)/src/libming.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_listaction_OBJECTS = listaction-outputtxt.$(OBJEXT) \ listaction-main.$(OBJEXT) listaction_OBJECTS = $(am_listaction_OBJECTS) listaction_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la listaction_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(listaction_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_listaction_d_OBJECTS = listaction_d-outputtxt.$(OBJEXT) \ listaction_d-main.$(OBJEXT) listaction_d_OBJECTS = $(am_listaction_d_OBJECTS) listaction_d_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la listaction_d_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(listaction_d_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_listfdb_OBJECTS = listfdb.$(OBJEXT) listfdb_OBJECTS = $(am_listfdb_OBJECTS) listfdb_DEPENDENCIES = $(top_builddir)/src/libming.la am_listjpeg_OBJECTS = listjpeg.$(OBJEXT) listjpeg_OBJECTS = $(am_listjpeg_OBJECTS) listjpeg_DEPENDENCIES = $(top_builddir)/src/libming.la am_listmp3_OBJECTS = listmp3.$(OBJEXT) listmp3_OBJECTS = $(am_listmp3_OBJECTS) listmp3_DEPENDENCIES = $(top_builddir)/src/libming.la am_listswf_OBJECTS = listswf-outputtxt.$(OBJEXT) \ listswf-main.$(OBJEXT) listswf_OBJECTS = $(am_listswf_OBJECTS) listswf_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la listswf_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(listswf_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_listswf_d_OBJECTS = outputtxt.$(OBJEXT) main.$(OBJEXT) listswf_d_OBJECTS = $(am_listswf_d_OBJECTS) listswf_d_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la am_makefdb_OBJECTS = makefdb-outputfdb.$(OBJEXT) \ makefdb-main.$(OBJEXT) makefdb_OBJECTS = $(am_makefdb_OBJECTS) makefdb_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la makefdb_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(makefdb_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_makeswf_OBJECTS = makeswf.$(OBJEXT) makeswf_utils.$(OBJEXT) makeswf_OBJECTS = $(am_makeswf_OBJECTS) makeswf_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la am_png2dbl_OBJECTS = png2dbl.$(OBJEXT) png2dbl_OBJECTS = $(am_png2dbl_OBJECTS) png2dbl_DEPENDENCIES = $(top_builddir)/src/libming.la \ $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \ $(am__DEPENDENCIES_1) am_raw2adpcm_OBJECTS = raw2adpcm.$(OBJEXT) raw2adpcm_OBJECTS = $(am_raw2adpcm_OBJECTS) raw2adpcm_DEPENDENCIES = $(top_builddir)/src/libming.la am_swftocxx_OBJECTS = swftocxx-outputscript.$(OBJEXT) \ swftocxx-main.$(OBJEXT) swftocxx_OBJECTS = $(am_swftocxx_OBJECTS) swftocxx_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la swftocxx_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(swftocxx_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_swftoperl_OBJECTS = swftoperl-outputscript.$(OBJEXT) \ swftoperl-main.$(OBJEXT) swftoperl_OBJECTS = $(am_swftoperl_OBJECTS) swftoperl_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la swftoperl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(swftoperl_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_swftophp_OBJECTS = swftophp-outputscript.$(OBJEXT) \ swftophp-main.$(OBJEXT) swftophp_OBJECTS = $(am_swftophp_OBJECTS) swftophp_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la swftophp_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(swftophp_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_swftopython_OBJECTS = swftopython-outputscript.$(OBJEXT) \ swftopython-main.$(OBJEXT) swftopython_OBJECTS = $(am_swftopython_OBJECTS) swftopython_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la swftopython_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(swftopython_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am_swftotcl_OBJECTS = swftotcl-outputscript.$(OBJEXT) \ swftotcl-main.$(OBJEXT) swftotcl_OBJECTS = $(am_swftotcl_OBJECTS) swftotcl_DEPENDENCIES = libutil.la $(top_builddir)/src/libming.la swftotcl_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(swftotcl_CFLAGS) \ $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`; am__vpath_adj = case $$p in \ $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \ *) f=$$p;; \ esac; am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`; am__install_max = 40 am__nobase_strip_setup = \ srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'` am__nobase_strip = \ for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||" am__nobase_list = $(am__nobase_strip_setup); \ for p in $$list; do echo "$$p $$p"; done | \ sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \ $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \ if (++n[$$2] == $(am__install_max)) \ { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \ END { for (dir in files) print dir, files[dir] }' am__base_list = \ sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \ sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g' am__uninstall_files_from_dir = { \ test -z "$$files" \ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \ $(am__cd) "$$dir" && rm -f $$files; }; \ } SCRIPTS = $(bin_SCRIPTS) DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src depcomp = $(SHELL) $(top_srcdir)/config/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ CCLD = $(CC) LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \ $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; SOURCES = $(libutil_la_SOURCES) $(dbl2png_SOURCES) $(gif2dbl_SOURCES) \ $(gif2mask_SOURCES) $(listaction_SOURCES) \ $(listaction_d_SOURCES) $(listfdb_SOURCES) $(listjpeg_SOURCES) \ $(listmp3_SOURCES) $(listswf_SOURCES) $(listswf_d_SOURCES) \ $(makefdb_SOURCES) $(makeswf_SOURCES) $(png2dbl_SOURCES) \ $(raw2adpcm_SOURCES) $(swftocxx_SOURCES) $(swftoperl_SOURCES) \ $(swftophp_SOURCES) $(swftopython_SOURCES) $(swftotcl_SOURCES) DIST_SOURCES = $(libutil_la_SOURCES) $(dbl2png_SOURCES) \ $(gif2dbl_SOURCES) $(gif2mask_SOURCES) $(listaction_SOURCES) \ $(listaction_d_SOURCES) $(listfdb_SOURCES) $(listjpeg_SOURCES) \ $(listmp3_SOURCES) $(listswf_SOURCES) $(listswf_d_SOURCES) \ $(makefdb_SOURCES) $(makeswf_SOURCES) $(png2dbl_SOURCES) \ $(raw2adpcm_SOURCES) $(swftocxx_SOURCES) $(swftoperl_SOURCES) \ $(swftophp_SOURCES) $(swftopython_SOURCES) $(swftotcl_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac HEADERS = $(noinst_HEADERS) ETAGS = etags CTAGS = ctags DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AR = @AR@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CXX = @CXX@ CXXCPP = @CXXCPP@ CXXDEPMODE = @CXXDEPMODE@ CXXFLAGS = @CXXFLAGS@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DLLTOOL = @DLLTOOL@ DSYMUTIL = @DSYMUTIL@ DUMPBIN = @DUMPBIN@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ FGREP = @FGREP@ FREETYPE_CFLAGS = @FREETYPE_CFLAGS@ FREETYPE_LIBS = @FREETYPE_LIBS@ GIFLIB = @GIFLIB@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ INTERFACE_AGE = @INTERFACE_AGE@ INTERFACE_CURRENT = @INTERFACE_CURRENT@ INTERFACE_REVISION = @INTERFACE_REVISION@ LD = @LD@ LDFLAGS = @LDFLAGS@ LEX = @LEX@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LIBTOOL = @LIBTOOL@ LIPO = @LIPO@ LN_S = @LN_S@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAJOR_VERSION = @MAJOR_VERSION@ MAKEINFO = @MAKEINFO@ MANIFEST_TOOL = @MANIFEST_TOOL@ MATHLIB = @MATHLIB@ MICRO_VERSION = @MICRO_VERSION@ MING_VERSION = @MING_VERSION@ MINOR_VERSION = @MINOR_VERSION@ MKDIR_P = @MKDIR_P@ NM = @NM@ NMEDIT = @NMEDIT@ OBJDUMP = @OBJDUMP@ OBJEXT = @OBJEXT@ OTOOL = @OTOOL@ OTOOL64 = @OTOOL64@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PERL = @PERL@ PHP = @PHP@ PHPIZE = @PHPIZE@ PNGLIB = @PNGLIB@ PYTHON = @PYTHON@ PYTHON_CPPFLAGS = @PYTHON_CPPFLAGS@ PYTHON_EXTRA_LDFLAGS = @PYTHON_EXTRA_LDFLAGS@ PYTHON_EXTRA_LIBS = @PYTHON_EXTRA_LIBS@ PYTHON_LDFLAGS = @PYTHON_LDFLAGS@ PYTHON_SITE_PKG = @PYTHON_SITE_PKG@ PYTHON_VERSION = @PYTHON_VERSION@ RANLIB = @RANLIB@ SED = @SED@ SET_MAKE = @SET_MAKE@ SHCFLAGS = @SHCFLAGS@ SHELL = @SHELL@ STRIP = @STRIP@ TCL = @TCL@ TCL_INC_DIR = @TCL_INC_DIR@ TCL_LIB_DIR = @TCL_LIB_DIR@ VERSION = @VERSION@ XLIB = @XLIB@ YACC = @YACC@ ZLIB = @ZLIB@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_AR = @ac_ct_AR@ ac_ct_CC = @ac_ct_CC@ ac_ct_CXX = @ac_ct_CXX@ ac_ct_DUMPBIN = @ac_ct_DUMPBIN@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ ft_config = @ft_config@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ INCLUDES = -I$(top_srcdir)/src @USE_GIF_FALSE@gifprograms = @USE_GIF_TRUE@@USE_ZLIB_TRUE@gifprograms = gif2mask gif2dbl @USE_PNG_FALSE@pngprograms = @USE_PNG_TRUE@@USE_ZLIB_TRUE@pngprograms = png2dbl dbl2png noinst_LTLIBRARIES = libutil.la libutil_la_SOURCES = \ action.c \ blocktypes.c \ decompile.c \ parser.c \ read.c \ vasprintf.c libutil_la_LIBADD = $(MATHLIB) $(ZLIB) noinst_HEADERS = \ action.h \ decompile.h \ libswf.h \ makeswf.h \ outputdecl.h \ output.h \ parserdecl.h \ parser.h \ read.h \ swfoutput.h \ swftypes.h \ vasprintf.h listswf_SOURCES = outputtxt.c main.c listswf_LDADD = libutil.la $(top_builddir)/src/libming.la listswf_CFLAGS = -DNODECOMPILE listswf_d_SOURCES = outputtxt.c main.c listswf_d_LDADD = libutil.la $(top_builddir)/src/libming.la swftophp_SOURCES = outputscript.c main.c swftophp_LDADD = libutil.la $(top_builddir)/src/libming.la swftophp_CFLAGS = -DSWFPHP swftoperl_SOURCES = outputscript.c main.c swftoperl_LDADD = libutil.la $(top_builddir)/src/libming.la swftoperl_CFLAGS = -DSWFPERL swftopython_SOURCES = outputscript.c main.c swftopython_LDADD = libutil.la $(top_builddir)/src/libming.la swftopython_CFLAGS = -DSWFPYTHON swftocxx_SOURCES = outputscript.c main.c swftocxx_LDADD = libutil.la $(top_builddir)/src/libming.la swftocxx_CFLAGS = -DSWFPLUSPLUS swftotcl_SOURCES = outputscript.c main.c swftotcl_LDADD = libutil.la $(top_builddir)/src/libming.la swftotcl_CFLAGS = -DSWFTCL listaction_SOURCES = outputtxt.c main.c listaction_LDADD = libutil.la $(top_builddir)/src/libming.la listaction_CFLAGS = -DACTIONONLY -DNODECOMPILE listaction_d_SOURCES = outputtxt.c main.c listaction_d_LDADD = libutil.la $(top_builddir)/src/libming.la listaction_d_CFLAGS = -DACTIONONLY listfdb_SOURCES = listfdb.c listfdb_LDADD = $(top_builddir)/src/libming.la raw2adpcm_SOURCES = raw2adpcm.c raw2adpcm_LDADD = $(top_builddir)/src/libming.la listmp3_SOURCES = listmp3.c listmp3_LDADD = $(top_builddir)/src/libming.la listjpeg_SOURCES = listjpeg.c listjpeg_LDADD = $(top_builddir)/src/libming.la makefdb_SOURCES = outputfdb.c main.c makefdb_LDADD = libutil.la $(top_builddir)/src/libming.la makefdb_CFLAGS = -DMAKE_FDB gif2mask_SOURCES = gif2mask.c gif2mask_LDADD = $(top_builddir)/src/libming.la $(MATHLIB) $(ZLIB) $(GIFLIB) png2dbl_SOURCES = png2dbl.c png2dbl_LDADD = $(top_builddir)/src/libming.la $(MATHLIB) $(ZLIB) $(PNGLIB) dbl2png_SOURCES = dbl2png.c dbl2png_LDADD = $(top_builddir)/src/libming.la $(ZLIB) $(PNGLIB) gif2dbl_SOURCES = gif2dbl.c gif2dbl_LDADD = $(top_builddir)/src/libming.la $(MATHLIB) $(ZLIB) $(GIFLIB) makeswf_SOURCES = makeswf.c makeswf_utils.c makeswf_LDADD = libutil.la $(top_builddir)/src/libming.la bin_SCRIPTS = ming-config EXTRA_DIST = \ README \ TIPS \ TODO \ bindump.c \ hexdump.c \ cws2fws \ swftoperl.html \ ming.css DISTCLEANFILES = ming-config all: all-am .SUFFIXES: .SUFFIXES: .c .lo .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu util/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --gnu util/Makefile .PRECIOUS: Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): ming-config: $(top_builddir)/config.status $(srcdir)/ming-config.in cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ clean-noinstLTLIBRARIES: -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES) @list='$(noinst_LTLIBRARIES)'; for p in $$list; do \ dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \ test "$$dir" != "$$p" || dir=.; \ echo "rm -f \"$${dir}/so_locations\""; \ rm -f "$${dir}/so_locations"; \ done libutil.la: $(libutil_la_OBJECTS) $(libutil_la_DEPENDENCIES) $(EXTRA_libutil_la_DEPENDENCIES) $(AM_V_CCLD)$(LINK) $(libutil_la_OBJECTS) $(libutil_la_LIBADD) $(LIBS) install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p || test -f $$p1; \ then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: @list='$(bin_PROGRAMS)'; test -n "$$list" || exit 0; \ echo " rm -f" $$list; \ rm -f $$list || exit $$?; \ test -n "$(EXEEXT)" || exit 0; \ list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \ echo " rm -f" $$list; \ rm -f $$list dbl2png$(EXEEXT): $(dbl2png_OBJECTS) $(dbl2png_DEPENDENCIES) $(EXTRA_dbl2png_DEPENDENCIES) @rm -f dbl2png$(EXEEXT) $(AM_V_CCLD)$(LINK) $(dbl2png_OBJECTS) $(dbl2png_LDADD) $(LIBS) gif2dbl$(EXEEXT): $(gif2dbl_OBJECTS) $(gif2dbl_DEPENDENCIES) $(EXTRA_gif2dbl_DEPENDENCIES) @rm -f gif2dbl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gif2dbl_OBJECTS) $(gif2dbl_LDADD) $(LIBS) gif2mask$(EXEEXT): $(gif2mask_OBJECTS) $(gif2mask_DEPENDENCIES) $(EXTRA_gif2mask_DEPENDENCIES) @rm -f gif2mask$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gif2mask_OBJECTS) $(gif2mask_LDADD) $(LIBS) listaction$(EXEEXT): $(listaction_OBJECTS) $(listaction_DEPENDENCIES) $(EXTRA_listaction_DEPENDENCIES) @rm -f listaction$(EXEEXT) $(AM_V_CCLD)$(listaction_LINK) $(listaction_OBJECTS) $(listaction_LDADD) $(LIBS) listaction_d$(EXEEXT): $(listaction_d_OBJECTS) $(listaction_d_DEPENDENCIES) $(EXTRA_listaction_d_DEPENDENCIES) @rm -f listaction_d$(EXEEXT) $(AM_V_CCLD)$(listaction_d_LINK) $(listaction_d_OBJECTS) $(listaction_d_LDADD) $(LIBS) listfdb$(EXEEXT): $(listfdb_OBJECTS) $(listfdb_DEPENDENCIES) $(EXTRA_listfdb_DEPENDENCIES) @rm -f listfdb$(EXEEXT) $(AM_V_CCLD)$(LINK) $(listfdb_OBJECTS) $(listfdb_LDADD) $(LIBS) listjpeg$(EXEEXT): $(listjpeg_OBJECTS) $(listjpeg_DEPENDENCIES) $(EXTRA_listjpeg_DEPENDENCIES) @rm -f listjpeg$(EXEEXT) $(AM_V_CCLD)$(LINK) $(listjpeg_OBJECTS) $(listjpeg_LDADD) $(LIBS) listmp3$(EXEEXT): $(listmp3_OBJECTS) $(listmp3_DEPENDENCIES) $(EXTRA_listmp3_DEPENDENCIES) @rm -f listmp3$(EXEEXT) $(AM_V_CCLD)$(LINK) $(listmp3_OBJECTS) $(listmp3_LDADD) $(LIBS) listswf$(EXEEXT): $(listswf_OBJECTS) $(listswf_DEPENDENCIES) $(EXTRA_listswf_DEPENDENCIES) @rm -f listswf$(EXEEXT) $(AM_V_CCLD)$(listswf_LINK) $(listswf_OBJECTS) $(listswf_LDADD) $(LIBS) listswf_d$(EXEEXT): $(listswf_d_OBJECTS) $(listswf_d_DEPENDENCIES) $(EXTRA_listswf_d_DEPENDENCIES) @rm -f listswf_d$(EXEEXT) $(AM_V_CCLD)$(LINK) $(listswf_d_OBJECTS) $(listswf_d_LDADD) $(LIBS) makefdb$(EXEEXT): $(makefdb_OBJECTS) $(makefdb_DEPENDENCIES) $(EXTRA_makefdb_DEPENDENCIES) @rm -f makefdb$(EXEEXT) $(AM_V_CCLD)$(makefdb_LINK) $(makefdb_OBJECTS) $(makefdb_LDADD) $(LIBS) makeswf$(EXEEXT): $(makeswf_OBJECTS) $(makeswf_DEPENDENCIES) $(EXTRA_makeswf_DEPENDENCIES) @rm -f makeswf$(EXEEXT) $(AM_V_CCLD)$(LINK) $(makeswf_OBJECTS) $(makeswf_LDADD) $(LIBS) png2dbl$(EXEEXT): $(png2dbl_OBJECTS) $(png2dbl_DEPENDENCIES) $(EXTRA_png2dbl_DEPENDENCIES) @rm -f png2dbl$(EXEEXT) $(AM_V_CCLD)$(LINK) $(png2dbl_OBJECTS) $(png2dbl_LDADD) $(LIBS) raw2adpcm$(EXEEXT): $(raw2adpcm_OBJECTS) $(raw2adpcm_DEPENDENCIES) $(EXTRA_raw2adpcm_DEPENDENCIES) @rm -f raw2adpcm$(EXEEXT) $(AM_V_CCLD)$(LINK) $(raw2adpcm_OBJECTS) $(raw2adpcm_LDADD) $(LIBS) swftocxx$(EXEEXT): $(swftocxx_OBJECTS) $(swftocxx_DEPENDENCIES) $(EXTRA_swftocxx_DEPENDENCIES) @rm -f swftocxx$(EXEEXT) $(AM_V_CCLD)$(swftocxx_LINK) $(swftocxx_OBJECTS) $(swftocxx_LDADD) $(LIBS) swftoperl$(EXEEXT): $(swftoperl_OBJECTS) $(swftoperl_DEPENDENCIES) $(EXTRA_swftoperl_DEPENDENCIES) @rm -f swftoperl$(EXEEXT) $(AM_V_CCLD)$(swftoperl_LINK) $(swftoperl_OBJECTS) $(swftoperl_LDADD) $(LIBS) swftophp$(EXEEXT): $(swftophp_OBJECTS) $(swftophp_DEPENDENCIES) $(EXTRA_swftophp_DEPENDENCIES) @rm -f swftophp$(EXEEXT) $(AM_V_CCLD)$(swftophp_LINK) $(swftophp_OBJECTS) $(swftophp_LDADD) $(LIBS) swftopython$(EXEEXT): $(swftopython_OBJECTS) $(swftopython_DEPENDENCIES) $(EXTRA_swftopython_DEPENDENCIES) @rm -f swftopython$(EXEEXT) $(AM_V_CCLD)$(swftopython_LINK) $(swftopython_OBJECTS) $(swftopython_LDADD) $(LIBS) swftotcl$(EXEEXT): $(swftotcl_OBJECTS) $(swftotcl_DEPENDENCIES) $(EXTRA_swftotcl_DEPENDENCIES) @rm -f swftotcl$(EXEEXT) $(AM_V_CCLD)$(swftotcl_LINK) $(swftotcl_OBJECTS) $(swftotcl_LDADD) $(LIBS) install-binSCRIPTS: $(bin_SCRIPTS) @$(NORMAL_INSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do \ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n' \ -e 'h;s|.*|.|' \ -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) { files[d] = files[d] " " $$1; \ if (++n[d] == $(am__install_max)) { \ print "f", d, files[d]; n[d] = 0; files[d] = "" } } \ else { print "f", d "/" $$4, $$1 } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binSCRIPTS: @$(NORMAL_UNINSTALL) @list='$(bin_SCRIPTS)'; test -n "$(bindir)" || exit 0; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 's,.*/,,;$(transform)'`; \ dir='$(DESTDIR)$(bindir)'; $(am__uninstall_files_from_dir) mostlyclean-compile: -rm -f *.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/action.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/blocktypes.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/dbl2png.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/decompile.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2dbl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gif2mask.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listaction-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listaction-outputtxt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listaction_d-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listaction_d-outputtxt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listfdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listjpeg.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listmp3.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listswf-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/listswf-outputtxt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makefdb-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makefdb-outputfdb.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makeswf.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/makeswf_utils.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/outputtxt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/parser.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/png2dbl.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/raw2adpcm.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/read.Plo@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftocxx-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftocxx-outputscript.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftoperl-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftoperl-outputscript.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftophp-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftophp-outputscript.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftopython-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftopython-outputscript.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftotcl-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/swftotcl-outputscript.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vasprintf.Plo@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)$(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c `$(CYGPATH_W) '$<'` .c.lo: @am__fastdepCC_TRUE@ $(AM_V_CC)$(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $< @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $< listaction-outputtxt.o: outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -MT listaction-outputtxt.o -MD -MP -MF $(DEPDIR)/listaction-outputtxt.Tpo -c -o listaction-outputtxt.o `test -f 'outputtxt.c' || echo '$(srcdir)/'`outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction-outputtxt.Tpo $(DEPDIR)/listaction-outputtxt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputtxt.c' object='listaction-outputtxt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -c -o listaction-outputtxt.o `test -f 'outputtxt.c' || echo '$(srcdir)/'`outputtxt.c listaction-outputtxt.obj: outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -MT listaction-outputtxt.obj -MD -MP -MF $(DEPDIR)/listaction-outputtxt.Tpo -c -o listaction-outputtxt.obj `if test -f 'outputtxt.c'; then $(CYGPATH_W) 'outputtxt.c'; else $(CYGPATH_W) '$(srcdir)/outputtxt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction-outputtxt.Tpo $(DEPDIR)/listaction-outputtxt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputtxt.c' object='listaction-outputtxt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -c -o listaction-outputtxt.obj `if test -f 'outputtxt.c'; then $(CYGPATH_W) 'outputtxt.c'; else $(CYGPATH_W) '$(srcdir)/outputtxt.c'; fi` listaction-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -MT listaction-main.o -MD -MP -MF $(DEPDIR)/listaction-main.Tpo -c -o listaction-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction-main.Tpo $(DEPDIR)/listaction-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='listaction-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -c -o listaction-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c listaction-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -MT listaction-main.obj -MD -MP -MF $(DEPDIR)/listaction-main.Tpo -c -o listaction-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction-main.Tpo $(DEPDIR)/listaction-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='listaction-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_CFLAGS) $(CFLAGS) -c -o listaction-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` listaction_d-outputtxt.o: outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -MT listaction_d-outputtxt.o -MD -MP -MF $(DEPDIR)/listaction_d-outputtxt.Tpo -c -o listaction_d-outputtxt.o `test -f 'outputtxt.c' || echo '$(srcdir)/'`outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction_d-outputtxt.Tpo $(DEPDIR)/listaction_d-outputtxt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputtxt.c' object='listaction_d-outputtxt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -c -o listaction_d-outputtxt.o `test -f 'outputtxt.c' || echo '$(srcdir)/'`outputtxt.c listaction_d-outputtxt.obj: outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -MT listaction_d-outputtxt.obj -MD -MP -MF $(DEPDIR)/listaction_d-outputtxt.Tpo -c -o listaction_d-outputtxt.obj `if test -f 'outputtxt.c'; then $(CYGPATH_W) 'outputtxt.c'; else $(CYGPATH_W) '$(srcdir)/outputtxt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction_d-outputtxt.Tpo $(DEPDIR)/listaction_d-outputtxt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputtxt.c' object='listaction_d-outputtxt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -c -o listaction_d-outputtxt.obj `if test -f 'outputtxt.c'; then $(CYGPATH_W) 'outputtxt.c'; else $(CYGPATH_W) '$(srcdir)/outputtxt.c'; fi` listaction_d-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -MT listaction_d-main.o -MD -MP -MF $(DEPDIR)/listaction_d-main.Tpo -c -o listaction_d-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction_d-main.Tpo $(DEPDIR)/listaction_d-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='listaction_d-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -c -o listaction_d-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c listaction_d-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -MT listaction_d-main.obj -MD -MP -MF $(DEPDIR)/listaction_d-main.Tpo -c -o listaction_d-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listaction_d-main.Tpo $(DEPDIR)/listaction_d-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='listaction_d-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listaction_d_CFLAGS) $(CFLAGS) -c -o listaction_d-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` listswf-outputtxt.o: outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -MT listswf-outputtxt.o -MD -MP -MF $(DEPDIR)/listswf-outputtxt.Tpo -c -o listswf-outputtxt.o `test -f 'outputtxt.c' || echo '$(srcdir)/'`outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listswf-outputtxt.Tpo $(DEPDIR)/listswf-outputtxt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputtxt.c' object='listswf-outputtxt.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -c -o listswf-outputtxt.o `test -f 'outputtxt.c' || echo '$(srcdir)/'`outputtxt.c listswf-outputtxt.obj: outputtxt.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -MT listswf-outputtxt.obj -MD -MP -MF $(DEPDIR)/listswf-outputtxt.Tpo -c -o listswf-outputtxt.obj `if test -f 'outputtxt.c'; then $(CYGPATH_W) 'outputtxt.c'; else $(CYGPATH_W) '$(srcdir)/outputtxt.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listswf-outputtxt.Tpo $(DEPDIR)/listswf-outputtxt.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputtxt.c' object='listswf-outputtxt.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -c -o listswf-outputtxt.obj `if test -f 'outputtxt.c'; then $(CYGPATH_W) 'outputtxt.c'; else $(CYGPATH_W) '$(srcdir)/outputtxt.c'; fi` listswf-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -MT listswf-main.o -MD -MP -MF $(DEPDIR)/listswf-main.Tpo -c -o listswf-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listswf-main.Tpo $(DEPDIR)/listswf-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='listswf-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -c -o listswf-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c listswf-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -MT listswf-main.obj -MD -MP -MF $(DEPDIR)/listswf-main.Tpo -c -o listswf-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/listswf-main.Tpo $(DEPDIR)/listswf-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='listswf-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(listswf_CFLAGS) $(CFLAGS) -c -o listswf-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` makefdb-outputfdb.o: outputfdb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -MT makefdb-outputfdb.o -MD -MP -MF $(DEPDIR)/makefdb-outputfdb.Tpo -c -o makefdb-outputfdb.o `test -f 'outputfdb.c' || echo '$(srcdir)/'`outputfdb.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/makefdb-outputfdb.Tpo $(DEPDIR)/makefdb-outputfdb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputfdb.c' object='makefdb-outputfdb.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -c -o makefdb-outputfdb.o `test -f 'outputfdb.c' || echo '$(srcdir)/'`outputfdb.c makefdb-outputfdb.obj: outputfdb.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -MT makefdb-outputfdb.obj -MD -MP -MF $(DEPDIR)/makefdb-outputfdb.Tpo -c -o makefdb-outputfdb.obj `if test -f 'outputfdb.c'; then $(CYGPATH_W) 'outputfdb.c'; else $(CYGPATH_W) '$(srcdir)/outputfdb.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/makefdb-outputfdb.Tpo $(DEPDIR)/makefdb-outputfdb.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputfdb.c' object='makefdb-outputfdb.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -c -o makefdb-outputfdb.obj `if test -f 'outputfdb.c'; then $(CYGPATH_W) 'outputfdb.c'; else $(CYGPATH_W) '$(srcdir)/outputfdb.c'; fi` makefdb-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -MT makefdb-main.o -MD -MP -MF $(DEPDIR)/makefdb-main.Tpo -c -o makefdb-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/makefdb-main.Tpo $(DEPDIR)/makefdb-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='makefdb-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -c -o makefdb-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c makefdb-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -MT makefdb-main.obj -MD -MP -MF $(DEPDIR)/makefdb-main.Tpo -c -o makefdb-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/makefdb-main.Tpo $(DEPDIR)/makefdb-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='makefdb-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(makefdb_CFLAGS) $(CFLAGS) -c -o makefdb-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` swftocxx-outputscript.o: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -MT swftocxx-outputscript.o -MD -MP -MF $(DEPDIR)/swftocxx-outputscript.Tpo -c -o swftocxx-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftocxx-outputscript.Tpo $(DEPDIR)/swftocxx-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftocxx-outputscript.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -c -o swftocxx-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c swftocxx-outputscript.obj: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -MT swftocxx-outputscript.obj -MD -MP -MF $(DEPDIR)/swftocxx-outputscript.Tpo -c -o swftocxx-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftocxx-outputscript.Tpo $(DEPDIR)/swftocxx-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftocxx-outputscript.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -c -o swftocxx-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` swftocxx-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -MT swftocxx-main.o -MD -MP -MF $(DEPDIR)/swftocxx-main.Tpo -c -o swftocxx-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftocxx-main.Tpo $(DEPDIR)/swftocxx-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftocxx-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -c -o swftocxx-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c swftocxx-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -MT swftocxx-main.obj -MD -MP -MF $(DEPDIR)/swftocxx-main.Tpo -c -o swftocxx-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftocxx-main.Tpo $(DEPDIR)/swftocxx-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftocxx-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftocxx_CFLAGS) $(CFLAGS) -c -o swftocxx-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` swftoperl-outputscript.o: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -MT swftoperl-outputscript.o -MD -MP -MF $(DEPDIR)/swftoperl-outputscript.Tpo -c -o swftoperl-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftoperl-outputscript.Tpo $(DEPDIR)/swftoperl-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftoperl-outputscript.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -c -o swftoperl-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c swftoperl-outputscript.obj: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -MT swftoperl-outputscript.obj -MD -MP -MF $(DEPDIR)/swftoperl-outputscript.Tpo -c -o swftoperl-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftoperl-outputscript.Tpo $(DEPDIR)/swftoperl-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftoperl-outputscript.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -c -o swftoperl-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` swftoperl-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -MT swftoperl-main.o -MD -MP -MF $(DEPDIR)/swftoperl-main.Tpo -c -o swftoperl-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftoperl-main.Tpo $(DEPDIR)/swftoperl-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftoperl-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -c -o swftoperl-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c swftoperl-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -MT swftoperl-main.obj -MD -MP -MF $(DEPDIR)/swftoperl-main.Tpo -c -o swftoperl-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftoperl-main.Tpo $(DEPDIR)/swftoperl-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftoperl-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftoperl_CFLAGS) $(CFLAGS) -c -o swftoperl-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` swftophp-outputscript.o: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -MT swftophp-outputscript.o -MD -MP -MF $(DEPDIR)/swftophp-outputscript.Tpo -c -o swftophp-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftophp-outputscript.Tpo $(DEPDIR)/swftophp-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftophp-outputscript.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -c -o swftophp-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c swftophp-outputscript.obj: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -MT swftophp-outputscript.obj -MD -MP -MF $(DEPDIR)/swftophp-outputscript.Tpo -c -o swftophp-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftophp-outputscript.Tpo $(DEPDIR)/swftophp-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftophp-outputscript.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -c -o swftophp-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` swftophp-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -MT swftophp-main.o -MD -MP -MF $(DEPDIR)/swftophp-main.Tpo -c -o swftophp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftophp-main.Tpo $(DEPDIR)/swftophp-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftophp-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -c -o swftophp-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c swftophp-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -MT swftophp-main.obj -MD -MP -MF $(DEPDIR)/swftophp-main.Tpo -c -o swftophp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftophp-main.Tpo $(DEPDIR)/swftophp-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftophp-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftophp_CFLAGS) $(CFLAGS) -c -o swftophp-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` swftopython-outputscript.o: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -MT swftopython-outputscript.o -MD -MP -MF $(DEPDIR)/swftopython-outputscript.Tpo -c -o swftopython-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftopython-outputscript.Tpo $(DEPDIR)/swftopython-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftopython-outputscript.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -c -o swftopython-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c swftopython-outputscript.obj: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -MT swftopython-outputscript.obj -MD -MP -MF $(DEPDIR)/swftopython-outputscript.Tpo -c -o swftopython-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftopython-outputscript.Tpo $(DEPDIR)/swftopython-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftopython-outputscript.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -c -o swftopython-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` swftopython-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -MT swftopython-main.o -MD -MP -MF $(DEPDIR)/swftopython-main.Tpo -c -o swftopython-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftopython-main.Tpo $(DEPDIR)/swftopython-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftopython-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -c -o swftopython-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c swftopython-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -MT swftopython-main.obj -MD -MP -MF $(DEPDIR)/swftopython-main.Tpo -c -o swftopython-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftopython-main.Tpo $(DEPDIR)/swftopython-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftopython-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftopython_CFLAGS) $(CFLAGS) -c -o swftopython-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` swftotcl-outputscript.o: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -MT swftotcl-outputscript.o -MD -MP -MF $(DEPDIR)/swftotcl-outputscript.Tpo -c -o swftotcl-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftotcl-outputscript.Tpo $(DEPDIR)/swftotcl-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftotcl-outputscript.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -c -o swftotcl-outputscript.o `test -f 'outputscript.c' || echo '$(srcdir)/'`outputscript.c swftotcl-outputscript.obj: outputscript.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -MT swftotcl-outputscript.obj -MD -MP -MF $(DEPDIR)/swftotcl-outputscript.Tpo -c -o swftotcl-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftotcl-outputscript.Tpo $(DEPDIR)/swftotcl-outputscript.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='outputscript.c' object='swftotcl-outputscript.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -c -o swftotcl-outputscript.obj `if test -f 'outputscript.c'; then $(CYGPATH_W) 'outputscript.c'; else $(CYGPATH_W) '$(srcdir)/outputscript.c'; fi` swftotcl-main.o: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -MT swftotcl-main.o -MD -MP -MF $(DEPDIR)/swftotcl-main.Tpo -c -o swftotcl-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftotcl-main.Tpo $(DEPDIR)/swftotcl-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftotcl-main.o' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -c -o swftotcl-main.o `test -f 'main.c' || echo '$(srcdir)/'`main.c swftotcl-main.obj: main.c @am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -MT swftotcl-main.obj -MD -MP -MF $(DEPDIR)/swftotcl-main.Tpo -c -o swftotcl-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` @am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/swftotcl-main.Tpo $(DEPDIR)/swftotcl-main.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='main.c' object='swftotcl-main.obj' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(swftotcl_CFLAGS) $(CFLAGS) -c -o swftotcl-main.obj `if test -f 'main.c'; then $(CYGPATH_W) 'main.c'; else $(CYGPATH_W) '$(srcdir)/main.c'; fi` mostlyclean-libtool: -rm -f *.lo clean-libtool: -rm -rf .libs _libs ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ mkid -fID $$unique tags: TAGS TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) set x; \ here=`pwd`; \ list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: CTAGS CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ $(TAGS_FILES) $(LISP) list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | \ $(AWK) '{ files[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in files) print i; }; }'`; \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) $(HEADERS) installdirs: for dir in "$(DESTDIR)$(bindir)" "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-am clean-am: clean-binPROGRAMS clean-generic clean-libtool \ clean-noinstLTLIBRARIES mostlyclean-am distclean: distclean-am -rm -rf ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-binSCRIPTS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic \ mostlyclean-libtool pdf: pdf-am pdf-am: ps: ps-am ps-am: uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS all all-am check check-am clean clean-binPROGRAMS \ clean-generic clean-libtool clean-noinstLTLIBRARIES ctags \ distclean distclean-compile distclean-generic \ distclean-libtool distclean-tags distdir dvi dvi-am html \ html-am info info-am install install-am install-binPROGRAMS \ install-binSCRIPTS install-data install-data-am install-dvi \ install-dvi-am install-exec install-exec-am install-html \ install-html-am install-info install-info-am install-man \ install-pdf install-pdf-am install-ps install-ps-am \ install-strip installcheck installcheck-am installdirs \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-compile mostlyclean-generic mostlyclean-libtool \ pdf pdf-am ps ps-am tags uninstall uninstall-am \ uninstall-binPROGRAMS uninstall-binSCRIPTS # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: ming-0.4.5/util/README0000644000175000017500000000234211454264373011242 00000000000000TOOLS FOR MING These are various tools useful in development of ming. None are particularly user friendly. make all_binaries - compiles all working tools make - compiles the single requested tool general tools: makeswf - compile actionscript code into an .swf movie bindump - show file data in hex and binary hexdump - show file data in hex list tools: listswf - swf format disassembler listaction - show actionscript in the swf listfdb - show contents of fdb font file listmp3 - show frame header info in mp3 files listjpeg - show frame header info in jpeg files swfto... converter: swftoperl - attempt to make a perl/ming script out of an swf file Look at swftoperl.html swftophp - attempt to make a php/ming script out of an swf file swftopython - a todo for pythonfriends :-) not done yet. fonts: makefdb - rip fdb font definition files out of a swf or generator template file. graphics: png2dbl - convert a png-file to dbl *gif2dbl - convert a gif-file to dbl *gif2mask - convert a gif image to an alpha mask sound: raw2adpcm - convert a raw(pcm?) soundfile to a adpcm-coded soundfile (smaller size than raw) ming-0.4.5/util/Makefile.am0000644000175000017500000000604412154722073012413 00000000000000 INCLUDES = -I$(top_srcdir)/src if USE_GIF if USE_ZLIB gifprograms = gif2mask gif2dbl endif else gifprograms = endif if USE_PNG if USE_ZLIB pngprograms = png2dbl dbl2png endif else pngprograms = endif bin_PROGRAMS = \ listswf \ listswf_d \ swftophp \ swftoperl \ swftopython \ swftocxx \ swftotcl \ makeswf \ listaction \ listaction_d \ listfdb \ makefdb \ listjpeg \ raw2adpcm \ listmp3 \ listmp3 \ $(pngprograms) \ $(gifprograms) noinst_LTLIBRARIES = libutil.la libutil_la_SOURCES = \ action.c \ blocktypes.c \ decompile.c \ parser.c \ read.c \ vasprintf.c libutil_la_LIBADD = $(MATHLIB) $(ZLIB) noinst_HEADERS = \ action.h \ decompile.h \ libswf.h \ makeswf.h \ outputdecl.h \ output.h \ parserdecl.h \ parser.h \ read.h \ swfoutput.h \ swftypes.h \ vasprintf.h listswf_SOURCES = outputtxt.c main.c listswf_LDADD = libutil.la $(top_builddir)/src/libming.la listswf_CFLAGS = -DNODECOMPILE listswf_d_SOURCES = outputtxt.c main.c listswf_d_LDADD = libutil.la $(top_builddir)/src/libming.la swftophp_SOURCES = outputscript.c main.c swftophp_LDADD = libutil.la $(top_builddir)/src/libming.la swftophp_CFLAGS = -DSWFPHP swftoperl_SOURCES = outputscript.c main.c swftoperl_LDADD = libutil.la $(top_builddir)/src/libming.la swftoperl_CFLAGS = -DSWFPERL swftopython_SOURCES = outputscript.c main.c swftopython_LDADD = libutil.la $(top_builddir)/src/libming.la swftopython_CFLAGS = -DSWFPYTHON swftocxx_SOURCES = outputscript.c main.c swftocxx_LDADD = libutil.la $(top_builddir)/src/libming.la swftocxx_CFLAGS = -DSWFPLUSPLUS swftotcl_SOURCES = outputscript.c main.c swftotcl_LDADD = libutil.la $(top_builddir)/src/libming.la swftotcl_CFLAGS = -DSWFTCL listaction_SOURCES = outputtxt.c main.c listaction_LDADD = libutil.la $(top_builddir)/src/libming.la listaction_CFLAGS = -DACTIONONLY -DNODECOMPILE listaction_d_SOURCES = outputtxt.c main.c listaction_d_LDADD = libutil.la $(top_builddir)/src/libming.la listaction_d_CFLAGS = -DACTIONONLY listfdb_SOURCES = listfdb.c listfdb_LDADD = $(top_builddir)/src/libming.la raw2adpcm_SOURCES = raw2adpcm.c raw2adpcm_LDADD = $(top_builddir)/src/libming.la listmp3_SOURCES = listmp3.c listmp3_LDADD = $(top_builddir)/src/libming.la listjpeg_SOURCES = listjpeg.c listjpeg_LDADD = $(top_builddir)/src/libming.la makefdb_SOURCES = outputfdb.c main.c makefdb_LDADD = libutil.la $(top_builddir)/src/libming.la makefdb_CFLAGS = -DMAKE_FDB gif2mask_SOURCES = gif2mask.c gif2mask_LDADD = $(top_builddir)/src/libming.la $(MATHLIB) $(ZLIB) $(GIFLIB) png2dbl_SOURCES = png2dbl.c png2dbl_LDADD = $(top_builddir)/src/libming.la $(MATHLIB) $(ZLIB) $(PNGLIB) dbl2png_SOURCES = dbl2png.c dbl2png_LDADD = $(top_builddir)/src/libming.la $(ZLIB) $(PNGLIB) gif2dbl_SOURCES = gif2dbl.c gif2dbl_LDADD = $(top_builddir)/src/libming.la $(MATHLIB) $(ZLIB) $(GIFLIB) makeswf_SOURCES = makeswf.c makeswf_utils.c makeswf_LDADD = libutil.la $(top_builddir)/src/libming.la bin_SCRIPTS = ming-config EXTRA_DIST = \ README \ TIPS \ TODO \ bindump.c \ hexdump.c \ cws2fws \ swftoperl.html \ ming.css DISTCLEANFILES = ming-config ming-0.4.5/util/raw2adpcm.c0000644000175000017500000001403411454264373012407 00000000000000/* * raw2adpcm converts a raw sound data to adpcm compressed. * This is based on adpcm.cpp found at http://www.openswf.org . * The original code is the code posted on news:forums.macromedia.com by Jonathan Gay. */ #include #include #include "../src/blocks/input.h" #include "../src/blocks/output.h" #include "../src/libming.h" /* * ADPCM tables */ static const int piIndexTable2[2] = { -1, 2, }; static const int piIndexTable3[4] = { -1, -1, 2, 4, }; static const int piIndexTable4[8] = { -1, -1, -1, -1, 2, 4, 6, 8, }; static const int piIndexTable5[16] = { -1, -1, -1, -1, -1, -1, -1, -1, 1, 2, 4, 6, 8, 10, 13, 16, }; static const int* ppiIndexTables[] = { piIndexTable2, piIndexTable3, piIndexTable4, piIndexTable5 }; static const int piStepSizeTable[89] = { 7, 8, 9, 10, 11, 12, 13, 14, 16, 17, 19, 21, 23, 25, 28, 31, 34, 37, 41, 45, 50, 55, 60, 66, 73, 80, 88, 97, 107, 118, 130, 143, 157, 173, 190, 209, 230, 253, 279, 307, 337, 371, 408, 449, 494, 544, 598, 658, 724, 796, 876, 963, 1060, 1166, 1282, 1411, 1552, 1707, 1878, 2066, 2272, 2499, 2749, 3024, 3327, 3660, 4026, 4428, 4871, 5358, 5894, 6484, 7132, 7845, 8630, 9493, 10442, 11487, 12635, 13899, 15289, 16818, 18500, 20350, 22385, 24623, 27086, 29794, 32767 }; void writeADPCMData(short *samples, int stereo, int sample_count, SWFOutput output) { int nBits = 4; /* number of bits per ADPCM sample */ int iSignBit = 1 << (nBits-1); /* Sign bit mask */ const int* piIndexTable = ppiIndexTables[nBits-2]; /* Select index table to use */ int iValPred[2] = {0, 0}; /* Predicted output value(s) */ int iIndex[2] = {0, 0}; /* Indeces int StepSizeTable */ int iStep[2] = {0, 0}; /* Step size */ int iSampleCount = sample_count; /* Number of samples. */ int iChannelCount = 1 + stereo; /* Number of channels (mono, stereo) */ short* psSample = samples; /* Pointer to start of 16-bit/sample data */ int i; /* Write number of bits per ADPCM sample */ SWFOutput_writeBits(output, nBits-2, 2); for (i=0; i < iSampleCount; i++) { if ((i & 0xfff) == 0) { int c; for (c=0; c 63) iIndex[c] = 63; iStep[c] = piStepSizeTable[iIndex[c]]; /* Write initial index into StepSizeTable */ SWFOutput_writeBits(output, (int)iIndex[c], 6); } } else { int c; for (c=0; c> (nBits-1)); for (k = nBits-2; k >= 0; k--, iStep[c] >>= 1) { if (iDiff >= iStep[c]) { iDelta |= (1< 0) iDiff -= iStep[c]; } } /* Step 3 - Update previous value */ if (iSign) iValPred[c] -= iVPDiff; else iValPred[c] += iVPDiff; /* Step 4 - Clamp previous value to 16 bits */ if (iValPred[c] > 32767) iValPred[c] = 32767; else if (iValPred[c] < -32768) iValPred[c] = -32768; /* Step 5 - Assemble value, update index and step values */ iIndex[c] += piIndexTable[iDelta]; iDelta |= iSign; /* Or with iSign *after* indexing */ /* Clamp StepSizeTable index */ if (iIndex[c] < 0) iIndex[c] = 0; if (iIndex[c] > 88) iIndex[c] = 88; iStep[c] = piStepSizeTable[iIndex[c]]; /* Step 6 - Output value */ SWFOutput_writeBits(output, iDelta, nBits); } } } } int main(int argc, char *argv[]) { FILE *fp_in, *fp_out; SWFInput input; SWFOutput output; int bits16; int stereo; int sample_count; short *samples, *i_sample; int i; if (argc < 3) { printf( "%s converts a raw sound data to adpcm compressed.\n" "\n" "Usage:\n" "%s in out [16bit] [stereo]\n" "\n" "in : the filename of input file, raw sound data\n" "out : the filename of output file, ADPCM compressed\n" "16bit : bits per sample 0=8bit 1=16bit default=1=16bit\n" "stereo : number of channels 0=mono 1=stereo default=1=stereo\n" , argv[0], argv[0]); exit(0); } fp_in = fopen(argv[1], "rb"); if (!fp_in) { fprintf(stderr, "file '%s' cannot open.\n", argv[1]); exit(1); } fp_out = fopen(argv[2], "wb"); if (!fp_out) { fprintf(stderr, "file '%s' cannnot open.\n", argv[2]); exit(1); } bits16 = 1; if (argc > 3) bits16 = atoi(argv[3]); stereo = 1; if (argc > 4) stereo = atoi(argv[4]); /* read RAW sound data */ input = newSWFInput_file(fp_in); sample_count = SWFInput_length(input) / (1+bits16) / (1+stereo); samples = malloc(sizeof(short) * sample_count * (1+stereo)); i_sample = samples; for (i=0; i #include #include #include #include #include #include #include #include int verbose = 0; typedef unsigned char byte; void error(char *s, ...) { va_list ap; va_start(ap, s); vprintf(s, ap); va_end(ap); putchar('\n'); exit(1); } void usage() { printf("dbl2png - convert a dbl file to an png file\n"); printf("\nUsage: dbl2png [--verbose] \n"); printf("where file.dbl is your dbl file. Writes to file.png.\n"); exit(1); } struct pngdata { png_uint_32 width; png_uint_32 height; int bit_depth; int color_type; int num_palette; int channels; png_colorp palette; unsigned char *data; }; struct pngdata readDBL(FILE *fp) { struct pngdata png; byte header[13],*data; unsigned long outsize,readsize=0,datsize; int i, ret; if(!fp) error("Couldn't open file!\n"); ret = fread(header, 1, 13, fp); if(ret != 13) error("Couldn't read header\n"); if (header[3]==2) { if(verbose) printf("image data RGBA\n"); png.color_type=PNG_COLOR_TYPE_RGB_ALPHA; } else { if (header[3]==1) { if(verbose) printf("image data RGB\n"); png.color_type=PNG_COLOR_TYPE_RGB; } else error("unexpected 3rd byte in header"); } outsize=(header[4]<<24)+(header[5]<<16)+(header[6]<<8)+header[7]; if(verbose) printf("outsize=%ld \n",outsize); png.bit_depth=8; // Can't deal with bit depth !=8 png.width= header[9] +(header[10]<<8); png.height=header[11]+(header[12]<<8); if (header[8]==3) { png.color_type=PNG_COLOR_TYPE_PALETTE; readsize=outsize-6 ; png.num_palette=0; i= fread(&png.num_palette, 1, 1 ,fp); if (verbose) { printf("image has PALETTE\npalette size=%d\n",png.num_palette+1); printf("size %d x %d\n", (int)png.width, (int)png.height); } } else { if (header[8]!=5) error("unexpected 8th byte in header"); else { readsize=outsize-5 ; if(verbose) { printf("size %d x %d\n", (int)png.width, (int)png.height); } } } if (!readsize) error("internal error"); // // ------ now we go -------- // data=malloc( readsize ); if (!data) { error("memory allocation"); } datsize=fread(data, 1, readsize, fp); fclose(fp); if (datsize != readsize) { free(data); error("Didn't read all of the file! %d vs %d",datsize , readsize); } if (png.color_type==PNG_COLOR_TYPE_PALETTE) // for palette bit_depth==8 datsize = (png.num_palette+1) * 3 + png.width * png.height; // palette of RGB style else datsize = png.width * png.height * 4; // RGBA png.data=malloc(datsize); if (!png.data) { free(data); error("memory allocation"); } /* uncompress the data */ i=uncompress (png.data, &datsize, data, readsize ); if (i) { printf("uncompress call result = %d\n",i); free(data); error("uncompress error"); } if(verbose) { printf("unpacked data size t=%ld byte\n",datsize); } free(data); return png; } // callback function: // reverse apply alpha, bytes shifting (see png2dbl.c for details) // expecting pixel_depth==32, bit_depth==8, color_type==PNG_COLOR_TYPE_RGB_ALPHA void alpha_apply(png_structp png_ptr, png_row_infop row_info, png_bytep p) { int i; byte a, r, g, b; for(i=0;iwidth;i++) { a = p[0]; r = p[1]; g = p[2]; b = p[3]; *p++ = (r<<8)/(a+1); *p++ = (g<<8)/(a+1); *p++ = (b<<8)/(a+1); *p++ = a; } } void writePNG(FILE *fp, struct pngdata png) { png_structp png_ptr; png_infop info_ptr; int i,chan; byte *ptr=png.data; if(!fp) error("Couldn't open file!\n"); png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(!png_ptr) error("Couldn't create png_ptr\n"); info_ptr = png_create_info_struct(png_ptr); if(!info_ptr) { png_destroy_write_struct(&png_ptr,(png_infopp)NULL); error("Couldn't create info_ptr\n"); } if (setjmp(png_jmpbuf(png_ptr))) { png_destroy_write_struct(&png_ptr, &info_ptr); fclose(fp); error("Mystery error (longjmp called)\n"); } png_init_io(png_ptr, fp); png_set_IHDR(png_ptr, info_ptr, png.width, png.height, png.bit_depth, png.color_type, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT); if (png.color_type==PNG_COLOR_TYPE_PALETTE) png_set_PLTE(png_ptr, info_ptr,(png_colorp)png.data, png.num_palette+1); png_write_info(png_ptr, info_ptr); // // ------ now we go -------- // chan=png_get_channels(png_ptr, info_ptr); if (verbose) printf("channel count=%d\n",chan); if(png.color_type == PNG_COLOR_TYPE_RGB_ALPHA ) { png_set_write_user_transform_fn(png_ptr, alpha_apply); for (i=0;i 2 && strcmp(argv[1], "--verbose")==0) { verbose = 1; argc--; argv++; } if(argc < 2) usage(); len = strlen(argv[1]); if(strcmp(argv[1]+len-4, ".dbl") != 0) usage(); if(argc < 3) { outfile = strdup(argv[1]); outfile[len-3] = 'p'; outfile[len-2] = 'n'; outfile[len-1] = 'g'; } else outfile = argv[2]; png = readDBL(fopen(argv[1], "rb")); writePNG(fopen(outfile, "wb"), png); exit(0); } ming-0.4.5/util/parser.h0000644000175000017500000000352312154635353012027 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include #include struct Rect { int xMin; int xMax; int yMin; int yMax; }; struct FontInfo { int ID; int GlyphCount; }; struct Movie { int version; int size; /* in bytes */ struct Rect frame; float rate; int nFrames; int soundStreamFmt; struct FontInfo *fonts; int numFonts; }; static inline void Movie_addFontInfo(struct Movie *m, int ID, int count) { m->fonts = realloc(m->fonts, (m->numFonts + 1) * sizeof(struct FontInfo)); m->fonts[m->numFonts].ID = ID; m->fonts[m->numFonts].GlyphCount = count; m->numFonts++; } static inline int Movie_getFontGlyphCount(struct Movie *m, int ID) { int i; for(i = 0; i < m->numFonts; i++) { if(m->fonts[i].ID == ID) return m->fonts[i].GlyphCount; } return -1; } #include "swftypes.h" typedef SWF_Parserstruct *(*SWFParseFunc)(FILE *, int); #include "parserdecl.h" ming-0.4.5/util/bindump.c0000644000175000017500000000157011454264373012166 00000000000000#include #include #define print(x) {fputs(x,stdout);} void dumpBytes(FILE *f) { int count=0, j, i, k, b; unsigned char buf[4]; for(;;) { printf("%04X: ", count); count += 4; for(i=0; i<4; ++i) { b = fgetc(f); if(b == EOF) break; printf("%02x ", buf[i] = (unsigned char)b); } if(b == EOF) { for(k=i; k<4; ++k) { print(" "); } } print(" "); for(k=0; k #include "blocks/blocktypes.h" #include "parser.h" #include "swfoutput.h" void outputHeader (struct Movie *m) { printf("File version: %i\n", m->version); } void outputTrailer (struct Movie *m) { } void outputBlock (int type, SWF_Parserstruct * blockp, FILE* f) { FILE *out; char name[256]; int skipBytes, ret; int offset = blockp->offset; int length = blockp->length; char *buf; switch ( type ) { case SWF_DEFINEFONT: case SWF_DEFINEFONT2: case SWF_DEFINEFONT3: break; default: return; } sprintf(name, "font%i.fdb", blockp->block.SWF_DEFINEFONT2.FontID); out=fopen(name,"wb"); if ( out == NULL ) { perror("Failed"); return; } fputc('f', out); fputc('d', out); fputc('b', out); fputc('0', out); skipBytes = 4; // skip blockType (2 bytes) + fontId (2 bytes) if(length >= 63) // long Block skipBytes += 4; fseek(f, offset + skipBytes, SEEK_SET); /* skip FontId (UI16) */ length -= 2; /* sub FontId (UI16) only */ printf("Writing font '%s' to file '%s' (%i bytes)... ", blockp->block.SWF_DEFINEFONT2.FontName, name, length+4); /* +4 for 'fdb0' header */ fflush(stdout); buf = malloc(length); if (!buf) { fclose(out); SWF_error("memory allocation error"); return; } ret = fread(buf, length, 1, f); if (ret != 1) { fclose(out); free(buf); return; } ret = fwrite(buf, length, 1, out); free(buf); if(ret != 1) { fclose(out); return; } fclose(out); printf("Done.\n"); } ming-0.4.5/util/swftoperl.html0000644000175000017500000000743011454264373013300 00000000000000

swftoperl - a flash to ming-perl converter.

Based on Daves swftophp. Tested only on a Linuxbox (SuSE 7.2). Would like to hear from success with other OS/versions. Peter Liscovius

Story:

I started from swftophp-source, converted this to a swftoperl and made some changes/enhancements, because swftophp and the util-stuff wasn't updated for a while.

The aim is to provide a program that can take a flash 3/4/5/? file and convert it to a ming-perl script that produces the same or a better/smaller flashfile with the same behavior without the need to change anything.

Install:

Start a console, go to the $ming/util/ - directory and type make swftoperl

Now swftoperl should be build from c-source in the same directory. (i hope successful.)

Type swftoperl to test. It should tell you something like Give me a filename.

Usage:

swftoperl myflash.swf

To save the script to a file, go to a console and type

swftoperl myflash.swf >myflash.pl or
swftoperl /home/peter/myflash.swf >/home/peter/myflash.pl or
swftoperl ~/myflash.swf >~/myflash.pl

myflash.swf is the name of your flashfile.

Some additional informations will be maybe printed to STDERR, so you don't have the ugly text in your myflash.pl , but you know about it.

Works this in the same way under Windows?

Changes:

  • Working currently on fixing TextField features. Simply remove constants with a number like SWFTEXTFIELD_2. I try to find out the meaning of unexplained bits. (What position is SWFTEXTFIELD_HTML)? Heared about SWFTEXTFIELD_USEFONT. Which bit? Look at #defines before function void printTextField(FILE *f, int length){} in swftoperl.c
  • SWF::Shape->setMaskLevel(depth) included. Enables masks using shapes. (depth-1) is the number of the following objects(shapes,movieclips,..) that will maybe added at the same movie or movieclip.
    
    $maskshape_i = $movie->add($maskshape);
    $maskshape_i->setMaskLevel(2);
    $shapeA_i = $movie->add($shapeA);
    $shapeB_i = $movie->add($shapeB);
    

    This will only mask the instance of $shapeA (depth=2), but not $shapeB-instance (depth=3).

  • Change "Sprite" to "MovieClip".

Todo:

Also look at file TODO

Much, much. But some things must be first done in ming/ming-perl itself.

Here is a list of todos:

  • Text
  • TextField and FONT. Uses only builtin "Browserfonts", not the font i wanted. I read there must be a constant SWFTEXTFIELD_USEFONT but i don't find it in the ming-source (0.2a). Example?
  • DefineFont2
  • command line options like
    --out=filename.pl STDOUT
    --writefonts=yes / no
    --fontdir=.
    --overwritefonts=yes / no
    --writeBitmaps=yes / no if yes both filetypes are yes
    --writeJPEG=yes / no
    --writeGIF=yes / no
    --writeSound=yes / no if yes both filetypes are yes
    --writeMP3=yes / no
    --writeWAV=yes / no
    --minglibdir= (default: an example in a perlcomment)

    Bold words are the default values.

  • Actionscript should work without extra modifications.
  • There are differences between F4 and F5 Actionscript. When you want to read x-property of object: in FLASH 4 object.x, but in Flash5 object._x. So SWF::setVersion(4/5) is important.
  • use SWF(); should automatically only import the used modules and CONSTANTS. Really needed?
ming-0.4.5/util/makeswf.c0000644000175000017500000005400312154635363012163 00000000000000/**************************************************************************** * * makeswf - a command line actionscript compiler * * Copyright (C) 2003-2009 "Sandro Santilli" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * **************************************************************************** * * Intro * ----- * * This is a simple Flash actionscript compiler that * uses libming to do its job. You'll find it useful * only when coding in pure actionscript, thus probably * only when using the Flash 6 drawing API. * * Input files are preprocessed * -D can be used to set macros and -I to add dirs to include search paths. * You can skip the preprocessing step using the -p switch, but this * is undocumented/deprecated. * * If you need another kind of preprocessing change the CPP define in * makeswf_utils.c. * * Build * ----- * * This binary will link dinamically to libming, so you should * install ming somewhere, or let the linker know where to find * the ming library. * * TODO * ---- * * - Write preprocessor output to .as.pp rather then .as.pp * to have more chances at succeeding (source dir can be unwriteable) * ***************************************************************************/ /* This is needed to get vasprintf definition */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include #include #include #include #include "makeswf.h" #ifdef HAVE_GETOPT_H #include #endif // Cheating, but it works (not sure why the above ifdef for getopt isn't) #ifdef _WIN32 #include #endif #define DEFSWFVERSION 6 #define DEFSWFCOMPRESSION 9 #define MAXERRORMSG 1024 /* prototypes */ static void add_import_spec(char *spec); static void add_init_action(char *file, int frameno); static void add_init_action_spec(char *spec); static void compile_init_actions(int frameno, int debug); static int add_imports(void); static void embed_image(SWFMovie movie, char *f); static void embed_swf(SWFMovie movie, char *f); static void print_init_actions(int frameno, FILE* stream); // return pointer to allocated memory (free it) static char* base_name(char* filename); /* data */ static char **import_specs; static int numimport_specs = 0; static int swfversion = DEFSWFVERSION; static const char *RCSID = "$Id$"; static SWFMovie mo; static int useBgColor=0; static long int bgcolor=0; char *outputfile="out.swf"; typedef struct { char* file; int frameno; } init_action; static init_action* init_actions = NULL; static int num_init_actions = 0; static int max_init_action_frame = 0; void usage (char *me, int ex) { fprintf(stderr, "Usage: %s [OPTIONS] ...\n", me); fprintf(stderr, " can be: swf, png, jpg, actionscript code.\n"); fprintf(stderr, "Options:\n"); fprintf(stderr, " -o \n"); fprintf(stderr, " -s x\n"); fprintf(stderr, " -r \n"); fprintf(stderr, " -v \n"); fprintf(stderr, " -c \n"); fprintf(stderr, " -b \n"); fprintf(stderr, " -I \n"); fprintf(stderr, " -D [=]>\n"); fprintf(stderr, " -i :[,]>\n"); fprintf(stderr, " -h Print this help screen\n"); fprintf(stderr, " -V Print version and copyright info\n"); fprintf(stderr, " -d debug parser\n"); fprintf(stderr, " -a [:] - add init action for frame (0-based, 0 if omitted)\n"); fprintf(stderr, " -n network|file - restrict sandbox access from locally-loaded movies (automatically restricted to file for SWF>=8)\n"); exit(ex); } static void warningHandler(const char *fmt, ...) { va_list ap; va_start (ap, fmt); vfprintf(stderr, fmt, ap); putc('\n', stderr); va_end(ap); } char *cppargs; size_t cppargsize = 256; typedef enum { // A prebuilt clip SWF, // Any bitmap that can be feed to embed_image BITMAP, // ActionScript code AS } FileType; FileType getFileType(char* filename) { // TODO: use magic number char *ext = strrchr(filename, '.'); if ( ! ext ) return AS; if ( ! strcasecmp(ext, ".swf") ) return SWF; if ( ! strcasecmp(ext, ".png") ) return BITMAP; if ( ! strcasecmp(ext, ".dbl") ) return BITMAP; if ( ! strcasecmp(ext, ".jpg") ) return BITMAP; if ( ! strcasecmp(ext, ".jpeg") ) return BITMAP; return AS; } int main (int argc, char **argv) { int width=640, height=480; /* default stage size */ int i; int swfcompression = DEFSWFCOMPRESSION; float framerate = 12.0; /* * Allow network access from locally-loaded movies. * * 0 = file access * 1 = network access * -1 = unspecified (omit the tag if SWF < 8, file access otherwise) * * By default is unspecified. */ int networkAccess = -1; int usedfiles = 0; struct stat statbuf; int debug_parser = 0; #ifdef HAVE_GETOPT_LONG struct option opts[] = { {"dont-preprocess", 0, 0, 'p'}, {"frame-rate", 1, 0, 'r'}, {"swfversion", 1, 0, 'v'}, {"bgcolor", 1, 0, 'b'}, {"compression", 1, 0, 'c'}, {"includepath", 1, 0, 'I'}, {"define", 1, 0, 'D'}, {"size", 1, 0, 's'}, {"network-access", 1, 0, 'n'}, {"output", 1, 0, 'o'}, {"import", 1, 0, 'i'}, {"version", 0, 0, 'V'}, {"help", 0, 0, 'h'}, {"debug", 0, 0, 'd'}, {"init-action", 1, 0, 'a'}, {0, 0, 0, 0} }; int opts_idx; #endif int c; char *me; cppargs = malloc(cppargsize); sprintf(cppargs, "%s", DEFAULT_FLAGS); //cppargs[0] = '\0'; me = argv[0]; while (1) { #define BUFSIZE 1024 char buf [BUFSIZE]; const char *optstring = "Vhpds:r:D:I:v:c:b:i:o:a:n:"; #ifdef HAVE_GETOPT_LONG c = getopt_long (argc, argv, optstring, opts, &opts_idx); #else c = getopt (argc, argv, optstring); #endif if (c == -1) break; switch (c) { case 'p': makeswf_set_dopreprocess(0); break; case 's': if ( sscanf(optarg, "%dx%d", &width, &height) != 2 ) { usage(argv[0], EXIT_FAILURE); } break; case 'n': { if ( ! strcasecmp(optarg, "network") ) { networkAccess = 1; } else if ( ! strcasecmp(optarg, "file") ) { networkAccess = 0; } else { fprintf(stderr, "Network access must be 'network' or 'file'\n"); exit(1); } break; } case 'v': if ( sscanf(optarg, "%d", &swfversion) != 1 ) { usage(argv[0], EXIT_FAILURE); } makeswf_set_swfversion(swfversion); break; case 'b': if ( sscanf(optarg, "%lx", &bgcolor) != 1 ) { usage(argv[0], EXIT_FAILURE); } useBgColor=1; break; case 'c': if ( sscanf(optarg, "%d", &swfcompression) != 1 ) { usage(argv[0], EXIT_FAILURE); } if ( swfcompression < -1 || swfcompression > 9 ) { fprintf(stderr, "Compression level must be in the range -1..9\n"); exit(1); } break; case 'r': if ( sscanf(optarg, "%f", &framerate) != 1 ) { usage(argv[0], EXIT_FAILURE); } break; case 'I': snprintf(buf, BUFSIZE-1, " -I%s", optarg); buf[BUFSIZE-1]='\0'; makeswf_append_cpparg(buf); break; case 'i': add_import_spec(optarg); break; case 'o': outputfile = optarg; break; case 'D': // yes, you can smash the stack ... snprintf(buf, BUFSIZE-1, " -D%s", optarg); buf[BUFSIZE-1]='\0'; makeswf_append_cpparg(buf); break; case 'd': debug_parser = 1; break; case 'a': add_init_action_spec(optarg); break; case 'V': printf("%s\n", RCSID); printf("Copyright (C) 2001-2006 \"Sandro Santilli\" .\n"); printf("Released under the GNU General Public License.\n"); exit(EXIT_SUCCESS); case 'h': usage(argv[0], EXIT_SUCCESS); default: usage(argv[0], EXIT_FAILURE); break; } } argv+=optind; argc-=optind; if ( argc < 1 ) usage(me, EXIT_FAILURE); if ( stat(outputfile, &statbuf) ) { // should warn about overriding (-f ?) } if ( Ming_init() ) { fprintf(stderr, "Ming initialization error\n"); exit(EXIT_FAILURE); } Ming_setWarnFunction(warningHandler); //Ming_setErrorFunction(compileError); Ming_useSWFVersion(swfversion); Ming_setSWFCompression(swfcompression); mo = newSWFMovie(); if ( networkAccess >= 0 ) SWFMovie_setNetworkAccess(mo, networkAccess); SWFMovie_setDimension(mo, (float)width, (float)height); SWFMovie_setRate(mo, framerate); if ( useBgColor ) { SWFMovie_setBackground(mo, bgcolor >> 16, (bgcolor&0x00FF00) >> 8, (bgcolor&0x0000FF)); } printf("Output file name: %s\n", outputfile); printf("Output compression level: %d\n", swfcompression); printf("Output SWF version: %d\n", swfversion); /* * Add imports */ if ( numimport_specs ) add_imports(); for ( i=0; i %d have been discarded:\n", i-1); for (;i<=max_init_action_frame; ++i) { print_init_actions(i, stderr); } } if ( ! usedfiles ) { printf("No valid input files\n"); return 1; } printf("Saving output to %s... ", outputfile); fflush(stdout); SWFMovie_save(mo, outputfile); printf("done.\n"); return 0; } static void add_import_spec(char *spec) { if ( numimport_specs == 0 ) { import_specs = (char **)malloc(1); } else { import_specs = (char **)realloc(import_specs, numimport_specs+1); } import_specs[numimport_specs] = spec; numimport_specs++; } static void add_init_action(char* file, int frameno) { printf("Init action for frame %d in file %s\n", frameno, file); ++num_init_actions; init_actions = (init_action*)realloc(init_actions, num_init_actions*sizeof(init_action)); init_action* ac = &(init_actions[num_init_actions-1]); ac->file = file; ac->frameno = frameno; if ( frameno > max_init_action_frame ) max_init_action_frame = frameno; } static void print_init_actions(int frameno, FILE* stream) { int i; for (i=0; iframeno != frameno ) continue; fprintf(stream, " %s:%d\n", ia->file, ia->frameno); } } static void compile_init_actions(int frameno, int debug) { int i; int found=0; SWFAction action; char ppfile[PATH_MAX]; for (i=0; iframeno != frameno ) continue; file = ia->file; sprintf(ppfile, "%s.frame%d.init%d.pp", outputfile, frameno, found); action = makeswf_compile_source(file, ppfile, debug); printf("Adding %s to frame %d init actions... ", file, frameno); SWFMovie_add(mo, newSWFInitAction(action)); printf("done.\n"); ++found; } } static void add_init_action_spec(char *spec) { struct stat statbuf; int frameno = 0; char *file = strtok(spec, ":"); char *framespec = strtok(NULL, ","); if ( framespec ) frameno = atoi(framespec); if ( -1 == stat(file, &statbuf) ) { perror(file); exit(EXIT_FAILURE); } if ( ! S_ISREG(statbuf.st_mode) ) { fprintf(stderr, "ERROR: %s: is not a regular file\n", file); exit(EXIT_FAILURE); } /* check valid frame spec here */ if ( frameno < 0 ) { fprintf(stderr, "ERROR: invalid frame number %d for init actions\n", frameno); exit(EXIT_FAILURE); } add_init_action(file, frameno); } static int add_imports() { int i; SWFMovieClip mc; SWFDisplayItem di; SWFAction ac; struct stat statbuf; mc = newSWFMovieClip(); for (i=0; i. * * Revision 1.34 2007/04/14 16:58:46 strk * Removed unused CPP define from makeswf.c, fix the *used* one in makeswf_utils. * Thanks to Bastiaan Jacques for finding this out. * * Revision 1.33 2007/04/01 10:01:16 strk * Add -xc++ in CPP define - patch by Deanna Phillips. * * Revision 1.32 2007/03/22 10:59:17 strk * Updated to use newSWFAction() instead of compileSWFActionCode() * * Revision 1.31 2006/12/12 23:36:10 strk * Implement a separate function for detecting the type of frame content. * Take files anding in .jpeg as bitmaps. * (to be improved to use magic number) * * Revision 1.30 2006/12/11 22:01:29 strk * Use a name for prebuilt clips as well. I can't belive how powerful this tool is getting ;) * * Revision 1.29 2006/12/11 20:01:44 strk * Allow png or jpg frame contents * * Revision 1.28 2006/11/22 23:24:26 strk * Experimental support for use of prebuilt clips. * Example: makeswf frame1.as frame2.swf frame3.as ... * * Revision 1.27 2006/11/15 16:34:48 strk * Fixed import feature to properly set __shared_assets sprite frame count * * Revision 1.26 2006/09/19 08:50:16 strk * Fixed handling of -D flag * * Revision 1.25 2006/07/10 16:11:26 strk * Changed makeswf_compile_source signature to accept path to preprocessor output file. Changed preprocessed file paths to (.frame#.pp) to reduce probability of filesystem permission problems. * * Revision 1.24 2006/07/10 15:30:41 strk * Fixed --help and --version to not require an argument, added TODO item * for non-writeable source dir case. * * Revision 1.23 2006/07/08 13:47:18 strk * Split makeswf general functionalities in a separate file, for use by unit testers * * Revision 1.22 2006/06/20 22:16:13 strk * makeswf: * - Added __SWF_VERSION__ macro definition for use in source files * * Revision 1.21 2006/05/06 10:38:37 strk * Fixed support for builds w/out zlib in SWF_output and listswf. * Added handler for Ming's warning in command line compiler * * Revision 1.20 2006/05/04 22:28:40 strk * fixed read past end of allocated memory in error handler * * Revision 1.19 2006/04/21 13:55:42 vapour * Added vasprintf() function from http://unixpapa.com/incnote/stdio.html, for those platforms missing it. * * Revision 1.18 2006/04/19 13:16:56 vapour * + Forced use of getopt on Windows. * + Changed to use memset rather than bzero. bzero not on MinGW. * * Revision 1.17 2006/04/19 11:38:01 vapour * Added liberal use of ifdefs to avoid vasprintf on the platforms that don't have it. I make no guarantees of the functional integrity on them now. ;( * * Revision 1.16 2005/03/28 08:08:52 strk * Added frame layout printing. * * Revision 1.15 2005/03/22 13:41:30 strk * Changed calling interface: * - all arguments are source files * - each source file will be stored in a separate * frame, in the order they appear * - output will be "out.swf" unless -o is used * * Revision 1.14 2004/11/10 14:00:46 strk * Added support for specifying output compression level * * Revision 1.13 2004/11/09 12:48:12 strk * Added -v flag in usage string (already supported but not documented) * * Revision 1.12 2004/11/03 07:52:08 strk * Introduced a default include path to easy code sharing. * * Revision 1.11 2004/11/02 17:53:05 strk * Fixed a bug in -I and -D handling. * * Revision 1.10 2004/09/29 10:07:29 strk * ImportAssets executed even if import file is not found on filesystem. * A warning is issued in that case. * * Revision 1.9 2004/09/28 14:39:50 strk * Forced imported assets inclusion by mean of instantiation. * Symbols are instantiated inside a __shared_assets clip, which in turn * is made invisible. * * Revision 1.8 2004/09/28 14:09:07 strk * Added assets import support. * * Revision 1.7 2004/09/28 06:59:29 strk * Added -v switch to set output version. * Added notice about output configuration. * * Revision 1.6 2004/09/25 08:23:05 strk * Added -C to cpp call * * Revision 1.5 2004/09/25 08:17:11 strk * Post-processed files are kept and their name is shown to the user to * allow for error Line finding. * * Revision 1.4 2004/07/19 08:22:56 strk * GNU_SOURCE define in makeswf.c, makeswf.h dependency in Makefile * * Revision 1.3 2004/07/15 12:45:54 strk * Added -D and -I switched for preprocessor control * * **************************************************************/ ming-0.4.5/util/png2dbl.c0000644000175000017500000001737312154635363012067 00000000000000#include #include #include #include #include #include #include #include #include #include int verbose = 0; typedef unsigned char byte; void error(char *s, ...) { va_list ap; va_start(ap, s); vprintf(s, ap); va_end(ap); putchar('\n'); exit(1); } void usage() { printf("png2dbl - convert a png file to an SWF DefineBitsLossless\n"); printf(" or DefineBitsLossless2 block\n"); printf("\nUsage: png2bmap [--verbose] \n"); printf("where file.png is your png file. Writes to file.dbl.\n"); exit(1); } struct pngdata { png_uint_32 width; png_uint_32 height; int bit_depth; int color_type; int num_palette; int channels; png_colorp palette; unsigned char *data; }; struct pngdata readPNG(FILE *fp) { struct pngdata png; unsigned char header[8]; unsigned int x, y; unsigned char *p; byte alpha; byte r, g, b; int ret; png_structp png_ptr; png_infop info_ptr, end_info; png_bytep *row_pointers; unsigned int i, rowbytes, depth; if(!fp) error("Couldn't open file!\n"); ret = fread(header, 1, 8, fp); if(ret != 8) error("failed read header\n"); /* if(png_check_sig(header, 8)) error("File doesn't appear to be a proper PNG file\n"); */ png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); if(!png_ptr) error("Couldn't create png_ptr\n"); info_ptr = png_create_info_struct(png_ptr); if(!info_ptr) { png_destroy_read_struct(&png_ptr, (png_infopp)NULL, (png_infopp)NULL); error("Couldn't create info_ptr\n"); } end_info = png_create_info_struct(png_ptr); if(!end_info) { png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); error("Couldn't create end_info\n"); } if(setjmp(png_jmpbuf(png_ptr))) { png_destroy_read_struct(&png_ptr, &info_ptr, &end_info); fclose(fp); error("Mystery error (longjmp called)\n"); } png_init_io(png_ptr, fp); png_set_sig_bytes(png_ptr, 8); png_read_info(png_ptr, info_ptr); png_get_IHDR(png_ptr, info_ptr, &png.width, &png.height, &png.bit_depth, &png.color_type, NULL, NULL, NULL); if(verbose) { printf("size %ld/%ld color %d/%d/%ld\n", png.width, png.height, png.bit_depth, png.color_type, png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)); } if(png.color_type == PNG_COLOR_TYPE_PALETTE) { if(verbose) printf("color type: PALETTE\n"); png_get_PLTE(png_ptr, info_ptr, &png.palette, &png.num_palette); } /* force bitdepth of 8 if necessary */ depth = png.bit_depth; if(png.bit_depth < 8) png_set_packing(png_ptr); if(png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) png_set_expand(png_ptr); if(png.bit_depth == 16) { if(verbose) printf("depth: 16\n"); png_set_strip_16(png_ptr); } if(png.color_type == PNG_COLOR_TYPE_GRAY_ALPHA) { if(verbose) printf("color type: GRAY ALPHA\n"); png_set_gray_to_rgb(png_ptr); } if(png.color_type == PNG_COLOR_TYPE_RGB) { if(verbose) printf("color type: RGB\n"); png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); } /* update info w/ the set transformations */ png_read_update_info(png_ptr, info_ptr); png_get_IHDR(png_ptr, info_ptr, &png.width, &png.height, &png.bit_depth, &png.color_type, NULL, NULL, NULL); png.channels = png_get_channels(png_ptr, info_ptr); if(png.color_type == PNG_COLOR_TYPE_GRAY) { /* turn it into a palettized image, use the gray values as indices to an rgb color table */ int i; if (verbose) printf("color type: GRAY\n"); 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 = (png_byte) ( (i*255)/(png.num_palette-1) ); } /* 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>8); p[2] = (char)((int)(g*alpha)>>8); p[3] = (char)((int)(b*alpha)>>8); } } } return png; } static void alignedcopy(struct pngdata png, unsigned char *data) { unsigned int row; int alignedrowsize; int pngrowsize; unsigned char *pngdata; alignedrowsize = (png.width * png.channels + 3) & ~3; pngdata = png.data; pngrowsize = png.width * png.channels; for( row = 0; row < png.height; row++ ) { memcpy(data, pngdata, pngrowsize); pngdata += pngrowsize; data += alignedrowsize; } } void writeDBL(FILE *f, struct pngdata png) { unsigned char *data, *outdata; int alignedsize; unsigned long outsize; int hasAlpha = png.color_type == PNG_COLOR_TYPE_GRAY_ALPHA || png.color_type == PNG_COLOR_TYPE_RGB_ALPHA; fputc('D', f); fputc('B', f); fputc('l', f); fputc(hasAlpha ? 2 : 1, f); alignedsize = png.height * ((png.width * png.channels + 3) & ~3); if(png.color_type == PNG_COLOR_TYPE_PALETTE) { int tablesize = png.num_palette * sizeof(png_color); data = (unsigned char*) malloc(tablesize + alignedsize); memcpy(data, png.palette, tablesize); alignedcopy(png, data + tablesize); alignedsize += tablesize; } else { data = (unsigned char*) malloc(alignedsize); alignedcopy(png, data); } outdata = (unsigned char*) malloc(outsize = (int)floor(alignedsize*1.01+12)); /* compress the RGB color table (if present) and image data one block */ compress2(outdata, &outsize, data, alignedsize, 9); #ifndef USE_ZLIB outsize = alignedsize; /* if using zlib use the compress2() result value! */ #endif /* write the remaining file size */ if(png.color_type == PNG_COLOR_TYPE_PALETTE) { fputc(((outsize+6)>>24)&0xff, f); fputc(((outsize+6)>>16)&0xff, f); fputc(((outsize+6)>>8)&0xff, f); fputc((outsize+6)&0xff, f); } else { fputc(((outsize+5)>>24)&0xff, f); fputc(((outsize+5)>>16)&0xff, f); fputc(((outsize+5)>>8)&0xff, f); fputc((outsize+5)&0xff, f); } /* UInt8 format 3: 8bit data 4: 16bit data 5: 32bit data */ if(png.bit_depth != 8) error("Can't deal with bit depth %i!", png.bit_depth); if(png.color_type == PNG_COLOR_TYPE_PALETTE) fputc(3, f); else fputc(5, f); fputc(png.width&0xff, f); fputc((png.width>>8)&0xff, f); fputc(png.height&0xff, f); fputc((png.height>>8)&0xff, f); if(png.color_type == PNG_COLOR_TYPE_PALETTE) fputc(png.num_palette-1, f); if(fwrite(outdata, sizeof(char), outsize, f) != outsize) error("Didn't write all of the file!"); } int main(int argc, char *argv[]) { int len; char *outfile; struct pngdata png; if (argc > 2 && strcmp(argv[1], "--verbose")==0) { verbose = 1; argc--; argv++; } if(argc < 2) usage(); len = strlen(argv[1]); if(strcmp(argv[1]+len-4, ".png") != 0) usage(); if(argc < 3) { outfile = strdup(argv[1]); outfile[len-3] = 'd'; outfile[len-2] = 'b'; outfile[len-1] = 'l'; } else outfile = argv[2]; png = readPNG(fopen(argv[1], "rb")); writeDBL(fopen(outfile, "wb"), png); exit(0); } ming-0.4.5/util/listmp3.c0000644000175000017500000001162111454264373012121 00000000000000#include #include #define error(x) {puts(x); exit(1);} #define MP3_FRAME_SYNC 0xFFE00000 #define MP3_VERSION 0x00180000 #define MP3_VERSION_25 0x00000000 #define MP3_VERSION_RESERVED 0x00080000 #define MP3_VERSION_2 0x00100000 #define MP3_VERSION_1 0x00180000 #define MP3_LAYER 0x00060000 #define MP3_LAYER_RESERVED 0x00000000 #define MP3_LAYER_3 0x00020000 #define MP3_LAYER_2 0x00040000 #define MP3_LAYER_1 0x00060000 #define MP3_PROTECT 0x00010000 /* 16-bit CRC after header */ #define MP3_BITRATE 0x0000F000 #define MP3_BITRATE_SHIFT 12 int mp1l1_bitrate_table[] = { 0, 32, 64, 96, 128, 160, 192, 224, 256, 288, 320, 352, 382, 416, 448 }; int mp1l2_bitrate_table[] = { 0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384 }; int mp1l3_bitrate_table[] = { 0, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320 }; int mp2l1_bitrate_table[] = { 0, 32, 48, 56, 64, 80, 96, 112, 128, 144, 160, 176, 192, 224, 256 }; int mp2l23_bitrate_table[] = { 0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160 }; #define MP3_SAMPLERATE 0x00000C00 #define MP3_SAMPLERATE_SHIFT 10 int mp1_samplerate_table[] = { 44100, 48000, 32000 }; int mp2_samplerate_table[] = { 22050, 24000, 16000 }; /* is this right?? */ int mp25_samplerate_table[] = { 11025, 12000, 8000 }; /* fewer samples?? */ #define MP3_PADDING 0x00000200 /* if set, add an extra slot - 4 bytes for layer 1, 1 byte for 2+3 */ #define MP3_CHANNEL 0x000000C0 #define MP3_CHANNEL_STEREO 0x00000000 #define MP3_CHANNEL_JOINT 0x00000040 #define MP3_CHANNEL_DUAL 0x00000080 #define MP3_CHANNEL_MONO 0x000000C0 /* rest of the header info doesn't affect frame size.. */ void skipBytes(FILE *f, int length) { for(; length>0; --length) if(fgetc(f) == EOF) return; } void printMP3Headers(FILE *f) { unsigned long flags; int frameLen, numFrames = 0; int bitrate=0, bitrate_idx, samplerate=0, samplerate_idx; int version, layer, channels, padding; int bitrateSum = 0; int length; for(;;) { /* get 4-byte header, bigendian */ if((flags = fgetc(f)) == EOF) break; /* XXX - fix this mad hackery */ if(flags == 'I' && fgetc(f) == 'D' && fgetc(f) == '3') { do { flags = fgetc(f); } while(flags != 0xFF && flags != EOF); } if(flags == EOF) break; flags <<= 24; flags += fgetc(f) << 16; flags += fgetc(f) << 8; flags += fgetc(f); if((flags & MP3_FRAME_SYNC) != MP3_FRAME_SYNC) break; /* error("bad sync on MP3 block!"); */ ++numFrames; bitrate_idx = (flags & MP3_BITRATE) >> MP3_BITRATE_SHIFT; samplerate_idx = (flags & MP3_SAMPLERATE) >> MP3_SAMPLERATE_SHIFT; channels = ((flags & MP3_CHANNEL) == MP3_CHANNEL_MONO) ? 1 : 2; switch(flags & MP3_VERSION) { case MP3_VERSION_1: version = 1; break; case MP3_VERSION_2: version = 2; break; case MP3_VERSION_25: version = 25; break; default: error("unknown MP3 version!"); } switch(flags & MP3_LAYER) { case MP3_LAYER_1: layer = 1; break; case MP3_LAYER_2: layer = 2; break; case MP3_LAYER_3: layer = 3; break; default: error("unknown MP3 layer!"); } bitrateSum += bitrate; if(version == 1) { samplerate = mp1_samplerate_table[samplerate_idx]; if(layer == 1) bitrate = mp1l1_bitrate_table[bitrate_idx]; else if(layer == 2) bitrate = mp1l2_bitrate_table[bitrate_idx]; else if(layer == 3) bitrate = mp1l3_bitrate_table[bitrate_idx]; } else { if(version == 2) samplerate = mp2_samplerate_table[samplerate_idx]; else samplerate = mp25_samplerate_table[samplerate_idx]; if(layer == 1) bitrate = mp2l1_bitrate_table[bitrate_idx]; else bitrate = mp2l23_bitrate_table[bitrate_idx]; } padding = (flags & MP3_PADDING) ? 1 : 0; if(layer == 1) padding <<= 2; if(version == 1) frameLen = 144 * bitrate * 1000 / samplerate + padding; else frameLen = 72 * bitrate * 1000 / samplerate + padding; printf("frame %i: MP%i layer %i, %i Hz, %ikbps, %s, length=%i, protect %s\n", numFrames, version, layer, samplerate, bitrate, (channels==2) ? "stereo" : "mono", frameLen, (flags&MP3_PROTECT) ? "on" : "off"); skipBytes(f, frameLen-4); } putchar('\n'); length = numFrames*(samplerate > 3200 ? 1152 : 576)/samplerate; printf("Number of frames: %i\n", numFrames); printf("Average bitrate: %i\n", bitrateSum/numFrames); printf("Length: %i:%02i\n", length/60, length%60); } int main(int argc, char *argv[]) { FILE *f; if(argc<1) error("gimme file name"); f = fopen(argv[1],"rb"); if(!f) error("couldn't open file"); printMP3Headers(f); exit(0); } ming-0.4.5/util/action.h0000644000175000017500000000230611454264373012010 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #ifndef SWF_ACTION_H_INCLUDED #define SWF_ACTION_H_INCLUDED #include "swftypes.h" #include "actiontypes.h" /* action.c */ extern const char *actionName(Action header); extern void outputSWF_ACTION(int n,SWF_ACTION *act); #endif /* SWF_ACTION_H_INCLUDED */ ming-0.4.5/util/TIPS0000644000175000017500000000120711454264373011063 00000000000000makefdb ------- How do you make a generator template file? Write some text in a flash movie using MM Flash(4,5,..?), under "save as.." select "Generator Template". Feed that file into makefdb, and it'll save every font def'n found therein into a file .fdb. If you don't save as a template, it won't write the entire glyph set out, only the letters you've actually used.. See, it's smart that way. graphics -------- There is a software named auto-trace (http://autotrace.sourceforge.net), that can vectorize a bitmap (*.bmp,*.pbm,..) and save it to swf (using ming) only using SWFShapes. Then just "swfto... swffile" and .. smile. ming-0.4.5/util/read.c0000644000175000017500000001777212154635363011455 00000000000000/**************************************************************************** * * Copyright (C) 2011 Sandro Santilli * Copyright (C) 2005-2006 Stuart R. Anderson * Copyright (C) 2001 Raffaele Sena * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include #include #include #include #include "parser.h" int fileOffset = 0; int buffer; int bufbits = 0; /* # of bits in buffer */ void byteAlign() { if(bufbits > 0) { bufbits = 0; buffer = 0; } } int readBits(FILE *f, int number) { int ret = buffer; if(number == bufbits) { bufbits = 0; buffer = 0; return ret; } if(number > bufbits) { number -= bufbits; while(number>8) { ret <<= 8; ret += fgetc(f); ++fileOffset; number -= 8; } ++fileOffset; buffer = fgetc(f); if(number>0) { ret <<= number; bufbits = 8-number; ret += buffer >> (8-number); buffer &= (1<> (bufbits-number); bufbits -= number; buffer &= (1<xMin = readSBits(f, nBits); s->xMax = readSBits(f, nBits); s->yMin = readSBits(f, nBits); s->yMax = readSBits(f, nBits); } int readUInt8(FILE *f) { bufbits = 0; ++fileOffset; return fgetc(f); } int readSInt8(FILE *f) { return (signed char)readUInt8(f); } int readSInt16(FILE *f) { return readUInt8(f) + readSInt8(f)*256; } int readUInt16(FILE *f) { return readUInt8(f) + (readUInt8(f)<<8); } long readSInt32(FILE *f) { return (long)readUInt8(f) + (readUInt8(f)<<8) + (readUInt8(f)<<16) + (readUInt8(f)<<24); } unsigned long readUInt32(FILE *f) { return (unsigned long)(readUInt8(f) + (readUInt8(f)<<8) + (readUInt8(f)<<16) + (readUInt8(f)<<24)); } double readDouble(FILE *f) { union { char c[8]; double d; } data; #ifdef SWF_LITTLE_ENDIAN data.c[4] = readUInt8(f); data.c[5] = readUInt8(f); data.c[6] = readUInt8(f); data.c[7] = readUInt8(f); data.c[0] = readUInt8(f); data.c[1] = readUInt8(f); data.c[2] = readUInt8(f); data.c[3] = readUInt8(f); #else data.c[3] = readUInt8(f); data.c[2] = readUInt8(f); data.c[1] = readUInt8(f); data.c[0] = readUInt8(f); data.c[7] = readUInt8(f); data.c[6] = readUInt8(f); data.c[5] = readUInt8(f); data.c[4] = readUInt8(f); #endif return data.d; } float readFloat(FILE *f) { union { char c[4]; float f; } data; #ifdef SWF_LITTLE_ENDIAN data.c[0] = readUInt8(f); data.c[1] = readUInt8(f); data.c[2] = readUInt8(f); data.c[3] = readUInt8(f); #else data.c[3] = readUInt8(f); data.c[2] = readUInt8(f); data.c[1] = readUInt8(f); data.c[0] = readUInt8(f); #endif return data.f; } char *readBytes(FILE *f,int size) { int i; char *buf; buf = (char *)malloc(sizeof(char)*size); for(i=0;i= buflen-2) { buf = (char *)realloc(buf, sizeof(char)*(buflen+256)); buflen += 256; p = buf+len; } switch(c) { case '\n': *(p++) = '\\'; *(p++) = 'n'; ++len; break; case '\t': *(p++) = '\\'; *(p++) = 't'; ++len; break; case '\r': *(p++) = '\\'; *(p++) = 'r'; ++len; break; default: *(p++) = c; } ++len; } *p = 0; return buf; } #define ENC_BITSPERBYTE 7 #define ENC_BYTEMASK 0x7f #define ENC_U30_VERIFY 0xfc #define ENC_HIGHBIT 0x80 static inline int hasNextByte(unsigned int b) { if(!(b & ENC_HIGHBIT)) return 0; return 1; } signed long readEncSInt32(FILE *f) { signed long result = 0, temp; int shift = 0; do { if(shift > 4 * ENC_BITSPERBYTE) break; temp = readUInt8(f); result |= (ENC_BYTEMASK & temp) << shift; shift += ENC_BITSPERBYTE; } while (hasNextByte(temp)); return result; } unsigned long readEncUInt30(FILE *f) { unsigned long result = 0, temp; int shift = 0; do { if(shift > 4 * ENC_BITSPERBYTE) break; temp = readUInt8(f); result |= (ENC_BYTEMASK & temp) << shift; shift += ENC_BITSPERBYTE; } while (hasNextByte(temp)); //if((temp & ENC_U30_VERIFY) && shift > 4 * ENC_BITSPERBYTE) // printf("readEncUInt30: verification error\n"); return result; } unsigned long readEncUInt32(FILE *f) { unsigned long result = 0, temp; int shift = 0; do { if(shift > 4 * ENC_BITSPERBYTE) break; temp = readUInt8(f); result |= (ENC_BYTEMASK & temp) << shift; shift += ENC_BITSPERBYTE; } while (hasNextByte(temp)); return result; } char *readSizedString(FILE *f,int size) { int len = 0, buflen = 256, i; char c, *buf, *p; buf = (char *)malloc(sizeof(char)*buflen); p = buf; for(i=0;i= buflen-2) { buf = (char *)realloc(buf, sizeof(char)*(buflen+256)); buflen += 256; p = buf+len; } switch(c) { case '\n': *(p++) = '\\'; *(p++) = 'n'; ++len; break; case '\t': *(p++) = '\\'; *(p++) = 't'; ++len; break; case '\r': *(p++) = '\\'; *(p++) = 'r'; ++len; break; default: *(p++) = c; } ++len; } *p = 0; return buf; } void _dumpBytes(FILE *f, int length, int restore) { int j=0, i, k, l=0, offset=0; unsigned char buf[16]; if(length<=0) return; if(restore) offset = ftell(f); putchar('\n'); for(;; ++l) { printf("%03x0: ", l); for(i=0; i<16; ++i) { if(i==8) putchar(' '); printf("%02x ", buf[i] = readUInt8(f)); ++j; if(j==length) break; } if(j==length) { for(k=i+1; k<16; ++k) printf(" "); if(k==8) putchar(' '); ++i; } printf(" "); for(k=0; k 31) && (buf[k] < 128)) putchar(buf[k]); else putchar('.'); } putchar('\n'); if(j==length) break; } putchar('\n'); putchar('\n'); if(restore) { fseek(f,offset, SEEK_SET); fileOffset = offset; } } void dumpBytes(FILE *f, int length) { _dumpBytes(f, length, 0 ); } void peekBytes(FILE *f, int length) { _dumpBytes(f, length, 1 ); } void dumpBuffer(unsigned char *buf, int length) { int j=0, i, k, l=0; if(length<=0) return; putchar('\n'); for(;; ++l) { printf("%03x0: ", l); for(i=0; i<16; ++i) { if(i==8) putchar(' '); printf("%02x ", buf[16*l+i]); ++j; if(j==length) break; } if(j==length) { for(k=i+1; k<16; ++k) printf(" "); if(k==8) putchar(' '); ++i; } printf(" "); for(k=0; k 31) && (buf[16*l+k] < 128)) putchar(buf[16*l+k]); else putchar('.'); } putchar('\n'); if(j==length) break; } putchar('\n'); putchar('\n'); } void silentSkipBytes(FILE *f, int length) { for(; length>0; --length) readUInt8(f); } ming-0.4.5/util/outputtxt.c0000644000175000017500000024177512154635363012644 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include "blocks/blocktypes.h" #include "action.h" #include "parser.h" #include "read.h" #include "decompile.h" #include "swfoutput.h" #include "abctypes.h" #include #include #include extern const char *blockName (SWFBlocktype header); extern int verbose; extern struct Movie m; /* * This file contains output functions that can display the different SWF block * types in a human readable format. */ #define OUT_BEGIN(block) \ struct block *sblock = (struct block *)pblock; static struct SWFBlockOutput outputs[] = { {SWF_CHARACTERSET, outputSWF_CHARACTERSET}, {SWF_DEFINEBITS, outputSWF_DEFINEBITS}, {SWF_DEFINEBITSJPEG2, outputSWF_DEFINEBITSJPEG2}, {SWF_DEFINEBITSJPEG3, outputSWF_DEFINEBITSJPEG3}, {SWF_DEFINEBITSPTR, outputSWF_DEFINEBITSPTR}, {SWF_DEFINEBUTTON, outputSWF_DEFINEBUTTON}, {SWF_DEFINEBUTTON2, outputSWF_DEFINEBUTTON2}, {SWF_DEFINEBUTTONCXFORM, outputSWF_DEFINEBUTTONCXFORM}, {SWF_DEFINEBUTTONSOUND, outputSWF_DEFINEBUTTONSOUND}, {SWF_DEFINECOMMANDOBJ, outputSWF_DEFINECOMMANDOBJ}, {SWF_DEFINEEDITTEXT, outputSWF_DEFINEEDITTEXT}, {SWF_DEFINEFONT, outputSWF_DEFINEFONT}, {SWF_DEFINEFONT2, outputSWF_DEFINEFONT2}, {SWF_DEFINEFONT3, outputSWF_DEFINEFONT3}, {SWF_DEFINEFONTINFO, outputSWF_DEFINEFONTINFO}, {SWF_DEFINEFONTINFO2, outputSWF_DEFINEFONTINFO2}, {SWF_CSMTEXTSETTINGS, outputSWF_CSMTEXTSETTINGS}, {SWF_DEFINEFONTNAME, outputSWF_DEFINEFONTNAME}, {SWF_DEFINEFONTALIGNZONES, outputSWF_DEFINEFONTALIGNZONES}, {SWF_DEFINELOSSLESS, outputSWF_DEFINELOSSLESS}, {SWF_DEFINELOSSLESS2, outputSWF_DEFINELOSSLESS2}, {SWF_DEFINEMORPHSHAPE, outputSWF_DEFINEMORPHSHAPE}, {SWF_DEFINEMORPHSHAPE2, outputSWF_DEFINEMORPHSHAPE2}, {SWF_DEFINESHAPE, outputSWF_DEFINESHAPE}, {SWF_DEFINESHAPE2, outputSWF_DEFINESHAPE2}, {SWF_DEFINESHAPE3, outputSWF_DEFINESHAPE3}, {SWF_DEFINESHAPE4, outputSWF_DEFINESHAPE4}, {SWF_DEFINESOUND, outputSWF_DEFINESOUND}, {SWF_DEFINESPRITE, outputSWF_DEFINESPRITE}, {SWF_DEFINETEXT, outputSWF_DEFINETEXT}, {SWF_DEFINETEXT2, outputSWF_DEFINETEXT2}, {SWF_DEFINETEXTFORMAT, outputSWF_DEFINETEXTFORMAT}, {SWF_DEFINEVIDEO, outputSWF_DEFINEVIDEO}, {SWF_DEFINEVIDEOSTREAM, outputSWF_DEFINEVIDEOSTREAM}, {SWF_DOACTION, outputSWF_DOACTION}, {SWF_ENABLEDEBUGGER, outputSWF_ENABLEDEBUGGER}, {SWF_ENABLEDEBUGGER2, outputSWF_ENABLEDEBUGGER2}, {SWF_END, outputSWF_END}, {SWF_EXPORTASSETS, outputSWF_EXPORTASSETS}, {SWF_FONTREF, outputSWF_FONTREF}, {SWF_FRAMELABEL, outputSWF_FRAMELABEL}, {SWF_FRAMETAG, outputSWF_FRAMETAG}, {SWF_FREEALL, outputSWF_FREEALL}, {SWF_FREECHARACTER, outputSWF_FREECHARACTER}, {SWF_GENCOMMAND, outputSWF_GENCOMMAND}, {SWF_IMPORTASSETS, outputSWF_IMPORTASSETS}, {SWF_IMPORTASSETS2, outputSWF_IMPORTASSETS2}, {SWF_JPEGTABLES, outputSWF_JPEGTABLES}, {SWF_NAMECHARACTER, outputSWF_NAMECHARACTER}, {SWF_PATHSAREPOSTSCRIPT, outputSWF_PATHSAREPOSTSCRIPT}, {SWF_PLACEOBJECT, outputSWF_PLACEOBJECT}, {SWF_PLACEOBJECT2, outputSWF_PLACEOBJECT2}, {SWF_PLACEOBJECT3, outputSWF_PLACEOBJECT3}, {SWF_PREBUILT, outputSWF_PREBUILT}, {SWF_PREBUILTCLIP, outputSWF_PREBUILTCLIP}, {SWF_PROTECT, outputSWF_PROTECT}, {SWF_REMOVEOBJECT, outputSWF_REMOVEOBJECT}, {SWF_REMOVEOBJECT2, outputSWF_REMOVEOBJECT2}, {SWF_SERIALNUMBER, outputSWF_SERIALNUMBER}, {SWF_SETBACKGROUNDCOLOR, outputSWF_SETBACKGROUNDCOLOR}, {SWF_SHOWFRAME, outputSWF_SHOWFRAME}, {SWF_SOUNDSTREAMBLOCK, outputSWF_SOUNDSTREAMBLOCK}, {SWF_SOUNDSTREAMHEAD, outputSWF_SOUNDSTREAMHEAD}, {SWF_SOUNDSTREAMHEAD2, outputSWF_SOUNDSTREAMHEAD2}, {SWF_STARTSOUND, outputSWF_STARTSOUND}, {SWF_STARTSOUND2, outputSWF_STARTSOUND2}, {SWF_SYNCFRAME, outputSWF_SYNCFRAME}, {SWF_INITACTION, outputSWF_INITACTION}, {SWF_VIDEOFRAME, outputSWF_VIDEOFRAME}, {SWF_REFLEX, outputSWF_REFLEX}, {SWF_FILEATTRIBUTES, outputSWF_FILEATTRIBUTES}, {SWF_METADATA, outputSWF_METADATA}, {SWF_SCRIPTLIMITS, outputSWF_SCRIPTLIMITS}, {SWF_DEFINESCALINGGRID, outputSWF_DEFINESCALINGGRID}, {SWF_SETTABINDEX, outputSWF_SETTABINDEX}, {SWF_DOABC, outputSWF_DOABC}, {SWF_SYMBOLCLASS, outputSWF_SYMBOLCLASS}, {SWF_DEFINESCENEANDFRAMEDATA, outputSWF_DEFINESCENEANDFRAMEDATA}, {SWF_DEBUGID, outputSWF_DEBUGID}, }; static int numOutputs = sizeof (outputs) / sizeof (struct SWFBlockOutput); /* Indented output function */ static unsigned INDENT=0; static void _iprintf(const char* fmt, ...) { va_list ap; unsigned ii=INDENT; /* do intenting */ while(ii--) printf(" "); va_start (ap, fmt); vprintf(fmt, ap); return; } /* Output basic Flash Types */ void outputSWF_RGBA (SWF_RGBA * rgb, char *pname) { _iprintf (" RGBA: ("); _iprintf ("%2x,", rgb->red); _iprintf ("%2x,", rgb->green); _iprintf ("%2x,", rgb->blue); _iprintf ("%2x)\n", rgb->alpha); } void outputSWF_RECT (SWF_RECT * rect) { _iprintf (" RECT: "); _iprintf (" (%ld,", rect->Xmin); _iprintf ("%ld)x", rect->Ymin); _iprintf ("(%ld,", rect->Xmax); _iprintf ("%ld)", rect->Ymax); _iprintf (":%d\n", rect->Nbits); } void outputSWF_MATRIX (SWF_MATRIX * matrix, char *name) { _iprintf (" Matrix:\n"); if (matrix->HasScale) { _iprintf (" ScaleX %f ", matrix->ScaleX); _iprintf ("ScaleY %f\n", matrix->ScaleY); } if (matrix->HasRotate) { _iprintf (" RotateSkew0 %f ", matrix->RotateSkew0); _iprintf ("RotateSkew1 %f\n", matrix->RotateSkew1); } _iprintf (" TranslateX %6ld ", matrix->TranslateX); _iprintf ("TranslateY %6ld\n", matrix->TranslateY); } void outputSWF_CXFORM(SWF_CXFORM * cxform){ _iprintf(" ColorTransform:\n"); if (cxform->HasMultTerms){ _iprintf(" Mult:"); _iprintf("%ld,", cxform->RedMultTerm); _iprintf("%ld,", cxform->GreenMultTerm); _iprintf("%ld,", cxform->BlueMultTerm); /* if (cxform->hasAlpha){ _iprintf("%ld", cxform->AlphaMultTerm); } */ _iprintf("\n"); } if (cxform->HasAddTerms){ _iprintf(" Add:"); _iprintf("%ld,", cxform->RedAddTerm); _iprintf("%ld,", cxform->GreenAddTerm); _iprintf("%ld,", cxform->BlueAddTerm); /* if (cxform->hasAlpha){ _iprintf("%ld", cxform->AlphaAddTerm); } */ _iprintf("\n"); } } /* alpha could be handled in SWF_CXFORM / outputSWF_CXFORM too * or is there a reason to make * 2 parsefunctions / * 2 cxform structures * 2 outputfunctions * for that? */ void outputSWF_CXFORMWITHALPHA(SWF_CXFORMWITHALPHA * cxform, char *name){ _iprintf(" ColorTransform:\n"); if (cxform->HasMultTerms){ _iprintf(" Mult:"); _iprintf("%ld,", cxform->RedMultTerm); _iprintf("%ld,", cxform->GreenMultTerm); _iprintf("%ld,", cxform->BlueMultTerm); _iprintf("%ld", cxform->AlphaMultTerm); _iprintf("\n"); } if (cxform->HasAddTerms){ _iprintf(" Add:"); _iprintf("%ld,", cxform->RedAddTerm); _iprintf("%ld,", cxform->GreenAddTerm); _iprintf("%ld,", cxform->BlueAddTerm); _iprintf("%ld", cxform->AlphaAddTerm); _iprintf("\n"); } } void outputSWF_FILTER(SWF_FILTER *filter); void outputSWF_BUTTONRECORD (SWF_BUTTONRECORD *brec) { _iprintf (" BUTTONRECORD: "); _iprintf (" ButtonHasBlendMode %d ", brec->ButtonHasBlendMode); _iprintf (" ButtonHasFilterList %d ", brec->ButtonHasFilterList); _iprintf (" ButtonStateHitTest: %d ", brec->ButtonStateHitTest); _iprintf (" ButtonStateDown: %d ", brec->ButtonStateDown); _iprintf (" ButtonStateOver: %d ", brec->ButtonStateOver); _iprintf (" ButtonStateUp: %d\n", brec->ButtonStateUp); _iprintf (" CharacterID: %d\n", brec->CharacterId); _iprintf (" PlaceDepth: %d\n", brec->PlaceDepth); outputSWF_MATRIX(&brec->PlaceMatrix,""); outputSWF_CXFORMWITHALPHA(&brec->ColorTransform,""); if( brec->ButtonHasBlendMode ) _iprintf(" BlendMode %d\n", brec->BlendMode ); if( brec->ButtonHasFilterList ) { int i; SWF_FILTERLIST *filterList = &brec->FilterList; _iprintf(" NumberOfFilters %d\n", filterList->NumberOfFilters); for(i = 0; i < filterList->NumberOfFilters; i++) outputSWF_FILTER(filterList->Filter + i); } } void outputSWF_BUTTONCONDACTION (SWF_BUTTONCONDACTION *bcarec) { #ifdef NODECOMPILE int i; #endif #if !defined(ACTIONONLY) _iprintf (" BUTTONCONDACTION: "); _iprintf (" CondActionSize: %d\n", bcarec->CondActionSize); _iprintf (" CondIdleToOverDown: %d ", bcarec->CondIdleToOverDown); _iprintf (" CondOutDownToIdle: %d ", bcarec->CondOutDownToIdle); _iprintf (" CondOutDownToOverDown: %d ", bcarec->CondOutDownToOverDown); _iprintf (" CondOverDownToOutDown: %d ", bcarec->CondOverDownToOutDown); _iprintf (" CondOverDownToOverUp: %d ", bcarec->CondOverDownToOverUp); _iprintf (" CondOverUpToOverDown: %d ", bcarec->CondOverUpToOverDown); _iprintf (" CondOverUpToIdle: %d ", bcarec->CondOverUpToIdle); _iprintf (" CondIdleToOverUp: %d ", bcarec->CondIdleToOverUp); _iprintf (" CondKeyPress: %d ", bcarec->CondKeyPress); _iprintf (" CondOverDownToIdle: %d ", bcarec->CondOverDownToIdle); _iprintf ("\n"); #endif #ifdef NODECOMPILE _iprintf(" %d Actions\n", bcarec->numActions); for(i=0;inumActions;i++) outputSWF_ACTION(i,&(bcarec->Actions[i])); #else _iprintf (" %s\n", decompile5Action(bcarec->numActions,bcarec->Actions,0)); #endif } void outputSWF_CLIPEVENTFLAGS (SWF_CLIPEVENTFLAGS * clipevflags ) { if ( clipevflags->ClipEventKeyUp ) printf (" ClipEventKeyUp"); if ( clipevflags->ClipEventKeyDown ) printf (" ClipEventKeyDown"); if ( clipevflags->ClipEventMouseUp ) printf (" ClipEventMouseUp"); if ( clipevflags->ClipEventMouseDown ) printf (" ClipEventMouseDown"); if ( clipevflags->ClipEventMouseMove ) printf (" ClipEventMouseMove"); if ( clipevflags->ClipEventUnload ) printf (" ClipEventUnload"); if ( clipevflags->ClipEventEnterFrame ) printf (" ClipEventEnterFrame"); if ( clipevflags->ClipEventLoad ) printf (" ClipEventLoad"); if ( clipevflags->ClipEventDragOver ) printf (" ClipEventDragOver"); if ( clipevflags->ClipEventRollOut ) printf (" ClipEventRollOut"); if ( clipevflags->ClipEventRollOver ) printf (" ClipEventRollOver"); if ( clipevflags->ClipEventReleaseOutside ) printf (" ClipEventReleaseOutside"); if ( clipevflags->ClipEventRelease ) _iprintf (" ClipEventRelease"); if ( clipevflags->ClipEventPress ) _iprintf (" ClipEventPress"); if ( clipevflags->ClipEventInitialize ) _iprintf (" ClipEventInitialize"); if ( clipevflags->ClipEventData ) _iprintf (" ClipEventData"); if ( clipevflags->ClipEventConstruct ) _iprintf (" ClipEventConstruct"); if ( clipevflags->ClipEventKeyPress ) _iprintf (" ClipEventKeyPress"); if ( clipevflags->ClipEventDragOut ) _iprintf (" ClipEventDragOut"); } void outputSWF_CLIPACTIONRECORD (SWF_CLIPACTIONRECORD * carec ) { #ifdef NODECOMPILE int i; #endif #if !defined(ACTIONONLY) _iprintf(" onClipEvents("); outputSWF_CLIPEVENTFLAGS (&carec->EventFlag); printf(" ):\n"); /*_iprintf(" ActionRecordSize %ld\n", carec->ActionRecordSize);*/ if ( carec->KeyCode) _iprintf(" EventKeyCode %d\n", carec->KeyCode); #endif #ifdef NODECOMPILE ++INDENT; /*_iprintf(" %d Actions\n", carec->numActions);*/ for(i=0;inumActions;i++) outputSWF_ACTION(i,&(carec->Actions[i])); --INDENT; #else ++INDENT; _iprintf (" %s\n", decompile5Action(carec->numActions,carec->Actions,0)); --INDENT; #endif } void outputSWF_CLIPACTIONS (SWF_CLIPACTIONS * clipactions ) { int i; for(i=0;iNumClipRecords-1;i++) outputSWF_CLIPACTIONRECORD(&(clipactions->ClipActionRecords[i])); } void outputSWF_GRADIENTRECORD (SWF_GRADIENTRECORD * gradientrec, char *gname) { _iprintf (" Ratio: %d\n", gradientrec->Ratio); outputSWF_RGBA (&gradientrec->Color, ""); } void outputSWF_MORPHGRADIENTRECORD (SWF_MORPHGRADIENTRECORD * gradientrec, char *gname) { _iprintf (" StartRatio: %d\n", gradientrec->StartRatio); outputSWF_RGBA (&gradientrec->StartColor, ""); _iprintf (" EndRatio: %d\n", gradientrec->EndRatio); outputSWF_RGBA (&gradientrec->EndColor, ""); } void outputFIXED(FIXED fixed, const char *prefix) { float f; f = fixed * 1.0 / (1<<16); _iprintf("%s%f\n", prefix, f); } void outputFIXED8(FIXED fixed, const char *prefix) { float f; f = fixed * 1.0 / (1<<8); _iprintf("%s%f\n", prefix, f); } void outputSWF_FOCALGRADIENT (SWF_FOCALGRADIENT * gradient, char *name) { int i; _iprintf (" Gradient: "); _iprintf (" SpreadMode: %d\n", gradient->SpreadMode); _iprintf (" InterpolationMode: %d\n", gradient->InterpolationMode); _iprintf (" NumGradients: %d\n", gradient->NumGradients); for (i = 0; i < gradient->NumGradients; i++) outputSWF_GRADIENTRECORD (&(gradient->GradientRecords[i]),""); outputFIXED8(gradient->FocalPoint, " FocalPoint: "); } void outputSWF_GRADIENT (SWF_GRADIENT * gradient, char *name) { int i; _iprintf (" Gradient: "); _iprintf (" SpreadMode: %d\n", gradient->SpreadMode); _iprintf (" InterpolationMode: %d\n", gradient->InterpolationMode); _iprintf (" NumGradients: %d\n", gradient->NumGradients); for (i = 0; i < gradient->NumGradients; i++) outputSWF_GRADIENTRECORD (&(gradient->GradientRecords[i]),""); } void outputSWF_MORPHGRADIENT (SWF_MORPHGRADIENT * gradient, char *name) { int i; _iprintf (" MorphGradient: "); _iprintf (" NumGradients: %d\n", gradient->NumGradients); for (i = 0; i < gradient->NumGradients; i++) outputSWF_MORPHGRADIENTRECORD (&(gradient->GradientRecords[i]),""); } void outputSWF_FILLSTYLE (SWF_FILLSTYLE * fillstyle, char *name, int i) { _iprintf (" FillStyle: "); _iprintf (" FillStyleType: %x\n", fillstyle->FillStyleType); switch (fillstyle->FillStyleType) { case 0x00: /* Solid Fill */ outputSWF_RGBA (&fillstyle->Color, ""); break; case 0x10: /* Linear Gradient Fill */ case 0x12: /* Radial Gradient Fill */ outputSWF_MATRIX (&fillstyle->GradientMatrix,""); outputSWF_GRADIENT (&fillstyle->Gradient,""); break; case 0x13: outputSWF_MATRIX (&fillstyle->GradientMatrix,""); outputSWF_FOCALGRADIENT(&fillstyle->FocalGradient, ""); case 0x40: /* Repeating Bitmap Fill */ case 0x41: /* Clipped Bitmap Fill */ case 0x42: /* Non-smoothed Repeating Bitmap Fill */ case 0x43: /* Non-smoothed Clipped Bitmap Fill */ _iprintf (" BitmapID: %d\n", fillstyle->BitmapId); outputSWF_MATRIX (&fillstyle->BitmapMatrix,""); break; } } void outputSWF_FILLSTYLEARRAY (SWF_FILLSTYLEARRAY * fillstylearray, char *name) { int count, i; _iprintf (" FillStyleArray: "); _iprintf (" FillStyleCount: %6d ", fillstylearray->FillStyleCount); _iprintf (" FillStyleCountExtended: %6d\n", fillstylearray->FillStyleCountExtended); count = (fillstylearray->FillStyleCount != 0xff) ? fillstylearray->FillStyleCount : fillstylearray-> FillStyleCountExtended; for (i = 0; i < count; i++) { outputSWF_FILLSTYLE (&(fillstylearray->FillStyles[i]),"",0); } } void outputSWF_MORPHFILLSTYLE (SWF_MORPHFILLSTYLE * fillstyle, char *name, int i) { _iprintf (" MorphFillStyle: "); _iprintf (" FillStyleType: %x\n", fillstyle->FillStyleType); switch (fillstyle->FillStyleType) { case 0x00: /* Solid Fill */ outputSWF_RGBA (&fillstyle->StartColor, ""); outputSWF_RGBA (&fillstyle->EndColor, ""); break; case 0x10: /* Linear Gradient Fill */ case 0x12: /* Radial Gradient Fill */ outputSWF_MATRIX (&fillstyle->StartGradientMatrix,""); outputSWF_MATRIX (&fillstyle->EndGradientMatrix,""); outputSWF_MORPHGRADIENT (&fillstyle->Gradient,""); break; case 0x40: /* Repeating Bitmap Fill */ case 0x41: /* Clipped Bitmap Fill */ case 0x42: /* Non-smoothed Repeating Bitmap Fill */ case 0x43: /* Non-smoothed Clipped Bitmap Fill */ _iprintf (" BitmapID: %d\n", fillstyle->BitmapId); outputSWF_MATRIX (&fillstyle->StartBitmapMatrix,""); outputSWF_MATRIX (&fillstyle->EndBitmapMatrix,""); break; } } void outputSWF_MORPHFILLSTYLES( SWF_MORPHFILLSTYLES *fillstylearray) { int count, i; if( !verbose ) return; _iprintf (" MorphFillStyleArray: "); _iprintf (" FillStyleCount: %6d ", fillstylearray->FillStyleCount); _iprintf (" FillStyleCountExtended: %6d\n", fillstylearray->FillStyleCountExtended); count = (fillstylearray->FillStyleCount != 0xff) ? fillstylearray->FillStyleCount : fillstylearray-> FillStyleCountExtended; for (i = 0; i < count; i++) { outputSWF_MORPHFILLSTYLE (&(fillstylearray->FillStyles[i]),"",0); } } void outputSWF_LINESTYLE (SWF_LINESTYLE * fillstyle, char *name, int i) { _iprintf (" LineStyle: "); _iprintf (" Width: %d\n", fillstyle->Width); outputSWF_RGBA (&fillstyle->Color, ""); } void outputSWF_LINESTYLE2 (SWF_LINESTYLE2 * fillstyle, char *name, int i) { _iprintf (" LineStyle2: "); _iprintf (" Width: %d\n", fillstyle->Width); _iprintf (" StartCapStyle: %d\n", fillstyle->StartCapStyle); _iprintf (" JoinStyle: %d\n", fillstyle->JoinStyle); _iprintf (" HasFillFlag: %d\n", fillstyle->HasFillFlag); _iprintf (" NoHScaleFlag: %d\n", fillstyle->NoHScaleFlag); _iprintf (" NoVScaleFlag: %d\n", fillstyle->NoVScaleFlag); _iprintf (" PixelHintingFlag %d\n", fillstyle->PixelHintingFlag); _iprintf (" NoClose %d\n", fillstyle->NoClose); _iprintf (" EndCapStyle %d\n", fillstyle->EndCapStyle); if(fillstyle->JoinStyle == 2) _iprintf (" MiterLimitFactor %d\n", fillstyle->MiterLimitFactor); if(fillstyle->HasFillFlag == 0) outputSWF_RGBA (&fillstyle->Color, ""); else outputSWF_FILLSTYLE (&fillstyle->FillType, "", 0); } void outputSWF_LINESTYLEARRAY (SWF_LINESTYLEARRAY * linestylearray, char *name) { int count, i; count = linestylearray->LineStyleCount; _iprintf (" LineStyleArray: "); _iprintf (" LineStyleCount: %d\n", count); for (i = 0; i < count; i++) { if(linestylearray->LineStyles != NULL) outputSWF_LINESTYLE (&(linestylearray->LineStyles[i]),"",0); else if(linestylearray->LineStyles2 != NULL) outputSWF_LINESTYLE2 (&(linestylearray->LineStyles2[i]),"",0); else _iprintf("LineStyleArray: parser error\n"); } } void outputSWF_MORPHLINESTYLE (SWF_MORPHLINESTYLE * linestyle, char *name) { _iprintf (" MorphLineStyle: "); _iprintf (" StartWidth: %d\n", linestyle->StartWidth); _iprintf (" EndWidth: %d\n", linestyle->EndWidth); outputSWF_RGBA (&linestyle->StartColor, ""); outputSWF_RGBA (&linestyle->EndColor, ""); } void outputSWF_MORPHLINESTYLE2 (SWF_MORPHLINESTYLE2 * linestyle, char *name) { _iprintf (" MorphLineStyle2: "); _iprintf (" StartWidth: %d\n", linestyle->StartWidth); _iprintf (" EndWidth: %d\n", linestyle->EndWidth); _iprintf (" StartCapStyle: %d\n", linestyle->StartCapStyle); _iprintf (" JoinStyle: %d\n", linestyle->JoinStyle); _iprintf (" HasFillFlag: %d\n", linestyle->HasFillFlag); _iprintf (" NoHScaleFlag: %d\n", linestyle->NoHScaleFlag); _iprintf (" NoVScaleFlag: %d\n", linestyle->NoVScaleFlag); _iprintf (" PixelHintingFlag %d\n", linestyle->PixelHintingFlag); _iprintf (" NoClose %d\n", linestyle->NoClose); _iprintf (" EndCapStyle %d\n", linestyle->EndCapStyle); if(linestyle->JoinStyle == 2) _iprintf (" MiterLimitFactor %d\n", linestyle->MiterLimitFactor); if(linestyle->HasFillFlag == 0) { outputSWF_RGBA (&linestyle->StartColor, ""); outputSWF_RGBA (&linestyle->EndColor, ""); } else outputSWF_MORPHFILLSTYLE (&linestyle->FillType, "", 0); } void outputSWF_MORPHLINESTYLES (SWF_MORPHLINESTYLES * linestylearray) { int count, i; if( !verbose ) return; _iprintf (" MorphLineStyleArray: "); _iprintf (" LineStyleCount: %6d ", linestylearray->LineStyleCount); _iprintf (" LineStyleCountExtended: %6d\n", linestylearray->LineStyleCountExtended); count = (linestylearray->LineStyleCount != 0xff) ? linestylearray->LineStyleCount : linestylearray-> LineStyleCountExtended; for (i = 0; i < count; i++) { if(linestylearray->LineStyles != NULL) outputSWF_MORPHLINESTYLE (&(linestylearray->LineStyles[i]),""); else if(linestylearray->LineStyles2 != NULL) outputSWF_MORPHLINESTYLE2 (&(linestylearray->LineStyles2[i]),""); else _iprintf("LineStyleArray: parser error\n"); } } void outputSWF_SHAPERECORD (SWF_SHAPERECORD * shaperec, char *parentname) { if (shaperec->EndShape.TypeFlag) { /* An Edge Record */ if (shaperec->StraightEdge.StraightEdge == 1) { /* A Straight Edge Record */ _iprintf (" Straight EdgeRecord: (%d)", shaperec->StraightEdge.NumBits); if( shaperec->StraightEdge.GeneralLineFlag ) { _iprintf(" - (%ld, %ld)\n",shaperec->StraightEdge.DeltaX,shaperec->StraightEdge.DeltaY); } else { if( shaperec->StraightEdge.VertLineFlag ) _iprintf(" - (0, %ld)\n",shaperec->StraightEdge.VLDeltaY); else _iprintf(" - (%ld, 0)\n",shaperec->StraightEdge.VLDeltaX); } } else { /* A Curved Edge Record */ _iprintf (" Curved EdgeRecord: %d", shaperec->CurvedEdge.NumBits); _iprintf (" Control(%ld,%ld)", shaperec->CurvedEdge.ControlDeltaX, shaperec->CurvedEdge.ControlDeltaY); _iprintf (" Anchor(%ld,%ld)\n", shaperec->CurvedEdge.AnchorDeltaX, shaperec->CurvedEdge.AnchorDeltaY); } } else { /* A Non-Edge Record */ if (shaperec->EndShape.EndOfShape == 0) { _iprintf (" ENDSHAPE\n"); return; } _iprintf (" StyleChangeRecord:\n"); _iprintf (" StateNewStyles: %d", shaperec->StyleChange.StateNewStyles); _iprintf (" StateLineStyle: %d ", shaperec->StyleChange.StateLineStyle); _iprintf (" StateFillStyle1: %d\n", shaperec->StyleChange.StateFillStyle1); _iprintf (" StateFillStyle0: %d", shaperec->StyleChange.StateFillStyle0); _iprintf (" StateMoveTo: %d\n", shaperec->StyleChange.StateMoveTo); if (shaperec->StyleChange.StateLineStyle) { _iprintf (" LineStyle: %ld\n", shaperec->StyleChange.LineStyle); } if (shaperec->StyleChange.StateFillStyle1) { _iprintf (" FillStyle1: %ld\n", shaperec->StyleChange.FillStyle1); } if (shaperec->StyleChange.StateFillStyle0) { _iprintf (" FillStyle0: %ld\n", shaperec->StyleChange.FillStyle0); } if (shaperec->StyleChange.StateMoveTo) { _iprintf (" MoveBits: %d ", shaperec->StyleChange.MoveBits); _iprintf (" MoveDeltaX: %ld ", shaperec->StyleChange.MoveDeltaX); _iprintf (" MoveDeltaY: %ld\n", shaperec->StyleChange.MoveDeltaY); } } } void outputSWF_SHAPE (SWF_SHAPE * shape, char *name) { int i; _iprintf (" %s\n", name ); _iprintf (" NumFillBits: %d\n", shape->NumFillBits); _iprintf (" NumLineBits: %d\n", shape->NumLineBits); for (i = 0; i < shape->NumShapeRecords; i++) { outputSWF_SHAPERECORD (&(shape->ShapeRecords[i]), name); } } void outputSWF_SHAPEWITHSTYLE (SWF_SHAPEWITHSTYLE * shape, int level, char *name) { int i; outputSWF_FILLSTYLEARRAY (&(shape->FillStyles),""); outputSWF_LINESTYLEARRAY (&(shape->LineStyles),""); _iprintf (" NumFillBits: %d\n", shape->NumFillBits); _iprintf (" NumLineBits: %d\n", shape->NumLineBits); for (i = 0; i < shape->NumShapeRecords; i++) { outputSWF_SHAPERECORD (&(shape->ShapeRecords[i]),name); } } void outputSWF_GLYPHENTRY (SWF_GLYPHENTRY *gerec) { _iprintf(" GlyphIndex[0] = %4.4lx ", gerec->GlyphIndex[0] ); _iprintf(" GlyphAdvance[0] = %4.4lx\n", gerec->GlyphAdvance[0] ); } void outputSWF_TEXTRECORD (SWF_TEXTRECORD *trec, int level) { int i; _iprintf (" TEXTRECORD: "); _iprintf (" TextRecordType: %d ", trec->TextRecordType); _iprintf (" StyleFlagsReserved: %d ", trec->StyleFlagsReserved); _iprintf (" StyleFlagHasFont: %d ", trec->StyleFlagHasFont); _iprintf (" StyleFlagHasColor: %d ", trec->StyleFlagHasColor); _iprintf (" StyleFlagHasYOffset: %d ", trec->StyleFlagHasYOffset); _iprintf (" StyleFlagHasXOffset: %d\n", trec->StyleFlagHasXOffset); if ( trec->TextRecordType == 0 ) { /* * parser doesn't initialize any other * member when TextRecordType == 0, * see parseSWF_TEXTRECORD in parser.c */ return; } if( trec->StyleFlagHasFont ) _iprintf (" FontID: %d\n", trec->FontID); if( trec->StyleFlagHasColor ) { outputSWF_RGBA(&trec->TextColor, "" ); } if( trec->StyleFlagHasYOffset || trec->StyleFlagHasXOffset ) { _iprintf (" XOffset: %d ", trec->XOffset); _iprintf (" YOffset: %d\n", trec->YOffset); } if( trec->StyleFlagHasFont ) _iprintf (" TextHeight: %d\n", trec->TextHeight); _iprintf (" GlyphCount: %d\n", trec->GlyphCount); for(i=0;iGlyphCount;i++) outputSWF_GLYPHENTRY( &(trec->GlyphEntries[i]) ); } void outputSWF_BLURFILTER(SWF_BLURFILTER *filter) { outputFIXED(filter->BlurX, " BlurX: "); outputFIXED(filter->BlurY, " BlurY: "); _iprintf(" Passes %d\n", filter->Passes); } void outputSWF_BEVELFILTER(SWF_BEVELFILTER *filter) { outputSWF_RGBA (&filter->ShadowColor, " ShadowColor:"); outputSWF_RGBA (&filter->HighlightColor, " HighLightColor:"); outputFIXED(filter->BlurX, " BlurX: "); outputFIXED(filter->BlurY, " BlurY: "); outputFIXED(filter->Angle, " Angle: "); outputFIXED(filter->Distance, " Distance: "); outputFIXED8(filter->Strength, " Strength: "); _iprintf(" InnerShadow: %d\n", filter->InnerShadow); _iprintf(" Kockout %d\n", filter->Kockout); _iprintf(" CompositeSource %d\n", filter->CompositeSource); _iprintf(" OnTop: %d\n", filter->OnTop); _iprintf(" Passes %d\n", filter->Passes); } void outputSWF_GRADIENTFILTER(SWF_GRADIENTFILTER *filter) { int i; _iprintf(" NumColor %d\n", filter->NumColors); for(i = 0; i < filter->NumColors; i++) { outputSWF_RGBA (filter->GradientColors + i, " "); _iprintf(" Ratio: %d\n", filter->GradientRatio[i]); } outputFIXED(filter->BlurX, " BlurX: "); outputFIXED(filter->BlurY, " BlurY: "); outputFIXED(filter->Angle, " Angle: "); outputFIXED(filter->Distance, " Distance: "); outputFIXED8(filter->Strength, " Strength: "); _iprintf(" InnerShadow: %d\n", filter->InnerShadow); _iprintf(" Kockout %d\n", filter->Kockout); _iprintf(" CompositeSource %d\n", filter->CompositeSource); _iprintf(" OnTop: %d\n", filter->OnTop); _iprintf(" Passes %d\n", filter->Passes); } void outputSWF_DROPSHADOWFILTER(SWF_DROPSHADOWFILTER *filter) { outputSWF_RGBA (&filter->DropShadowColor, " DropShadowColor:"); outputFIXED(filter->BlurX, " BlurX: "); outputFIXED(filter->BlurY, " BlurY: "); outputFIXED(filter->Angle, " Angle: "); outputFIXED(filter->Distance, " Distance: "); outputFIXED8(filter->Strength, " Strength: "); _iprintf(" InnerShadow: %d\n", filter->InnerShadow); _iprintf(" Kockout %d\n", filter->Kockout); _iprintf(" CompositeSource %d\n", filter->CompositeSource); _iprintf(" Passes %d\n", filter->Passes); } void outputSWF_GLOWFILTER(SWF_GLOWFILTER *filter) { outputSWF_RGBA (&filter->GlowColor, ""); outputFIXED(filter->BlurX, " BlurX: "); outputFIXED(filter->BlurY, " BlurY: "); outputFIXED8(filter->Strength, " Strength: "); _iprintf(" InnerGlow: %d\n", filter->InnerGlow); _iprintf(" Kockout %d\n", filter->Kockout); _iprintf(" CompositeSource %d\n", filter->CompositeSource); _iprintf(" Passes %d\n", filter->Passes); } void outputSWF_CONVOLUTIONFILTER(SWF_CONVOLUTIONFILTER *filter) { int y, x; _iprintf(" Matrix %dx%d\n", filter->MatrixX, filter->MatrixY); _iprintf(" Bias %f, Divisor %f\n", filter->Bias, filter->Divisor); for(y = 0; y < filter->MatrixY; y++) { _iprintf(" "); for(x = 0; x < filter->MatrixX; x++) { FLOAT val = filter->Matrix[y * filter->MatrixX + x]; _iprintf("%f ", val); } _iprintf("\n"); } outputSWF_RGBA (&filter->DefaultColor, " efault Color: "); _iprintf(" Clamp: %d\n", filter->Clamp); _iprintf(" PreserveAlpha: %d\n", filter->PreserveAlpha); } void outputSWF_COLORMATRIXFILTER(SWF_COLORMATRIXFILTER *filter) { int y, x; for(y = 0; y < 4; y++) { _iprintf(" "); for(x = 0; x < 5; x++) { FLOAT val = filter->Matrix[y * 5 + x]; _iprintf("%f ", val); } _iprintf("\n"); } } void outputSWF_FILTER(SWF_FILTER *filter) { switch(filter->FilterId) { case FILTER_DROPSHADOW: _iprintf(" Filter: DropShadow\n"); outputSWF_DROPSHADOWFILTER(&filter->filter.dropShadow); break; case FILTER_BLUR: _iprintf(" Filter: Blur\n"); outputSWF_BLURFILTER(&filter->filter.blur); break; case FILTER_GLOW: _iprintf(" Filter: Glow\n"); outputSWF_GLOWFILTER(&filter->filter.glow); break; case FILTER_BEVEL: _iprintf(" Filter: Bevel\n"); outputSWF_BEVELFILTER(&filter->filter.bevel); break; case FILTER_GRADIENTGLOW: _iprintf(" Filter: GradientGlow\n"); outputSWF_GRADIENTFILTER(&filter->filter.gradientGlow); break; case FILTER_CONVOLUTION: _iprintf(" Filter: Convolution\n"); outputSWF_CONVOLUTIONFILTER(&filter->filter.convolution); break; case FILTER_COLORMATRIX: _iprintf(" Filter: ColorMatrix\n"); outputSWF_COLORMATRIXFILTER(&filter->filter.colorMatrix); break; case FILTER_GRADIENTBEVEL: _iprintf(" Filter: GradientBevel\n"); outputSWF_GRADIENTFILTER(&filter->filter.gradientBevel); break; default: _iprintf(" Filter: Unknown %d\n", filter->FilterId); } } /* Output Flash Blocks */ void outputSWF_CHARACTERSET (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_CHARACTERSET); } void outputSWF_DEFINEBITS (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEBITS); _iprintf(" CharacterID: %d\n", sblock->CharacterID); } void outputSWF_DEFINEBITSJPEG2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEBITSJPEG2); _iprintf(" CharacterID: %d\n", sblock->CharacterID); } void outputSWF_DEFINEBITSJPEG3 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEBITSJPEG3); _iprintf(" CharacterID: %d\n", sblock->CharacterID); _iprintf(" AlphaDataOffset %d\n", sblock->AlphaDataOffset); } void outputSWF_DEFINEBITSPTR (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_DEFINEBITSPTR); } void outputSWF_DEFINEBUTTON (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_DEFINEBUTTON); } void outputSWF_DEFINEBUTTON2 (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEBUTTON2); #if !defined(ACTIONONLY) _iprintf (" CharacterID: %d\n", sblock->Buttonid); _iprintf (" TrackAsMenu: %d\n", sblock->TrackAsMenu); _iprintf (" ActionOffset: %d\n", sblock->ActionOffset); for(i=0;inumCharacters;i++) { outputSWF_BUTTONRECORD( &(sblock->Characters[i]) ); } #endif for(i=0;inumActions;i++) { outputSWF_BUTTONCONDACTION( &(sblock->Actions[i]) ); } } void outputSWF_DEFINEBUTTONCXFORM (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEBUTTONCXFORM); _iprintf(" ButtonId %d\n", sblock->ButtonId); outputSWF_CXFORM(&sblock->ButtonColorTransform); } void outputSWF_SOUNDINFO (SWF_SOUNDINFO *info); void outputSWF_DEFINEBUTTONSOUND (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEBUTTONSOUND); _iprintf(" CharacterID: %d\n", sblock->CharacterID); _iprintf(" ButtonSoundChar0 %d\n", sblock->ButtonSoundChar0); if(sblock->ButtonSoundChar0) outputSWF_SOUNDINFO (&sblock->ButtonSoundInfo0); _iprintf(" ButtonSoundChar1 %d\n", sblock->ButtonSoundChar1); if(sblock->ButtonSoundChar1) outputSWF_SOUNDINFO (&sblock->ButtonSoundInfo1); _iprintf(" ButtonSoundChar2 %d\n", sblock->ButtonSoundChar2); if(sblock->ButtonSoundChar2) outputSWF_SOUNDINFO (&sblock->ButtonSoundInfo2); _iprintf(" ButtonSoundChar3 %d\n", sblock->ButtonSoundChar3); if(sblock->ButtonSoundChar3) outputSWF_SOUNDINFO (&sblock->ButtonSoundInfo3); } void outputSWF_DEFINECOMMANDOBJ (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_DEFINECOMMANDOBJ); } void outputSWF_DEFINEEDITTEXT (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEEDITTEXT); _iprintf (" CharacterID: %d\n", sblock->CharacterID); outputSWF_RECT (&(sblock->Bounds)); _iprintf (" Flags: "); _iprintf (" HasText: %d ", sblock->HasText); _iprintf (" WordWrap: %d ", sblock->WordWrap); _iprintf (" Multiline: %d ", sblock->Multiline); _iprintf (" Password: %d ", sblock->Password); _iprintf (" ReadOnly: %d\n", sblock->ReadOnly); _iprintf (" "); _iprintf (" HasTextColor: %d ", sblock->HasTextColor); _iprintf (" HasMaxLength: %d ", sblock->HasMaxLength); _iprintf (" HasFont: %d ", sblock->HasFont); _iprintf (" HasFontClass: %d ", sblock->HasFontClass); _iprintf (" AutoSize: %d ", sblock->AutoSize); _iprintf (" HasLayout: %d\n", sblock->HasLayout); _iprintf (" "); _iprintf (" NoSelect: %d ", sblock->NoSelect); _iprintf (" Border: %d ", sblock->Border); _iprintf (" WasStatic: %d ", sblock->WasStatic); _iprintf (" HTML: %d ", sblock->HTML); _iprintf (" UseOutlines: %d\n", sblock->UseOutlines); if (sblock->HasFont) { _iprintf (" Font: "); _iprintf (" FontID: %d ", sblock->FontID); _iprintf (" FontHeight: %d\n", sblock->FontHeight); } if (sblock->HasFontClass) _iprintf(" FontClass: %s\n", sblock->FontClass); if (sblock->HasTextColor) { outputSWF_RGBA (&sblock->TextColor,""); } if (sblock->HasLayout) { _iprintf (" Layout:: "); _iprintf (" Align: %d ", sblock->Align); _iprintf (" LeftMargin: %d ", sblock->LeftMargin); _iprintf (" RightMargin: %d ", sblock->RightMargin); _iprintf (" Indent: %d ", sblock->Indent); _iprintf (" Leading: %d\n", sblock->Leading); } _iprintf (" VariableName: %s\n", sblock->VariableName); if (sblock->HasText) { _iprintf (" InitialText: %s\n", sblock->InitialText); } } void outputSWF_DEFINEFONT (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEFONT); _iprintf (" FontID: %d\n", sblock->FontID); for (i = 0; i < sblock->NumGlyphs; i++) _iprintf (" OffsetTable[%3.3d]: %x\n", i, sblock->OffsetTable[i]); for (i = 0; i < sblock->NumGlyphs; i++) { char shapename[32]; sprintf(shapename,"Shape[%3.3d]",i); outputSWF_SHAPE (&(sblock->GlyphShapeTable[i]), shapename); } } void outputSWF_DEFINEFONT2 (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEFONT2); _iprintf (" FontID: %d\n", sblock->FontID); _iprintf (" FontFlagsHasLayout: %d\n", sblock->FontFlagsHasLayout); _iprintf (" FontFlagsShiftJis: %d\n", sblock->FontFlagsShiftJis); _iprintf (" FontFlagsSmallText: %d\n", sblock->FontFlagsSmallText); _iprintf (" FontFlagsFlagANSI: %d\n", sblock->FontFlagsFlagANSI); _iprintf (" FontFlagsWideOffsets: %d\n", sblock->FontFlagsWideOffsets); _iprintf (" FontFlagsWideCodes: %d\n", sblock->FontFlagsWideCodes); _iprintf (" FontFlagsFlagsItalics: %d\n", sblock->FontFlagsFlagsItalics); _iprintf (" FontFlagsFlagsBold: %d\n", sblock->FontFlagsFlagsBold); _iprintf (" LanguageCode: %d\n", sblock->LanguageCode); _iprintf (" FontNameLen: %d\n", sblock->FontNameLen); _iprintf (" FontName: %s\n", sblock->FontName); _iprintf (" NumGlyphs: %d\n", sblock->NumGlyphs); for (i = 0; i < sblock->NumGlyphs; i++) { if (sblock->FontFlagsWideOffsets) { _iprintf (" OffsetTable[%3.3d]: %lx\n", i, sblock->OffsetTable.UI32[i]); } else { _iprintf (" OffsetTable[%3.3d]: %x\n", i, sblock->OffsetTable.UI16[i]); } } if (sblock->FontFlagsWideOffsets) { _iprintf (" CodeTableOffset: %lx\n", sblock->CodeTableOffset.UI32); } else { _iprintf (" CodeTableOffset: %x\n", sblock->CodeTableOffset.UI16); } for (i = 0; i < sblock->NumGlyphs; i++) { char shapename[32]; sprintf(shapename,"Shape[%3.3d]",i); outputSWF_SHAPE (&(sblock->GlyphShapeTable[i]), shapename); } for (i = 0; i < sblock->NumGlyphs; i++) { if( sblock->FontFlagsWideCodes ) { _iprintf (" CodeTable[%3.3d]: %4.4x\n", i, sblock->CodeTable[i]); } else { _iprintf (" CodeTable[%3.3d]: %2.2x\n", i, sblock->CodeTable[i]); } } if( sblock->FontFlagsHasLayout ) { _iprintf (" FontAscent: %d\n", sblock->FontAscent); _iprintf (" FontDecent: %d\n", sblock->FontDecent); _iprintf (" FontLeading: %d\n", sblock->FontLeading); for (i = 0; i < sblock->NumGlyphs; i++) { _iprintf (" FontAdvanceTable[%3.3d]: %x\n", i, sblock->FontAdvanceTable[i]); } _iprintf (" FontBoundsTable: (not used)\n"); for (i = 0; i < sblock->NumGlyphs; i++) { outputSWF_RECT (&(sblock->FontBoundsTable[i])); } _iprintf (" KerningCount: %d\n", sblock->KerningCount); for (i = 0; i < sblock->KerningCount; i++) { _iprintf (" FontKerningTable[%3.3d]: %d,%d %d\n", i, sblock->FontKerningTable[i].FontKerningCode1, sblock->FontKerningTable[i].FontKerningCode2, sblock->FontKerningTable[i].FontKerningAdjustment); } } } void outputSWF_DEFINEFONT3 (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEFONT3); _iprintf (" FontID: %d\n", sblock->FontID); _iprintf (" FontFlagsHasLayout: %d\n", sblock->FontFlagsHasLayout); _iprintf (" FontFlagsShiftJis: %d\n", sblock->FontFlagsShiftJis); _iprintf (" FontFlagsSmallText: %d\n", sblock->FontFlagsSmallText); _iprintf (" FontFlagsFlagANSI: %d\n", sblock->FontFlagsFlagANSI); _iprintf (" FontFlagsWideOffsets: %d\n", sblock->FontFlagsWideOffsets); _iprintf (" FontFlagsWideCodes: %d\n", sblock->FontFlagsWideCodes); _iprintf (" FontFlagsFlagsItalics: %d\n", sblock->FontFlagsFlagsItalics); _iprintf (" FontFlagsFlagsBold: %d\n", sblock->FontFlagsFlagsBold); _iprintf (" LanguageCode: %d\n", sblock->LanguageCode); _iprintf (" FontNameLen: %d\n", sblock->FontNameLen); _iprintf (" FontName: %s\n", sblock->FontName); _iprintf (" NumGlyphs: %d\n", sblock->NumGlyphs); for (i = 0; i < sblock->NumGlyphs; i++) { if (sblock->FontFlagsWideOffsets) { _iprintf (" OffsetTable[%3.3d]: %lx\n", i, sblock->OffsetTable.UI32[i]); } else { _iprintf (" OffsetTable[%3.3d]: %x\n", i, sblock->OffsetTable.UI16[i]); } } if (sblock->FontFlagsWideOffsets) { _iprintf (" CodeTableOffset: %lx\n", sblock->CodeTableOffset.UI32); } else { _iprintf (" CodeTableOffset: %x\n", sblock->CodeTableOffset.UI16); } for (i = 0; i < sblock->NumGlyphs; i++) { char shapename[32]; sprintf(shapename,"Shape[%3.3d]",i); outputSWF_SHAPE (&(sblock->GlyphShapeTable[i]), shapename); } for (i = 0; i < sblock->NumGlyphs; i++) { if( sblock->FontFlagsWideCodes ) { _iprintf (" CodeTable[%3.3d]: %4.4x\n", i, sblock->CodeTable[i]); } else { _iprintf (" CodeTable[%3.3d]: %2.2x\n", i, sblock->CodeTable[i]); } } if( sblock->FontFlagsHasLayout ) { _iprintf (" FontAscent: %d\n", sblock->FontAscent); _iprintf (" FontDecent: %d\n", sblock->FontDecent); _iprintf (" FontLeading: %d\n", sblock->FontLeading); for (i = 0; i < sblock->NumGlyphs; i++) { _iprintf (" FontAdvanceTable[%3.3d]: %x\n", i, sblock->FontAdvanceTable[i]); } _iprintf (" FontBoundsTable: (not used)\n"); for (i = 0; i < sblock->NumGlyphs; i++) { outputSWF_RECT (&(sblock->FontBoundsTable[i])); } _iprintf (" KerningCount: %d\n", sblock->KerningCount); for (i = 0; i < sblock->KerningCount; i++) { _iprintf (" FontKerningTable[%3.3d]: %d,%d %d\n", i, sblock->FontKerningTable[i].FontKerningCode1, sblock->FontKerningTable[i].FontKerningCode2, sblock->FontKerningTable[i].FontKerningAdjustment); } } } void outputSWF_DEFINEFONTINFO (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEFONTINFO); _iprintf("FontID: %d\n", sblock->FontID); _iprintf("FontNameLen %d\n", sblock->FontNameLen); _iprintf("FontName %s\n", sblock->FontName); _iprintf("FontFlagsSmallText %d\n", sblock->FontFlagsSmallText); _iprintf("FontFlagsShiftJIS %d\n", sblock->FontFlagsShiftJIS); _iprintf("FontFlagsANSI %d\n", sblock->FontFlagsANSI); _iprintf("FontFlagsItalic %d\n", sblock->FontFlagsItalic); _iprintf("FontFlagsBold %d\n", sblock->FontFlagsBold); _iprintf("FontFlagsWideCodes %d\n", sblock->FontFlagsWideCodes); if(!verbose) return; for (i = 0; i < sblock->nGlyph; i++) _iprintf("code table mapping: %i -> %i\n", i, sblock->CodeTable[i]); } void outputSWF_DEFINEFONTINFO2 (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEFONTINFO2); _iprintf("FontID: %d\n", sblock->FontID); _iprintf("FontNameLen %d\n", sblock->FontNameLen); _iprintf("FontName %s\n", sblock->FontName); _iprintf("FontFlagsSmallText %d\n", sblock->FontFlagsSmallText); _iprintf("FontFlagsShiftJIS %d\n", sblock->FontFlagsShiftJIS); _iprintf("FontFlagsANSI %d\n", sblock->FontFlagsANSI); _iprintf("FontFlagsItalic %d\n", sblock->FontFlagsItalic); _iprintf("FontFlagsBold %d\n", sblock->FontFlagsBold); _iprintf("FontFlagsWideCodes %d\n", sblock->FontFlagsWideCodes); _iprintf("LanguageCode %d\n", sblock->LanguageCode); if(!verbose) return; for (i = 0; i < sblock->nGlyph; i++) _iprintf("code table mapping: %i -> %i\n", i, sblock->CodeTable[i]); } void outputSWF_CSMTEXTSETTINGS (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_CSMTEXTSETTINGS); _iprintf("TextID: %d\n", sblock->TextID); _iprintf("UseFlashType %d\n", sblock->UseFlashType); _iprintf("GridFit %d\n", sblock->GridFit); _iprintf("Thickness %d\n", sblock->Thickness); _iprintf("Sharpness %d\n", sblock->Sharpness); } void outputSWF_ZONEDATA(int j, struct SWF_ZONEDATA *data) { _iprintf(" ZoneData: %i\n", j); _iprintf(" AlignmentCoordinate %d\n", data->AlignmentCoordinate); _iprintf(" Range %d\n", data->Range); } void outputSWF_ZONERECORD(int i, struct SWF_ZONERECORD *zone) { int j; _iprintf("ZoneRecord %d\n", i); _iprintf(" NumZoneData %d\n", zone->NumZoneData); for(j = 0; j < zone->NumZoneData; j++) outputSWF_ZONEDATA(j, zone->ZoneData + j); _iprintf(" ZoneMask X %d, Y %d\n", zone->ZoneMaskX, zone->ZoneMaskY); } void outputSWF_DEFINEFONTALIGNZONES (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINEFONTALIGNZONES); _iprintf(" FontID: %d\n", sblock->FontID); _iprintf(" CSMTableHint %d\n", sblock->CSMTableHint); _iprintf(" GlyphCount %d\n", sblock->GlyphCount); for(i = 0; i < sblock->GlyphCount; i++) outputSWF_ZONERECORD(i, sblock->ZoneTable + i); } void outputSWF_DEFINEFONTNAME (SWF_Parserstruct *pblock) { OUT_BEGIN(SWF_DEFINEFONTNAME); _iprintf(" FontId: %d\n", sblock->FontId); _iprintf(" FontName: %s\n", sblock->FontName); _iprintf(" FontCopyright %s\n", sblock->FontCopyright); } void outputSWF_DEFINELOSSLESS (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINELOSSLESS); _iprintf(" CharacterID: %d\n", sblock->CharacterID); _iprintf(" Bitmap format %d\n", sblock->BitmapFormat); _iprintf(" Bitmap width %d x height %d\n", sblock->BitmapWidth, sblock->BitmapHeight); if(sblock->BitmapFormat == 3) _iprintf(" BitmapColorTableSize %d\n", sblock->BitmapColorTableSize); } void outputSWF_DEFINELOSSLESS2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINELOSSLESS2); _iprintf(" CharacterID: %d\n", sblock->CharacterID); _iprintf(" Bitmap format %d\n", sblock->BitmapFormat); _iprintf(" Bitmap width %d x height %d\n", sblock->BitmapWidth, sblock->BitmapHeight); if(sblock->BitmapFormat == 3) _iprintf(" BitmapColorTableSize %d\n", sblock->BitmapColorTableSize); } void outputSWF_DEFINEMORPHSHAPE (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEMORPHSHAPE); _iprintf(" CharacterID: %d\n", sblock->CharacterID); outputSWF_RECT(&(sblock->StartBounds)); outputSWF_RECT(&(sblock->EndBounds)); _iprintf(" Offset %d\n", sblock->Offset); outputSWF_MORPHFILLSTYLES(&(sblock->MorphFillStyles)); outputSWF_MORPHLINESTYLES(&(sblock->MorphLineStyles)); outputSWF_SHAPE(&(sblock->StartEdges), ""); outputSWF_SHAPE(&(sblock->EndEdges), ""); } void outputSWF_DEFINEMORPHSHAPE2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEMORPHSHAPE2); _iprintf(" CharacterID: %d\n", sblock->CharacterID); outputSWF_RECT(&(sblock->StartBounds)); outputSWF_RECT(&(sblock->EndBounds)); outputSWF_RECT(&(sblock->StartEdgeBounds)); outputSWF_RECT(&(sblock->EndEdgeBounds)); _iprintf(" UsesNonScalingStrokes %d\n", sblock->UsesNonScalingStrokes); _iprintf(" UsesScalinStrokes %d\n", sblock->UsesScalingStrokes); _iprintf(" Offset %d\n", sblock->Offset); outputSWF_MORPHFILLSTYLES(&(sblock->MorphFillStyles)); outputSWF_MORPHLINESTYLES(&(sblock->MorphLineStyles)); outputSWF_SHAPE(&(sblock->StartEdges), ""); outputSWF_SHAPE(&(sblock->EndEdges), ""); } void outputSWF_DEFINESHAPE (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINESHAPE); _iprintf (" CharacterID: %d\n", sblock->ShapeID); outputSWF_RECT (&(sblock->ShapeBounds)); outputSWF_SHAPEWITHSTYLE (&(sblock->Shapes),1,""); } void outputSWF_DEFINESHAPE2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINESHAPE2); _iprintf (" CharacterID: %d\n", sblock->ShapeID); outputSWF_RECT (&(sblock->ShapeBounds)); outputSWF_SHAPEWITHSTYLE (&(sblock->Shapes),2,""); } void outputSWF_DEFINESHAPE3 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINESHAPE3); _iprintf (" CharacterID: %d\n", sblock->ShapeID); outputSWF_RECT (&(sblock->ShapeBounds)); outputSWF_SHAPEWITHSTYLE (&(sblock->Shapes),2,""); } void outputSWF_DEFINESHAPE4 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINESHAPE4); _iprintf (" CharacterID: %d\n", sblock->ShapeID); outputSWF_RECT (&(sblock->ShapeBounds)); outputSWF_RECT (&(sblock->EdgeBounds)); _iprintf(" UsesNonScalingStrokes: %d\n", sblock->UsesNonScalingStrokes); _iprintf(" UsesScalingStrokes: %d\n", sblock->UsesScalingStrokes); outputSWF_SHAPEWITHSTYLE (&(sblock->Shapes),2,""); } void outputSWF_DEFINESOUND (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINESOUND); _iprintf(" CharacterID: %d\n", sblock->SoundId); _iprintf(" SoundFormat: "); switch(sblock->SoundFormat) { case 0: _iprintf("uncompressed\n"); break; case 1: _iprintf("ADPCM\n"); break; case 2: _iprintf("MP3\n"); break; case 3: _iprintf("uncompressed (LE)\n"); break; case 6: _iprintf("Nellymoser\n"); break; default: _iprintf("unknow ID %d\n", sblock->SoundFormat); } _iprintf(" SoundRate: "); switch(sblock->SoundRate) { case 0: _iprintf("5.5 KHz\n"); break; case 1: _iprintf("11 KHz\n"); break; case 2: _iprintf("22 KHz\n"); break; case 3: _iprintf("44 KHz\n"); break; } _iprintf(" SoundSize: %s\n", sblock->SoundSize?"16-bit":"8-bit"); _iprintf(" SoundType: %s\n", sblock->SoundType?"Stereo":"Mono"); _iprintf(" SoundSampleCount: %d\n", sblock->SoundSampleCount); if(sblock->SoundFormat == 2) { _iprintf(" Mp3: SeekSamples %i\n", sblock->SoundData.mp3.SeekSamples); } } void outputSWF_DEFINESPRITE (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINESPRITE); _iprintf(" CharacterID: %d\n", sblock->SpriteId ); _iprintf(" FrameCount: %d\n", sblock->FrameCount ); _iprintf(" BlockCount: %d\n", sblock->BlockCount ); ++INDENT; for(i=0;iBlockCount;i++) { outputBlock(sblock->tagTypes[i], sblock->Tags[i], NULL); } --INDENT; } void outputSWF_DEFINETEXT (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINETEXT); _iprintf(" CharacterID: %d\n", sblock->CharacterID ); outputSWF_RECT( &sblock->TextBounds ); outputSWF_MATRIX( &sblock->TextMatrix, "" ); _iprintf(" GlyphBits: %d\n", sblock->GlyphBits ); _iprintf(" AdvanceBits: %d\n", sblock->AdvanceBits ); _iprintf(" TextRecords: %d\n", sblock->numTextRecords ); for(i=0;inumTextRecords;i++) { outputSWF_TEXTRECORD(&(sblock->TextRecords[i]), 1 ); } } void outputSWF_DEFINETEXT2 (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINETEXT2); _iprintf(" CharacterID: %d\n", sblock->CharacterID ); outputSWF_RECT( &sblock->TextBounds ); outputSWF_MATRIX( &sblock->TextMatrix, "" ); _iprintf(" GlyphBits: %d\n", sblock->GlyphBits ); _iprintf(" AdvanceBits: %d\n", sblock->AdvanceBits ); _iprintf(" TextRecords: %d\n", sblock->numTextRecords ); for(i=0;inumTextRecords;i++) { outputSWF_TEXTRECORD(&(sblock->TextRecords[i]), 2 ); } } void outputSWF_DEFINETEXTFORMAT (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_DEFINETEXTFORMAT); } void outputSWF_DEFINEVIDEO (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_DEFINEVIDEO); } void outputSWF_DEFINEVIDEOSTREAM (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINEVIDEOSTREAM); _iprintf(" CharacterID: %d\n", sblock->CharacterID); _iprintf(" NumFrames: %d\n", sblock->NumFrames); _iprintf(" Width: %d; Height %d\n", sblock->Width, sblock->Height); _iprintf(" Flag deblocking: %x\n", sblock->VideoFlagsDeblocking); _iprintf(" Flag smoothing: %x\n", sblock->VideoFlagsSmoothing); _iprintf(" Codec ID: %d\n", sblock->CodecID); } void outputSWF_DOACTION (SWF_Parserstruct * pblock) { #ifdef NODECOMPILE int i; #endif OUT_BEGIN (SWF_DOACTION); #ifdef NODECOMPILE _iprintf(" %d Actions\n", sblock->numActions); for(i=0;inumActions;i++) outputSWF_ACTION(i,&(sblock->Actions[i])); #else _iprintf ("%s\n", decompile5Action(sblock->numActions, sblock->Actions, 0)); #endif } void outputSWF_ENABLEDEBUGGER (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_ENABLEDEBUGGER); _iprintf(" Password: %s\n", sblock->Password); } void outputSWF_ENABLEDEBUGGER2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_ENABLEDEBUGGER2); _iprintf(" Password: %s\n", sblock->Password); } void outputSWF_END (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_END); } void outputSWF_EXPORTASSETS (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_EXPORTASSETS); _iprintf (" num assets: %d\n", sblock->Count ); for (i = 0; i < sblock->Count; i++) { _iprintf (" Asset[%3.3d]: %s\n", sblock->Tags[i], sblock->Names[i]); } } void outputSWF_FONTREF (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_FONTREF); } void outputSWF_FRAMELABEL (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_FRAMELABEL); _iprintf (" Name: %s\n", sblock->Name ); _iprintf (" IsAnchor: %d\n", sblock->IsAnchor ); } void outputSWF_FRAMETAG (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_FRAMETAG); } void outputSWF_FREEALL (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_FREEALL); } void outputSWF_FREECHARACTER (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_FREECHARACTER); } void outputSWF_GENCOMMAND (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_GENCOMMAND); } void outputSWF_IMPORTASSETS (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_IMPORTASSETS); _iprintf (" URL: %s\n", sblock->URL ); _iprintf (" num assets: %d\n", sblock->Count ); for (i = 0; i < sblock->Count; i++) { _iprintf (" Asset[%3.3d]: %s\n", sblock->Tags[i], sblock->Names[i]); } } void outputSWF_IMPORTASSETS2 (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_IMPORTASSETS2); _iprintf (" URL: %s\n", sblock->URL ); _iprintf (" num assets: %d\n", sblock->Count ); for (i = 0; i < sblock->Count; i++) { _iprintf (" Asset[%3.3d]: %s\n", sblock->Tags[i], sblock->Names[i]); } } void outputSWF_JPEGTABLES (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_JPEGTABLES); } void outputSWF_NAMECHARACTER (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_NAMECHARACTER); _iprintf(" Id: %d\n", sblock->Id); _iprintf(" Name: %s\n", sblock->Name); } void outputSWF_PATHSAREPOSTSCRIPT (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_PATHSAREPOSTSCRIPT); } void outputSWF_PLACEOBJECT (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_PLACEOBJECT); } void outputSWF_PLACEOBJECT2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_PLACEOBJECT2); #if !defined(ACTIONONLY) _iprintf(" PlaceFlagHasClipActions %d\n", sblock->PlaceFlagHasClipActions); _iprintf(" PlaceFlagHasClipDepth %d\n", sblock->PlaceFlagHasClipDepth); _iprintf(" PlaceFlagHasName %d\n", sblock->PlaceFlagHasName); _iprintf(" PlaceFlagHasRatio %d\n", sblock->PlaceFlagHasRatio); _iprintf(" PlaceFlagHasColorTransform %d\n", sblock->PlaceFlagHasColorTransform); _iprintf(" PlaceFlagHasMatrix %d\n", sblock->PlaceFlagHasMatrix); _iprintf(" PlaceFlagHasCharacter %d\n", sblock->PlaceFlagHasCharacter); _iprintf(" PlaceFlagMove %d\n", sblock->PlaceFlagMove); _iprintf(" Depth %d\n", sblock->Depth); if( sblock->PlaceFlagHasCharacter ) _iprintf( " CharacterID: %d\n", sblock->CharacterId ); if( sblock->PlaceFlagHasMatrix ) outputSWF_MATRIX (&(sblock->Matrix), ""); if( sblock->PlaceFlagHasColorTransform ) outputSWF_CXFORMWITHALPHA (&(sblock->ColorTransform), ""); if( sblock->PlaceFlagHasRatio ) _iprintf( " Ratio: %d\n", sblock->Ratio ); if( sblock->PlaceFlagHasName ) _iprintf( " Name: %s\n", sblock->Name ); if( sblock->PlaceFlagHasClipDepth ) _iprintf( " ClipDepth: %d\n", sblock->ClipDepth ); #endif if( sblock->PlaceFlagHasClipActions ) outputSWF_CLIPACTIONS (&(sblock->ClipActions)); } void outputSWF_PLACEOBJECT3 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_PLACEOBJECT3); #if !defined(ACTIONONLY) _iprintf(" PlaceFlagHasClipActions %d\n", sblock->PlaceFlagHasClipActions); _iprintf(" PlaceFlagHasClipDepth %d\n", sblock->PlaceFlagHasClipDepth); _iprintf(" PlaceFlagHasName %d\n", sblock->PlaceFlagHasName); _iprintf(" PlaceFlagHasRatio %d\n", sblock->PlaceFlagHasRatio); _iprintf(" PlaceFlagHasColorTransform %d\n", sblock->PlaceFlagHasColorTransform); _iprintf(" PlaceFlagHasMatrix %d\n", sblock->PlaceFlagHasMatrix); _iprintf(" PlaceFlagHasCharacter %d\n", sblock->PlaceFlagHasCharacter); _iprintf(" PlaceFlagMove %d\n", sblock->PlaceFlagMove); _iprintf(" PlaceFlagHasImage %d\n", sblock->PlaceFlagHasImage); _iprintf(" PlaceFlagHasClassName %d\n", sblock->PlaceFlagHasClassName); _iprintf(" PlaceFlagHasCacheAsbitmap %d\n", sblock->PlaceFlagHasCacheAsBitmap); _iprintf(" PlaceFlagHasBlendMode %d\n", sblock->PlaceFlagHasBlendMode); _iprintf(" PlaceFlagHasFilterList %d\n", sblock->PlaceFlagHasFilterList); _iprintf(" Depth %d\n", sblock->Depth); if( sblock->PlaceFlagHasClassName || (sblock->PlaceFlagHasImage && sblock->PlaceFlagHasCharacter)) _iprintf(" ClassName %s\n", sblock->ClassName); if( sblock->PlaceFlagHasCharacter ) _iprintf( " CharacterID: %d\n", sblock->CharacterId ); if( sblock->PlaceFlagHasMatrix ) outputSWF_MATRIX (&(sblock->Matrix), ""); if( sblock->PlaceFlagHasColorTransform ) outputSWF_CXFORMWITHALPHA (&(sblock->ColorTransform), ""); if( sblock->PlaceFlagHasRatio ) _iprintf( " Ratio: %d\n", sblock->Ratio ); if( sblock->PlaceFlagHasName ) _iprintf( " Name: %s\n", sblock->Name ); if( sblock->PlaceFlagHasClipDepth ) _iprintf( " ClipDepth: %d\n", sblock->ClipDepth ); if( sblock->PlaceFlagHasBlendMode ) _iprintf(" BlendMode %d\n", sblock->BlendMode ); if( sblock->PlaceFlagHasFilterList ) { int i; SWF_FILTERLIST *filterList = &sblock->SurfaceFilterList; _iprintf(" NumberOfFilters %d\n", filterList->NumberOfFilters); for(i = 0; i < filterList->NumberOfFilters; i++) outputSWF_FILTER(filterList->Filter + i); } #endif if( sblock->PlaceFlagHasClipActions ) outputSWF_CLIPACTIONS (&(sblock->ClipActions)); } void outputSWF_PREBUILT (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_PREBUILT); } void outputSWF_PREBUILTCLIP (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_PREBUILTCLIP); } void outputSWF_PROTECT (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_PROTECT); if( sblock->Password ) _iprintf(" Password: %s\n", sblock->Password); } void outputSWF_REMOVEOBJECT (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_REMOVEOBJECT); _iprintf(" CharacterID: %d\n", sblock->CharacterId); _iprintf(" Depth: %d\n", sblock->Depth); } void outputSWF_REMOVEOBJECT2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_REMOVEOBJECT2); _iprintf(" Depth: %d\n", sblock->Depth); } void outputSWF_SERIALNUMBER (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SERIALNUMBER); _iprintf("Version %d.%d.%d.%d\n", sblock->Id, sblock->Edition, sblock->Major, sblock->Minor); _iprintf("Build: %lu\n", (((long long)sblock->BuildH) << 32) + sblock->BuildL); _iprintf("Timestamp: %lu\n", (((long long)sblock->TimestampH) << 32) + sblock->TimestampL); } void outputSWF_SETBACKGROUNDCOLOR (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SETBACKGROUNDCOLOR); outputSWF_RGBA (&sblock->rgb, ""); } void outputSWF_SHOWFRAME (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_SHOWFRAME); } void outputSWF_SOUNDSTREAMBLOCK (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SOUNDSTREAMBLOCK); if(m.soundStreamFmt == 2) { _iprintf(" SampleCount %u\n", sblock->StreamData.mp3.SampleCount); _iprintf(" Mp3: SeekSamples %i\n", sblock->StreamData.mp3.SeekSamples); } } void outputSWF_SOUNDSTREAMHEAD (SWF_Parserstruct * pblock) { char *tmp; OUT_BEGIN (SWF_SOUNDSTREAMHEAD); switch(sblock->PlaybackSoundRate) { case 0: tmp = "5.5 kHz"; break; case 1: tmp = "11 kHz"; break; case 2: tmp = "22 kHz"; break; case 3: tmp = "44 kHz"; break; default: tmp = "error"; } _iprintf(" PlaybackSoundRate %s\n", tmp); switch(sblock->PlaybackSoundSize) { case 1: tmp = "16 bit"; break; default: tmp = "error"; } _iprintf(" PlaybackSoundSize %s\n", tmp); switch(sblock->PlaybackSoundType) { case 0: tmp = "mono"; break; case 1: tmp = "stereo"; break; default: tmp = "error"; } _iprintf(" PlaybackSoundType %s\n", tmp); switch(sblock->StreamSoundCompression) { case 1: tmp = "ADPCM"; break; case 2: tmp = "MP3"; break; default: tmp ="error"; } _iprintf(" StreamSoundCompression %s\n", tmp); switch(sblock->StreamSoundRate) { case 0: tmp = "5.5 kHz"; break; case 1: tmp = "11 kHz"; break; case 2: tmp = "22 kHz"; break; case 3: tmp = "44 kHz"; break; default: tmp = "error"; } _iprintf(" StreamSoundRate %s\n", tmp); switch(sblock->StreamSoundSize) { case 1: tmp = "16 bit"; break; default: tmp = "error"; } _iprintf(" StreamSoundSize %s\n", tmp); switch(sblock->StreamSoundType) { case 0: tmp = "mono"; break; case 1: tmp = "stereo"; break; default: tmp = "error"; } _iprintf(" StreamSoundType %s\n", tmp); _iprintf(" StreamSoundSampleCount %u\n", sblock->StreamSoundSampleCount); if(sblock->StreamSoundCompression == 2) _iprintf(" LatencySeek %i\n", sblock->LatencySeek); } void outputSWF_SOUNDSTREAMHEAD2 (SWF_Parserstruct * pblock) { char *tmp; OUT_BEGIN (SWF_SOUNDSTREAMHEAD2); switch(sblock->PlaybackSoundRate) { case 0: tmp = "5.5 kHz"; break; case 1: tmp = "11 kHz"; break; case 2: tmp = "22 kHz"; break; case 3: tmp = "44 kHz"; break; default: tmp = "error"; } _iprintf(" PlaybackSoundRate %s\n", tmp); switch(sblock->PlaybackSoundSize) { case 0: tmp = "8 bit"; break; case 1: tmp = "16 bit"; break; default: tmp = "error"; } _iprintf(" PlaybackSoundSize %s\n", tmp); switch(sblock->PlaybackSoundType) { case 0: tmp = "mono"; break; case 1: tmp = "stereo"; break; default: tmp = "error"; } _iprintf(" PlaybackSoundType %s\n", tmp); switch(sblock->StreamSoundCompression) { case 0: tmp = "uncompressed"; break; case 1: tmp = "ADPCM"; break; case 2: tmp = "MP3"; break; case 3: tmp = "uncompressed"; break; case 6: tmp = "Nellymoser"; break; default: tmp ="error"; } _iprintf(" StreamSoundCompression %s\n", tmp); switch(sblock->StreamSoundRate) { case 0: tmp = "5.5 kHz"; break; case 1: tmp = "11 kHz"; break; case 2: tmp = "22 kHz"; break; case 3: tmp = "44 kHz"; break; default: tmp = "error"; } _iprintf(" StreamSoundRate %s\n", tmp); switch(sblock->StreamSoundSize) { case 0: tmp = "8 bit"; break; case 1: tmp = "16 bit"; break; default: tmp = "error"; } _iprintf(" StreamSoundSize %s\n", tmp); switch(sblock->StreamSoundType) { case 0: tmp = "mono"; break; case 1: tmp = "stereo"; break; default: tmp = "error"; } _iprintf(" StreamSoundType %s\n", tmp); _iprintf(" StreamSoundSampleCount %u\n", sblock->StreamSoundSampleCount); if(sblock->StreamSoundCompression == 2) _iprintf(" LatencySeek %i\n", sblock->LatencySeek); } void outputSWF_SOUNDENVELOPE (SWF_SOUNDENVELOPE *env) { _iprintf(" SoundEnvelope:"); _iprintf(" Pos44 %d, LeftLevel %d, RightLevel %d\n", env->Pos44, env->LeftLevel, env->RightLevel); } void outputSWF_SOUNDINFO (SWF_SOUNDINFO *info) { _iprintf(" SoundInfo:\n"); _iprintf(" SyncStop: %s\n", info->SyncStop?"Yes":"No"); _iprintf(" SyncNoMultiple: %s\n", info->SyncNoMultiple?"Yes":"No"); _iprintf(" HasEnvelope: %s\n", info->HasEnvelope?"Yes":"No"); _iprintf(" Loops: %d\n", info->HasLoops?info->LoopCount:0); if(info->HasOutPoint) _iprintf(" HasOutPoint: %d", info->OutPoint); if(info->HasInPoint) _iprintf(" HasInPoint: %d", info->InPoint); _iprintf("\n"); if(info->HasEnvelope) { int i; _iprintf(" EnvPoints %d\n", info->EnvPoints); for(i = 0; i < info->EnvPoints; i++) outputSWF_SOUNDENVELOPE(info->EnvelopeRecords + i); } } void outputSWF_STARTSOUND (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_STARTSOUND); _iprintf(" SoundId %d\n", sblock->SoundId); outputSWF_SOUNDINFO(&sblock->SoundInfo); } void outputSWF_STARTSOUND2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_STARTSOUND2); _iprintf(" SoundClassName %s\n", sblock->SoundClassName); outputSWF_SOUNDINFO(&sblock->SoundInfo); } void outputSWF_SYNCFRAME (SWF_Parserstruct * pblock) { //OUT_BEGIN (SWF_SYNCFRAME); } void outputSWF_INITACTION (SWF_Parserstruct * pblock) { #ifdef NODECOMPILE int i; #endif OUT_BEGIN (SWF_INITACTION); _iprintf(" %d Init actions for character %u\n", sblock->numActions, sblock->SpriteId); #ifdef NODECOMPILE for(i=0;inumActions;i++) outputSWF_ACTION(i,&(sblock->Actions[i])); #else _iprintf ("%s\n", decompile5Action(sblock->numActions,sblock->Actions,0)); #endif } void outputSWF_VIDEOFRAME (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_VIDEOFRAME); _iprintf(" StreamID %i\n", sblock->StreamID); _iprintf(" FrameNum %i\n", sblock->FrameNum); } void outputSWF_REFLEX (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_REFLEX); _iprintf(" Reflex: \"%c%c%c\"\n", sblock->rfx[0], sblock->rfx[1], sblock->rfx[2]); } void outputSWF_FILEATTRIBUTES(SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_FILEATTRIBUTES); _iprintf(" FileAttributes: HasMetaData %d, UseNetwork %d, HasAS3 %d\n", sblock->HasMetadata, sblock->UseNetwork, sblock->ActionScript3); } void outputSWF_METADATA(SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_METADATA); _iprintf(" Metadata: \n%s\n\n", sblock->Metadata); } void outputSWF_SCRIPTLIMITS(SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SCRIPTLIMITS); _iprintf(" MaxRecursionDepth %d\n", sblock->MaxRecursionDepth); _iprintf(" ScriptTimeoutSeconds %d\n", sblock->ScriptTimeoutSeconds); } void outputSWF_DEFINESCALINGGRID(SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DEFINESCALINGGRID); _iprintf(" CharacterId %d\n", sblock->CharacterId); outputSWF_RECT(&sblock->Splitter); } void outputSWF_SETTABINDEX(SWF_Parserstruct *pblock) { OUT_BEGIN (SWF_SETTABINDEX); _iprintf(" Depth: %d\n", sblock->Depth); _iprintf(" TabIndex: %d\n", sblock->TabIndex); } static void outputNSSetConstant(struct ABC_FILE *abc, unsigned int index); static void outputNamespaceConstant(struct ABC_FILE *abc, unsigned int index); static void outputMultinameConstant(struct ABC_FILE *abc, unsigned int index); static void outputStringConstant(struct ABC_FILE *abc, unsigned int strIndex); static void outputABC_STRING_INFO(struct ABC_STRING_INFO *si) { char *buffer, *bufp; int i; if(si->Size == 0) { _iprintf(" ** empty ** (0)\n"); return; } // we don't deal with utf8 yet buffer = malloc(si->Size+1); memset(buffer, 0, si->Size+1); bufp = buffer; for(i = 0; i < si->Size; i++) { if(si->UTF8String[i] < 128) *bufp++ = si->UTF8String[i]; } _iprintf(" '%s' (%i)\n", buffer, si->Size); free(buffer); } static void outputABC_QNAME(struct ABC_FILE *abc, struct ABC_QNAME *qn) { outputNamespaceConstant(abc, qn->NS); outputStringConstant(abc, qn->Name); } static void outputABC_RTQNAME(struct ABC_FILE *abc, struct ABC_RTQNAME *rtq) { outputStringConstant(abc, rtq->Name); } static void outputABC_MULTINAME(struct ABC_FILE *abc, struct ABC_MULTINAME *mn) { outputStringConstant(abc, mn->Name); outputNSSetConstant(abc, mn->NSSet); } static void outputABC_MULTINAME_L(struct ABC_FILE *abc, struct ABC_MULTINAME_L *ml) { outputNSSetConstant(abc, ml->NSSet); } static void outputABC_MULTINAME_INFO(struct ABC_FILE *abc, struct ABC_MULTINAME_INFO *mi) { switch(mi->Kind) { case ABC_CONST_QNAME: case ABC_CONST_QNAME_A: _iprintf(" Multiname ABC_CONST_QNAME(A)"); outputABC_QNAME(abc, &mi->Data.QName); break; case ABC_CONST_RTQNAME: case ABC_CONST_RTQNAME_A: _iprintf(" Multiname ABC_CONST_RTQNAME(A)"); outputABC_RTQNAME(abc, &mi->Data.RTQName); break; case ABC_CONST_RTQNAME_L: case ABC_CONST_RTQNAME_LA: _iprintf(" Multiname ABC_CONST_MULTINAME(A)"); break; case ABC_CONST_MULTINAME: case ABC_CONST_MULTINAME_A: _iprintf(" Multiname ABC_CONST_MULTINAME(A)"); outputABC_MULTINAME(abc, &mi->Data.Multiname); break; case ABC_CONST_MULTINAME_L: case ABC_CONST_MULTINAME_LA: _iprintf(" Multiname ABC_CONST_MULTINAME(A)"); outputABC_MULTINAME_L(abc, &mi->Data.MultinameL); break; } } static void outputABC_NS_INFO(struct ABC_FILE *abc, struct ABC_NS_INFO *ns) { _iprintf(" Namespace Kind %x\n", ns->Kind); outputStringConstant(abc, ns->Name); } static void outputABC_NS_SET_INFO(struct ABC_FILE *abc, struct ABC_NS_SET_INFO *set) { int i; for(i = 0; i < set->Count; i++) { unsigned int index = set->NS[i]; outputNamespaceConstant(abc, index); } } static void outputNSSetConstant(struct ABC_FILE *abc, unsigned int index) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(index >= cp->NamespaceSetCount) { _iprintf("ConstantPool NamespaceSetCount %u <= index %u\n", cp->NamespaceSetCount, index); return; } if(index == 0) { _iprintf("*\n"); return; } outputABC_NS_SET_INFO(abc, cp->NsSets + index); } static void outputNamespaceConstant(struct ABC_FILE *abc, unsigned int index) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(index >= cp->NamespaceCount) { _iprintf("ConstantPool NamespaceCount %u <= index %u\n", cp->NamespaceCount, index); return; } if(index == 0) { _iprintf("*\n"); return; } outputABC_NS_INFO(abc, cp->Namespaces + index); } static void outputMultinameConstant(struct ABC_FILE *abc, unsigned int index) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(index >= cp->MultinameCount) { _iprintf("ConstantPool MultinameCount %u <= index %u\n", cp->MultinameCount, index); return; } if(index == 0) { _iprintf("Multiname index 0 is not allowed\n"); return; } outputABC_MULTINAME_INFO(abc, cp->Multinames + index); } static void outputIntConstant(struct ABC_FILE *abc, unsigned int index) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(index >= cp->IntCount) { _iprintf("ConstantPool IntCount %u <= index %u\n", cp->IntCount, index); return; } if(index == 0) { _iprintf("Integer index 0 is not allowed\n"); return; } _iprintf("Int %i\n", cp->Integers[index]); } static void outputUIntConstant(struct ABC_FILE *abc, unsigned int index) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(index >= cp->UIntCount) { _iprintf("ConstantPool UIntCount %u <= index %u\n", cp->UIntCount, index); return; } if(index == 0) { _iprintf("UInteger index 0 is not allowed\n"); return; } _iprintf(" UInt %u\n", cp->UIntegers[index]); } static void outputDoubleConstant(struct ABC_FILE *abc, unsigned int index) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(index >= cp->DoubleCount) { _iprintf("ConstantPool DoubleCount %u <= index %u\n", cp->DoubleCount, index); return; } if(index == 0) { _iprintf(" NaN\n"); return; } _iprintf(" Double %f\n", cp->Doubles[index]); } static void outputStringConstant(struct ABC_FILE *abc, unsigned int strIndex) { struct ABC_CONSTANT_POOL *cp = &abc->ConstantPool; if(strIndex >= cp->StringCount) { _iprintf("ConstantPool StringCount %u <= strIndex %u\n", cp->StringCount, strIndex); return; } if(strIndex == 0) { _iprintf(" *\n"); return; } outputABC_STRING_INFO(cp->Strings + strIndex); } void outputABC_OPTION_INFO(struct ABC_FILE *abc, struct ABC_OPTION_INFO *o) { int i; for (i = 0; i < o->OptionCount; i++) { unsigned int index = o->Option[i].Val; _iprintf(" Option: "); switch(o->Option[i].Kind) { case ABC_INT: outputIntConstant(abc, index); break; case ABC_UINT: outputUIntConstant(abc, index); break; case ABC_DOUBLE: outputDoubleConstant(abc, index); break; case ABC_UTF8: outputStringConstant(abc, index); break; case ABC_TRUE: _iprintf(" TRUE\n"); break; case ABC_FALSE: _iprintf(" FALSE\n"); break; case ABC_NULL: _iprintf(" NULL\n"); break; case ABC_UNDEF: _iprintf(" UNDEF\n"); break; case ABC_NAMESPACE: case ABC_PACKAGE_NS: case ABC_PACKAGE_INTERNAL_NS: case ABC_PROTECTED_NS: case ABC_EXPLICIT_NS: case ABC_STATIC_PROTECTED_NS: case ABC_PRIVATE_NS: outputNamespaceConstant(abc, index); break; default: _iprintf("Option type %x unknown\n", o->Option[i].Kind); } } } void outputABC_METHOD_INFO(struct ABC_FILE *abc, struct ABC_METHOD_INFO *minfo) { int i; _iprintf(" ParamCount %u\n", minfo->ParamCount); _iprintf(" ReturnType \n {\n"); if(minfo->ReturnType) outputMultinameConstant(abc, minfo->ReturnType); else _iprintf(" void\n"); _iprintf(" }\n\n"); for(i = 0; i < minfo->ParamCount; i++) { unsigned int index = minfo->ParamType[i]; _iprintf(" Parameter %i\n {\n", i); outputMultinameConstant(abc, index); _iprintf(" }\n"); } _iprintf(" Name (%u) ", minfo->Name); if(minfo->Name) outputStringConstant(abc, minfo->Name); else _iprintf("**no name**\n"); _iprintf(" Flags %x\n", minfo->Flags); if(minfo->Flags & ABC_METHOD_HAS_OPTIONAL) outputABC_OPTION_INFO(abc, &minfo->Options); if(minfo->Flags & ABC_METHOD_HAS_PARAM_NAMES) { int i; _iprintf(" Parameter Names:\n"); for(i = 0; i < minfo->ParamCount; i++) { int strIndex = minfo->ParamType[i]; outputStringConstant(abc, strIndex); } } } void outputABC_CONSTANT_POOL(struct ABC_CONSTANT_POOL *cpool) { _iprintf(" ConstantPool: \n"); _iprintf(" Integers: %u, Unsigend %u Doubles %u\n", cpool->IntCount, cpool->UIntCount, cpool->DoubleCount); _iprintf(" Strings %u, Namespaces %u, NS-Sets %u, Multinames %u\n\n", cpool->StringCount, cpool->NamespaceCount, cpool->NamespaceSetCount, cpool->MultinameCount); } void outputABC_METADATA_INFO(struct ABC_FILE *abc, struct ABC_METADATA_INFO *mi) { unsigned int i; _iprintf(" Name: "); outputStringConstant(abc, mi->Name); for(i = 0; i < mi->ItemCount; i++) { _iprintf(" Key (%u) ", mi->Items[i].Key); outputStringConstant(abc, mi->Items[i].Key); _iprintf(" Value (%u) ", mi->Items[i].Value); outputStringConstant(abc, mi->Items[i].Value); _iprintf("\n"); } } void outputABC_TRAIT_SLOT(struct ABC_FILE *abc, struct ABC_TRAIT_SLOT *ts) { _iprintf(" Trait Slot\n"); _iprintf(" SlotId %u\n", ts->SlotId); _iprintf(" Type Name "); if(ts->TypeName) outputMultinameConstant(abc, ts->TypeName); else _iprintf(" * "); _iprintf("\n"); _iprintf(" VIndex %u\n", ts->VIndex); if(ts->VIndex) _iprintf(" VKind %u\n", ts->VKind); } void outputABC_TRAIT_CLASS(struct ABC_FILE *abc, struct ABC_TRAIT_CLASS *tc) { _iprintf(" Trait Class\n"); _iprintf(" SlotId %u\n", tc->SlotId); _iprintf(" Class Index %u\n", tc->ClassIndex); } void outputABC_TRAIT_FUNCTION(struct ABC_FILE *abc, struct ABC_TRAIT_FUNCTION *tf) { _iprintf(" Trait Function\n"); _iprintf(" SlotId %u\n", tf->SlotId); _iprintf(" Method Index %u\n", tf->Function); } void outputABC_TRAIT_METHOD(struct ABC_FILE *abc, struct ABC_TRAIT_METHOD *tm) { _iprintf(" Trait Method\n"); _iprintf(" DispId %u\n", tm->DispId); _iprintf(" Method Index %u\n", tm->Method); } void outputABC_TRAITS_INFO(struct ABC_FILE *abc, struct ABC_TRAITS_INFO *ti) { _iprintf(" Name: "); outputMultinameConstant(abc, ti->Name); _iprintf("\n"); switch(ti->Kind & 0xf) { case ABC_CONST_TRAIT_SLOT: case ABC_CONST_TRAIT_CONST: outputABC_TRAIT_SLOT(abc, &ti->Data.Slot); break; case ABC_CONST_TRAIT_CLASS: outputABC_TRAIT_CLASS(abc, &ti->Data.Class); break; case ABC_CONST_TRAIT_FUNCTION: outputABC_TRAIT_FUNCTION(abc, &ti->Data.Function); break; case ABC_CONST_TRAIT_METHOD: case ABC_CONST_TRAIT_GETTER: case ABC_CONST_TRAIT_SETTER: outputABC_TRAIT_METHOD(abc, &ti->Data.Method); break; default: _iprintf("unknown trait %x\n", ti->Kind); } _iprintf(" Trait Attr %x\n", ti->Attr); if(ti->Attr & ABC_TRAIT_ATTR_METADATA) { unsigned int i; _iprintf(" Trait Metadata Num %u\n", ti->MetadataCount); for(i = 0; i < ti->MetadataCount; i++) { _iprintf(" Metadata[%u] -> %u\n", i, ti->Metadata[i]); } } } void outputABC_INSTANCE_INFO(struct ABC_FILE *abc, struct ABC_INSTANCE_INFO *ii) { unsigned int i; _iprintf(" Name: "); outputStringConstant(abc, ii->Name); _iprintf(" SuperName: "); outputStringConstant(abc, ii->SuperName); _iprintf(" Flags %x\n", ii->Flags); if(ii->Flags & ABC_CLASS_PROTECTED_NS) { _iprintf(" Protected NS "); outputNamespaceConstant(abc, ii->ProtectedNs); } _iprintf(" Interfaces: (%u)\n", ii->InterfaceCount); for(i = 0; i < ii->InterfaceCount; i++) { _iprintf(" Interface (%u)", i); outputMultinameConstant(abc, ii->Interfaces[i]); } _iprintf(" Init Method #%u\n", ii->IInit); _iprintf(" Traits (%u):\n", ii->TraitCount); for(i = 0; i < ii->TraitCount; i++) { _iprintf(" Trait %u:\n", i); outputABC_TRAITS_INFO(abc, ii->Traits + i); } } void outputABC_CLASS_INFO(struct ABC_FILE *abc, struct ABC_CLASS_INFO *ci) { unsigned int i; _iprintf(" Init Method #%u\n", ci->CInit); _iprintf(" Traits (%u):\n", ci->TraitCount); for(i = 0; i < ci->TraitCount; i++) { _iprintf(" Trait %u:\n", i); outputABC_TRAITS_INFO(abc, ci->Traits + i); } } void outputABC_SCRIPT_INFO(struct ABC_FILE *abc, struct ABC_SCRIPT_INFO *si) { unsigned int i; _iprintf(" Init Method #%u\n", si->Init); _iprintf(" Traits (%u):\n", si->TraitCount); for(i = 0; i < si->TraitCount; i++) { _iprintf(" Trait %u:\n", i); outputABC_TRAITS_INFO(abc, si->Traits + i); } } void outputABC_EXCEPTION_INFO(struct ABC_FILE *abc, struct ABC_EXCEPTION_INFO *ei) { _iprintf(" From: %u\n", ei->From); _iprintf(" To: %u\n", ei->To); _iprintf(" Target: %u\n", ei->Target); _iprintf(" ExcType: "); outputStringConstant(abc, ei->ExcType); _iprintf(" VarName: "); outputStringConstant(abc, ei->VarName); } void outputABC_METHOD_BODY_INFO(struct ABC_FILE *abc, struct ABC_METHOD_BODY_INFO *mb) { unsigned int i; _iprintf(" Method Index -> %u\n", mb->Method); _iprintf(" Max Stack %u\n", mb->MaxStack); _iprintf(" LocalCount %u\n", mb->LocalCount); _iprintf(" InitScopeDepth %u\n", mb->InitScopeDepth); _iprintf(" MaxScopeDepth %u\n", mb->CodeLength); _iprintf(" CodeLength %u\n", mb->CodeLength); _iprintf(" ExceptionCount %u\n", mb->ExceptionCount); for(i = 0; i < mb->ExceptionCount; i++) { _iprintf(" Exception [%u]: \n", i); outputABC_EXCEPTION_INFO(abc, mb->Exceptions + i); } _iprintf(" Traits (%u):\n", mb->TraitCount); for(i = 0; i < mb->TraitCount; i++) { _iprintf(" Trait [%u]:\n", i); outputABC_TRAITS_INFO(abc, mb->Traits + i); } } void outputABC_FILE(struct ABC_FILE *abc) { unsigned int i; _iprintf(" Version %i.%i\n", abc->Major, abc->Minor); outputABC_CONSTANT_POOL(&abc->ConstantPool); _iprintf(" MethodCount %u\n", abc->MethodCount); for(i = 0; i < abc->MethodCount; i++) { _iprintf(" Method Info[%u]:\n", i); outputABC_METHOD_INFO(abc, abc->Methods + i); _iprintf(" ### Method done ###\n\n"); } _iprintf(" ### Method Info done ###\n\n"); _iprintf(" MetadataCount %u\n", abc->MetadataCount); for(i = 0; i < abc->MetadataCount; i++) { _iprintf(" Metadata [%u]:\n", i); outputABC_METADATA_INFO(abc, abc->Metadata + i); _iprintf(" ### Metadata done ###\n\n"); } _iprintf(" ### Metadata Info done ###\n\n"); _iprintf(" InstanceCount %u\n", abc->ClassCount); for(i = 0; i < abc->ClassCount; i++) { _iprintf(" Instance [%u]:\n", i); outputABC_INSTANCE_INFO(abc, abc->Instances + i); _iprintf(" ### Instance done ###\n\n"); } _iprintf(" ### Instances Info done ###\n\n"); _iprintf(" ClassCount %u\n", abc->ClassCount); for(i = 0; i < abc->ClassCount; i++) { _iprintf(" Class [%u]:\n", i); outputABC_CLASS_INFO(abc, abc->Classes + i); _iprintf(" ### Class done ###\n\n"); } _iprintf(" ### Class Info done ###\n\n"); _iprintf(" ScriptCount %u\n", abc->ScriptCount); for(i = 0; i < abc->ScriptCount; i++) { _iprintf(" Script [%u]:\n", i); outputABC_SCRIPT_INFO(abc, abc->Scripts + i); _iprintf(" ### Script done ###\n\n"); } _iprintf(" ### Script Info done ###\n\n"); _iprintf(" MethodBodyCount %u\n", abc->MethodBodyCount); for(i = 0; i < abc->MethodBodyCount; i++) { _iprintf(" Method Body [%u]:\n", i); outputABC_METHOD_BODY_INFO(abc, abc->MethodBodies + i); _iprintf(" ### Method Body done ###\n\n"); } _iprintf(" ### Method Body Info done ###\n\n"); } void outputSWF_DOABC(SWF_Parserstruct *pblock) { OUT_BEGIN (SWF_DOABC); _iprintf(" ActionFlags: %x\n", sblock->Flags); _iprintf(" Name %s\n", sblock->Name); outputABC_FILE(&sblock->AbcFile); } void outputSWF_SYMBOLCLASS(SWF_Parserstruct *pblock) { int count, i; OUT_BEGIN(SWF_SYMBOLCLASS); count = sblock->SymbolCount; _iprintf("SymbolCount %i\n", count); for(i = 0; i < count; i++) { _iprintf(" Id: %i, Name: %s\n", sblock->SymbolList[i].SymbolId, sblock->SymbolList[i].SymbolName); } } void outputSWF_DEFINESCENEANDFRAMEDATA(SWF_Parserstruct *pblock) { int i; OUT_BEGIN(SWF_DEFINESCENEANDFRAMEDATA); _iprintf(" SceneCount: %d\n", sblock->SceneCount); for(i = 0; i < sblock->SceneCount; i++) _iprintf(" Scene #%d: Offset: %d, Name: %s\n", i, sblock->Scenes[i].Offset, sblock->Scenes[i].Name); _iprintf(" FrameLabelCount: %d\n", sblock->FrameLabelCount); for(i = 0; i < sblock->FrameLabelCount; i++) _iprintf(" FrameLabel #%d: Frame: %d, Name: %s\n", i, sblock->Frames[i].FrameNum, sblock->Frames[i].FrameLabel); } void outputSWF_DEBUGID(SWF_Parserstruct *pblock) { int i; OUT_BEGIN(SWF_DEBUGID); _iprintf(" UUID: "); for(i = 0; i < pblock->length; i++) _iprintf("%x ", sblock->UUID[i]); _iprintf("\n"); } void outputSWF_UNKNOWNBLOCK(SWF_Parserstruct *pblock) { OUT_BEGIN(SWF_UNKNOWNBLOCK); if(sblock->Data == NULL) return; dumpBuffer(sblock->Data, pblock->length); } void printRect(struct Rect *r) { _iprintf("(%i,%i)x(%i,%i)", r->xMin, r->xMax, r->yMin, r->yMax); } void outputHeader (struct Movie *m) { setNewLineString("\n"); _iprintf("File version: %i\n", m->version); _iprintf("File size: %i\n", m->size); _iprintf("Frame size: "); printRect(&(m->frame)); putchar('\n'); _iprintf("Frame rate: %f / sec.\n", m->rate); _iprintf("Total frames: %i\n", m->nFrames); } void outputTrailer (struct Movie *m) { } void outputBlock (int type, SWF_Parserstruct * blockp, FILE* stream) { int i; if(blockp == NULL) return; int offset = blockp->offset; int length = blockp->length; if (type < 0) return; #if defined(ACTIONONLY) if( type != SWF_DOACTION && type != SWF_INITACTION && type != SWF_DEFINEBUTTON2 && type != SWF_PLACEOBJECT2 ) return; #endif putchar('\n'); _iprintf( "Offset: %d (0x%4.4x)\n", offset, offset ); _iprintf( "Block type: %d (%s)\n", type, blockName(type) ); _iprintf( "Block length: %d\n", length ); putchar('\n'); for (i = 0; i < numOutputs; i++) { if (outputs[i].type == type) { outputs[i].output (blockp); return; } } outputSWF_UNKNOWNBLOCK(blockp); return; } ming-0.4.5/util/decompile.c0000644000175000017500000024434612154635363012502 00000000000000/**************************************************************************** * * Copyright (C) 2006,2007 A.Kleine * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #define _GNU_SOURCE 1 #define DEBUGSTACK #define DECOMP_SWITCH // #define DEBUGSWITCH //#define STATEMENT_CLASS // I have uncommented some buggy class recognition stuff in decompileIF() // to make work simple code lines like: "if(!a) trace(a);" - ak, November 2006 // To do: add some free()-calls for allocated blocks #include #include #include #include #include #include #include "read.h" #include "action.h" #include "swftypes.h" #include "../src/blocks/error.h" #include "vasprintf.h" static char **pool; struct SWF_ACTIONPUSHPARAM *regs[256]; static char *getName(struct SWF_ACTIONPUSHPARAM *act); static int offseoloop; // offset wherever a break can jump to (loops and switch) static void dumpRegs() { int i; for(i=0;i<6;i++) if( regs[i] ) printf("reg[%d] %s\n", i, getName(regs[i])); } /* * Start Package * * A package to build up a string that can be returned to the caller * ak/2006: Extended for temporary swichting to a 2nd buffer */ #define USE_LIB 1 static int strsize=0; static int strmaxsize=0; static char *dcstr=NULL; static char *dcptr=NULL; #define DCSTRSIZE 40960 #define PARAM_STRSIZE 512 void dcinit() { strsize=0; strmaxsize=DCSTRSIZE; dcstr=calloc(DCSTRSIZE,1); dcptr=dcstr; } void dcchkstr(int size) { while( (strsize+size) > strmaxsize ) { dcstr=realloc(dcstr,strmaxsize+DCSTRSIZE); strmaxsize+=DCSTRSIZE; dcptr=dcstr+strsize; } } void dcputs(const char *s) { int len=strlen(s); dcchkstr(len); strcat(dcptr,s); dcptr+=len; strsize+=len; } void dcputchar(char c) { dcchkstr(1); *dcptr++=c; *dcptr='\000'; strsize++; } int dcprintf(char *format, ...) { char *s; size_t size; int ret; va_list args; va_start(args,format); ret = vasprintf(&s,format,args); dcputs(s); size=strlen(s); free(s); return size; } char * dcgetstr() { char *ret; ret = dcstr; dcstr=NULL; strmaxsize=0; return ret; } struct strbufinfo { int size; int maxsize; char *str; char *ptr; }; static struct strbufinfo setTempString(void) { struct strbufinfo current; current.size=strsize; current.maxsize=strmaxsize; current.str=dcstr; current.ptr=dcptr; dcinit(); return current; } static void setOrigString(struct strbufinfo old) { free(dcstr); /* not needed anymore */ strsize=old.size; strmaxsize=old.maxsize; dcstr=old.str; dcptr=old.ptr; } // a variant of setOrigString() // but for further usage of 2nd buffer // static char * switchToOrigString(struct strbufinfo old) { char *tmp=dcstr; strsize=old.size; strmaxsize=old.maxsize; dcstr=old.str; dcptr=old.ptr; return tmp; } #if USE_LIB #define puts(s) dcputs(s) #define putchar(c) dcputchar(c) #define printf dcprintf #endif #define INDENT { int ii=gIndent; while(--ii>=0) { putchar(' '); putchar(' '); } } /* String used for terminating lines (see println) */ static const char* newlinestring = "\\\n"; /* Set the newline character. By default it is an escaped NL. */ void setNewLineString(const char* ch) { newlinestring = ch; } /* Print a line with a terminating newline, which can be set by * setNewLineString() */ static void println(const char* fmt, ...) { char *tmp; int written; va_list ap; va_start (ap, fmt); written = vasprintf (&tmp, fmt, ap); dcprintf("%s%s", tmp, newlinestring); free(tmp); } /* End Package */ /* * Start Package * * A package to maintain escaped characters strings * [ BSC == BackSlashCounter ] */ #define BSC 2 static int strlenext(char *str) { int i=0; while (*str) { i++; if (*str=='\'') i+=BSC; str++; } return i; } static char* strcpyext(char *dest,char *src) { char *r=dest; while (*src) { if (*src=='\'') { *dest++='\\'; #if BSC == 2 *dest++='\\'; #endif } *dest++=*src++; } *dest='\0'; return r; } static char* strcatext(char *dest,char *src) { char *r=dest; while (*dest) dest++; strcpyext(dest,src); return r; } /* End Package */ /* * Start Package * * A package to maintain a representation of the Flash VM stack */ struct _stack { char type; struct SWF_ACTIONPUSHPARAM *val; struct _stack *next; }; struct _stack *Stack; enum { PUSH_STRING = 0, PUSH_FLOAT = 1, PUSH_NULL = 2, PUSH_UNDEF = 3, PUSH_REGISTER = 4, PUSH_BOOLEAN = 5, PUSH_DOUBLE = 6, PUSH_INT = 7, PUSH_CONSTANT = 8, PUSH_CONSTANT16 = 9, PUSH_VARIABLE = 10, }; static char * getString(struct SWF_ACTIONPUSHPARAM *act) { char *t; #ifdef DEBUG printf("*getString* type=%d\n",act->Type); #endif switch( act->Type ) { case PUSH_STRING: t=malloc(strlen(act->p.String)+3); /* 2 "'"s and a NULL */ strcpy(t,"'"); strcat(t,act->p.String); strcat(t,"'"); return t; case PUSH_NULL: /* NULL */ return "null"; case PUSH_UNDEF: /* Undefined */ return "undefined"; case PUSH_REGISTER: /* REGISTER */ if( regs[act->p.RegisterNumber] && regs[act->p.RegisterNumber]->Type != 4 && regs[act->p.RegisterNumber]->Type != 7 ) { return getName(regs[act->p.RegisterNumber]); } else { t=malloc(4); /* Rdd */ sprintf(t,"R%d", act->p.RegisterNumber ); return t; } case PUSH_BOOLEAN: /* BOOLEAN */ if( act->p.Boolean ) return "true"; else return "false"; case PUSH_DOUBLE: /* DOUBLE */ t=malloc(10); /* big enough? */ sprintf(t,"%g", act->p.Double ); return t; case PUSH_INT: /* INTEGER */ t=malloc(10); /* 32-bit decimal */ sprintf(t,"%ld", act->p.Integer ); return t; case PUSH_CONSTANT: /* CONSTANT8 */ t=malloc(strlenext(pool[act->p.Constant8])+3); /* 2 "'"s and a NULL */ strcpy(t,"'"); strcatext(t,pool[act->p.Constant8]); strcat(t,"'"); return t; case PUSH_CONSTANT16: /* CONSTANT16 */ t=malloc(strlenext(pool[act->p.Constant16])+3); /* 2 '\"'s and a NULL */ strcpy(t,"'"); strcatext(t,pool[act->p.Constant16]); strcat(t,"'"); return t; case 12: case 11: /* INCREMENTED or DECREMENTED VARIABLE */ case PUSH_VARIABLE: /* VARIABLE */ return act->p.String; default: fprintf (stderr," Can't get string for type: %d\n", act->Type); break; } return ""; } static char * getName(struct SWF_ACTIONPUSHPARAM *act) { char *t; switch( act->Type ) { case PUSH_STRING: /* STRING */ t=malloc(strlen(act->p.String)+3); /* strcpy(t,"\""); strcat(t,act->p.String); strcat(t,"\""); */ strcpy(t,act->p.String); if(strlen(t)) /* Not a zero length string */ return t; else return "this"; #if 0 case 4: /* REGISTER */ t=malloc(4); /* Rdd */ sprintf(t,"R%d", act->p.RegisterNumber ); return t; #endif case PUSH_CONSTANT: /* CONSTANT8 */ t=malloc(strlenext(pool[act->p.Constant8])+1); strcpyext(t,pool[act->p.Constant8]); if(strlen(t)) /* Not a zero length string */ return t; else { t=realloc(t,6); return strcpy(t,"this"); } case PUSH_CONSTANT16: /* CONSTANT16 */ t=malloc(strlenext(pool[act->p.Constant16])+1); strcpyext(t,pool[act->p.Constant16]); if(strlen(t)) /* Not a zero length string */ return t; else { t=realloc(t,6); return strcpy(t,"this"); } default: return getString(act); } } static int getInt(struct SWF_ACTIONPUSHPARAM *act) { switch( act->Type ) { case PUSH_FLOAT: /* FLOAT -- also used for PROPERTY storing */ return ((int)act->p.Float); case PUSH_NULL: /* NULL */ return 0; case PUSH_REGISTER: /* REGISTER */ return getInt(regs[act->p.RegisterNumber]); case PUSH_DOUBLE: /* DOUBLE */ return (int)act->p.Double; case PUSH_INT: /* INTEGER */ return act->p.Integer; default: fprintf (stderr," Can't get int for type: %d\n", act->Type); } return 0; } static char * getProperty(Property prop) { switch(prop) { case SWF_SETPROPERTY_X: return("_x"); break; case SWF_SETPROPERTY_Y: case PROPERTY_Y: return("_y"); break; case PROPERTY_XMOUSE: return("_xMouse"); break; case PROPERTY_YMOUSE: return("_yMouse"); break; case SWF_SETPROPERTY_XSCALE: case PROPERTY_XSCALE: return("_xScale"); break; case SWF_SETPROPERTY_YSCALE: case PROPERTY_YSCALE: return("_yScale"); break; case PROPERTY_CURRENTFRAME: return("_currentFrame"); break; case PROPERTY_TOTALFRAMES: return("_totalFrames"); break; case SWF_SETPROPERTY_ALPHA: case PROPERTY_ALPHA: return("_alpha"); break; case SWF_SETPROPERTY_VISIBILITY: case PROPERTY_VISIBLE: return("_visible"); break; case PROPERTY_WIDTH: return("_width"); break; case PROPERTY_HEIGHT: return("_height"); break; case SWF_SETPROPERTY_ROTATION: case PROPERTY_ROTATION: return("_rotation"); break; case PROPERTY_TARGET: return("_target"); break; case PROPERTY_FRAMESLOADED: return("_framesLoaded"); break; case SWF_SETPROPERTY_NAME: case PROPERTY_NAME: return("_name"); break; case PROPERTY_DROPTARGET: return("_dropTarget"); break; case PROPERTY_URL: return("_url"); break; case SWF_SETPROPERTY_HIGHQUALITY: case PROPERTY_HIGHQUALITY: return("_quality"); break; case SWF_SETPROPERTY_SHOWFOCUSRECT: case PROPERTY_FOCUSRECT: return("_focusRect"); break; case SWF_SETPROPERTY_SOUNDBUFFERTIME: case PROPERTY_SOUNDBUFTIME: return("_soundBufTime"); break; case SWF_SETPROPERTY_WTHIT: case PROPERTY_WTHIT: return("_WTHIT!?"); break; default: return("unknown property!"); break; } } struct SWF_ACTIONPUSHPARAM * newVar(char *var) { struct SWF_ACTIONPUSHPARAM *v; v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM)); v->Type = PUSH_VARIABLE; v->p.String = var; return v; } struct SWF_ACTIONPUSHPARAM * newVar2(char *var,char *var2) { struct SWF_ACTIONPUSHPARAM *v; v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM)); v->Type = PUSH_VARIABLE; v->p.String = malloc(strlen(var)+strlen(var2)+1); strcpy(v->p.String,var); strcat(v->p.String,var2); return v; } struct SWF_ACTIONPUSHPARAM * newVar3(char *var,char *var2, char *var3) { struct SWF_ACTIONPUSHPARAM *v; v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM)); v->Type = PUSH_VARIABLE; /* VARIABLE */ v->p.String = malloc(strlen(var)+strlen(var2)+strlen(var3)+1); strcpy(v->p.String,var); strcat(v->p.String,var2); strcat(v->p.String,var3); return v; } struct SWF_ACTIONPUSHPARAM * newVar5(char *var,char *var2, char *var3,char *var4,char *var5) { struct SWF_ACTIONPUSHPARAM *v; v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM)); v->Type = PUSH_VARIABLE; /* VARIABLE */ v->p.String = malloc(strlen(var)+strlen(var2)+strlen(var3)+strlen(var4)+strlen(var5)+1); strcpy(v->p.String,var); strcat(v->p.String,var2); strcat(v->p.String,var3); strcat(v->p.String,var4); strcat(v->p.String,var5); return v; } void push(struct SWF_ACTIONPUSHPARAM *val) { struct _stack *t; #ifdef DEBUG printf("*push* type=%d\n",val->Type); #endif t = calloc(1,sizeof(*Stack)); t->type = val->Type; t->val = val; t->next = Stack; Stack = t; } void pushdup() { struct _stack *t; #ifdef DEBUG printf("*pushdup*\n"); #endif if(Stack == NULL) { SWF_warn("WARNING: pushdup on empty stack. This might be wrong!\n"); return; } t = calloc(1,sizeof(*Stack)); t->type = Stack->type; t->val = Stack->val; t->next = Stack; Stack = t; } void pushvar(struct SWF_ACTIONPUSHPARAM *val) { struct _stack *t; #ifdef DEBUG printf("*pushvar*\n"); #endif t = calloc(1,sizeof(*Stack)); t->type = 'v'; // ??? t->val = val; t->next = Stack; Stack = t; } struct SWF_ACTIONPUSHPARAM * pop() { struct _stack *t; struct SWF_ACTIONPUSHPARAM * ret; #ifdef DEBUG printf("*pop*\n"); #endif #ifdef DEBUGSTACK /* continue w stack dummy */ if( Stack == NULL ) push(newVar("// *** pop(): INTERNAL STACK ERROR FOUND ***")); #else if( Stack == NULL ) SWF_error("Stack blown!! - pop"); #endif t=Stack; Stack=t->next; ret=t->val; return ret; } struct SWF_ACTIONPUSHPARAM * peek() { #ifdef DEBUG printf("*peek*\n"); #endif #ifdef DEBUGSTACK /* continue w stack dummy */ if( Stack == NULL ) push(newVar("// *** peek(): INTERNAL STACK ERROR FOUND ***")); #else if( Stack == NULL ) SWF_error("Stack blown!! - peek"); #endif return Stack->val; } void stackswap() { #ifdef DEBUG printf("*stackswap*\n"); #endif struct SWF_ACTIONPUSHPARAM *p = peek(); /* peek() includes error handling */ char type = Stack->type; Stack->type = Stack->next->type; Stack->val = Stack->next->val; Stack->next->type = type; Stack->next->val = p; } static struct SWF_ACTIONPUSHPARAM * newVar_N(char *var,char *var2, char *var3,char *var4,int pop_counter,char *final) { struct SWF_ACTIONPUSHPARAM *v; int psize=PARAM_STRSIZE; int i; int slen=strlen(var)+strlen(var2)+strlen(var3)+strlen(var4)+strlen(final); v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM)); v->p.String = malloc(psize + slen); v->Type = PUSH_VARIABLE; strcpy(v->p.String,var); strcat(v->p.String,var2); strcat(v->p.String,var3); strcat(v->p.String,var4); for(i=0;ip.String)+ 2 + strlen(pops) +slen >= psize) { psize += PARAM_STRSIZE; v->p.String = realloc( v->p.String, psize); } strcat(v->p.String,pops); if( i < pop_counter-1 ) strcat(v->p.String,","); } strcat(v->p.String,final); return v; } // similar to newVar_N(), // but pops 2 items from stack per counter, // and second of them we are interested in getName() instead of getString() static struct SWF_ACTIONPUSHPARAM * newVar_N2(char *var,char *var2, char *var3,char *var4,int pop_counter,char *final) { struct SWF_ACTIONPUSHPARAM *v; int psize=PARAM_STRSIZE; int i; int slen=strlen(var)+strlen(var2)+strlen(var3)+strlen(var4)+strlen(final); v=malloc(sizeof(struct SWF_ACTIONPUSHPARAM)); v->p.String = malloc(psize + slen); v->Type = PUSH_VARIABLE; strcpy(v->p.String,var); strcat(v->p.String,var2); strcat(v->p.String,var3); strcat(v->p.String,var4); for(i=0;ip.String)+ 3 + strlen(pops1)+ strlen(pops2) +slen >= psize) { psize += PARAM_STRSIZE; v->p.String = realloc( v->p.String, psize); } strcat(v->p.String,pops2); strcat(v->p.String,":"); strcat(v->p.String,pops1); if( i < pop_counter-1 ) strcat(v->p.String,","); } strcat(v->p.String,final); return v; } /* End Package */ static int gIndent; static void decompileActions(int n, SWF_ACTION *actions,int indent); char * decompile5Action(int n, SWF_ACTION *actions,int indent); /******************************************************************************/ /******************************************************************************/ /******************************************************************************/ /******************************************************************************/ /******************************************************************************/ #define SanityCheck(curact,test,msg ) \ if(!(test) ) SWF_error( "SanityCheck failed in %s\n %s\n", #curact, msg ); #define OUT_BEGIN(block) \ struct block *sact = (struct block *)act; #define OUT_BEGIN2(block) \ struct block *sact = (struct block *)&(actions[n]); static void decompileCONSTANTPOOL (SWF_ACTION *act) { OUT_BEGIN(SWF_ACTIONCONSTANTPOOL); pool=sact->ConstantPool; } static void decompileWAITFORFRAME (SWF_ACTION *act) { OUT_BEGIN(SWF_ACTIONWAITFORFRAME); INDENT println("WaitForFrame(%d,%d);", sact->Frame,sact->SkipCount); } static void decompilePUSHPARAM (struct SWF_ACTIONPUSHPARAM *act, int wantstring) { char *t; switch( act->Type ) { case PUSH_STRING: /* STRING */ if( wantstring ) printf ("'%s'", act->p.String); else printf ("%s", act->p.String); break; case PUSH_FLOAT: /* FLOAT */ printf ("%f", act->p.Float); break; case PUSH_NULL: /* NULL */ printf ("NULL" ); break; case PUSH_UNDEF: /* Undefined */ printf ("undefined" ); break; case PUSH_REGISTER: /* Register */ if( regs[act->p.RegisterNumber] ) { printf ("%s", getName(act)); } else { printf ("R%d", (int)act->p.RegisterNumber); } break; case PUSH_BOOLEAN: /* BOOLEAN */ printf ("%s", act->p.Boolean?"true":"false"); break; case PUSH_DOUBLE: /* DOUBLE */ printf ("%g", act->p.Double); break; case PUSH_INT: /* INTEGER */ printf ("%ld", act->p.Integer); break; case PUSH_CONSTANT: /* CONSTANT8 */ case PUSH_CONSTANT16: /* CONSTANT16 */ if( wantstring ) t=getString(act); else t=getName(act); puts(t); free(t); break; #if 0 case 8: /* CONSTANT8 */ if( wantstring ) printf ("'%s'", pool[act->p.Constant8]); else printf ("%s", pool[act->p.Constant8]); break; case 9: /* CONSTANT16 */ if( wantstring ) printf ("'%s'", pool[act->p.Constant16]); else printf ("%s", pool[act->p.Constant16]); break; #endif case 12: case 11: /* INCREMENTED or DECREMENTED VARIABLE */ case PUSH_VARIABLE: /* VARIABLE */ printf ("%s", act->p.String); break; default: printf (" Unknown type: %d\n", act->Type); } } static void decompileGETURL (SWF_ACTION *act) { OUT_BEGIN(SWF_ACTIONGETURL); INDENT println("getUrl('%s',%s);", sact->UrlString, sact->TargetString); } static int decompileGETURL2 (SWF_ACTION *act) { struct SWF_ACTIONPUSHPARAM *a,*b; OUT_BEGIN(SWF_ACTIONGETURL2); INDENT a = pop(); b = pop(); if (sact->f.FlagBits.SendVarsMethod==3) puts("loadVariables("); else { if (sact->f.FlagBits.SendVarsMethod==2) puts("loadVariablesNum("); else { if (sact->f.FlagBits.SendVarsMethod==1) puts("loadMovie("); else { if (*getName(a)=='_') // found a _level puts("loadMovieNum("); else puts("getURL("); } } } decompilePUSHPARAM (b, 1); puts(","); decompilePUSHPARAM (a, 1); if (sact->f.FlagBits.LoadVariableFlag) puts(",'GET'"); if (sact->f.FlagBits.LoadTargetFlag) puts(",'POST'"); println(");"); return 0; } static inline int OpCode(SWF_ACTION *actions, int n, int maxn) { if(!n || n >= maxn) { #if DEBUG SWF_warn("OpCode: want %i, max %i\n", n, maxn); #endif return -999; } return actions[n].SWF_ACTIONRECORD.ActionCode; } static int isStoreOp(int n, SWF_ACTION *actions,int maxn) { switch(OpCode(actions, n, maxn)) { case SWFACTION_STOREREGISTER: case SWFACTION_SETVARIABLE: case SWFACTION_SETMEMBER: case SWFACTION_CASTOP: return 1; default: return 0; } } static int decompileGOTOFRAME(int n, SWF_ACTION *actions,int maxn,int islabel) { int i=0; struct SWF_ACTIONGOTOLABEL *sactv2; OUT_BEGIN2(SWF_ACTIONGOTOFRAME); sactv2 = (struct SWF_ACTIONGOTOLABEL*)sact; INDENT if (OpCode(actions, n+1, maxn) == SWFACTION_PLAY) { i=1; puts("gotoAndPlay("); } else { if (OpCode(actions, n+1, maxn) == SWFACTION_STOP) i=1; puts("gotoAndStop("); } if (islabel) println("'%s');", sactv2->FrameLabel); else println("%d);", sact->Frame+1); /* GOTOFRAME arg is 0-based */ return i; } static int decompileGOTOFRAME2(int n, SWF_ACTION *actions, int maxn) { int i=0; OUT_BEGIN2(SWF_ACTIONGOTOFRAME2); INDENT if (n+1 < maxn) { if (OpCode(actions, n+1, maxn) == SWFACTION_PLAY || OpCode(actions, n+1, maxn) == SWFACTION_STOP) i=1; if (OpCode(actions, n+1, maxn) == SWFACTION_PLAY) puts("gotoAndPlay("); else { if (OpCode(actions, n+1, maxn) == SWFACTION_STOP) puts("gotoAndStop("); else { if (sact->f.FlagBits.PlayFlag) puts("gotoAndPlay("); else puts("gotoAndStop("); } } } else { if (sact->f.FlagBits.PlayFlag) puts("gotoAndPlay("); else puts("gotoAndStop("); } decompilePUSHPARAM(pop(),0); println(");"); return i; } static int precedence(int op1,int op2) { static unsigned char ops[]= { // array of opcodes w rising precedence // SWFACTION_SETVARIABLE, // TAKE CARE: array is incomplete // SWFACTION_TRACE, // missing ops are considered with low precedence SWFACTION_LOGICALOR, SWFACTION_LOGICALAND, SWFACTION_BITWISEOR, SWFACTION_BITWISEXOR, SWFACTION_BITWISEAND, SWFACTION_STRICTEQUALS, SWFACTION_EQUALS2, SWFACTION_EQUAL, SWFACTION_GREATER, SWFACTION_LESSTHAN, SWFACTION_LESS2, SWFACTION_SHIFTRIGHT, SWFACTION_SHIFTRIGHT2, SWFACTION_SHIFTLEFT, SWFACTION_ADD, SWFACTION_ADD2, SWFACTION_SUBTRACT, SWFACTION_MODULO, SWFACTION_MULTIPLY, SWFACTION_DIVIDE, SWFACTION_LOGICALNOT, SWFACTION_PUSH // FIXME: need more analysis on code after PUSH }; unsigned char* f=memchr(ops,op1,sizeof(ops)); unsigned char* s=memchr(ops,op2,sizeof(ops)); #ifdef DEBUG printf("1op=%d 2op=%d result=%d\n",op1,op2,f>s); if (!f) printf("opcode=%d NOT in precedence list\n",op1); if (!s) printf("opcode=%d NOT in precedence list\n",op2); #endif return f>s; } #ifdef DECOMP_SWITCH static int check_switch(int firstcode) { return (firstcode == SWFACTION_PUSH || firstcode == SWFACTION_JUMP); } #endif static int decompileArithmeticOp(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *left, *right; int op_l = OpCode(actions, n, maxn); int op_r = OpCode(actions, n+1, maxn); right=pop(); left=pop(); switch(OpCode(actions, n, maxn)) { /* case SWFACTION_GETMEMBER: decompilePUSHPARAM(peek(),0); break; */ case SWFACTION_INSTANCEOF: if (precedence(op_l, op_r)) push(newVar3(getString(left)," instanceof ",getString(right))); else push(newVar_N("(",getString(left)," instanceof ",getString(right),0,")")); break; case SWFACTION_ADD: case SWFACTION_ADD2: if (precedence(op_l, op_r)) push(newVar3(getString(left),"+",getString(right))); else push(newVar_N("(",getString(left),"+",getString(right),0,")")); break; case SWFACTION_SUBTRACT: if (precedence(op_l, op_r)) push(newVar3(getString(left),"-",getString(right))); else push(newVar_N("(",getString(left),"-",getString(right),0,")")); break; case SWFACTION_MULTIPLY: if (precedence(op_l, op_r)) push(newVar3(getString(left),"*",getString(right))); else push(newVar_N("(",getString(left),"*",getString(right),0,")")); break; case SWFACTION_DIVIDE: if (precedence(op_l, op_r)) push(newVar3(getString(left),"/",getString(right))); else push(newVar_N("(",getString(left),"/",getString(right),0,")")); break; case SWFACTION_MODULO: if (precedence(op_l, op_r)) push(newVar3(getString(left),"%",getString(right))); else push(newVar_N("(",getString(left),"%",getString(right),0,")")); break; case SWFACTION_SHIFTLEFT: if (precedence(op_l, op_r)) push(newVar3(getString(left),"<<",getString(right))); else push(newVar_N("(",getString(left),"<<",getString(right),0,")")); break; case SWFACTION_SHIFTRIGHT: if (precedence(op_l, op_r)) push(newVar3(getString(left),">>",getString(right))); else push(newVar_N("(",getString(left),">>",getString(right),0,")")); break; case SWFACTION_SHIFTRIGHT2: if (precedence(op_l, op_r)) push(newVar3(getString(left),">>>",getString(right))); else push(newVar_N("(",getString(left),">>>",getString(right),0,")")); break; case SWFACTION_LOGICALAND: if (precedence(op_l, op_r)) push(newVar3(getString(left),"&&",getString(right))); else push(newVar_N("(",getString(left),"&&",getString(right),0,")")); break; case SWFACTION_LOGICALOR: if (precedence(op_l, op_r)) push(newVar3(getString(left),"||",getString(right))); else push(newVar_N("(",getString(left),"||",getString(right),0,")")); break; case SWFACTION_BITWISEAND: if (precedence(op_l, op_r)) push(newVar3(getString(left),"&",getString(right))); else push(newVar_N("(",getString(left),"&",getString(right),0,")")); break; case SWFACTION_BITWISEOR: if (precedence(op_l, op_r)) push(newVar3(getString(left),"|",getString(right))); else push(newVar_N("(",getString(left),"|",getString(right),0,")")); break; case SWFACTION_BITWISEXOR: if (precedence(op_l, op_r)) push(newVar3(getString(left),"^",getString(right))); else push(newVar_N("(",getString(left),"^",getString(right),0,")")); break; case SWFACTION_EQUALS2: /* including negation */ case SWFACTION_EQUAL: if( OpCode(actions, n+1, maxn) == SWFACTION_LOGICALNOT && OpCode(actions, n+2, maxn) != SWFACTION_IF) { op_r = OpCode(actions, n+1, maxn); if (precedence(op_l, op_r)) push(newVar3(getString(left),"!=",getString(right))); else push(newVar_N("(",getString(left),"!=",getString(right),0,")")); return 1; /* due negation op */ } if (precedence(op_l, op_r)) push(newVar3(getString(left),"==",getString(right))); else push(newVar_N("(",getString(left),"==",getString(right),0,")")); break; case SWFACTION_LESS2: if( OpCode(actions, n+1, maxn) == SWFACTION_LOGICALNOT && OpCode(actions, n+2, maxn) != SWFACTION_IF ) { op_r = OpCode(actions, n+2, maxn); if (precedence(op_l, op_r)) push(newVar3(getString(left),">=",getString(right))); else push(newVar_N("(",getString(left),">=",getString(right),0,")")); return 1; /* due negation op */ } if (precedence(op_l, op_r)) push(newVar3(getString(left),"<",getString(right))); else push(newVar_N("(",getString(left),"<",getString(right),0,")")); break; case SWFACTION_GREATER: if (precedence(op_l, op_r)) push(newVar3(getString(left),">",getString(right))); else push(newVar_N("(",getString(left),">",getString(right),0,")")); break; case SWFACTION_LESSTHAN: if (precedence(op_l, op_r)) push(newVar3(getString(left),"<",getString(right))); else push(newVar_N("(",getString(left),"<",getString(right),0,")")); break; case SWFACTION_STRINGEQ: if (precedence(op_l, op_r)) push(newVar3(getString(left),"==",getString(right))); else push(newVar_N("(",getString(left),"==",getString(right),0,")")); break; case SWFACTION_STRINGCOMPARE: puts("STRINGCOMPARE"); break; case SWFACTION_STRICTEQUALS: #ifdef DECOMP_SWITCH if (OpCode(actions, n, maxn) == SWFACTION_IF) { int code = actions[n+1].SWF_ACTIONIF.Actions[0].SWF_ACTIONRECORD.ActionCode; if(check_switch(code)) { push(right); // keep left and right side separated push(left); // because it seems we have found a switch(){} and break; // let decompileIF() once more do all the dirty work } } #endif if( OpCode(actions, n+1, maxn) == SWFACTION_LOGICALNOT && OpCode(actions, n+2, maxn) != SWFACTION_IF ) { op_r = OpCode(actions, n+2, maxn); if (precedence(op_l, op_r)) push(newVar3(getString(left),"!==",getString(right))); else push(newVar_N("(",getString(left),"!==",getString(right),0,")")); return 1; /* due negation op */ } else { if (precedence(op_l, op_r)) push(newVar3(getString(left),"===",getString(right))); else push(newVar_N("(",getString(left),"===",getString(right),0,")")); break; } default: printf("Unhandled Arithmetic/Logic OP %x\n", actions[n].SWF_ACTIONRECORD.ActionCode); } return 0; } static int isLogicalOp(int n, SWF_ACTION *actions, int maxn) { switch(OpCode(actions, n, maxn)) { case SWFACTION_LESSTHAN: case SWFACTION_LOGICALAND: case SWFACTION_LOGICALOR: case SWFACTION_LOGICALNOT: case SWFACTION_STRINGEQ: case SWFACTION_STRINGCOMPARE: case SWFACTION_LESS2: case SWFACTION_EQUALS2: case SWFACTION_EQUAL: case SWFACTION_BITWISEAND: case SWFACTION_BITWISEOR: case SWFACTION_BITWISEXOR: case SWFACTION_STRICTEQUALS: case SWFACTION_GREATER: /* case SWFACTION_GETMEMBER: */ return 1; default: return 0; } } static int isLogicalOp2(int n, SWF_ACTION *actions,int maxn) { switch(actions[n].SWF_ACTIONRECORD.ActionCode) { case SWFACTION_LOGICALNOT: case SWFACTION_PUSHDUP: case SWFACTION_IF: return 1; default: return 0; } } static int stackVal(int n, SWF_ACTION *actions) { if (!n) return 0; switch((actions[n-1]).SWF_ACTIONRECORD.ActionCode) { case SWFACTION_LOGICALNOT: case SWFACTION_DECREMENT: case SWFACTION_INCREMENT: case SWFACTION_RANDOMNUMBER: case SWFACTION_TOSTRING: case SWFACTION_TONUMBER: case SWFACTION_ORD: case SWFACTION_CHR: case SWFACTION_MBORD: case SWFACTION_MBCHR: case SWFACTION_INT: case SWFACTION_GETVARIABLE: case SWFACTION_SUBSTRING: case SWFACTION_MBSUBSTRING: case SWFACTION_GETMEMBER: case SWFACTION_ADD: case SWFACTION_ADD2: case SWFACTION_SUBTRACT: case SWFACTION_MULTIPLY: case SWFACTION_DIVIDE: case SWFACTION_MODULO: case SWFACTION_BITWISEAND: case SWFACTION_BITWISEOR: case SWFACTION_BITWISEXOR: case SWFACTION_LESSTHAN: case SWFACTION_LOGICALAND: case SWFACTION_LOGICALOR: case SWFACTION_STRINGEQ: case SWFACTION_STRINGCOMPARE: case SWFACTION_LESS2: case SWFACTION_EQUALS2: case SWFACTION_EQUAL: case SWFACTION_STRICTEQUALS: case SWFACTION_GREATER: case SWFACTION_STRINGGREATER: case SWFACTION_STRINGCONCAT: case SWFACTION_SHIFTLEFT: case SWFACTION_SHIFTRIGHT: case SWFACTION_SHIFTRIGHT2: case SWFACTION_INSTANCEOF: case SWFACTION_CALLMETHOD: case SWFACTION_CALLFUNCTION: case SWFACTION_GETTIME: case SWFACTION_GETPROPERTY: case SWFACTION_PUSH: case SWFACTION_DELETE: case SWFACTION_DELETE2: case SWFACTION_MBLENGTH: case SWFACTION_STRINGLENGTH: case SWFACTION_CASTOP: case SWFACTION_TYPEOF: case SWFACTION_PUSHDUP: return 1; default: return 0; } } static int decompileLogicalNot(int n, SWF_ACTION *actions, int maxn) { #ifdef STATEMENT_CLASS if(OpCode(actions, n-1, maxn) == SWFACTION_GETVARIABLE && OpCode(actions, n+1, maxn) == SWFACTION_LOGICALNOT && OpCode(actions, n+2, maxn) == SWFACTION_IF ) { /* It's a class statement -- skip over both NOTs */ return 1; } #endif if(OpCode(actions, n+1, maxn) != SWFACTION_IF ) push(newVar2("!",getString(pop()))); return 0; } static void decompilePUSH (SWF_ACTION *act) { int i; OUT_BEGIN(SWF_ACTIONPUSH); SanityCheck(SWF_PUSH, act->SWF_ACTIONRECORD.ActionCode == SWFACTION_PUSH, "not a PUSH") for(i=0;iNumParam;i++) push(&(sact->Params[i])); } static void decompilePUSHDUP (SWF_ACTION *act) { SanityCheck(SWF_PUSHDUP, act->SWF_ACTIONRECORD.ActionCode == SWFACTION_PUSHDUP, "not a PUSHDUP") pushdup(); } static void decompileSTACKSWAP (SWF_ACTION *act) { SanityCheck(SWF_STACKSWAP, act->SWF_ACTIONRECORD.ActionCode == SWFACTION_STACKSWAP, "not a STACKSWAP") stackswap(); } static int decompileSETPROPERTY(int n, SWF_ACTION *actions,int maxn) { struct SWF_ACTIONPUSHPARAM *val, *idx, *obj; INDENT val = pop(); idx = pop(); obj = pop(); #ifdef DEBUG printf("*setProp* objName %s (type=%d) Prop (type=%d) =%x\n", getName(obj), obj->Type, idx->Type,getInt(idx)); #endif if (obj->Type == PUSH_VARIABLE) puts("eval("); decompilePUSHPARAM(obj,0); if (obj->Type == PUSH_VARIABLE) puts(")"); puts("."); puts(getProperty(getInt(idx))); printf(" = " ); decompilePUSHPARAM(val,0); println(";"); return 0; } static int decompileGETPROPERTY(int n, SWF_ACTION *actions,int maxn) { struct SWF_ACTIONPUSHPARAM *idx, *obj; INDENT idx = pop(); obj = pop(); #ifdef DEBUG printf("*GETProp* objName %s (type=%d) Prop (type=%d) =%x\n", getName(obj), obj->Type, idx->Type,getInt(idx)); #endif if (obj->Type == PUSH_VARIABLE) push( newVar5("eval(",getName(obj),".",getProperty(getInt(idx)),")")); else push( newVar3( getName(obj),".",getProperty(getInt(idx)))); return 0; } static int decompileTRACE(int n, SWF_ACTION *actions, int maxn) { INDENT puts("trace("); decompilePUSHPARAM(pop(),1); println(");"); return 0; } static int decompileCALLFRAME(int n, SWF_ACTION *actions, int maxn) { INDENT puts("callFrame("); decompilePUSHPARAM(pop(),1); println(");"); return 0; } static int decompileGETTIME(int n, SWF_ACTION *actions, int maxn) { if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { INDENT println("getTimer();"); return 1; } else { push(newVar("getTimer()")); return 0; } } static int decompileINCR_DECR(int n, SWF_ACTION *actions, int maxn, int is_incr) { int is_postop; struct SWF_ACTIONPUSHPARAM *var=pop(); char *dblop=is_incr ? "++":"--"; if((OpCode(actions, n, maxn) == SWFACTION_PUSHDUP || OpCode(actions, n+1, maxn) == SWFACTION_PUSHDUP || OpCode(actions, n+1, maxn) == SWFACTION_SETVARIABLE) || ( OpCode(actions, n-1, maxn) == SWFACTION_GETVARIABLE && OpCode(actions, n+1, maxn) == SWFACTION_STOREREGISTER && OpCode(actions, n+1, maxn) == SWFACTION_SETVARIABLE)) { is_postop=(OpCode(actions, n-1, maxn) == SWFACTION_PUSHDUP)?1:0; if (is_postop) var = newVar2(getString(var),dblop); else var = newVar2(dblop,getString(var)); if (OpCode(actions, n+1, maxn) == SWFACTION_SETVARIABLE) { var->Type=11; /* later trigger printing variable inc/dec */ } else { var->Type=12; /* later be quiet, see decompileSETVARIABLE() */ if (is_postop) { pop(); push(var); /* will duplicate stacktop */ } } push(var); } else { if((OpCode(actions, n-1, maxn) == SWFACTION_GETMEMBER && OpCode(actions, n+1, maxn) == SWFACTION_STOREREGISTER && OpCode(actions, n+2, maxn) == SWFACTION_SETMEMBER ) || (OpCode(actions, n-1, maxn) == SWFACTION_STOREREGISTER && OpCode(actions, n+1, maxn) == SWFACTION_SETMEMBER && OpCode(actions, n+2, maxn) == SWFACTION_PUSH ) || (OpCode(actions, n-1, maxn) == SWFACTION_PUSH && OpCode(actions, n+1, maxn) == SWFACTION_SETMEMBER) || (OpCode(actions, n-3, maxn) == SWFACTION_GETMEMBER && OpCode(actions, n-2, maxn) == SWFACTION_PUSH && OpCode(actions, n-1, maxn) == SWFACTION_GETMEMBER && OpCode(actions, n+1, maxn) == SWFACTION_SETMEMBER && ((struct SWF_ACTIONPUSH *)&actions[n-2].SWF_ACTIONRECORD)->NumParam >= 4 /* 4: a pair of get/set - FIXME: add more analysis about stack here */)) { // incr/decr object variables with side effects is_postop= (OpCode(actions, n+1, maxn) == SWFACTION_SETMEMBER)?1:0; if (is_postop) var = newVar2(getString(var),dblop); else var = newVar2(dblop,getString(var)); if (is_postop && OpCode(actions, n-1, maxn) == SWFACTION_PUSH) pop(); if(OpCode(actions, n+1, maxn) == SWFACTION_GETMEMBER) pop(); pop(); pop(); var->Type=12; // to be quiet later in ...SETMEMBER() regs[0]=var; // FIXME: r0 perhaps a ming special push(var); push(var); push(var); if (is_postop && OpCode(actions, n-1, maxn) == SWFACTION_PUSH ) push(var); if (is_postop && OpCode(actions, n-1, maxn) == SWFACTION_GETMEMBER ) push(var); } else { if(OpCode(actions, n-1, maxn) == SWFACTION_PUSH && OpCode(actions, n+1, maxn) == SWFACTION_STOREREGISTER && regs[actions[n+1].SWF_ACTIONSTOREREGISTER.Register]->Type == PUSH_VARIABLE) { var = newVar2(dblop,getString(var)); if ((OpCode(actions, n+2, maxn) == SWFACTION_POP && actions[n-1].SWF_ACTIONPUSH.NumParam==1) || OpCode(actions, n+3, maxn) == SWFACTION_POP) { var->Type=11; // later print inc/dec } else { var->Type=12; // later be quiet in ..STOREREGISTER() if (actions[n-1].SWF_ACTIONPUSH.NumParam>1) { pop(); push(var); } } push(var); } else // fallback to old incr/decr code { // FIXME: this is bad designed for handling side effect code INDENT // like post-incrementing a function argument etc. decompilePUSHPARAM(var,0); puts(dblop); println(";"); push(var); } } } return 0; } static int decompileSTOREREGISTER(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *data; OUT_BEGIN2(SWF_ACTIONSTOREREGISTER); data=peek(); if (!regs[sact->Register] || sact->Register==0 ) // ===internal=== { regs[sact->Register] = data; } else // ===user visible level=== { if ( regs[sact->Register]->Type == PUSH_VARIABLE) // V7: a named function parameter in register { // V7: a local var in register if (data->Type==12) data->Type = PUSH_VARIABLE; // do nothing, but only once else { char *l=getName(regs[sact->Register]); char *r=getName(data); if (strcmp(l,r)) { INDENT if (data->Type==11) { println("%s;", r); } else { printf("%s = ",l); decompilePUSHPARAM(data,1); println(";"); } } } } } return 0; } static int decompileNEWOBJECT(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *obj, *nparam; obj = pop(); nparam=pop(); push(newVar_N("new ","",getName(obj),"(", nparam->p.Integer,")")); return 0; } static int decompileNEWMETHOD(int n, SWF_ACTION *actions, int maxn) { char *t; struct SWF_ACTIONPUSHPARAM *meth, *nparam, *obj; meth = pop(); obj = pop(); nparam=pop(); t=malloc(strlen( getName(obj) ) +2); strcpy(t,getName(obj)); strcat(t,"."); push(newVar_N("new ",t,getName(meth),"(", nparam->p.Integer,")")); free (t); return 0; } static int decompileGETMEMBER(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *obj, *mem, *var; char *vname, *varname,*memname; int len; mem=pop(); var=pop(); varname=getName(var); memname=getName(mem); #ifdef DEBUG printf("*getMember* varName %s (type=%d) memName=%s (type=%d)\n", varname,var->Type, memname,mem->Type); #endif len = strlen(varname)+strlen(memname); if (mem->Type == PUSH_INT || mem->Type == PUSH_DOUBLE || mem->Type == PUSH_VARIABLE || mem->Type == PUSH_REGISTER || mem->Type == 12 ) { vname = malloc(len+3); strcpy(vname,varname); strcat(vname,"["); strcat(vname,memname); strcat(vname,"]"); } else { vname = malloc(len+2); strcpy(vname,varname); strcat(vname,"."); strcat(vname,memname); } obj = newVar(vname); pushvar(obj); return 0; } static int decompileSETMEMBER(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *val, *var, *obj; val = pop(); var = pop(); obj = pop(); #ifdef DEBUG printf("*SETMember* varName %s (type=%d) objName=%s (type=%d)\n",getName(var),var->Type, getName(obj),obj->Type); #endif if (obj->Type == 12) /* do nothing: inline inc/dec using side effect */ { obj->Type = PUSH_VARIABLE; /* ...but only once */ return 0; } INDENT if (obj->Type == 11) /* simply output variable and inc/dec op */ { decompilePUSHPARAM(obj,0); println(";"); return 0; } decompilePUSHPARAM(obj,0); if (var->Type == PUSH_INT || var->Type == PUSH_DOUBLE || var->Type == PUSH_VARIABLE || var->Type == PUSH_REGISTER || var->Type == 12 ) { puts("["); } else { puts("."); if (OpCode(actions, n-1, maxn) == SWFACTION_STOREREGISTER) { struct SWF_ACTIONSTOREREGISTER *sactv2 = (struct SWF_ACTIONSTOREREGISTER*)&actions[n-1]; if (sactv2->Register==0) regs[0]=newVar3(getName(obj),".",getName(var)); // easter 07: some sugar for mtc et al. } } decompilePUSHPARAM(var,0); if (var->Type == PUSH_INT || var->Type == PUSH_DOUBLE || var->Type == PUSH_VARIABLE || var->Type == PUSH_REGISTER || var->Type == 12 ) { puts("]"); } printf(" = " ); if ( OpCode(actions, n-1, maxn) == SWFACTION_STOREREGISTER ) { struct SWF_ACTIONSTOREREGISTER *sr = (struct SWF_ACTIONSTOREREGISTER*)&actions[n-1]; printf("R%d", sr->Register); } else if (val->Type != PUSH_VARIABLE) { /* later it will be a switch{} */ decompilePUSHPARAM(val,1); } else { decompilePUSHPARAM(val,0); } println(";"); return 0; } static int decompileGETVARIABLE(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *var; var = pop(); #ifdef DEBUG printf("*GETVariable* varName %s (type=%d)\n",getName(var),var->Type); #endif if (var->Type == PUSH_VARIABLE) pushvar(newVar3("eval(",getName(var),")")); else pushvar(newVar(getName(var))); return 0; } static int decompileSETVARIABLE(int n, SWF_ACTION *actions,int maxn,int islocalvar) { struct SWF_ACTIONPUSHPARAM *val, *var; val = pop(); var = pop(); if (val->Type!=12) { INDENT } #ifdef DEBUG printf("*SETVariable* varName %s (type=%d) valName=%s (type=%d)\n", getName(var),var->Type, getName(val),val->Type); #endif if (val->Type!=12 && islocalvar) { puts("var "); } if (gIndent<0) /* the ENUM workaround: */ { /* in "for (xx in yy) { }" we need xx, but nothing else */ puts(getName(var)); return 0; } switch (val->Type) { case 10: puts(getName(var)); // Variable (NEVER as string) printf(" = " ); decompilePUSHPARAM(val,0); println(";"); break; case 11: /* simply output variable and inc/dec op */ puts(getName(val)); println(";"); break; case 12: /* do nothing: inline increment/decrement (using side effect only) */ val->Type = PUSH_VARIABLE; // but print next time e.g. in y=++x; break; default: puts(getName(var)); printf(" = " ); decompilePUSHPARAM(val,1); // for certain types parameter 1 does not care println(";"); } return 0; } static int decompileRETURN(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *var=pop(); INDENT printf("return "); if (var->Type== PUSH_REGISTER && var->p.RegisterNumber==0) /* REGISTER 0 used as helper variable */ puts(getName(regs[0])); else decompilePUSHPARAM(var,1); println(";"); return 0; } static int decompileJUMP(int n, SWF_ACTION *actions, int maxn) { int i=0,j=0; int offSave; struct SWF_ACTIONIF *sactif; OUT_BEGIN2(SWF_ACTIONJUMP); sactif=NULL; if(isLogicalOp(n+1, actions, maxn) || (OpCode(actions, n+1, maxn) == SWFACTION_PUSH && isLogicalOp(n+2, actions, maxn))) { /* Probably the start of a do {} while(), so skip it */ return 0; } /* Probably the end of a switch{}, so skip it */ if (OpCode(actions, n+1, maxn) == SWFACTION_POP) return 1; if (OpCode(actions, n+1, maxn) == SWFACTION_JUMP) { if (actions[n+1].SWF_ACTIONJUMP.BranchOffset==0) return 1; } for(i=0; n + 1 + i < maxn && (actions[(n+1)+i].SWF_ACTIONRECORD.Offset < (actions[n+1].SWF_ACTIONRECORD.Offset+actions[n ].SWF_ACTIONJUMP.BranchOffset)); i++) { #if 0 printf("/* for PART3 OP 0x%x */\n",actions[n+1+i].SWF_ACTIONRECORD.ActionCode); #endif ; // NOOP } if (i) { for (j=0; n+j+iActions[sactif->numActions-1].SWF_ACTIONRECORD.ActionCode==SWFACTION_JUMP && sactif->Actions[sactif->numActions-1].SWF_ACTIONJUMP.BranchOffset+ sactif->Actions[sactif->numActions-1].SWF_ACTIONJUMP.Offset== actions[n].SWF_ACTIONRECORD.Offset ) { break; } else sactif=NULL; } } } if (sactif) { INDENT puts("while("); decompileActions(j-1, &actions[n+1+i], gIndent); puts(getName(pop())); println("){ /* original FOR loop rewritten to WHILE */"); offSave=offseoloop; if (n+i+j+1numActions-1, sactif->Actions,gIndent+1); decompileActions(i, &actions[n+1], gIndent+1); offseoloop=offSave; INDENT println("};"); return i+j; } if (sact->BranchOffset>0) { if ( stackVal(n,actions) == 1 && n+1==maxn) { // leaving block @last op with value on stack: a return x; return decompileRETURN(n, actions,maxn); } if (n+2 < maxn && OpCode(actions, n+1, maxn) == SWFACTION_PUSH && actions[n+2].SWF_ACTIONRECORD.Offset == actions[n+1].SWF_ACTIONRECORD.Offset+sact->BranchOffset) { return 1; // jump to short to be a 'break': but an internal jump over a push } // to do: add some control flow analysis INDENT if (offseoloop==actions[n].SWF_ACTIONRECORD.Offset+sact->BranchOffset+5) puts("break;" ); else puts("return;" ); println("\t\t\t// offs_end_of_loop=%d offs_jmp_dest=%d", offseoloop, actions[n].SWF_ACTIONRECORD.Offset+sact->BranchOffset+5); } else { if (sact->BranchOffset<0) { INDENT println("continue; /*------*/"); } } /* error("Unhandled JUMP"); */ return 0; } static int decompileDEFINELOCAL2(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *var; INDENT var = pop(); puts("var "); puts(getName(var)); println(";"); return 0; } static int decompileENUMERATE(int n, SWF_ACTION *actions, int maxn, int is_type2) { int i=0; while (i < maxn && i < 5 && OpCode(actions, n+i, maxn)) i++; INDENT println("/* a for-var-in loop should follow below: */" ); return i-1; // preserve some code for decompileIF()... } // ... and let decompileIF() do all the dirty work ;-) #ifdef DECOMP_SWITCH // [recursive] estimate size of buffer needed for decompiling 'switch' // [ only call by decompileIF() ] // static int countAllSwitchActions (union SWF_ACTION *actions, union SWF_ACTION *pre) { int i,j=1; if (actions->SWF_ACTIONRECORD.ActionCode==SWFACTION_IF && pre->SWF_ACTIONRECORD.ActionCode==SWFACTION_STRICTEQUALS ) { for(i=0; i < ((struct SWF_ACTIONIF*)actions)->numActions; i++) { j+=countAllSwitchActions(&((struct SWF_ACTIONIF*)actions)->Actions[i],pre); pre=&((struct SWF_ACTIONIF*)actions)->Actions[i]; } } return j; } // [recursive] copy all actions in a 'flat' buffer by // unpackung all if-actions that are part of the switch operation // [ only call by decompileIF() ] // static union SWF_ACTION * getAllSwitchActions(union SWF_ACTION *dest, union SWF_ACTION *actions, union SWF_ACTION *pre) { #ifdef DEBUGSWITCH println("SWCODE: %p %d %s %s", dest, actions->SWF_ACTIONRECORD.Offset, actionName(actions->SWF_ACTIONRECORD.ActionCode), actionName(pre->SWF_ACTIONRECORD.ActionCode)); #endif *dest++=*actions; if (actions->SWF_ACTIONRECORD.ActionCode==SWFACTION_IF && pre->SWF_ACTIONRECORD.ActionCode==SWFACTION_STRICTEQUALS ) { int i; struct SWF_ACTIONIF *sactv2 = (struct SWF_ACTIONIF*)actions; for(i=0; i< sactv2->numActions; i++) { dest=getAllSwitchActions(dest,&sactv2->Actions[i],pre); pre=&((struct SWF_ACTIONIF*)actions)->Actions[i]; } } return dest; } // looks similar other decompileXXXX() but // can't called by decompileAction() // [ do only call by decompileIF() ] // static int decompile_SWITCH(int n, SWF_ACTION *actions, int maxn, int off1end) { int i,j; int start; // base action index for case value and code int ccsize=0; // size of code for case value int cvsize=0; // size of case value int maxoff=0; // action offset AFTER switch int n_maxoff=0; // array index of maxoff int pend=0; // control pending output int xsize=0; // ret val int jmpsize=0; // debug helper int lastoff=0; // debug helper int n_firstactions=maxn;// array index of 1st case actions code int lastcasestart=0; // offs where last "case x:" begins char *defa="[last]"; // debug helper for early "default:" char *tmp=NULL; // helper for pending output struct strbufinfo origbuf; // pending output buffer struct _stack *StackSave; struct SWF_ACTIONPUSHPARAM *swcopy,*sw=pop(); struct SWF_ACTIONPUSHPARAM *compare=pop(); int offSave; for (i=0; i=0;i--) // seek from end of block last op of switch{} { if (OpCode(actions, i, maxn) == SWFACTION_JUMP && !actions[i].SWF_ACTIONJUMP.BranchOffset) { maxoff=actions[i].SWF_ACTIONRECORD.Offset+5; j=2; break; } } } for (i=0;i=maxoff) { n_maxoff=i; // part of block is switch break; } } if (!n_maxoff) n_maxoff=maxn; // whole block is switch INDENT println("switch( %s ) { // end switch at %d (index %d) / found via meth %d)", getString(sw), maxoff,n_maxoff,j); push(sw); push(compare); i=1; do // here we go into main loop { if((OpCode(actions, i, maxn) == SWFACTION_IF && OpCode(actions, i-1, maxn) == SWFACTION_STRICTEQUALS ) ||(OpCode(actions, i, maxn) == SWFACTION_JUMP && OpCode(actions, i-1, maxn) == SWFACTION_IF) ) { start=i; while (startlastcasestart) xsize+=ccsize; else defa="[early]"; println("default: // at %d %s start=%d ccsize=%d", actions[start].SWF_ACTIONRECORD.Offset,defa, start, ccsize); } } else { INDENT xsize=ccsize; lastcasestart=actions[start].SWF_ACTIONRECORD.Offset; println("case %s: // at %d start=%d ccsize=%d jmp=%d+%d+5", getString(pop()), lastcasestart, start, ccsize, lastoff,jmpsize); swcopy=pop(); // SanityCheck(decompile_SWITCH,!strcmp(getName(swcopy),getName(sw)),"sw0 != sw"); } #if USE_LIB origbuf=setTempString(); // switch to temp buffer #endif StackSave=Stack; offSave=offseoloop; offseoloop=maxoff; decompileActions( ccsize, &actions[start],gIndent+1); offseoloop=offSave; Stack=StackSave; #if USE_LIB tmp=switchToOrigString(origbuf); #endif if (actions[i].SWF_ACTIONRECORD.ActionCode==SWFACTION_JUMP) // after "default:" { break; // ready } else { if (actions[i+1].SWF_ACTIONRECORD.ActionCode!=SWFACTION_JUMP) // not before "default:" or end { i++; // the 'if' itself cvsize=0; while (i+cvsize < n_firstactions && actions[i+cvsize].SWF_ACTIONRECORD.ActionCode!=SWFACTION_STRICTEQUALS) { #ifdef DEBUGSWITCH println("in cvsize=%d %d %s", cvsize, actions[i+cvsize].SWF_ACTIONRECORD.Offset, actionName(actions[i+cvsize].SWF_ACTIONRECORD.ActionCode)); #endif cvsize++; // count "case X:" code size } decompileActions( cvsize, &actions[i],gIndent+1); // at least one push on stack expected i+=cvsize; } } } } while (++i < n_firstactions); #if USE_LIB if (tmp) { puts(tmp); // print last pending output free(tmp); } #endif INDENT println("} // switch ret value =%d",xsize); return xsize; } #endif static int decompileIF(int n, SWF_ACTION *actions, int maxn) { int offSave; int j,i=0; struct strbufinfo origbuf; OUT_BEGIN2(SWF_ACTIONIF); /* * IF is used in various way to implement different types * of loops. We try to detect these different types of loops * here. */ #ifdef STATEMENT_CLASS if((OpCode(actions, n-1, maxn) == SWFACTION_LOGICALNOT) && (OpCode(actions, n-2, maxn) == SWFACTION_LOGICALNOT) && (OpCode(actions, n-3, maxn) == SWFACTION_GETVARIABLE) && (OpCode(actions, n-4, maxn) == SWFACTION_PUSH) ) { /* It's really a class definition */ INDENT puts("class "); decompilePUSHPARAM(newVar(getName(pop())),0); println(" {" ); decompileActions(sact->numActions, sact->Actions,gIndent+1); INDENT println("}"); return 0; } if( (OpCode(actions, n-1, maxn) == SWFACTION_LOGICALNOT) && (OpCode(actions, n-2, maxn) == SWFACTION_LOGICALNOT) && (OpCode(actions, n-3, maxn) == SWFACTION_GETMEMBER) && (OpCode(actions, n-4, maxn) == SWFACTION_PUSH) ) { /* It's really a class definition */ INDENT println(" {"); decompileActions(sact->numActions, sact->Actions,gIndent+1); INDENT println("}"); return 0; } #endif /* * do {} while() loops have a JUMP at the end of the if clause * that points to a JUMP above the IF statement. */ if(n && isLogicalOp(n-1, actions, maxn) && (sact->Actions[sact->numActions-1].SWF_ACTIONRECORD.ActionCode == SWFACTION_JUMP) && ( (sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.Offset + sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset) < actions[n].SWF_ACTIONRECORD.Offset) && isLogicalOp(sact->numActions-2, sact->Actions, maxn) ) { INDENT println("do {"); offSave=offseoloop; offseoloop=actions[n].SWF_ACTIONRECORD.Offset+5; decompileActions(sact->numActions-1, sact->Actions,gIndent+1); offseoloop=offSave; INDENT puts("while( "); puts(getName(pop())); puts(");"); return 0; } /* ak,2006 * lots of "do {} while()" have simply a CONDITIONED JUMP back at the end of the loop */ if( actions[n].SWF_ACTIONJUMP.BranchOffset < 0 ) { INDENT println("do { /* 2nd type */ "); offSave=offseoloop; offseoloop=actions[n ].SWF_ACTIONRECORD.Offset+5; decompileActions(sact->numActions, sact->Actions,gIndent+1); offseoloop=offSave; INDENT puts("} while( "); puts(getName(pop())); println(");"); return 0; } j=0; while (OpCode(actions, n-j, maxn) != SWFACTION_ENUMERATE && OpCode(actions, n-j, maxn) != SWFACTION_ENUMERATE2 && jActions[1].SWF_ACTIONRECORD.ActionCode == SWFACTION_STOREREGISTER) { struct SWF_ACTIONSTOREREGISTER *sactv2 = (struct SWF_ACTIONSTOREREGISTER*)&sact->Actions[1]; puts("var "); puts(getName(regs[sactv2->Register])); x=3; } else { decompileActions( 2 , sact->Actions,-1); /* -1 == the ENUM workaround */ x=2; } puts(" in "); puts(getName(var)); println(" ) {"); if(n+1 >= maxn) { SWF_warn("Warning: %s:%i: something is wrong here\n", __FILE__, __LINE__); } else { offSave=offseoloop; offseoloop=actions[n+1].SWF_ACTIONRECORD.Offset; decompileActions(sact->numActions-1-x, &sact->Actions[x],gIndent+1); offseoloop=offSave; } INDENT println("}"); return 0; } /* * while() loops have a JUMP at the end of the if clause that jumps backwards * But also "continue" statements could jump backwards. */ if( isLogicalOp(n-1, actions, maxn) && ( (sact->Actions[sact->numActions-1].SWF_ACTIONRECORD.ActionCode == SWFACTION_JUMP) && sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset < 0) ) { if(0) dumpRegs(); INDENT /* if on a level >0 we can check for any outer loop To do: get the level on a better way than using gIndent */ if (gIndent && actions[maxn-1].SWF_ACTIONRECORD.ActionCode==SWFACTION_JUMP && actions[maxn-1].SWF_ACTIONJUMP.Offset+actions[maxn].SWF_ACTIONJUMP.BranchOffset== sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.Offset+sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset) { /* this jump leads from a block to start of a loop on outer block: it is an 'if' later followed by last action 'continue' */ SWF_warn("WARNING: this might be wrong (%s:%i)\n", __FILE__, __LINE__); puts("if ( "); puts(getName(pop())); println(" ) {"); decompileActions(sact->numActions, sact->Actions,gIndent+1); } else /* while(){} as usual */ { puts("while( "); puts(getName(pop())); println(" ) {"); offSave=offseoloop; offseoloop=actions[n+1].SWF_ACTIONRECORD.Offset; decompileActions(sact->numActions-1, sact->Actions,gIndent+1); offseoloop=offSave; } INDENT println("}"); return 0; } { // WTF ??? #define SOME_IF_DEBUG 0 /* coders only */ int has_else_or_break= ((sact->Actions[sact->numActions-1].SWF_ACTIONRECORD.ActionCode == SWFACTION_JUMP) && (sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset > 0 )) ? 1:0; int has_lognot=(actions[n-1].SWF_ACTIONRECORD.ActionCode == SWFACTION_LOGICALNOT) ? 1:0; int else_action_cnt=0,is_logor=0,is_logand=0,sbi,sbe; /* before emitting any "if"/"else" characters let's check for a ternary operation cond?a:b */ if (has_else_or_break) { int limit=actions[n+1].SWF_ACTIONRECORD.Offset + sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset; /* Count the number of action records that are part of * the else clause, and then decompile only that many. */ for(else_action_cnt=0; else_action_cnt+n+1numActions-1,sact->Actions); sbe=stackVal (else_action_cnt,&actions[n+1]); // check against opcodes we do not expect in a ternary operation if (sbi==1 && sbe==1) { for (j=0;jnumActions-1;j++) { if (sact->Actions[j].SWF_ACTIONRECORD.ActionCode==SWFACTION_JUMP) // perhaps more ops { sbi=i=has_else_or_break=0; break; } } for (j=0;jnumActions-1); printf("Else Actions=%d\n",else_action_cnt); #endif struct strbufinfo origbuf; #if USE_LIB origbuf=setTempString(); /* switch to a temporary string buffer */ #endif puts("("); puts(getName(pop())); puts(" ? "); decompileActions(else_action_cnt , &actions[n+1],0); puts(getName(pop())); puts(" : "); decompileActions(sact->numActions-1, sact->Actions,0); puts(getName(pop())); puts(")"); #if USE_LIB push (newVar(dcgetstr())); /* push for later assignment */ setOrigString(origbuf); /* switch back to orig buffer */ #else push (newVar("/* ternary op: see code above */")); #endif } else { /* at this point let's check for conditioned jumps that are NOT 'if': currently that is code for the locical operations && and || */ if (OpCode(actions, n-1, maxn) == SWFACTION_PUSHDUP) is_logor=1; if (OpCode(actions, n-2, maxn)== SWFACTION_PUSHDUP && OpCode(actions, n-1, maxn) == SWFACTION_LOGICALNOT) { is_logand=1; } if (is_logor || is_logand) { #if SOME_IF_DEBUG println(""); println("/* detected LOGICAL %s: %d actions*/", is_logor ? "OR":"AND",sact->numActions); #endif #if USE_LIB origbuf=setTempString(); /* switch to a temporary string buffer */ #endif puts(getName(pop())); /* get left side of logical or */ puts(is_logor ? " || ":" && "); decompileActions(sact->numActions, sact->Actions,gIndent+1); puts(getName(pop())); /* get right side of logical or */ #if USE_LIB push(newVar(dcgetstr())); setOrigString(origbuf); /* switch back to orig buffer */ #else push (newVar("/* see logical term lines above */")); #endif return 0; } #ifdef DECOMP_SWITCH if ( OpCode(actions, n-1, maxn) == SWFACTION_STRICTEQUALS && check_switch(sact->Actions[0].SWF_ACTIONRECORD.ActionCode) ) { union SWF_ACTION *xact,*xact0; for(i=n-1,j=0; i< maxn ;i++) // n-1 due adding 1st SWFACTION_STRICTEQUALS in buffer { j+=countAllSwitchActions(&actions[i],&actions[i-1]); // FIRST count size of code } xact0=xact = (union SWF_ACTION *) calloc (j,sizeof (SWF_ACTION)); INDENT println("// checking %d actions for switch(){}",j); for(i=n-1; i< maxn ;i++) { xact=getAllSwitchActions(xact,&actions[i],&actions[i-1]); // SECOND copy into xtra buffer } j=decompile_SWITCH(0,xact0,j,actions[n+1].SWF_ACTIONRECORD.Offset); // THIRD decompile xtra buffer free(xact0); return j; } #endif /* it seems we have a found the REAL 'if' statement, so it's right time to print the "if" just NOW! */ INDENT puts("if( "); puts(getName(pop())); /* the condition itself */ println(" ) {"); if ( has_else_or_break ) { int limit=actions[n+1].SWF_ACTIONRECORD.Offset + sact->Actions[sact->numActions-1].SWF_ACTIONJUMP.BranchOffset; // limit == dest of jmp == offset next op after 'if' + jumpdist at end of 'if' int lastopsize=actions[maxn-1].SWF_ACTIONRECORD.Length; if (actions[maxn-1].SWF_ACTIONRECORD.ActionCode == SWFACTION_IF) lastopsize+=actions[maxn-1].SWF_ACTIONIF.BranchOffset + 3; /* +3 see parser.c: "Action + Length bytes not included in the length" */ if (offseoloop && ! (has_lognot && OpCode(actions, n-2, maxn) == SWFACTION_EQUALS2 && OpCode(actions, n-3, maxn) == SWFACTION_PUSH && OpCode(actions, n-4, maxn) == SWFACTION_PUSHDUP) && limit > actions[maxn-1].SWF_ACTIONRECORD.Offset+lastopsize) { /* the jump leads outside this limit, so it is a simple 'if' with a 'break' or 'return' at the end, and there is NO else clause. */ INDENT println("// offs_endjump_dest=%d offs_after_blk %d", limit, actions[maxn-1].SWF_ACTIONRECORD.Offset+lastopsize); decompileActions(sact->numActions, sact->Actions,gIndent+1); i=0; /* found break/return but no else and thus return 0 */ } else { /* There is an else clause also! (action counter is set above) */ struct _stack *StackSave=Stack; /* decompile if and else blocks at same stack base */ if (has_lognot) { decompileActions(sact->numActions-1, sact->Actions,gIndent+1); INDENT println("} else {"); } Stack=StackSave; decompileActions(else_action_cnt , &actions[n+1],gIndent+1); if (!has_lognot) /* the missing if-part just NOW */ { Stack=StackSave; INDENT println ("} else {" ); decompileActions(sact->numActions-1, sact->Actions,gIndent+1); } } } else { /* It's a simple if() {} */ decompileActions(sact->numActions, sact->Actions,gIndent+1); } INDENT println("}"); } // WTF ??? return i; } return 0; } static int decompileINITOBJECT(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *nparam; nparam=pop(); push(newVar_N2("","","","{", nparam->p.Integer,"}")); return 0; } static int decompileWITH(int n, SWF_ACTION *actions, int maxn) { OUT_BEGIN2(SWF_ACTIONWITH); INDENT puts("with("); decompilePUSHPARAM(pop(),0); puts(")"); println(" {" ); decompileActions(sact->numActions, sact->Actions,gIndent+1); INDENT println("}" ); return 1; } static int decompileTRY(int n, SWF_ACTION *actions, int maxn) { #ifdef DEBUG struct _stack *StackSave=Stack; #endif OUT_BEGIN2(SWF_ACTIONTRY); INDENT println("try {"); decompileActions(sact->numTryActs, sact->TryActs,gIndent+1); INDENT println("}"); #ifdef DEBUG if (Stack!=StackSave) { println("/* Stack problem in try{} code above */"); Stack=StackSave; } #endif if (sact->numCatchActs) { struct SWF_ACTIONPUSHPARAM *rsave=NULL; INDENT if( ! sact->CatchInRegisterFlag) println("catch (%s) {",sact->CatchName); else { char *t=malloc(5); /* Rddd */ sprintf(t,"R%d", sact->CatchRegister ); rsave=regs[sact->CatchRegister]; regs[sact->CatchRegister] = newVar(t); println("catch (%s) {",t); } decompileActions(sact->numCatchActs, sact->CatchActs,gIndent+1); INDENT println("}"); if (rsave) regs[sact->CatchRegister]=rsave; #ifdef DEBUG if (Stack!=StackSave) { println("/* Stack problem in catch{} code above */"); Stack=StackSave; } #endif } if (sact->numFinallyActs) { INDENT println("finally () {"); decompileActions(sact->numFinallyActs, sact->FinallyActs,gIndent+1); INDENT println("}"); #ifdef DEBUG if (Stack!=StackSave) { println("/* Stack problem in finally{} code above */"); Stack=StackSave; } #endif } return 0; } static int decompileDEFINEFUNCTION(int n, SWF_ACTION *actions, int maxn, int is_type2) { int i,j,k,m,r; struct SWF_ACTIONPUSHPARAM *myregs[ 256 ]; struct _stack *StackSave; struct SWF_ACTIONDEFINEFUNCTION2 *sactv2; struct strbufinfo origbuf; OUT_BEGIN2(SWF_ACTIONDEFINEFUNCTION); sactv2 = (struct SWF_ACTIONDEFINEFUNCTION2*)sact; #ifdef DEBUG if(n+1 < maxn) { println("/* function followed by OP %x */", OpCode(actions, n+1, maxn)); } #endif #if USE_LIB if (isStoreOp(n+1, actions,maxn) || ( *sact->FunctionName==0 && !is_type2 ) || (*sactv2->FunctionName==0 && is_type2 )) { origbuf=setTempString(); /* switch to a temporary string buffer */ } #endif puts("function "); if (is_type2) { for(j=1;jRegisterCount;j++) { myregs[j]=regs[j]; regs[j]=NULL; } r=1; if (sactv2->PreloadThisFlag) regs[r++]=newVar("this"); if (sactv2->PreloadArgumentsFlag) regs[r++]=newVar("arguments"); if (sactv2->PreloadSuperFlag) regs[r++]=newVar("super"); if (sactv2->PreloadRootFlag) regs[r++]=newVar("root"); if (sactv2->PreloadParentFlag) regs[r++]=newVar("parent"); if (sactv2->PreloadGlobalFlag) regs[r++]=newVar("global"); puts(sactv2->FunctionName); puts("("); for(i=0,m=0;iNumParams;i++) { puts(sactv2->Params[i].ParamName); if ( sactv2->Params[i].Register) { printf(" /*=R%d*/ ",sactv2->Params[i].Register); regs[sactv2->Params[i].Register] = newVar(sactv2->Params[i].ParamName); m++; // do not count 'void' etc } if( sactv2->NumParams > i+1 ) puts(","); } println(") {" ); if (r+m < sactv2->RegisterCount) { INDENT puts(" var "); } for(k=r;rRegisterCount;r++) { if (!regs[r]) { char *t=malloc(5); /* Rddd */ sprintf(t,"R%d", r ); puts (t); if (k++ < sactv2->RegisterCount- m -1) puts(", "); else println(";" ); regs[r]=newVar(t); } } StackSave=Stack; decompileActions(sactv2->numActions, sactv2->Actions,gIndent+1); #ifdef DEBUG if (Stack!=StackSave) { println("/* Stack problem in function code above */"); } #endif Stack=StackSave; for(j=1;jRegisterCount;j++) regs[j]=myregs[j]; } else { puts(sact->FunctionName); puts("("); for(i=0;iNumParams;i++) { puts(sact->Params[i]); if( sact->NumParams > i+1 ) puts(","); } println(") {" ); k=0; if (sact->Actions[0].SWF_ACTIONRECORD.ActionCode == SWFACTION_PUSH) { struct SWF_ACTIONPUSH *sactPush=(struct SWF_ACTIONPUSH *)sact->Actions; for(i=0;iNumParam;i++) { if ((&(sactPush->Params[i]))->Type == PUSH_REGISTER) k++; /* REGISTER */ } if (k) { INDENT puts(" var "); for(i=1;i<=k;i++) { char *t=malloc(5); /* Rddd */ sprintf(t,"R%d", i ); puts (t); if (i < k) puts(", "); else println(";" ); regs[i]=newVar(t); } } } for(j=1;j<=k;j++) myregs[j]=regs[j]; StackSave=Stack; decompileActions(sact->numActions, sact->Actions,gIndent+1); #ifdef DEBUG if (Stack!=StackSave) { println("/* Stack problem in function code above */"); } #endif Stack=StackSave; for(j=1;j<=k;j++) regs[j]=myregs[j]; } INDENT if (isStoreOp(n+1, actions,maxn) || ( *sact->FunctionName==0 && !is_type2 ) || (*sactv2->FunctionName==0 && is_type2 )) { puts("}"); #if USE_LIB push (newVar(dcgetstr())); /* push func body for later assignment */ setOrigString(origbuf); /* switch back to orig buffer */ #else push (newVar("/* see function code above */")); /* workaround only if LIB is not in use */ #endif } else println("}" ); return 0; } static int decompileCALLMETHOD(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *meth, *obj, *nparam; meth=pop(); obj=pop(); nparam=pop(); if (nparam->p.Integer>25) { INDENT println("// Problem getting method arguments (%d ignored) below:", nparam->p.Integer); nparam->p.Integer=0; } #ifdef DEBUG printf("*CALLMethod* objName=%s (type=%d) methName=%s (type=%d)\n", getName(obj), obj->Type, getName(meth), meth->Type); #endif if (meth->Type == PUSH_UNDEF) /* just undefined, like in "super();" */ push(newVar_N(getName(obj),"","","(", nparam->p.Integer,")")); else { if (meth->Type == PUSH_INT || meth->Type == PUSH_DOUBLE || meth->Type == PUSH_VARIABLE || meth->Type == PUSH_REGISTER || meth->Type == 12 ) { push(newVar_N(getName(obj),"[",getName(meth),"](", nparam->p.Integer,")")); } else push(newVar_N(getName(obj),".",getName(meth),"(", nparam->p.Integer,")")); } if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { /* call method and throw away any result */ INDENT puts(getName(pop())); println(";" ); return 1; } return 0; } static int decompileCALLFUNCTION(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *meth, *nparam; SanityCheck(SWF_CALLMETHOD, actions[n-1].SWF_ACTIONRECORD.ActionCode == SWFACTION_PUSH, "CALLMETHOD not preceeded by PUSH") meth=pop(); nparam=pop(); if (nparam->p.Integer>25) { INDENT println("// Problem getting function arguments (%d ignored) below:", nparam->p.Integer); nparam->p.Integer=0; } push(newVar_N("","",getName(meth),"(", nparam->p.Integer,")")); if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { /* call function and throw away any result */ INDENT puts(getName(pop())); println(";" ); return 1; } return 0; } static int decompile_Null_ArgBuiltInFunctionCall(int n, SWF_ACTION *actions, int maxn, char *functionname) { INDENT puts(functionname); // only used for cases w/o return value println("();" ); return 0; } static int decompileSingleArgBuiltInFunctionCall(int n, SWF_ACTION *actions, int maxn, char *functionname) { push(newVar_N("","",functionname,"(", 1,")")); if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { /* call function and throw away any result */ INDENT puts(getName(pop())); println(";" ); return 1; } return 0; } static int decompileSTARTDRAG(int n, SWF_ACTION *actions, int maxn) { INDENT puts("startDrag("); decompilePUSHPARAM(pop(),1); puts(","); decompilePUSHPARAM(pop(),0); puts(","); decompilePUSHPARAM(pop(),0); // println(");" ); return 0; } static int decompileSUBSTRING(int n, SWF_ACTION *actions,int maxn) { push(newVar_N("","","substr","(", 3,")")); if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { /* call function and throw away any result */ INDENT puts(getName(pop())); println(";" ); return 1; } return 0; } static int decompileSTRINGCONCAT(int n, SWF_ACTION *actions, int maxn) { push(newVar_N("","","concat","(", 2,")")); if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { /* call function and throw away any result */ INDENT puts(getName(pop())); println(";" ); return 1; } return 0; } static int decompileTHROW(int n, SWF_ACTION *actions, int maxn) { INDENT puts("throw "); puts(getName(pop())); println(";"); return 0; } static int decompileREMOVECLIP(int n, SWF_ACTION *actions, int maxn) { INDENT puts("removeMovieClip("); puts(getName(pop())); println(");" ); return 0; } static int decompileDUPLICATECLIP(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *a, *b; INDENT a = pop(); b = pop(); puts("duplicateMovieClip("); puts(getString(pop())); puts(","); puts(getString(b)); puts(","); puts(getString(a)); println(");" ); return 0; } static int decompileINITARRAY(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *nparam; nparam=pop(); push(newVar_N("","","","[", nparam->p.Integer,"]")); return 0; } static int decompileEXTENDS(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *baseclass; baseclass=pop(); #if 0 /* It's useless to open a class body when there's no * other code supporting it. */ printf("class "); puts(getName(pop())); printf(" extends "); puts(getName(baseclass)); println(" {" ); #else /* We'll do it with asm{} */ println("asm {"); println(" push '%s'", getName(pop())); println(" getvariable"); println(" push '%s'", getName(baseclass)); println(" getvariable"); println(" extends"); println("};"); #endif return 0; } static int decompileDELETE(int n, SWF_ACTION *actions, int maxn, int is_type2) { if (is_type2) push(newVar3("delete(",getName(pop()),")")); else push(newVar_N("delete(",getName(pop()),".",getName(pop()), 0,")")); if (OpCode(actions, n+1, maxn) == SWFACTION_POP) { /* call delete() with its args and throw away any result */ INDENT puts(getName(pop())); println(";" ); return 1; } return 0; } static int decompileSETTARGET(int n, SWF_ACTION *actions, int maxn, int is_type2) { int action_cnt=0; char *name; OUT_BEGIN2(SWF_ACTIONSETTARGET); name = is_type2 ? getString(pop()) : sact->TargetName; if (*name) { INDENT println("tellTarget('%s') {" ,name); while(action_cnt+np.Integer;i++) { puts(getName(pop())); } println(" ;"); return 0; } static int decompileCAST(int n, SWF_ACTION *actions, int maxn) { struct SWF_ACTIONPUSHPARAM *iparam=pop(); struct SWF_ACTIONPUSHPARAM *tparam=pop(); push(newVar_N( getName(tparam),"(",getName(iparam),"", 0,")")); return 0; } int decompileAction(int n, SWF_ACTION *actions, int maxn) { if( n > maxn ) SWF_error("Action overflow!!"); #ifdef DEBUG fprintf(stderr,"%d:\tACTION[%3.3d]: %s\n", actions[n].SWF_ACTIONRECORD.Offset, n, actionName(actions[n].SWF_ACTIONRECORD.ActionCode)); #endif switch(actions[n].SWF_ACTIONRECORD.ActionCode) { case SWFACTION_END: return 0; case SWFACTION_CONSTANTPOOL: decompileCONSTANTPOOL(&actions[n]); return 0; case SWFACTION_GOTOLABEL: return decompileGOTOFRAME(n, actions, maxn,1); case SWFACTION_GOTOFRAME: return decompileGOTOFRAME(n, actions, maxn,0); case SWFACTION_GOTOFRAME2: return decompileGOTOFRAME2(n, actions, maxn); case SWFACTION_WAITFORFRAME: decompileWAITFORFRAME(&actions[n]); return 0; case SWFACTION_GETURL2: decompileGETURL2(&actions[n]); return 0; case SWFACTION_GETURL: decompileGETURL(&actions[n]); return 0; case SWFACTION_PUSH: decompilePUSH(&actions[n]); return 0; case SWFACTION_PUSHDUP: decompilePUSHDUP(&actions[n]); return 0; case SWFACTION_STACKSWAP: decompileSTACKSWAP(&actions[n]); return 0; case SWFACTION_SETPROPERTY: decompileSETPROPERTY(n, actions, maxn); return 0; case SWFACTION_GETPROPERTY: decompileGETPROPERTY(n, actions, maxn); return 0; case SWFACTION_GETTIME: return decompileGETTIME(n, actions, maxn); case SWFACTION_TRACE: decompileTRACE(n, actions, maxn); return 0; case SWFACTION_CALLFRAME: decompileCALLFRAME(n, actions, maxn); return 0; case SWFACTION_EXTENDS: decompileEXTENDS(n, actions, maxn); return 0; case SWFACTION_INITOBJECT: decompileINITOBJECT(n, actions, maxn); return 0; case SWFACTION_NEWOBJECT: decompileNEWOBJECT(n, actions, maxn); return 0; case SWFACTION_NEWMETHOD: decompileNEWMETHOD(n, actions, maxn); return 0; case SWFACTION_GETMEMBER: decompileGETMEMBER(n, actions, maxn); return 0; case SWFACTION_SETMEMBER: decompileSETMEMBER(n, actions, maxn); return 0; case SWFACTION_GETVARIABLE: decompileGETVARIABLE(n, actions, maxn); return 0; case SWFACTION_SETVARIABLE: decompileSETVARIABLE(n, actions, maxn, 0); return 0; case SWFACTION_DEFINELOCAL: decompileSETVARIABLE(n, actions, maxn, 1); return 0; case SWFACTION_DEFINELOCAL2: decompileDEFINELOCAL2(n, actions, maxn); return 0; case SWFACTION_DECREMENT: return decompileINCR_DECR(n, actions, maxn, 0); case SWFACTION_INCREMENT: return decompileINCR_DECR(n, actions, maxn,1); case SWFACTION_STOREREGISTER: decompileSTOREREGISTER(n, actions, maxn); return 0; case SWFACTION_JUMP: return decompileJUMP(n, actions, maxn); case SWFACTION_RETURN: decompileRETURN(n, actions, maxn); return 0; case SWFACTION_LOGICALNOT: return decompileLogicalNot(n, actions, maxn); case SWFACTION_IF: return decompileIF(n, actions, maxn); case SWFACTION_WITH: decompileWITH(n, actions, maxn); return 0; case SWFACTION_ENUMERATE: return decompileENUMERATE(n, actions, maxn, 0); case SWFACTION_ENUMERATE2 : return decompileENUMERATE(n, actions, maxn,1); case SWFACTION_INITARRAY: return decompileINITARRAY(n, actions, maxn); case SWFACTION_DEFINEFUNCTION: return decompileDEFINEFUNCTION(n, actions, maxn,0); case SWFACTION_DEFINEFUNCTION2: return decompileDEFINEFUNCTION(n, actions, maxn,1); case SWFACTION_CALLFUNCTION: return decompileCALLFUNCTION(n, actions, maxn); case SWFACTION_CALLMETHOD: return decompileCALLMETHOD(n, actions, maxn); case SWFACTION_INSTANCEOF: case SWFACTION_SHIFTLEFT: case SWFACTION_SHIFTRIGHT: case SWFACTION_SHIFTRIGHT2: case SWFACTION_ADD: case SWFACTION_ADD2: case SWFACTION_SUBTRACT: case SWFACTION_MULTIPLY: case SWFACTION_DIVIDE: case SWFACTION_MODULO: case SWFACTION_BITWISEAND: case SWFACTION_BITWISEOR: case SWFACTION_BITWISEXOR: case SWFACTION_EQUAL: case SWFACTION_EQUALS2: case SWFACTION_LESS2: case SWFACTION_LOGICALAND: case SWFACTION_LOGICALOR: case SWFACTION_GREATER: case SWFACTION_LESSTHAN: case SWFACTION_STRINGEQ: case SWFACTION_STRINGCOMPARE: case SWFACTION_STRICTEQUALS: return decompileArithmeticOp(n, actions, maxn); case SWFACTION_POP: pop(); return 0; case SWFACTION_STARTDRAG: return decompileSTARTDRAG(n, actions, maxn); case SWFACTION_DELETE: return decompileDELETE(n, actions, maxn,0); case SWFACTION_DELETE2: return decompileDELETE(n, actions, maxn,1); case SWFACTION_TARGETPATH: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"targetPath"); case SWFACTION_TYPEOF: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"typeof"); case SWFACTION_ORD: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"ord"); case SWFACTION_CHR: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"chr"); case SWFACTION_INT: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"int"); case SWFACTION_TOSTRING: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"String"); case SWFACTION_TONUMBER: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"Number"); case SWFACTION_RANDOMNUMBER: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"random"); case SWFACTION_STRINGLENGTH: return decompileSingleArgBuiltInFunctionCall(n, actions, maxn,"length"); case SWFACTION_PLAY: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"play"); case SWFACTION_STOP: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"stop"); case SWFACTION_NEXTFRAME: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"nextFrame"); case SWFACTION_PREVFRAME: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"prevFrame"); case SWFACTION_ENDDRAG: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"stopDrag"); case SWFACTION_STOPSOUNDS: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"stopAllSounds"); case SWFACTION_TOGGLEQUALITY: return decompile_Null_ArgBuiltInFunctionCall(n, actions, maxn,"toggleHighQuality"); case SWFACTION_MBSUBSTRING: case SWFACTION_SUBSTRING: return decompileSUBSTRING(n, actions, maxn); case SWFACTION_STRINGCONCAT: return decompileSTRINGCONCAT(n, actions, maxn); case SWFACTION_REMOVECLIP: return decompileREMOVECLIP(n, actions, maxn); case SWFACTION_DUPLICATECLIP: return decompileDUPLICATECLIP(n, actions, maxn); case SWFACTION_SETTARGET: return decompileSETTARGET(n, actions, maxn,0); case SWFACTION_SETTARGET2: return decompileSETTARGET(n, actions, maxn,1); case SWFACTION_IMPLEMENTSOP: return decompileIMPLEMENTS(n, actions, maxn); case SWFACTION_CASTOP: return decompileCAST(n, actions, maxn); case SWFACTION_THROW: return decompileTHROW(n, actions, maxn); case SWFACTION_TRY: return decompileTRY(n, actions, maxn); default: outputSWF_ACTION(n,&actions[n]); return 0; } } static void decompileActions(int n, SWF_ACTION *actions, int indent) { int i, svindent; svindent = gIndent; gIndent = indent; for(i=0;i * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ extern void parseSWF_RGB(FILE *f, struct SWF_RGBA *rgb); extern void parseSWF_RGBA(FILE *f, struct SWF_RGBA *rgb); extern void parseSWF_RECT(FILE *f, struct SWF_RECT *rect); extern void parseSWF_MATRIX(FILE *f, struct SWF_MATRIX *matrix); extern void parseSWF_CXFORMWITHALPHA(FILE *f, struct SWF_CXFORMWITHALPHA *cxform); extern int parseSWF_CLIPEVENTFLAGS(FILE *f, struct SWF_CLIPEVENTFLAGS *cflags); extern void parseSWF_GRADIENTRECORD(FILE *f, struct SWF_GRADIENTRECORD *gradientrec, int level); extern void parseSWF_GRADIENT(FILE *f, struct SWF_GRADIENT *gradient, int level); extern int parseSWF_SHAPERECORD(FILE *f, SWF_SHAPERECORD *shape, int *fillBits, int *lineBits, int level); extern void parseSWF_FILLSTYLE(FILE *f, SWF_FILLSTYLE *fillstyle, int level); extern void parseSWF_FILLSTYLEARRAY(FILE *f, SWF_FILLSTYLEARRAY *fillstyle, int level); extern void parseSWF_LINESTYLE(FILE *f, SWF_LINESTYLE *linestyle, int level); extern void parseSWF_LINESTYLEARRAY(FILE *f, SWF_LINESTYLEARRAY *linestyle, int level); extern void parseSWF_SHAPE(FILE *f, SWF_SHAPE *shape, int level, int len); extern void parseSWF_SHAPEWITHSTYLE(FILE *f, SWF_SHAPEWITHSTYLE *shape, int level); extern int parseSWF_ACTIONRECORD(FILE *f, int *this, SWF_ACTION *action); extern SWF_Parserstruct *parseSWF_CHARACTERSET(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBITS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBITSJPEG2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBITSJPEG3(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBITSPTR(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBUTTON(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBUTTON2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBUTTONCXFORM(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBUTTONSOUND(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINECOMMANDOBJ(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEEDITTEXT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONT2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONT3(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONTINFO(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONTINFO2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_CSMTEXTSETTINGS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONTNAME(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEFONTALIGNZONES(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINELOSSLESS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINELOSSLESS2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEMORPHSHAPE(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEMORPHSHAPE2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESHAPE(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESHAPE2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESHAPE3(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESHAPE4(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESOUND(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESPRITE(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINETEXT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINETEXT2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINETEXTFORMAT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEVIDEO(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEVIDEOSTREAM(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DOACTION(FILE *f, int length); extern SWF_Parserstruct *parseSWF_ENABLEDEBUGGER(FILE *f, int length); extern SWF_Parserstruct *parseSWF_ENABLEDEBUGGER2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_END(FILE *f, int length); extern SWF_Parserstruct *parseSWF_EXPORTASSETS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_FONTREF(FILE *f, int length); extern SWF_Parserstruct *parseSWF_FRAMELABEL(FILE *f, int length); extern SWF_Parserstruct *parseSWF_FRAMETAG(FILE *f, int length); extern SWF_Parserstruct *parseSWF_FREEALL(FILE *f, int length); extern SWF_Parserstruct *parseSWF_FREECHARACTER(FILE *f, int length); extern SWF_Parserstruct *parseSWF_GENCOMMAND(FILE *f, int length); extern SWF_Parserstruct *parseSWF_IMPORTASSETS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_IMPORTASSETS2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_INITACTION(FILE *f, int length); extern SWF_Parserstruct *parseSWF_JPEGTABLES(FILE *f, int length); extern SWF_Parserstruct *parseSWF_NAMECHARACTER(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PATHSAREPOSTSCRIPT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PLACEOBJECT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PLACEOBJECT2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PLACEOBJECT3(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PREBUILT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PREBUILTCLIP(FILE *f, int length); extern SWF_Parserstruct *parseSWF_PROTECT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_REMOVEOBJECT(FILE *f, int length); extern SWF_Parserstruct *parseSWF_REMOVEOBJECT2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SERIALNUMBER(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SETBACKGROUNDCOLOR(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SHOWFRAME(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SOUNDSTREAMBLOCK(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SOUNDSTREAMHEAD(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SOUNDSTREAMHEAD2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_STARTSOUND(FILE *f, int length); extern SWF_Parserstruct *parseSWF_STARTSOUND2(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SYNCFRAME(FILE *f, int length); extern SWF_Parserstruct *parseSWF_VIDEOFRAME(FILE *f, int length); extern SWF_Parserstruct *parseSWF_REFLEX(FILE *f, int length); extern SWF_Parserstruct *parseSWF_FILEATTRIBUTES(FILE *f, int length); extern SWF_Parserstruct *parseSWF_METADATA(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SCRIPTLIMITS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESCALINGGRID(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SETTABINDEX(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DOABC(FILE *f, int length); extern SWF_Parserstruct *parseSWF_SYMBOLCLASS(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINEBINARYDATA(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEFINESCENEANDFRAMEDATA(FILE *f, int length); extern SWF_Parserstruct *parseSWF_UNKNOWNBLOCK(FILE *f, int length); extern SWF_Parserstruct *parseSWF_DEBUGID(FILE *f, int length); ming-0.4.5/util/vasprintf.c0000644000175000017500000000132312154635363012537 00000000000000#include #include #include #ifndef HAVE_VASPRINTF /* Workaround for the lack of vasprintf() * As found on: http://unixpapa.com/incnote/stdio.html * Seems to be Public Domain */ int vasprintf(char **ret, const char *format, va_list ap) { va_list ap2; int len = 100; /* First guess at the size */ if ((*ret = (char *) malloc(len)) == NULL) { return -1; } while (1) { int nchar; va_copy(ap2, ap); nchar= vsnprintf(*ret, len, format, ap2); if (nchar > -1 && nchar < len) { return nchar; } if (nchar > len) { len= nchar+1; } else { len*= 2; } if ((*ret = (char *) realloc(*ret, len)) == NULL) { free(*ret); return -1; } } } #endif ming-0.4.5/util/output.h0000644000175000017500000000454711454264373012104 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #ifndef SWF_OUTPUT_H_INCLUDED #define SWF_OUTPUT_H_INCLUDED #include "libswf.h" #define max(x,y) (((x)>(y))?(x):(y)) #define BUFFER_INCREMENT 1024 struct _output { struct _output *next; byte *buffer; byte *pos; int buffersize; int free; int bitpos; }; typedef struct _output *Output; #define OUTPUT_SIZE sizeof(struct _output) /* create/destroy output object */ Output newOutput(); Output newSizedOutput(int size); void destroyOutput(Output out); /* write output's buffer to stream */ void outputWriteToStream(Output out, FILE *f); /* utilities for writing */ void outputGrow(Output out); void outputCheckSize(Output out, int bytes); void outputByteAlign(Output out); int outputLength(Output out); /* write data to output */ void outputWriteBits(Output out, int data, int bits); void outputWriteSBits(Output out, int data, int bits); void outputWriteUInt8(Output out, int data); void outputWriteSInt8(Output out, int data); void outputWriteUInt16(Output out, int data); void outputWriteSInt16(Output out, int data); void outputWriteUInt32(Output out, long data); void outputWriteSInt32(Output out, long data); void outputWriteBuffer(Output out, char *buffer, int bytes); /* number of bits required to store num */ int numBits(int num); int numSBits(int num); void outputWriteRect(Output out, int xmin, int xmax, int ymin, int ymax); void outputWriteString(Output out, byte *string); #endif /* SWF_OUTPUT_H_INCLUDED */ ming-0.4.5/util/makeswf_utils.c0000644000175000017500000001622512154635363013407 00000000000000/**************************************************************************** * * makeswf - a command line actionscript compiler * * Copyright (C) 2003-2009 "Sandro Santilli" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * **************************************************************************** * * Utility functions for 'makeswf' * ***************************************************************************/ /* This is needed to get vasprintf definition */ #define _GNU_SOURCE 1 #include #include #include #include #include #include #include #include #include #include #include "makeswf.h" #ifdef HAVE_GETOPT_H #include #endif #include "vasprintf.h" // Cheating, but it works (not sure why the above ifdef for getopt isn't) #ifdef _WIN32 #include #endif #define DEFSWFVERSION 6 #define DEFSWFCOMPRESSION 9 //#define CPP "cpp -P -C -Wall" /* we don't need comments, do we ? */ #define CPP "cpp -xc++ -P -Wall" #define MAXERRORMSG 1024 /* prototypes */ static int makeswf_preprocess (const char *file, const char *out); static char *makeswf_readfile (const char *file); static void compileError(const char *fmt, ...); static void printCompileMessage(SWFMsgFunc); /* data */ static char lastcompilemessage[MAXERRORMSG]; static int lastcompilefailed = 0; static int swfversion = DEFSWFVERSION; #define MAXCPPARGS 1024 static char cppargs[MAXCPPARGS]; static int dopreprocess = 1; /* use preprocessor by default */ void makeswf_append_cpparg(const char* buf) { strncat(cppargs, buf, MAXCPPARGS-1); } void makeswf_set_dopreprocess(int value) { dopreprocess=value; } void makeswf_set_swfversion(int value) { swfversion=value; } SWFAction makeswf_compile_source(const char* filename, const char* ppfile, int debug) { SWFAction ac; char *code; char ppfile_fallback[PATH_MAX]; /* preprocessed file */ SWFMsgFunc old_error_func; int length; if ( dopreprocess ) { if ( ! ppfile ) { sprintf(ppfile_fallback, "%s.pp", filename); ppfile = ppfile_fallback; } // TODO: make sure ppfile is writable printf("Preprocessing %s... ", filename); fflush(stdout); if ( ! makeswf_preprocess(filename, ppfile) ) { return NULL; } //unlink(ppfile); filename = ppfile; printf("done.\n"); } if ( ! (code=makeswf_readfile(filename)) ) { return NULL; } old_error_func = Ming_setErrorFunction(compileError); printf("Compiling `%s'... ", filename); ac = newSWFAction(code); SWFAction_setDebug(ac, debug); if (SWFAction_compile(ac, swfversion, &length) || lastcompilefailed) { printf("failed:\n"); printCompileMessage(old_error_func); return NULL; } else { printf("successfully compiled %i bytes bytecode.\n", length); } free(code); Ming_setErrorFunction(old_error_func); return ac; } /* * Should translate preprocessed file's line number to * original file's line number (seems not so easy) */ static void printCompileMessage(SWFMsgFunc func) { char *ptr1; fprintf(stderr, " %s\n", strtok(lastcompilemessage, "\n")); while ( (ptr1=strtok(NULL, "\n")) ) { fprintf(stderr, " %s\n", ptr1); } func("\n"); } /* * This is here to handle line number reporting * due to preprocessor scrambling of it */ static void compileError(const char *fmt, ...) { char *msg; va_list ap; size_t msglen; va_start (ap, fmt); lastcompilefailed++; /* * This is a GNU extension. * Dunno how to handle errors here. */ if ( ! vasprintf(&msg, fmt, ap) ) { fprintf(stderr, "vasnprintf allocated 0 bytes\n"); va_end(ap); return; } va_end(ap); msglen = strlen(msg); if ( msglen > MAXERRORMSG-1 ) msglen = MAXERRORMSG-1; memcpy(lastcompilemessage, msg, msglen); free(msg); lastcompilemessage[MAXERRORMSG-1] = '\0'; return; } static char * makeswf_readfile (const char *file) { FILE *fd; struct stat buf; int size; char *ret; fd = fopen(file, "r"); if ( ! fd ) { perror(file); return NULL; } fstat(fileno(fd), &buf); size = buf.st_size; ret = (char *) malloc( size+1 ); if ( ! ret ) { perror("readfile"); return NULL; } if(fread(ret, 1, size, fd) != size) { fprintf(stderr, "makeswf_readfile: failed\n"); fclose(fd); free(ret); return NULL; } ret[size] = '\0'; fclose(fd); return ret; } static int makeswf_preprocess (const char *file, const char *out) { char buf[1024]; int ret; struct stat statbuf; if ( -1 == stat(file, &statbuf) ) { perror(file); exit(EXIT_FAILURE); } sprintf(buf, "%s -D__SWF_VERSION__=%d %s %s > %s", CPP, swfversion, cppargs, file, out); /*printf("preprocess[%s]\n", buf);*/ ret = system(buf); if ( ret ) { exit(EXIT_FAILURE); } return 1; } /************************************************************** * * $Log$ * Revision 1.14 2010/04/28 12:09:58 strk * Don't trust SWFAction_compile return code to be the only sign of failure. * * Revision 1.13 2009/09/08 22:26:17 strk * Update copyright notice (and FSF address) * * Revision 1.12 2008/10/13 21:57:19 krechert * fix warning * * Revision 1.11 2008/06/26 19:36:12 krechert * fix linker error and make enabling SWFAction's debug mode generic * * Revision 1.10 2007/12/17 17:28:26 strk * Check existance of input file before attempting to preprocess it * * Revision 1.9 2007/11/02 10:18:08 krechert * fix warnings * * Revision 1.8 2007/10/31 16:53:29 krechert * x * * Revision 1.7 2007/10/27 15:12:58 krechert * pass through real swf version * * Revision 1.6 2007/10/27 15:03:14 krechert * handle compile errors. do not output empty swf files * * Revision 1.5 2007/04/30 09:58:32 strk * Don't include getopt.h if it's not found. Patch by Nils Goroll . * * Revision 1.4 2007/04/14 16:58:46 strk * Removed unused CPP define from makeswf.c, fix the *used* one in makeswf_utils. * Thanks to Bastiaan Jacques for finding this out. * * Revision 1.3 2007/03/22 10:59:20 strk * Updated to use newSWFAction() instead of compileSWFActionCode() * * Revision 1.2 2006/07/10 16:11:26 strk * Changed makeswf_compile_source signature to accept path to preprocessor output file. Changed preprocessed file paths to (.frame#.pp) to reduce probability of filesystem permission problems. * * Revision 1.1 2006/07/08 13:47:18 strk * Split makeswf general functionalities in a separate file, for use by unit testers * * **************************************************************/ ming-0.4.5/util/swfoutput.h0000644000175000017500000000222311454264373012611 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #if !defined(OUTPUTRET) #define OUTPUTRET void #endif typedef OUTPUTRET (*SWFOutputFunc)(SWF_Parserstruct *); struct SWFBlockOutput { SWFBlocktype type; SWFOutputFunc output; }; #include "outputdecl.h" ming-0.4.5/util/decompile.h0000644000175000017500000000254511454264373012501 00000000000000/* take a stack, turn it into a tree. e.g.: cmd stack push 'a' 'a' push 'a' 'a' 'a' getvar 'a' a push '1' 'a' a 1 add 'a' a+1 setvar a = a+1 when all that's left on the stack is a tree, you've got a statement. read everything into a list of statements, noting offsets and branches. step through list, resolving branches into if/else/while/do: if branch backwards, it's a do (or while(true)) if forwards, check instruction before branch target: if a branch, this is either: branch backwards- while branch forwards- if/else inside loop, continue jumps to beginning, break jumps to end. */ #include "action.h" #include "swftypes.h" struct _stack; struct _tree { struct _stack *left; struct _stack *right; Action action; }; typedef struct _tree *Tree; struct _stack { struct _stack *next; char type; /* (s)tring, (t)ree, (p)roperty, (b)ranch, (i)nt, (d)ouble, (r)register */ char seenit; union { const char *string; int inum; double dnum; int reg; Tree tree; Property prop; int *iptr; struct _stack **sptr; } data; int offset; int target; /* statement number which branches to this statement */ }; typedef struct _stack *Stack; char *decompile5Action(int n, SWF_ACTION *actions,int indent); void setNewLineString(const char* ch); ming-0.4.5/util/gif2mask.c0000644000175000017500000000416012154635363012230 00000000000000 #include #include #include #include #include #include #include #include "libming.h" #define max(a,b,c) (((a)>(b))?(((c)>(a))?(c):(a)):(((c)>(b))?(c):(b))) void error(char *msg) { printf("%s:\n\n", msg); PrintGifError(); exit(-1); } unsigned char *readGif(char *fileName, int *length) { GifFileType *file; unsigned char *bits; unsigned char colorMap[256]; unsigned char *data; int i, nColors, size; if((file = DGifOpenFileName(fileName)) == NULL) error("Error opening file"); if(DGifSlurp(file) != GIF_OK) error("Error slurping file"); /* data should now be available */ nColors = file->SColorMap->ColorCount; for(i=0; iSColorMap->Colors[i]; colorMap[i] = max(c.Blue, c.Red, c.Green); } bits = file->SavedImages[0].RasterBits; size = file->SWidth * file->SHeight; data = malloc(size); for(i=0; i\n"); exit(0); } int main(int argc, char *argv[]) { int len, size; unsigned long outsize; char *outfile; unsigned char *data, *outdata; FILE *mask; if(argc < 2) usage(); len = strlen(argv[1]); if(strcmp(argv[1]+len-4, ".gif") != 0) usage(); outfile = strdup(argv[1]); outfile[len-3] = 'm'; outfile[len-2] = 's'; outfile[len-1] = 'k'; data = readGif(argv[1], &size); outdata = malloc(outsize = (int)floor(size*1.01+12)); /* zlib-compress the gif data */ compress2(outdata, &outsize, data, size, 9); /* outsize = size; */ /* Let's better use the compress2() result value */ /* of compressed data size instead using original size */ /* else we would waste some outdata file space -- ak'09 */ /* dump to outfile */ mask = fopen(outfile, "wb"); if(fwrite(outdata, sizeof(char), outsize, mask) != outsize) { printf("Didn't write all of the file!"); exit(-1); } exit(0); } ming-0.4.5/util/main.c0000644000175000017500000001725412154635353011460 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include #include #include #include #include #include #include //open() #include //fstat() #include #include #include #include "ming_config.h" //decompression #ifdef USE_ZLIB #include #endif #include "blocks/blocktypes.h" #include "action.h" #include "parser.h" #include "read.h" #include "swfoutput.h" SWF_Parserstruct *blockParse (FILE *f, int length, SWFBlocktype header); const char *blockName (SWFBlocktype header); char *filename; char tmp_name[PATH_MAX]; FILE *tempfile; char *swftargetfile=NULL; struct Movie m; int verbose = 0; #if USE_ZLIB /* * Compressed swf-files have a 8 Byte uncompressed header and a * zlib-compressed body. */ int cws2fws(FILE *f, uLong outsize) { struct stat statbuffer; int insize, ret; int err,tmp_fd; Byte *inbuffer,*outbuffer; sprintf(tmp_name, "/tmp/swftoscriptXXXXXX"); #ifdef HAVE_MKSTEMP tmp_fd = mkstemp(tmp_name); #endif #ifndef HAVE_MKSTEMP tmp_fd = open(tmp_name, O_RDWR | O_CREAT | O_TRUNC , 0600); #endif if ( tmp_fd == -1 ) { SWF_error("Couldn't create tempfile.\n"); } tempfile = fdopen(tmp_fd, "w+"); if ( ! tempfile ) { SWF_error("fdopen: %s", strerror(errno)); } if( stat(filename, &statbuffer) == -1 ) { SWF_error("stat() failed on input file"); } insize = statbuffer.st_size-8; inbuffer = malloc(insize); if(!inbuffer){ SWF_error("malloc() failed"); } if ( ! fread(inbuffer, insize, 1, f) ) { SWF_error("Error reading input file"); } /* We don't trust the value in the swfheader. */ outbuffer=NULL; do{ outbuffer = realloc(outbuffer, outsize); if (!outbuffer) { SWF_error("malloc(%lu) failed",outsize); } /* uncompress the data */ err=uncompress(outbuffer,&outsize,inbuffer,insize); switch(err){ case Z_MEM_ERROR: SWF_error("Not enough memory.\n"); break; case Z_BUF_ERROR: SWF_warn("resizing outbuffer..\n"); outsize*=2; continue; case Z_DATA_ERROR: SWF_error("Data corrupted. Couldn't uncompress.\n"); break; case Z_OK: break; default: SWF_error("Unknown returnvalue of uncompress:%i\n", err); break; } } while(err == Z_BUF_ERROR); /* Rebuild the header so the file offsets will be right */ fputc('F',tempfile); fputc('W',tempfile); fputc('S',tempfile); fputc(m.version,tempfile); ret = fwrite(&m.size,sizeof(int),1,tempfile); if(ret != 1) SWF_error("cws2fws: failed writing file size\n"); if ( outsize != fwrite(outbuffer, 1, outsize, tempfile) ) { SWF_error("Error writing uncompressed"); } rewind(tempfile); return (int)outsize; } #endif static void usage(char *prog) { #ifdef MAKE_FDB fprintf(stderr,"%s: [-v] inputfile\n", prog); fprintf(stderr," should be a swf files containing font blocks (DEFINEFONT2).\n"); fprintf(stderr,"For every fontblock found a .fdb file is wirtten with the associated font name.\n\n"); #else fprintf(stderr,"%s: [-v] inputfile [swftargetfile]\n", prog); #endif } static int filelen_check_fails(int minLength) { if(m.size - fileOffset < minLength) { SWF_warn("sudden file end: read failed @%i fileSize %i, request %i\n", fileOffset, m.size, minLength); return -1; } return 0; } static int readMovieHeader(FILE *f, int *compressed) { char first; struct stat stat_buf; first = readUInt8 (f); *compressed = (first == ('C')) ? 1 : 0; if (!((first == 'C' || first == 'F') && readUInt8 (f) == 'W' && readUInt8 (f) == 'S')) { SWF_error ("Doesn't look like a swf file to me..\n"); } m.version = readUInt8 (f); m.size = readUInt32 (f); m.soundStreamFmt = -1; m.fonts = NULL; m.numFonts = 0; if (*compressed) { #if USE_ZLIB int unzipped = cws2fws (f, m.size); if (m.size != (unzipped + 8)) { SWF_warn ("m.size: %i != %i+8 Maybe wrong value in swfheader.\n", m.size, unzipped + 8); m.size = unzipped +8; } fclose (f); f = tempfile; fseek(f,8,SEEK_SET); #else /* No zlib, so we can't uncompress the data */ SWF_error("No zlib support compiled in, " "cannot read compressed SWF"); #endif } else { if(fstat(fileno(f), &stat_buf) < 0) // verify file size! { perror("stat failed: "); return -1; } if(m.size != stat_buf.st_size) { SWF_warn("header indicates a filesize of %lu but filesize is %lu\n", m.size, stat_buf.st_size); m.size = stat_buf.st_size; } } readRect (f, &(m.frame)); m.rate = readUInt8 (f) / 256.0 + readUInt8 (f); m.nFrames = readUInt16 (f); outputHeader(&m); return 0; } static void readMovie(FILE *f) { int block, type, blockstart, blockoffset, length, nextFrame=0; SWF_Parserstruct *blockp; for (;;) { blockoffset = fileOffset; // printf ("Block offset: %d %d\n", fileOffset, m.size); if(filelen_check_fails(2)) break; block = readUInt16 (f); type = block >> 6; length = block & ((1 << 6) - 1); if (length == 63) /* it's a long block. */ { if(filelen_check_fails(4)) break; length = readUInt32 (f); } // printf ("Found Block: %s (%i), %i bytes\n", blockName (type), type, length); blockstart = fileOffset; nextFrame = fileOffset+length; if(filelen_check_fails(length)) break; blockp= blockParse(f, length, type); if( ftell(f) != nextFrame ) { // will SEEK_SET later, so this is not a critical error SWF_warn(" Stream out of sync after parse of blocktype %d (%s)." " %ld but expecting %d.\n", type, blockName(type), ftell(f),nextFrame); } if( blockp ) { outputBlock( type, blockp, f); free(blockp); } else { SWF_warn("Error parsing block (unknown block type: %d, length %d)\n", type, length); } if (type == 0 || fileOffset >= m.size) break; fseek(f, nextFrame, SEEK_SET); fileOffset = ftell(f); } putchar ('\n'); if (fileOffset < m.size) { SWF_warn("extra garbage (i.e., we messed up in main): \n"); dumpBytes (f, m.size - fileOffset); printf ("\n\n"); } outputTrailer(&m); } int main (int argc, char *argv[]) { FILE *f; int compressed = 0; setbuf(stdout, NULL); switch( argc ) { case 2: filename = argv[1]; break; case 3: if (strcmp (argv[1], "-v") == 0) { verbose = 1; filename = argv[2]; } else { filename = argv[1]; swftargetfile = argv[2]; } break; case 4: if (strcmp (argv[1], "-v") != 0) { usage(argv[0]); exit(1); } verbose = 1; filename = argv[2]; swftargetfile = argv[3]; break; case 0: case 1: default: usage(argv[0]); exit(1); } if (!(f = fopen (filename, "rb"))) { fprintf(stderr,"Sorry, can't seem to read the file '%s'\n",filename); usage(argv[0]); exit(1); } if(readMovieHeader(f, &compressed)) SWF_error("reading movie header failed\n"); if(compressed) f = tempfile; readMovie(f); fclose (f); if (compressed) { unlink (tmp_name); } exit (0); } ming-0.4.5/util/hexdump.c0000644000175000017500000000162211454264373012200 00000000000000#include #include #define print(x) {fputs(x,stdout);} void dumpBytes(FILE *f) { int j=0, i, k, b; unsigned char buf[16]; for(;;) { printf("%03X0: ",j); ++j; for(i=0; i<16; ++i) { b = fgetc(f); if(b == EOF) break; printf("%02x ", buf[i] = (unsigned char)b); if(i==7) putchar(' '); } if(b == EOF) { for(k=i; k<16; ++k) { if(k==7) putchar(' '); print(" "); } } print(" "); for(k=0; k 31) && (buf[k] < 128)) putchar(buf[k]); else putchar('.'); if(k==7) putchar(' '); } putchar('\n'); if(b == EOF) break; } putchar('\n'); } int main(int argc, char *argv[]) { FILE *f; int i=0, c; if(argc<2 || !(f = fopen(argv[1], "rb"))) { printf("Gimme a file name.\n"); exit(1); } dumpBytes(f); return 0; } ming-0.4.5/util/makeswf.h0000644000175000017500000000363011454264373012171 00000000000000/**************************************************************************** * * Copyright (C) 2003-2009 "Sandro Santilli" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA * ***************************************************************************/ /* Set this to the default include path */ #define DEFAULT_FLAGS "-I/usr/share/actionscript -I/usr/local/share/actionscript -I." /** * Use a value of 0 to skip the preprocessing phase (unreccommended) */ void makeswf_set_dopreprocess(int value); /** * Set SWF version to the given number * !! Make sure you'll save your SWF with that version !! */ void makeswf_set_swfversion(int value); /** * Add CPP flags to the default ones */ void makeswf_append_cpparg(const char* buf); /** * Return an SWFAction by compiling code in the given sourcefile. * * Note that the source code can use the preprocessor, unless * preprocessing phase is skipped by a call to makeswf_set_dopreprocess(0). * * If the preprocessing step is not skipped, preprocessed file is wrote * into the provided 'ppfile', or .pp if NULL. * * The debug parameter, if set, enables SWFAction's debugmode. */ SWFAction makeswf_compile_source(const char* filename, const char* ppfile, int debug); ming-0.4.5/util/blocktypes.c0000644000175000017500000001041611454264373012706 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include "blocks/blocktypes.h" #include "parser.h" #include "read.h" struct SWFBlock { SWFBlocktype type; char *name; SWFParseFunc parser; }; #define BlockType( block ) \ { block, #block, parse##block, } static struct SWFBlock blocks[] = { BlockType (SWF_CHARACTERSET), BlockType (SWF_DEFINEBITS), BlockType (SWF_DEFINEBITSJPEG2), BlockType (SWF_DEFINEBITSJPEG3), BlockType (SWF_DEFINEBITSPTR), BlockType (SWF_DEFINEBUTTON), BlockType (SWF_DEFINEBUTTON2), BlockType (SWF_DEFINEBUTTONCXFORM), BlockType (SWF_DEFINEBUTTONSOUND), BlockType (SWF_DEFINECOMMANDOBJ), BlockType (SWF_DEFINEEDITTEXT), BlockType (SWF_DEFINEFONT), BlockType (SWF_DEFINEFONT2), BlockType (SWF_DEFINEFONT3), BlockType (SWF_DEFINEFONTINFO), BlockType (SWF_DEFINEFONTINFO2), BlockType (SWF_CSMTEXTSETTINGS), BlockType (SWF_DEFINEFONTNAME), BlockType (SWF_DEFINEFONTALIGNZONES), BlockType (SWF_DEFINELOSSLESS), BlockType (SWF_DEFINELOSSLESS2), BlockType (SWF_DEFINEMORPHSHAPE), BlockType (SWF_DEFINEMORPHSHAPE2), BlockType (SWF_DEFINESHAPE), BlockType (SWF_DEFINESHAPE2), BlockType (SWF_DEFINESHAPE3), BlockType (SWF_DEFINESHAPE4), BlockType (SWF_DEFINESOUND), BlockType (SWF_DEFINESPRITE), BlockType (SWF_DEFINETEXT), BlockType (SWF_DEFINETEXT2), BlockType (SWF_DEFINETEXTFORMAT), BlockType (SWF_DEFINEVIDEO), BlockType (SWF_DEFINEVIDEOSTREAM), BlockType (SWF_DOACTION), BlockType (SWF_ENABLEDEBUGGER), BlockType (SWF_ENABLEDEBUGGER2), BlockType (SWF_END), BlockType (SWF_EXPORTASSETS), BlockType (SWF_FONTREF), BlockType (SWF_FRAMELABEL), BlockType (SWF_FRAMETAG), BlockType (SWF_FREEALL), BlockType (SWF_FREECHARACTER), BlockType (SWF_GENCOMMAND), BlockType (SWF_IMPORTASSETS), BlockType (SWF_IMPORTASSETS2), BlockType (SWF_INITACTION), BlockType (SWF_JPEGTABLES), BlockType (SWF_NAMECHARACTER), BlockType (SWF_PATHSAREPOSTSCRIPT), BlockType (SWF_PLACEOBJECT), BlockType (SWF_PLACEOBJECT2), BlockType (SWF_PLACEOBJECT3), BlockType (SWF_PREBUILT), BlockType (SWF_PREBUILTCLIP), BlockType (SWF_PROTECT), BlockType (SWF_REMOVEOBJECT), BlockType (SWF_REMOVEOBJECT2), BlockType (SWF_SERIALNUMBER), BlockType (SWF_SETBACKGROUNDCOLOR), BlockType (SWF_SHOWFRAME), BlockType (SWF_SOUNDSTREAMBLOCK), BlockType (SWF_SOUNDSTREAMHEAD), BlockType (SWF_SOUNDSTREAMHEAD2), BlockType (SWF_STARTSOUND), BlockType (SWF_STARTSOUND2), BlockType (SWF_SYNCFRAME), BlockType (SWF_VIDEOFRAME), BlockType (SWF_REFLEX), BlockType (SWF_FILEATTRIBUTES), BlockType (SWF_METADATA), BlockType (SWF_SCRIPTLIMITS), BlockType (SWF_DEFINESCALINGGRID), BlockType (SWF_SETTABINDEX), BlockType (SWF_DOABC), BlockType (SWF_SYMBOLCLASS), BlockType (SWF_DEFINESCENEANDFRAMEDATA), BlockType (SWF_DEFINEBINARYDATA), BlockType (SWF_DEBUGID), }; static int numBlocks = sizeof (blocks) / sizeof (struct SWFBlock); const char * blockName (SWFBlocktype header) { int i; for (i = 0; i < numBlocks; i++) { if (blocks[i].type == header) { return blocks[i].name; } } return "Unknown Block Type"; /* Should never get here */ } SWF_Parserstruct * blockParse (FILE *f, int length, SWFBlocktype header) { int i; for (i = 0; i < numBlocks; i++) { if (blocks[i].type == header) { return blocks[i].parser(f,length); } } return parseSWF_UNKNOWNBLOCK(f, length); } ming-0.4.5/util/ming.css0000644000175000017500000000143311454264373012026 00000000000000/* ming.css */ h1,h2,h3,h4,p,ul,ol,li,div,td,th,address,blockquote,nobr,b,i { font-family:sans-serif; } h1 { font-size:18pt; margin-bottom:18px; } h2 { font-size:16pt; margin-bottom:18px; } h3 { font-size:14pt; } p,ul,ol,li,div,td,th,address,blockquote { font-size:12pt; } li { margin-top:3pt; } pre { font-family:Courier New,Courier; font-size:12pt; color:#0000C0; } code,kbd,tt { font-family:Courier New,Courier; color:#0000C0; } var { font-style:normal; color:#0000C0; } blockquote,cite { font-style:italic; } a:link { color:#AA5522; text-decoration:underline; } a:visited { color:#772200; text-decoration:underline; } a:active { color:#000000; text-decoration:none; } a.an { text-decoration:none; } .unicode { font-size:15pt; font-family:Arial Unicode MS,Arial,sans-serif } ming-0.4.5/util/listjpeg.c0000644000175000017500000000322011454264373012343 00000000000000 #include #include /* JPEG stream markers: */ #define JPEG_MARKER 0xFF /* Start of Image, End of Image */ #define JPEG_SOI 0xD8 #define JPEG_EOI 0xD9 #define JPEG_JFIF 0xE0 /* encoding markers, quantization tables and Huffman tables */ #define JPEG_QUANT 0xDB #define JPEG_HUFF 0xC4 /* image markers, start of frame and start of scan */ #define JPEG_SOF0 0xC0 #define JPEG_SOF1 0xC1 #define JPEG_SOF2 0xC2 #define JPEG_SOS 0xDA void printJpegStream(FILE *f) { int c, l; while(!feof(f)) { if(fgetc(f) != JPEG_MARKER) { printf("Jpeg marker not found!\n"); break; } switch(c=fgetc(f)) { case JPEG_SOI: printf("SOI\n"); break; case JPEG_EOI: printf("EOI\n"); break; case JPEG_JFIF: printf("JFIF\n"); break; case JPEG_QUANT: printf("Quantization table\n"); break; case JPEG_HUFF: printf("Huffman table\n"); break; case JPEG_SOF0: printf("Start of frame 0\n"); break; case JPEG_SOF1: printf("Start of frame 1\n"); break; case JPEG_SOF2: printf("Start of frame 2\n"); break; case JPEG_SOS: printf("Start of scan\n"); break; default: printf("Unknown JPEG block: %02x\n", c); } if(c==JPEG_SOS) break; if(c != JPEG_SOI && c != JPEG_EOI) { l = (fgetc(f)<<8) + fgetc(f); printf("%i bytes\n", l); for(l-=2; l>0; --l) fgetc(f); } } } int main(int argc, char *argv[]) { FILE *f; f = fopen(argv[1], "rb"); if(argc<1) { printf("Gimme file name\n"); exit(1); } if(!f) { printf("Couldn't open file %s!\n", argv[1]); exit(1); } printJpegStream(f); exit(0); } ming-0.4.5/util/gif2dbl.c0000644000175000017500000001505612154635363012044 00000000000000/* gif2dbl: convert a gif file to a DBL file using a RGB palette * for non-transparent gifs and RGBA palette for transparent ones. * * author: Raffaele Sena (raff@aromatic.org) * * (derived from gif2mask.c) */ /* $Id$ */ #include #include #include #include #include #include #include #include "libming.h" void error(char *msg) { printf("%s:\n\n", msg); PrintGifError(); exit(-1); } /** * Get transparency color from graphic extension block * * Return: transparency color or -1 */ int getTransparentColor(GifFileType * file) { int i,returnvalue=-1; ExtensionBlock * ext = file->SavedImages[0].ExtensionBlocks; for (i=0; i < file->SavedImages[0].ExtensionBlockCount; i++, ext++) { if (ext->Function == GRAPHICS_EXT_FUNC_CODE) { if (ext->Bytes[0] & 1){ /* there is a transparent color */ if (!ext->Bytes[3]) returnvalue=255; // exception else returnvalue=ext->Bytes[3]&0xff; } } } return returnvalue; } unsigned char *readGif(char *fileName, int *length, int *bytesPerColor) { GifFileType *file; ColorMapObject *colorMap; unsigned char *bits; unsigned char *data; unsigned char *p; int i, nColors, size, alpha, bgColor, alignedWidth; if((file = DGifOpenFileName(fileName)) == NULL) error("Error opening file"); if(DGifSlurp(file) != GIF_OK) error("Error slurping file"); /* data should now be available */ /* Local colormap has precedence over Global colormap */ colorMap = file->Image.ColorMap ? file->Image.ColorMap : file->SColorMap; nColors = colorMap->ColorCount; alpha = getTransparentColor(file); /* bgColor is the background color to fill the bitmap with * if an image is smaller than screen coordinates */ if (file->SColorMap) /* There is a GlobalColorMap */ bgColor = file->SBackGroundColor; /* The BackGroundColor is meaningful */ else if (alpha >= 0) /* There is a transparency color */ bgColor = alpha; /* set the bgColor to tranparent */ else bgColor = 0; /* Don't know what to do here. * If this doesn't work, we could * create a new color and set the * alpha-channel to transparent * (unless we are using all the 256 * colors, in which case either we * give up, or move to 16-bits palette */ *bytesPerColor = 3; if (alpha >= 0) *bytesPerColor += 1; /* if tranparent color, use the alpha * channel (RGBA instead of RGB) */ /* Ah! The Flash specs says scanlines must be DWORD ALIGNED! * (but image width is the correct number of pixels) */ alignedWidth = (file->SWidth + 3) & ~3; /* size = size-of-header + size-of-colormap + size-of-bitmap */ size = 6 + (nColors * *bytesPerColor) + (alignedWidth * file->SHeight); data = malloc(size); p = data; *p++ = 3; /* 8-bit image data */ *p++ = (file->SWidth >> 0) & 0xFF; /* image width */ *p++ = (file->SWidth >> 8) & 0xFF; *p++ = (file->SHeight >> 0) & 0xFF; /* image height */ *p++ = (file->SHeight >> 8) & 0xFF; *p++ = nColors-1; /* size(colorMap) - 1 */ /* create ColorMap */ for(i=0; iColors[i]; if (*bytesPerColor == 3) { /* RGB */ *p++ = c.Red; *p++ = c.Green; *p++ = c.Blue; } else { /* RGBA */ #if 1 /* You would think that an alpha value of 0 * would mean fully transparent, but Flash * player doesn't seem to think so. * So, we just set the transparency color * as 0,0,0,0 */ if (i != alpha) { *p++ = c.Red; *p++ = c.Green; *p++ = c.Blue; *p++ = 255; /* Fully opaque */ } else { *p++ = 0; /* red */ *p++ = 0; /* green */ *p++ = 0; /* blue */ *p++ = 0; /* Fully transparent */ } #else *p++ = c.Red; *p++ = c.Green; *p++ = c.Blue; *p++ = (i != alpha) ? 255 : 0; /* set alpha to 0 for transparent color */ #endif } } bits = file->SavedImages[0].RasterBits; if (alignedWidth == file->SWidth && file->Image.Width == file->SWidth && file->Image.Height == file->SHeight) { /* we are all nicely aligned and don't need to move the bitmap around. * Just copy the bits into the output buffer. */ memcpy(p, bits, file->SWidth * file->SHeight); } else { /* here we need to pad the scanline or to move the bitmap around * (if the image is not at 0,0 in the logical screen) */ int screenWidth = file->SWidth; int screenHeight = file->SHeight; int imageTop = file->Image.Top; int imageBottom = file->Image.Top + file->Image.Height; int imageLeft = file->Image.Left; int imageWidth = file->Image.Width; for (i=0; i < screenHeight; i++, p += alignedWidth) { /* the image is smaller than the logical "screen": * Fill the reminder with the background color. */ if (imageWidth != screenWidth) memset(p, bgColor, screenWidth); /* finally, copy scanline */ if (i >= imageTop && i < imageBottom) { memcpy(p + imageLeft, bits, imageWidth); bits += imageWidth; } } } /* Done! */ DGifCloseFile(file); *length = size; return data; } void usage() { printf("gif2dbl - convert a gif image to DefineBitLossless2 bitmap\n"); printf("\nusage: gif2dbl \n"); exit(0); } int main(int argc, char *argv[]) { int len, size, bytesPerColor; unsigned long outsize; char *outfile; unsigned char *data, *outdata; FILE *dbl; if(argc <= 1) usage(); len = strlen(argv[1]); if(strcmp(argv[1]+len-4, ".gif") != 0) usage(); outfile = strdup(argv[1]); outfile[len-3] = 'd'; outfile[len-2] = 'b'; outfile[len-1] = 'l'; data = readGif(argv[1], &size, &bytesPerColor); outdata = malloc(outsize = (int)floor(size*1.01+12)); /* zlib-compress the gif data */ compress2(outdata, &outsize, data+6, size-6, 9); /* dump to outfile */ dbl = fopen(outfile, "wb"); if (dbl) { /* DBL header */ fputc('D', dbl); fputc('B', dbl); fputc('l', dbl); fputc(bytesPerColor==3 ? 1 : 2, dbl); /* 1: RGB - 2: RGBA */ /* fill size */ fputc(((outsize+6) >> 24) & 0xFF, dbl); fputc(((outsize+6) >> 16) & 0xFF, dbl); fputc(((outsize+6) >> 8) & 0xFF, dbl); fputc(((outsize+6) >> 0) & 0xFF, dbl); /* write header */ if(fwrite(data, sizeof(char), 6, dbl) != 6) { perror(outfile); exit(1); } /* write compressed data */ if(fwrite(outdata, sizeof(char), outsize, dbl) != outsize) { perror(outfile); exit(-1); } /* and we are done! */ fclose(dbl); } else { perror(outfile); exit(-1); } exit(0); } ming-0.4.5/util/cws2fws0000755000175000017500000000270411454264373011710 00000000000000#!/usr/bin/perl -w # ==================================================================== # Copyright (c) 2003 by Peter Liscovius. All rights reserved. # This program is free software; you can redistribute it and/or modify # it under the same terms as Perl itself. # ==================================================================== use strict; use Compress::Zlib; if (!$ARGV[1]) {die("Flash decompression tool\nConverts compressed flashfiles to uncompressed flashfiles.\nusage: cws2fws infile.swf outfile.swf\n\n");} my $filein = $ARGV[0]; my $fileout = $ARGV[1]; open(CWS,"<$filein") or die("Couldn't open $filein .\n"); #Turn off lineseparator character. We read binary data. $/=undef; my $header; read(CWS,$header,8); my $cwsfile=; my $unzip = uncompress($cwsfile) or die("Uncompression failed. Maybe not a compressed SWF or corrupt data?\n"); close CWS; open (FWS,">$fileout") or die("Couldn't open $fileout .\n"); $header =~ s/^C/F/; print FWS $header.$unzip; close FWS; my @header=unpack("C*",$header); my $filesize=$header[4]+$header[5]*256+$header[6]*65536+$header[7]*16777216; if ($filesize == -s $fileout){ print "Decompression of compressed SWF-file seems to be successful.\n"; } else { print "\nreal filesize: ".(-s $fileout); print "\nsize in swfheader: ".$filesize; print "\n\nFilesize of decompressed file is not equal with size number in the header the SWF!\nMaybe it wasn't a compressed SWF or the file is corrupt or modified.\n"; } ming-0.4.5/util/outputscript.c0000644000175000017500000015517312154635363013325 00000000000000/**************************************************************************** * * Copyright (C) 2005-2006 "Stuart R. Anderson" * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * ****************************************************************************/ #include #include #include #include "blocks/blocktypes.h" #include "decompile.h" #include "parser.h" #include "swfoutput.h" extern char *swftargetfile; /* * This file contains output functions that can convert the different SWF block * types into libming API calls that can recreate the block. Because the Ming * API usage is the same independent of the language being used, this file * can be used for multiple language bindings (OK, maybe not LISP). The * difference in syntax can be paramterized so the code in #ifdefs is not * a lot of duplicated code. */ #if !defined(SWFPHP) && !defined(SWFPERL) && !defined(SWFPYTHON) && !defined(SWFPLUSPLUS) && !defined(SWFTCL) #error "You must define SWFPHP or SWFPERL or SWFPYTHON or SWFPLUSPLUS or SWFTCL when building this file" #endif #ifdef SWFPERL #define COMMSTART "#" #define COMMEND "" #define VAR "$" #define DECLOBJ(x) "$" #define MEMBER "->" #define OBJPREF "SWF::" #define NEWOP "new" #define SQ "'" #define ARGSEP "," #define ARGSTART "(" #define ARGEND ")" #define STMNTEND ";" #endif #ifdef SWFPHP #define COMMSTART "/*" #define COMMEND "*/" #define VAR "$" #define DECLOBJ(x) "$" #define MEMBER "->" #define OBJPREF "SWF" #define NEWOP "new" #define SQ "'" #define ARGSEP "," #define ARGSTART "(" #define ARGEND ")" #define STMNTEND ";" #endif #ifdef SWFPYTHON #define COMMSTART "#" #define COMMEND "" #define VAR "" #define DECLOBJ(x) "" #define MEMBER "." #define OBJPREF "SWF" #define NEWOP "" #define SQ "'" #define ARGSEP "," #define ARGSTART "(" #define ARGEND ")" #define STMNTEND ";" #endif #ifdef SWFPLUSPLUS #define COMMSTART "//" #define COMMEND "" #define VAR "" #define DECLOBJ(x) "SWF" #x "* " #define MEMBER "->" #define OBJPREF "SWF" #define NEWOP "new" #define SQ "\"" #define ARGSEP "," #define ARGSTART "(" #define ARGEND ")" #define STMNTEND ";" #endif #ifdef SWFTCL #define COMMSTART "#" #define COMMEND "" #define VAR "$" #define DECLOBJ(x) "SWF" #x "* " #define MEMBER " " #define OBJPREF "SWF" #define NEWOP "new" #define SQ "" #define ARGSEP " " #define ARGSTART "" #define ARGEND "" #define STMNTEND "" #endif static int framenum = 1; static int spframenum = 1; static int spritenum = 0; static char spritename[64]; static int offsetX=0; static int offsetY=0; struct FONTINFO { /* a linked list for all our font code info: */ int *fontcodeptr; /* built in several outputSWF_DEFINEFONTxxxx(), used in outputSWF_TEXT_RECORD() */ int fontcodearrsize; int fontcodeID; struct FONTINFO *next; }; static struct FONTINFO *fip; /* start point of list */ static struct FONTINFO *fip_current; #define OUT_BEGIN(block) \ struct block *sblock = (struct block *)pblock; \ printf( "\n" COMMSTART " " #block " " COMMEND "\n"); #define OUT_BEGIN_EMPTY(block) \ printf( "\n" COMMSTART " " #block " " COMMEND "\n"); static struct SWFBlockOutput outputs[] = { {SWF_CHARACTERSET, outputSWF_CHARACTERSET}, {SWF_DEFINEBITS, outputSWF_DEFINEBITS}, {SWF_DEFINEBITSJPEG2, outputSWF_DEFINEBITSJPEG2}, {SWF_DEFINEBITSJPEG3, outputSWF_DEFINEBITSJPEG3}, {SWF_DEFINEBITSPTR, outputSWF_DEFINEBITSPTR}, {SWF_DEFINEBUTTON, outputSWF_DEFINEBUTTON}, {SWF_DEFINEBUTTON2, outputSWF_DEFINEBUTTON2}, {SWF_DEFINEBUTTONCXFORM, outputSWF_DEFINEBUTTONCXFORM}, {SWF_DEFINEBUTTONSOUND, outputSWF_DEFINEBUTTONSOUND}, {SWF_DEFINECOMMANDOBJ, outputSWF_DEFINECOMMANDOBJ}, {SWF_DEFINEEDITTEXT, outputSWF_DEFINEEDITTEXT}, {SWF_DEFINEFONT, outputSWF_DEFINEFONT}, {SWF_DEFINEFONT2, outputSWF_DEFINEFONT2}, {SWF_DEFINEFONT3, outputSWF_DEFINEFONT3}, {SWF_DEFINEFONTINFO, outputSWF_DEFINEFONTINFO}, {SWF_DEFINEFONTINFO2, outputSWF_DEFINEFONTINFO2}, {SWF_DEFINELOSSLESS, outputSWF_DEFINELOSSLESS}, {SWF_DEFINELOSSLESS2, outputSWF_DEFINELOSSLESS2}, {SWF_DEFINEMORPHSHAPE, outputSWF_DEFINEMORPHSHAPE}, {SWF_DEFINESHAPE, outputSWF_DEFINESHAPE}, {SWF_DEFINESHAPE2, outputSWF_DEFINESHAPE2}, {SWF_DEFINESHAPE3, outputSWF_DEFINESHAPE3}, {SWF_DEFINESHAPE4, outputSWF_DEFINESHAPE4}, {SWF_DEFINESOUND, outputSWF_DEFINESOUND}, {SWF_DEFINESPRITE, outputSWF_DEFINESPRITE}, {SWF_DEFINETEXT, outputSWF_DEFINETEXT}, {SWF_DEFINETEXT2, outputSWF_DEFINETEXT2}, {SWF_DEFINETEXTFORMAT, outputSWF_DEFINETEXTFORMAT}, {SWF_DEFINEVIDEO, outputSWF_DEFINEVIDEO}, {SWF_DEFINEVIDEOSTREAM, outputSWF_DEFINEVIDEOSTREAM}, {SWF_DOACTION, outputSWF_DOACTION}, {SWF_ENABLEDEBUGGER, outputSWF_ENABLEDEBUGGER}, {SWF_END, outputSWF_END}, {SWF_EXPORTASSETS, outputSWF_EXPORTASSETS}, {SWF_FONTREF, outputSWF_FONTREF}, {SWF_FRAMELABEL, outputSWF_FRAMELABEL}, {SWF_FRAMETAG, outputSWF_FRAMETAG}, {SWF_FREEALL, outputSWF_FREEALL}, {SWF_FREECHARACTER, outputSWF_FREECHARACTER}, {SWF_GENCOMMAND, outputSWF_GENCOMMAND}, {SWF_IMPORTASSETS, outputSWF_IMPORTASSETS}, {SWF_JPEGTABLES, outputSWF_JPEGTABLES}, {SWF_NAMECHARACTER, outputSWF_NAMECHARACTER}, {SWF_PATHSAREPOSTSCRIPT, outputSWF_PATHSAREPOSTSCRIPT}, {SWF_PLACEOBJECT, outputSWF_PLACEOBJECT}, {SWF_PLACEOBJECT2, outputSWF_PLACEOBJECT2}, {SWF_PLACEOBJECT3, outputSWF_PLACEOBJECT3}, {SWF_PREBUILT, outputSWF_PREBUILT}, {SWF_PREBUILTCLIP, outputSWF_PREBUILTCLIP}, {SWF_PROTECT, outputSWF_PROTECT}, {SWF_REMOVEOBJECT, outputSWF_REMOVEOBJECT}, {SWF_REMOVEOBJECT2, outputSWF_REMOVEOBJECT2}, {SWF_SERIALNUMBER, outputSWF_SERIALNUMBER}, {SWF_SETBACKGROUNDCOLOR, outputSWF_SETBACKGROUNDCOLOR}, {SWF_SHOWFRAME, outputSWF_SHOWFRAME}, {SWF_SOUNDSTREAMBLOCK, outputSWF_SOUNDSTREAMBLOCK}, {SWF_SOUNDSTREAMHEAD, outputSWF_SOUNDSTREAMHEAD}, {SWF_SOUNDSTREAMHEAD2, outputSWF_SOUNDSTREAMHEAD2}, {SWF_STARTSOUND, outputSWF_STARTSOUND}, {SWF_SYNCFRAME, outputSWF_SYNCFRAME}, {SWF_INITACTION, outputSWF_INITACTION}, {SWF_VIDEOFRAME, outputSWF_VIDEOFRAME}, {SWF_METADATA, outputSWF_METADATA}, {SWF_SETTABINDEX, outputSWF_SETTABINDEX}, {SWF_SCRIPTLIMITS, outputSWF_SCRIPTLIMITS}, {SWF_SYMBOLCLASS, outputSWF_SYMBOLCLASS}, {SWF_DEFINESCENEANDFRAMEDATA, outputSWF_DEFINESCENEANDFRAMEDATA}, }; static int numOutputs = sizeof (outputs) / sizeof (struct SWFBlockOutput); /* Handle language syntax differnces with these function */ static void init_script() { static int initialized = 0; if ( initialized ) return; #ifdef SWFPHP setNewLineString("\n"); #endif #ifdef SWFPERL setNewLineString("\n"); #endif initialized = 1; } char * methodcall (char *varname, char *method) { static char buf[256]; #if defined(SWFTCL) sprintf (buf, "%s " VAR "%s ", method, varname); #else sprintf (buf, VAR "%s" MEMBER "%s", varname, method); #endif return buf; } void params(int nparam, ...) { va_list ap; char *fmt; unsigned long p; int i; va_start(ap,nparam); printf("%s", ARGSTART); for(i=0;ired); printf ("int %s_green = 0x%2.2x;\n", pname, color->green); printf ("int %s_blue = 0x%2.2x;\n", pname, color->blue); printf ("int %s_alpha = 0x%2.2x;\n", pname, color->alpha); #else printf ("" VAR "%s_red = 0x%2.2x;\n", pname, color->red); printf ("" VAR "%s_green = 0x%2.2x;\n", pname, color->green); printf ("" VAR "%s_blue = 0x%2.2x;\n", pname, color->blue); printf ("" VAR "%s_alpha = 0x%2.2x;\n", pname, color->alpha); #endif } void outputSWF_MATRIX (SWF_MATRIX * matrix, char *fname) { float a, b, c, d; float angle, xScale, yScale, skew; a = matrix->ScaleX; b = matrix->RotateSkew0; c = matrix->RotateSkew1; d = matrix->ScaleY; xScale = sqrt (a * a + c * c); /* always >= 0 */ if (a<0) xScale *= -1; /* preserve sign if needed */ yScale = (a * d - b * c) / xScale; skew = (a * b + c * d) / (a * a + c * c); if (a == 0) { if (c < 0) angle = -90; else angle = 90; } else { angle = atan (c / a) * 180 / M_PI; if (a < 0) { if (angle < 0) angle += 180; else angle -= 180; } } #define TOLERANCE 0.02 if (skew < -TOLERANCE || skew > TOLERANCE) printf ("%s(%f);\n", methodcall (fname, "skewXTo"), skew); if (matrix->HasScale) { if (xScale > 1.0 - TOLERANCE && xScale < 1.0 + TOLERANCE) xScale = 1.0; if (yScale > 1.0 - TOLERANCE && yScale < 1.0 + TOLERANCE) yScale = 1.0; if (xScale != 1.0 || yScale != 1.0) { if (xScale == yScale) printf ("%s(%f);\n", methodcall (fname, "scaleTo"), xScale); else printf ("%s(%f, %f);\n", methodcall (fname, "scaleTo"), xScale, yScale); } } if (matrix->HasRotate) if (angle < -TOLERANCE || angle > TOLERANCE) printf ("%s(%f);\n", methodcall (fname, "rotateTo"), angle); if (matrix->TranslateX != 0 || matrix->TranslateY != 0) printf ("%s(%ld, %ld);\n", methodcall (fname, "moveTo"), matrix->TranslateX, matrix->TranslateY); } static void prepareSWF_MATRIX (SWF_MATRIX * matrix, SWF_RECT *shapeBounds) { if (shapeBounds) if (shapeBounds->Xmax-shapeBounds->Xmin && shapeBounds->Ymax-shapeBounds->Ymin) { matrix->ScaleX*=(32768.0/(shapeBounds->Xmax-shapeBounds->Xmin)); matrix->ScaleY*=(32768.0/(shapeBounds->Ymax-shapeBounds->Ymin)); matrix->RotateSkew1*=(32768.0/(shapeBounds->Xmax-shapeBounds->Xmin)); matrix->RotateSkew0*=(32768.0/(shapeBounds->Ymax-shapeBounds->Ymin)); matrix->TranslateX = (long)(matrix->TranslateX*32768) / (long)(shapeBounds->Xmax-shapeBounds->Xmin) - 16384; matrix->TranslateY = (long)(matrix->TranslateY*32768) / (long)(shapeBounds->Ymax-shapeBounds->Ymin) - 16384; } } static void outputSWF_CXFORMWITHALPHA(SWF_CXFORMWITHALPHA * cxform, char *name) { if (cxform->HasMultTerms) { printf("%s" ARGSTART "%0.2f" ARGSEP "%0.2f" ARGSEP "%0.2f" ARGSEP "%0.2f" ARGEND STMNTEND "\n", methodcall (name, "multColor"), cxform->RedMultTerm/256.0, cxform->GreenMultTerm/256.0, cxform->BlueMultTerm/256.0, cxform->AlphaMultTerm/256.0); } if (cxform->HasAddTerms) { printf("%s" ARGSTART "%ld" ARGSEP "%ld" ARGSEP "%ld" ARGSEP "%ld" ARGEND STMNTEND "\n", methodcall (name, "addColor"), cxform->RedAddTerm, cxform->GreenAddTerm, cxform->BlueAddTerm, cxform->AlphaAddTerm); } } static char* getButtonCondString(SWF_BUTTONCONDACTION *flags) { if ( flags->CondOverUpToOverDown ) return ("SWFBUTTON_MOUSEDOWN"); if ( flags->CondOverDownToOverUp ) return ("SWFBUTTON_MOUSEUP"); if ( flags->CondIdleToOverUp ) return ("SWFBUTTON_MOUSEOVER"); if ( flags->CondOverUpToIdle ) return ("SWFBUTTON_MOUSEOUT"); if ( flags->CondIdleToOverDown ) return ("SWFBUTTON_DRAGOVER"); if ( flags->CondOutDownToOverDown) return ("SWFBUTTON_DRAGOVER"); if ( flags->CondOutDownToIdle ) return ("SWFBUTTON_MOUSEUPOUTSIDE"); if ( flags->CondOverDownToIdle ) return ("SWFBUTTON_DRAGOUT"); return "unknown_flag"; } static char* getEventString(SWF_CLIPEVENTFLAGS *clipevflags) { if ( clipevflags->ClipEventKeyUp ) return ("SWFACTION_KEYUP"); if ( clipevflags->ClipEventKeyDown ) return ("SWFACTION_KEYDOWN"); if ( clipevflags->ClipEventMouseUp ) return ("SWFACTION_MOUSEUP"); if ( clipevflags->ClipEventMouseDown ) return ("SWFACTION_MOUSEDOWN"); if ( clipevflags->ClipEventMouseMove ) return ("SWFACTION_MOUSEMOVE"); if ( clipevflags->ClipEventUnload ) return ("SWFACTION_UNLOAD"); if ( clipevflags->ClipEventEnterFrame ) return ("SWFACTION_ENTERFRAME"); if ( clipevflags->ClipEventLoad ) return ("SWFACTION_ONLOAD"); if ( clipevflags->ClipEventDragOver ) return ("SWFACTION_DRAGOVER"); if ( clipevflags->ClipEventRollOut ) return ("SWFACTION_ROLLOUT"); if ( clipevflags->ClipEventRollOver ) return ("SWFACTION_ROLLOVER"); if ( clipevflags->ClipEventReleaseOutside ) return ("SWFACTION_RELEASEOUTSIDE"); if ( clipevflags->ClipEventRelease ) return ("SWFACTION_RELEASE"); if ( clipevflags->ClipEventPress ) return ("SWFACTION_PRESS"); if ( clipevflags->ClipEventInitialize ) return ("SWFACTION_INIT"); if ( clipevflags->ClipEventData ) return ("SWFACTION_DATA"); if ( clipevflags->ClipEventConstruct ) return ("SWFACTION_CONSTRUCT"); if ( clipevflags->ClipEventKeyPress ) return ("SWFACTION_KEYPRESS"); if ( clipevflags->ClipEventDragOut ) return ("SWFACTION_DRAGOUT"); return "unknown_flag"; } void outputSWF_CLIPACTIONS (SWF_CLIPACTIONS * clipactions, char *sname) { int i; /* printf( COMMSTART " %d clip actions " COMMEND "\n", clipactions->NumClipRecords );*/ for (i = 0; i < clipactions->NumClipRecords-1 ; i++) { printf ("%s(%s(\"%s\"),%s);\n\n", methodcall (sname, "addAction"), newobj (NULL, "Action"), decompile5Action(clipactions->ClipActionRecords[i].numActions, clipactions->ClipActionRecords[i].Actions, 0), getEventString( &clipactions->ClipActionRecords[i].EventFlag) ); } } void outputSWF_GRADIENT (SWF_GRADIENT * gradient, char *gname) { int i; printf ("%s();\n", newobj (gname, "Gradient")); for (i = 0; i < gradient->NumGradients; i++) printf ("%s(%f,0x%2.2x,0x%2.2x,0x%2.2x,0x%2.2x);\n", methodcall (gname, "addEntry"), (gradient->GradientRecords[i].Ratio / 255.0), gradient->GradientRecords[i].Color.red, gradient->GradientRecords[i].Color.green, gradient->GradientRecords[i].Color.blue, gradient->GradientRecords[i].Color.alpha); } void outputSWF_FILLSTYLE_new (SWF_FILLSTYLE * fillstyle, char *parentname, int i, SWF_RECT *shapeBounds) { char fname[64]; char gname[64]; const char* fillTypeName = NULL; sprintf (fname, "%s_f%d", parentname, i); switch (fillstyle->FillStyleType) { case 0x00: /* Solid Fill */ outputSWF_RGBA (&fillstyle->Color, fname); printf ("" DECLOBJ(Fill) "%s = %s(" VAR "%s_red, " VAR "%s_green, " VAR "%s_blue, " VAR "%s_alpha " "); " COMMSTART "SWFFILL_SOLID" COMMEND "\n", fname, methodcall (parentname, "addSolidFill"), fname, fname, fname, fname); break; case 0x10: /* Linear Gradient Fill */ sprintf (gname, "%s_g%d", parentname, i); outputSWF_GRADIENT (&fillstyle->Gradient, gname); printf ("" DECLOBJ(Fill) "%s = %s(" VAR "%s,SWFFILL_LINEAR_GRADIENT);\n", fname, methodcall (parentname, "addGradientFill"), gname); if (shapeBounds) prepareSWF_MATRIX(&fillstyle->GradientMatrix, shapeBounds); outputSWF_MATRIX (&fillstyle->GradientMatrix, fname); break; case 0x12: /* Radial Gradient Fill */ sprintf (gname, "%s_g%d", parentname, i); outputSWF_GRADIENT (&fillstyle->Gradient, gname); printf ("" DECLOBJ(Fill) "%s = %s(" VAR "%s,SWFFILL_RADIAL_GRADIENT);\n", fname, methodcall (parentname, "addGradientFill"), gname); if (shapeBounds) prepareSWF_MATRIX(&fillstyle->GradientMatrix, shapeBounds); outputSWF_MATRIX (&fillstyle->GradientMatrix, fname); break; case 0x40: /* Repeating Bitmap Fill */ fillTypeName = "SWFFILL_TILED_BITMAP"; case 0x41: /* Clipped Bitmap Fill */ if ( ! fillTypeName ) fillTypeName = "SWFFILL_CLIPPED_BITMAP"; case 0x42: /* Non-smoothed Repeating Bitmap Fill */ if ( ! fillTypeName ) fillTypeName = "SWFFILL_NONSMOOTHED_TILED_BITMAP"; case 0x43: /* Non-smoothed Clipped Bitmap Fill */ if ( ! fillTypeName ) fillTypeName = "SWFFILL_NONSMOOTHED_CLIPPED_BITMAP"; /* * TODO: * - specially handle a CharacterID of 65535 (it occurs!) */ printf (COMMSTART " BitmapID: %d " COMMEND "\n", fillstyle->BitmapId); sprintf (gname, "character%d", fillstyle->BitmapId); printf ("" DECLOBJ(Fill) "%s = %s(" VAR "%s,%s);\n", fname, methodcall (parentname, "addBitmapFill"), gname, fillTypeName); outputSWF_MATRIX (&fillstyle->BitmapMatrix, fname); break; } } void outputSWF_FILLSTYLEARRAY_new (SWF_FILLSTYLEARRAY * fillstylearray, char *parentname,SWF_RECT *shapeBounds) { int i, count; count = (fillstylearray->FillStyleCount != 0xff) ? fillstylearray->FillStyleCount : fillstylearray->FillStyleCountExtended; printf ("" COMMSTART "%d fillstyle(s)" COMMEND "\n", count); for (i = 0; i < count; i++) { outputSWF_FILLSTYLE_new (&(fillstylearray->FillStyles[i]), parentname, i,shapeBounds); } } void outputSWF_LINESTYLE (SWF_LINESTYLE * linestyle, char *parentname, int i) { char lname[64]; sprintf (lname, "%s_l%d", parentname, i); #ifdef SWFPLUSPLUS printf ("int %s_width = %d;\n", lname, linestyle->Width); #else printf ("" VAR "%s_width = %d;\n", lname, linestyle->Width); #endif outputSWF_RGBA (&linestyle->Color, lname); } void outputSWF_LINESTYLE2 (SWF_LINESTYLE2 * linestyle, char *parentname, int i) { char lname[64]; sprintf (lname, "%s_l%d", parentname, i); #ifdef SWFPLUSPLUS printf ("int %s_width = %d;\n", lname, linestyle->Width); #else printf ("" VAR "%s_width = %d;\n", lname, linestyle->Width); #endif /* TODO: use also all the other fields (styles) */ printf (COMMSTART "Style information not output" COMMEND "\n"); outputSWF_RGBA (&linestyle->Color, lname); } void outputSWF_LINESTYLEARRAY (SWF_LINESTYLEARRAY * linestylearray, char *parentname) { int i, count; count = linestylearray->LineStyleCount; printf ("" COMMSTART "%d linestyles(s)" COMMEND "\n", count); for (i = 0; i < count; i++) { if(linestylearray->LineStyles != NULL) outputSWF_LINESTYLE (&(linestylearray->LineStyles[i]), parentname, i); else if(linestylearray->LineStyles2 != NULL) outputSWF_LINESTYLE2 (&(linestylearray->LineStyles2[i]), parentname, i); else printf ("" COMMSTART "Unknown linestyle %d (parser error?)" COMMEND "\n", i); } } void outputSWF_SHAPERECORD (SWF_SHAPERECORD * shaperec, char *parentname) { if (shaperec->EndShape.TypeFlag) { /* An Edge Record */ if (shaperec->StraightEdge.StraightEdge == 1) { /* A Straight Edge Record */ if (shaperec->StraightEdge.GeneralLineFlag) { /* The general case */ printf ("%s(%ld, %ld);\n", methodcall (parentname, "drawLine"), shaperec->StraightEdge.DeltaX, shaperec->StraightEdge.DeltaY); } else { /* The Horizontal or Verticle case */ printf ("%s(%ld, %ld);\n", methodcall (parentname, "drawLine"), shaperec->StraightEdge.VLDeltaX, shaperec->StraightEdge.VLDeltaY); } } else { /* A Curved Edge Record */ printf ("%s(%ld, %ld, %ld, %ld);\n", methodcall (parentname, "drawCurve"), shaperec->CurvedEdge.ControlDeltaX, shaperec->CurvedEdge.ControlDeltaY, shaperec->CurvedEdge.AnchorDeltaX, shaperec->CurvedEdge.AnchorDeltaY); } } else { /* A Non-Edge Record */ if (shaperec->EndShape.EndOfShape == 0) { return; } if (shaperec->StyleChange.StateNewStyles) { /* output new style changes before using */ printf (COMMSTART "Some styles are CHANGED now:" COMMEND "\n"); outputSWF_LINESTYLEARRAY (&(shaperec->StyleChange.LineStyles), parentname); outputSWF_FILLSTYLEARRAY_new (&(shaperec->StyleChange.FillStyles), parentname,NULL); } if (shaperec->StyleChange.StateLineStyle) { printf (COMMSTART " StateLineStyle: %ld " COMMEND "\n", shaperec->StyleChange.LineStyle); if (shaperec->StyleChange.LineStyle == 0) { printf ("%s(0,0,0,0,0);\n", methodcall (parentname, "setLine")); } else { /* * We use the variable names that were output by * outputSWF_LINESTYLE() */ printf ("%s(" VAR "%s_l%ld_width, " VAR "%s_l%ld_red, " VAR "%s_l%ld_green, " VAR "%s_l%ld_blue, " VAR "%s_l%ld_alpha);\n", methodcall (parentname, "setLine"), parentname, shaperec->StyleChange.LineStyle - 1, parentname, shaperec->StyleChange.LineStyle - 1, parentname, shaperec->StyleChange.LineStyle - 1, parentname, shaperec->StyleChange.LineStyle - 1, parentname, shaperec->StyleChange.LineStyle - 1); } } if (shaperec->StyleChange.StateFillStyle1) { printf ("%s(", methodcall (parentname, "setRightFill")); if (shaperec->StyleChange.FillStyle1) { printf (VAR "%s_f%ld", parentname,shaperec->StyleChange.FillStyle1 - 1); } printf (");\n"); } if (shaperec->StyleChange.StateFillStyle0) { printf ("%s(", methodcall (parentname, "setLeftFill")); if (shaperec->StyleChange.FillStyle0) { printf (VAR "%s_f%ld", parentname,shaperec->StyleChange.FillStyle0 - 1); } printf (");\n"); } if (shaperec->StyleChange.StateMoveTo) { printf ("%s(%ld, %ld);\n", methodcall (parentname, "movePenTo"), shaperec->StyleChange.MoveDeltaX, shaperec->StyleChange.MoveDeltaY); } } } void outputSWF_SHAPE (SWF_SHAPE * shape, char *name) { int i; for (i = 0; i < shape->NumShapeRecords; i++) { outputSWF_SHAPERECORD (&(shape->ShapeRecords[i]), name); } } void outputSWF_SHAPEWITHSTYLE_new (SWF_SHAPEWITHSTYLE * shape, int level, char *name, SWF_RECT *shapeBounds ) { int i; outputSWF_FILLSTYLEARRAY_new (&(shape->FillStyles), name, shapeBounds); outputSWF_LINESTYLEARRAY (&(shape->LineStyles), name); for (i = 0; i < shape->NumShapeRecords; i++) { outputSWF_SHAPERECORD (&(shape->ShapeRecords[i]), name); } } /* Output Flash Blocks */ void outputSWF_CHARACTERSET (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_CHARACTERSET); } void outputSWF_DEFINEBITS (SWF_Parserstruct * pblock) { char name[32]; /* TODO: use JPEGData and JPEGDataSize to actually include content. dump to a file maybe */ OUT_BEGIN (SWF_DEFINEBITS); sprintf (name, "character%d", sblock->CharacterID); printf ("\n" COMMSTART " Bitmap %d (bits). To extract: " COMMEND "\n", sblock->CharacterID); printf (COMMSTART " swfextract -j %d -o %s.jpg $swf " COMMEND "\n", sblock->CharacterID, name); printf ("%s('%s.jpg');\n", newobj (name, "Bitmap"), name); } void outputSWF_DEFINEBITSJPEG2 (SWF_Parserstruct * pblock) { char name[32]; /* TODO: use JPEGData and JPEGDataSize to actually include content. dump to a file maybe */ OUT_BEGIN (SWF_DEFINEBITSJPEG2); sprintf (name, "character%d", sblock->CharacterID); printf ("\n" COMMSTART " Bitmap %d (jpeg2). To extract: " COMMEND "\n", sblock->CharacterID); printf (COMMSTART " swfextract -j %d -o %s.jpg $swf " COMMEND "\n", sblock->CharacterID, name); printf ("%s('%s.jpg');\n", newobj (name, "Bitmap"), name); } void outputSWF_DEFINEBITSJPEG3 (SWF_Parserstruct * pblock) { char name[32]; /* TODO: use JPEGData and JPEGDataSize to actually include content. dump to a file maybe */ OUT_BEGIN (SWF_DEFINEBITSJPEG3); sprintf (name, "character%d", sblock->CharacterID); printf ("\n" COMMSTART " Bitmap %d (jpeg3). To extract: " COMMEND "\n", sblock->CharacterID); printf (COMMSTART " swfextract -j %d -o %s.jpg $swf " COMMEND "\n", sblock->CharacterID, name); printf ("%s('%s.jpg');\n", newobj (name, "Bitmap"), name); } void outputSWF_DEFINEBITSPTR (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINEBITSPTR); } void outputSWF_BUTTONRECORD( SWF_BUTTONRECORD *brec, char *bname) { int notFirst = 0; char cname[64]; char brname[64]; //char buttonstates[64]; OUT_BEGIN_EMPTY (SWF_BUTTONRECORD); sprintf(cname, "character%d", brec->CharacterId); sprintf(brname, "%sbr%d", bname, brec->PlaceDepth); //printf ("%s(" VAR "%s,", methodcall(bname, "addCharacter"), cname); printf ( DECLOBJ(ButtonRecord) "%s = %s(" VAR "%s,", brname, methodcall(bname, "addCharacter"), cname); if (brec->ButtonStateHitTest) { if (notFirst) printf(" | "); printf("SWFBUTTON_HIT"); notFirst = 1; } if (brec->ButtonStateDown) { if (notFirst) printf(" | "); printf("SWFBUTTON_DOWN"); notFirst = 1; } if (brec->ButtonStateOver) { if (notFirst) printf(" | "); printf("SWFBUTTON_OVER"); notFirst = 1; } if (brec->ButtonStateUp) { if (notFirst) printf(" | "); printf("SWFBUTTON_UP"); notFirst = 1; } printf (")"STMNTEND"\n"); // ButtonRecord uses same transformation function names as DisplayItem, so this should work. outputSWF_MATRIX(&brec->PlaceMatrix, brname); } void outputSWF_DEFINEBUTTON (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINEBUTTON); } void outputSWF_DEFINEBUTTON2 (SWF_Parserstruct * pblock) { int i; char bname[64]; OUT_BEGIN (SWF_DEFINEBUTTON2); sprintf (bname, "character%d", sblock->Buttonid); printf ("%s()"STMNTEND"\n", newobj (bname, "Button")); for(i=0;i < sblock->numCharacters;i++) { outputSWF_BUTTONRECORD( &(sblock->Characters[i]), bname ); } for(i=0;i < sblock->numActions;i++) { printf ("%s(%s(\"%s\"),%s);\n\n", methodcall (bname, "addAction"), newobj (NULL, "Action"), decompile5Action(sblock->Actions[i].numActions, sblock->Actions[i].Actions,0), getButtonCondString(&sblock->Actions[i]) ); } } void outputSWF_DEFINEBUTTONCXFORM (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINEBUTTONCXFORM); } void outputSWF_DEFINEBUTTONSOUND (SWF_Parserstruct * pblock) { char bname[64]; char sname[64]; OUT_BEGIN (SWF_DEFINEBUTTONSOUND); sprintf (bname, "character%d", sblock->CharacterID); if (sblock->ButtonSoundChar0) { sprintf (sname, VAR "character%d", sblock->ButtonSoundChar0); printf ("%s(%s,%s);\n\n", methodcall (bname, "addSound"), sname, "SWFBUTTON_MOUSEOUT"); } if (sblock->ButtonSoundChar1) { sprintf (sname, VAR "character%d", sblock->ButtonSoundChar1); printf ("%s(%s,%s);\n\n", methodcall (bname, "addSound"), sname, "SWFBUTTON_MOUSEOVER"); } if (sblock->ButtonSoundChar2) { sprintf (sname, VAR "character%d", sblock->ButtonSoundChar2); printf ("%s(%s,%s);\n\n", methodcall (bname, "addSound"), sname, "SWFBUTTON_MOUSEDOWN"); } if (sblock->ButtonSoundChar3) { sprintf (sname, VAR "character%d", sblock->ButtonSoundChar3); printf ("%s(%s,%s);\n\n", methodcall (bname, "addSound"), sname, "SWFBUTTON_MOUSEUP"); } /* todo proc soundinstance */ } void outputSWF_DEFINECOMMANDOBJ (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINECOMMANDOBJ); } void outputSWF_DEFINEEDITTEXT (SWF_Parserstruct * pblock) { struct FONTINFO *fi=fip; int notFirst = 0; char tname[64]; OUT_BEGIN (SWF_DEFINEEDITTEXT); sprintf (tname, "character%d", sblock->CharacterID); printf ("%s();\n", newobj (tname, "TextField")); printf ("%s(", methodcall (tname, "setFlags")); if (sblock->WordWrap) { printf ("SWFTEXTFIELD_WORDWRAP"); notFirst = 1; } if (sblock->Multiline) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_MULTILINE"); notFirst = 1; } if (sblock->Password) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_PASSWORD"); notFirst = 1; } if (sblock->ReadOnly) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_NOEDIT"); notFirst = 1; } /* handled by setLength later on if (sblock->HasMaxLength) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_HASLENGTH"); notFirst = 1; } */ if (sblock->AutoSize) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_AUTOSIZE"); notFirst = 1; } /* if( sblock->HasLayout ) { if( notFirst ) printf("|"); printf("SWFTEXTFIELD_HASLAYOUT"); notFirst=1; } */ if (sblock->NoSelect) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_NOSELECT"); notFirst = 1; } if (sblock->Border) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_DRAWBOX"); notFirst = 1; } if (sblock->HTML) { if (notFirst) printf (" | "); printf ("SWFTEXTFIELD_HTML"); notFirst = 1; } printf (");\n"); printf ("%s(%ld, %ld);\n", methodcall (tname, "setBounds"), sblock->Bounds.Xmax, sblock->Bounds.Ymax); if (sblock->HasFont) { printf ("%s(" VAR "f%d);\n", methodcall (tname, "setFont"), sblock->FontID); printf ("%s(%d);\n", methodcall (tname, "setHeight"), sblock->FontHeight); while (fi) { int i; if (fi->fontcodeID==sblock->FontID) { printf ("%s(" SQ , methodcall (tname, "addChars")); for(i=0;ifontcodearrsize;i++) { #ifdef SWFPERL if (fi->fontcodeptr[i]=='\'' || fi->fontcodeptr[i]=='\\' || fi->fontcodeptr[i]=='@' || fi->fontcodeptr[i]=='%' ) printf ("\\"); #endif #if defined(SWFPHP) || defined(SWFPYTHON) if (fi->fontcodeptr[i]=='\'' || fi->fontcodeptr[i]=='\\') printf ("\\"); #endif if (fi->fontcodeptr[i]<256) printf ("%c",fi->fontcodeptr[i]); } printf (SQ ");\n" ); break; } else fi=fi->next; } } if (sblock->HasTextColor) { printf ("%s(0x%02x, 0x%02x, 0x%02x, 0x%02x);\n", methodcall (tname, "setColor"), sblock->TextColor.red, sblock->TextColor.green, sblock->TextColor.blue, sblock->TextColor.alpha); } if (sblock->HasMaxLength) { printf ("%s(%d);\n", methodcall (tname, "setLength"), sblock->MaxLength); } if (sblock->HasLayout) { printf ("%s(", methodcall (tname, "align")); switch (sblock->Align) { case 0: printf ("SWFTEXTFIELD_ALIGN_LEFT"); break; case 1: printf ("SWFTEXTFIELD_ALIGN_RIGHT"); break; case 2: printf ("SWFTEXTFIELD_ALIGN_CENTER"); break; case 3: printf ("SWFTEXTFIELD_ALIGN_JUSTIFY"); break; } printf (");\n"); printf ("%s(%d);\n", methodcall (tname, "setLeftMargin"), sblock->LeftMargin); printf ("%s(%d);\n", methodcall (tname, "setRightMargin"), sblock->RightMargin); printf ("%s(%d);\n", methodcall (tname, "setIndentation"), sblock->Indent); printf ("%s(%d);\n", methodcall (tname, "setLineSpacing"), sblock->Leading); } printf ("%s('%s');\n", methodcall (tname, "setName"), sblock->VariableName); if (sblock->HasText) { printf ("%s('%s');\n", methodcall (tname, "addString"), sblock->InitialText); } } void outputSWF_DEFINEFONT (SWF_Parserstruct * pblock) { char fname[64]; OUT_BEGIN (SWF_DEFINEFONT); sprintf (fname, "f%d", sblock->FontID); printf ("\n" COMMSTART " Font %d (%d glyps)." COMMEND "\n", sblock->FontID, sblock->NumGlyphs); printf ("%s(\"font%d.fdb\" );\n", newobj (fname, "Font"), sblock->FontID); } /* save important part for later usage in outputSWF_DEFINETEXT(), outputSWF_DEFINETEXT2() */ static void saveFontInfo(int id,int numglyph,int *codetable,UI16 *ct16) { struct FONTINFO *fi=fip; if (!fi) fi=fip=fip_current=calloc(1,sizeof(struct FONTINFO)); else { while (fi->next) fi=fi->next; fi->next=calloc(1,sizeof(struct FONTINFO)); fi=fi->next; } if (fi) { if (NULL != (fi->fontcodeptr=malloc(numglyph * sizeof(int)))) { int i; for (i=0;ifontcodeptr[i]=codetable ? codetable[i] : ct16[i]; } fi->fontcodearrsize=numglyph; fi->fontcodeID=id; printf (COMMSTART " init font %d code table" COMMEND "\n",id); } } } void outputSWF_DEFINEFONT2 (SWF_Parserstruct * pblock) { char fname[64]; OUT_BEGIN (SWF_DEFINEFONT2); sprintf (fname, "f%d", sblock->FontID); if (sblock->FontFlagsHasLayout || sblock->NumGlyphs) { printf (COMMSTART " font name: %s" COMMEND "\n", sblock->FontName); printf ("%s(\"font%d.fdb\" );\n", newobj (fname, "Font"), sblock->FontID); saveFontInfo(sblock->FontID,sblock->NumGlyphs,sblock->CodeTable,NULL); } else { printf ("%s(\"%s\" );\n", newobj (fname, "BrowserFont"), sblock->FontName); } } void outputSWF_DEFINEFONT3 (SWF_Parserstruct * pblock) { char fname[64]; OUT_BEGIN (SWF_DEFINEFONT3); sprintf (fname, "f%d", sblock->FontID); if (sblock->FontFlagsHasLayout || sblock->NumGlyphs) { printf (COMMSTART " font name: %s" COMMEND "\n", sblock->FontName); printf ("%s(\"font%d.fdb\" );\n", newobj (fname, "Font"), sblock->FontID); saveFontInfo(sblock->FontID,sblock->NumGlyphs,NULL,sblock->CodeTable); } else { printf ("%s(\"%s\" );\n", newobj (fname, "BrowserFont"), sblock->FontName); } } void outputSWF_DEFINEFONTINFO (SWF_Parserstruct * pblock) { char fname[64]; OUT_BEGIN (SWF_DEFINEFONTINFO); sprintf (fname, "f%d", sblock->FontID); printf ("%s(\"%s.fdb\" );\n", newobj (fname, "Font"), sblock->FontName); saveFontInfo(sblock->FontID,sblock->nGlyph,NULL,sblock->CodeTable); } void outputSWF_DEFINEFONTINFO2(SWF_Parserstruct * pblock) { char fname[64]; OUT_BEGIN (SWF_DEFINEFONTINFO2); sprintf (fname, "f%d", sblock->FontID); printf ("%s(\"%s.fdb\" );\n", newobj (fname, "Font"), sblock->FontName); saveFontInfo(sblock->FontID,sblock->nGlyph,NULL,sblock->CodeTable); } void outputSWF_DEFINELOSSLESS (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINELOSSLESS); sprintf (name, "character%d", sblock->CharacterID); printf ("\n" COMMSTART " Bitmap %d (lossless). To extract: " COMMEND "\n", sblock->CharacterID); printf (COMMSTART " swfextract -p %d -o %s.png $swf " COMMEND "\n", sblock->CharacterID, name); printf ("%s('%s.png');\n", newobj (name, "Bitmap"), name); } void outputSWF_DEFINELOSSLESS2 (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINELOSSLESS2); sprintf (name, "character%d", sblock->CharacterID); printf ("\n" COMMSTART " Bitmap %d (lossless2). To extract:" COMMEND "\n", sblock->CharacterID); printf (COMMSTART " swfextract -p %d -o %s.png $swf " COMMEND "\n", sblock->CharacterID, name); printf ("%s('%s.png');\n", newobj (name, "Bitmap"), name); } void outputSWF_DEFINEMORPHSHAPE (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINEMORPHSHAPE); } void outputSWF_DEFINESHAPE (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINESHAPE); sprintf (name, "character%d", sblock->ShapeID); printf ("\n" COMMSTART " Shape %d (TYPE=1, RECT=%d,%d %d,%d)" COMMEND "\n", sblock->ShapeID, (int)sblock->ShapeBounds.Xmin,(int)sblock->ShapeBounds.Xmax,(int)sblock->ShapeBounds.Ymin,(int)sblock->ShapeBounds.Ymax); printf ("%s();\n", newobj (name, "Shape")); /* There doesn't seem to be a way to use this in the API * it is calculated internal to teh shape object, but I'm not * sure it will come up with the same answer. outputSWF_RECT(&sblock->ShapeBounds); */ outputSWF_SHAPEWITHSTYLE_new (&sblock->Shapes, 1, name, &sblock->ShapeBounds); } void outputSWF_DEFINESHAPE2 (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINESHAPE2); sprintf (name, "character%d", sblock->ShapeID); printf ("\n" COMMSTART " Shape %d (TYPE=2, RECT=%d,%d %d,%d)" COMMEND "\n", sblock->ShapeID, (int)sblock->ShapeBounds.Xmin,(int)sblock->ShapeBounds.Xmax,(int)sblock->ShapeBounds.Ymin,(int)sblock->ShapeBounds.Ymax); printf ("%s();\n", newobj (name, "Shape")); /* There doesn't seem to be a way to use this in the API * it is calculated internal to teh shape object, but I'm not * sure it will come up with the same answer. outputSWF_RECT(&sblock->ShapeBounds); */ outputSWF_SHAPEWITHSTYLE_new (&sblock->Shapes, 2, name, &sblock->ShapeBounds); } void outputSWF_DEFINESHAPE3 (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINESHAPE3); sprintf (name, "character%d", sblock->ShapeID); printf ("\n" COMMSTART " Shape %d (TYPE=3, RECT=%d,%d %d,%d)" COMMEND "\n", sblock->ShapeID, (int)sblock->ShapeBounds.Xmin,(int)sblock->ShapeBounds.Xmax,(int)sblock->ShapeBounds.Ymin,(int)sblock->ShapeBounds.Ymax); printf ("%s();\n", newobj (name, "Shape")); /* There doesn't seem to be a way to use this in the API * it is calculated internal to teh shape object, but I'm not * sure it will come up with the same answer. outputSWF_RECT(&sblock->ShapeBounds); */ outputSWF_SHAPEWITHSTYLE_new (&sblock->Shapes, 3, name, &sblock->ShapeBounds); } void outputSWF_DEFINESHAPE4 (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINESHAPE4); sprintf (name, "character%d", sblock->ShapeID); printf ("\n" COMMSTART " Shape %d (TYPE=4, RECT=%d,%d %d,%d)" COMMEND "\n", sblock->ShapeID, (int)sblock->ShapeBounds.Xmin,(int)sblock->ShapeBounds.Xmax,(int)sblock->ShapeBounds.Ymin,(int)sblock->ShapeBounds.Ymax); printf ("%s();\n", newobj (name, "Shape")); /* There doesn't seem to be a way to use this in the API * it is calculated internal to teh shape object, but I'm not * sure it will come up with the same answer. outputSWF_RECT(&sblock->ShapeBounds); */ outputSWF_SHAPEWITHSTYLE_new (&sblock->Shapes, 4, name, &sblock->ShapeBounds); } void outputSWF_DEFINESOUND (SWF_Parserstruct * pblock) { char sname[64]; OUT_BEGIN (SWF_DEFINESOUND); sprintf (sname, "character%d", sblock->SoundId); printf ("%s(\"FIX_MY_PARAMS\")"STMNTEND"\n", newobj (sname, "Sound")); } void outputSWF_DEFINESPRITE (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINESPRITE); spritenum = sblock->SpriteId; spframenum = 1; sprintf(spritename,"character%d",sblock->SpriteId); printf ("\n\t" COMMSTART " MovieClip %d " COMMEND "\n", sblock->SpriteId); printf ("%s(); " COMMSTART " %d frames " COMMEND "\n", newobj (spritename, "MovieClip"), sblock->FrameCount); for(i=0;iBlockCount;i++) { outputBlock( sblock->tagTypes[i], sblock->Tags[i], NULL); } spritenum = 0; } static void outputSWF_TEXT_RECORD (SWF_TEXTRECORD *trec, int level,char *tname,char *buffer,int bsize,int id) { int i=0; struct FONTINFO *fi=fip; if ( trec->TextRecordType == 0 ) return; if (trec->StyleFlagHasFont) { printf("%s(" VAR "f%d);\n", methodcall (tname, "setFont"), trec->FontID); printf("%s(%d);\n",methodcall(tname,"setHeight"),trec->TextHeight); } if( trec->StyleFlagHasColor ) { if (level==2) printf ("%s(0x%02x, 0x%02x, 0x%02x, 0x%02x);\n",methodcall (tname, "setColor"), trec->TextColor.red,trec->TextColor.green,trec->TextColor.blue, trec->TextColor.alpha); else printf ("%s(0x%02x, 0x%02x, 0x%02x);\n",methodcall (tname, "setColor"), trec->TextColor.red,trec->TextColor.green,trec->TextColor.blue); } if( trec->StyleFlagHasYOffset || trec->StyleFlagHasXOffset ) { printf ("%s(%d, %d);\n", methodcall (tname, "moveTo"),trec->XOffset,trec->YOffset); } if (trec->FontID) { id=trec->FontID; } if (!trec->StyleFlagHasFont) /* always check flag before use data */ { fi = fip_current; /* so cont w current font */ id = fi->fontcodeID; /* trigger next if */ } while (fi) { if (fi->fontcodeID==id) { fip_current=fi; /* set current font */ for(i=0;iGlyphCount && iGlyphEntries[i]))->GlyphIndex[0]; if (offfontcodearrsize) buffer[i]=fi->fontcodeptr[off]; else buffer[i]='?'; /* fallback to dummy A */ /* printf ( COMMSTART "GlyphIndex[0] = %d char = %d " COMMEND"\n",off,fi->fontcodeptr[off] ); */ } buffer[i]='\0'; return; } else fi=fi->next; } buffer[0]='X'; /* fallback to dummy B */ buffer[1]='\0'; } void outputSWF_DEFINETEXT (SWF_Parserstruct * pblock) { int i,id=0; char name[32]; char buffer[64]; OUT_BEGIN (SWF_DEFINETEXT); sprintf (name, "character%d", sblock->CharacterID); printf ("%s(1);\n", newobj (name, "Text")); for(i=0;inumTextRecords;i++) { if (!id && sblock->TextRecords[i].FontID) id=sblock->TextRecords[i].FontID; if ( sblock->TextRecords[i].TextRecordType ) { memset(buffer,0,64); outputSWF_TEXT_RECORD(&(sblock->TextRecords[i]), 1,name,buffer,64,id ); printf ("%s(\"%s\");\n", methodcall (name, "addString"),buffer); } } } void outputSWF_DEFINETEXT2 (SWF_Parserstruct * pblock) { int i,id=0; char name[32]; char buffer[64]; OUT_BEGIN (SWF_DEFINETEXT2); sprintf (name, "character%d", sblock->CharacterID); printf ("%s(2);\n", newobj (name, "Text")); for(i=0;inumTextRecords;i++) { if (!id && sblock->TextRecords[i].FontID) id=sblock->TextRecords[i].FontID; if ( sblock->TextRecords[i].TextRecordType ) { memset(buffer,0,64); outputSWF_TEXT_RECORD(&(sblock->TextRecords[i]), 2,name,buffer,64,id ); printf ("%s(\"%s\");\n", methodcall (name, "addString"),buffer); } } } void outputSWF_DEFINETEXTFORMAT (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINETEXTFORMAT); } void outputSWF_DEFINEVIDEO (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_DEFINEVIDEO); } void outputSWF_DEFINEVIDEOSTREAM (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_DEFINEVIDEOSTREAM); sprintf (name, "character%d", sblock->CharacterID); /* NOTE: Ming sets NumFrames = 65535 for empty movies.. */ if ( sblock->NumFrames && sblock->NumFrames != 65535 ) { printf (COMMSTART " You'll need to extract video%d.flv " COMMEND "\n", sblock->CharacterID); printf ("%s('video%d.flv');", newobj (name, "VideoStream"), sblock->CharacterID); } else { printf ("%s(); ", newobj (name, "VideoStream")); } printf (COMMSTART " %d frames advertised " COMMEND "\n", sblock->NumFrames); printf ("%s(%d, %d);\n", methodcall (name, "setDimension"), sblock->Width, sblock->Height); /* We go manual and have SWF_VIDEOFRAME trigger a nextFrame */ printf ("%s(SWF_VIDEOSTREAM_MODE_MANUAL);\n", methodcall (name, "setFrameMode")); } void outputSWF_DOACTION (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_DOACTION); printf ("%s(%s(\"%s\") );\n", methodcall (spritenum?spritename:"m", "add"), newobj (NULL, "Action"), decompile5Action(sblock->numActions,sblock->Actions,0)); } void outputSWF_ENABLEDEBUGGER (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_ENABLEDEBUGGER); } void outputSWF_END (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_END); } void outputSWF_EXPORTASSETS (SWF_Parserstruct * pblock) { int i; char name[32]; OUT_BEGIN (SWF_EXPORTASSETS); for (i = 0; i < sblock->Count; i++) { sprintf (name, VAR "character%d", sblock->Tags[i]); printf ("%s" ARGSTART "%s" ARGSEP SQ "%s" SQ ARGEND STMNTEND "\n", methodcall ("m", "addExport"),name,sblock->Names[i]); } printf ("%s" ARGSTART ARGEND STMNTEND "\n",methodcall ("m", "writeExports")); } void outputSWF_FONTREF (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_FONTREF); } void outputSWF_FRAMELABEL (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_FRAMELABEL); printf ("%s("SQ"%s"SQ");\n", methodcall (spritenum?spritename:"m", sblock->IsAnchor?"namedAnchor":"labelFrame"), sblock->Name ); } void outputSWF_FRAMETAG (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_FRAMETAG); } void outputSWF_FREEALL (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_FREEALL); } void outputSWF_FREECHARACTER (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_FREECHARACTER); } void outputSWF_GENCOMMAND (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_GENCOMMAND); } void outputSWF_IMPORTASSETS (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_IMPORTASSETS); } void outputSWF_JPEGTABLES (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_JPEGTABLES); } void outputSWF_NAMECHARACTER (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_NAMECHARACTER); } void outputSWF_PATHSAREPOSTSCRIPT (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_PATHSAREPOSTSCRIPT); } void outputSWF_PLACEOBJECT (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_PLACEOBJECT); } void outputSWF_PLACEOBJECT2 (SWF_Parserstruct * pblock) { char cname[64]; OUT_BEGIN (SWF_PLACEOBJECT2); if( sblock->PlaceFlagHasCharacter ) { sprintf(cname, "character%d", sblock->CharacterId ); if(sblock->Depth) { printf ("" DECLOBJ(DisplayItem) "%s%d = %s(" VAR "%s)"STMNTEND"\n", "i" , sblock->Depth, methodcall (spritenum?spritename:"m", "add"), cname); sprintf(cname, "i%d", sblock->Depth ); printf("%s(%d)"STMNTEND"\n", methodcall(cname, "setDepth"), sblock->Depth); } else printf(COMMSTART " PlaceFlagHasCharacter and Depth == 0! " COMMEND "\n"); } if( sblock->PlaceFlagHasMatrix ) { printf(COMMSTART " PlaceFlagHasMatrix " COMMEND "\n"); sprintf(cname, "i%d", sblock->Depth ); if (!spritenum) /* coordinate translation on main movie */ { sblock->Matrix.TranslateX-=offsetX; sblock->Matrix.TranslateY-=offsetY; } outputSWF_MATRIX (&sblock->Matrix, cname); } if( sblock->PlaceFlagHasColorTransform ) { sprintf(cname, "i%d", sblock->Depth); outputSWF_CXFORMWITHALPHA(&sblock->ColorTransform, cname); } if( sblock->PlaceFlagHasRatio ) { printf(COMMSTART " PlaceFlagHasRatio " COMMEND "\n"); } if( sblock->PlaceFlagHasName ) { sprintf(cname, "i%d", sblock->Depth ); printf("%s("SQ"%s"SQ")"STMNTEND"\n", methodcall(cname, "setName"), sblock->Name); } if( sblock->PlaceFlagHasClipDepth ) { sprintf(cname, "i%d", sblock->Depth ); printf("%s(%d)"STMNTEND"\n", methodcall(cname, "setMaskLevel"), sblock->ClipDepth); } if( sblock->PlaceFlagHasClipActions ) { sprintf(cname, "i%d", sblock->Depth ); outputSWF_CLIPACTIONS (&sblock->ClipActions, cname); } } void outputSWF_PLACEOBJECT3 (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_PLACEOBJECT3); } void outputSWF_PREBUILT (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_PREBUILT); } void outputSWF_PREBUILTCLIP (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_PREBUILTCLIP); } void outputSWF_PROTECT (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_PROTECT); if( sblock->Password == NULL ) { printf ("%s();\n", methodcall ("m", "protect")); } else{ printf ("%s(\"%s\");\n", methodcall ("m", "protect"),sblock->Password); } } void outputSWF_REMOVEOBJECT (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_REMOVEOBJECT); printf ("%s(" VAR "c%d);\n", methodcall (spritenum?spritename:"m", "remove"), sblock->CharacterId); } void outputSWF_REMOVEOBJECT2 (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_REMOVEOBJECT2); printf ("%s(" VAR "i%d);\n", methodcall (spritenum?spritename:"m", "remove"), sblock->Depth); } void outputSWF_SERIALNUMBER (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_SERIALNUMBER); } void outputSWF_SETBACKGROUNDCOLOR (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SETBACKGROUNDCOLOR); printf ("%s", methodcall ("m", "setBackground")); params (3,"0x%02x", sblock->rgb.red, "0x%02x", sblock->rgb.green, "0x%02x", sblock->rgb.blue); printf (STMNTEND "\n"); } void outputSWF_SHOWFRAME (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_SHOWFRAME); printf ("%s", methodcall (spritenum?spritename:"m", "nextFrame")); params(0); printf (STMNTEND " " COMMSTART " end of %sframe %d " COMMEND "\n", spritenum?"clip ":"", spritenum?spframenum++:framenum++); } void outputSWF_SOUNDSTREAMBLOCK (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_SOUNDSTREAMBLOCK); } void outputSWF_SOUNDSTREAMHEAD (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_SOUNDSTREAMHEAD); } void outputSWF_SOUNDSTREAMHEAD2 (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_SOUNDSTREAMHEAD2); } void outputSWF_STARTSOUND (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_STARTSOUND); } void outputSWF_SYNCFRAME (SWF_Parserstruct * pblock) { OUT_BEGIN_EMPTY (SWF_SYNCFRAME); } void outputSWF_INITACTION (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_INITACTION); printf (COMMSTART " Might be more appropriate to use addInitAction here" COMMEND "\n"); /* NOTE: the printf must be split in two cause newobj uses * a static buffer so can't be used twice to return * different strings */ printf ("%s(%s(", methodcall (spritenum?spritename:"m", "add"), newobj (NULL, "InitAction")); /* TODO: add SpriteID ? */ printf ("%s(\"%s\")));\n", newobj (NULL, "Action"), decompile5Action(sblock->numActions,sblock->Actions,0)); } void outputSWF_VIDEOFRAME (SWF_Parserstruct * pblock) { char name[32]; OUT_BEGIN (SWF_VIDEOFRAME); sprintf (name, "character%d", sblock->StreamID); printf (COMMSTART " Frame %d of stream %d " COMMEND "\n", sblock->FrameNum, sblock->StreamID); printf ("%s();\n", methodcall (name, "nextFrame")); } void outputSWF_METADATA (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_METADATA); /* TODO: escape Metadata string (might contain quotes!) */ printf ("%s(\"%s\");\n", methodcall (spritenum?spritename:"m", "addMetadata"), sblock->Metadata); } void outputSWF_SETTABINDEX (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SETTABINDEX); printf("%s(%d, %d)"STMNTEND"\n", methodcall("m", "setTabIndex"), sblock->Depth, sblock->TabIndex); } void outputSWF_SCRIPTLIMITS (SWF_Parserstruct * pblock) { OUT_BEGIN (SWF_SCRIPTLIMITS); printf("%s(%d, %d)"STMNTEND"\n", methodcall("m", "setScriptLimits"), sblock->MaxRecursionDepth, sblock->ScriptTimeoutSeconds); } void outputSWF_SYMBOLCLASS (SWF_Parserstruct * pblock) { char cname[64]; int i; OUT_BEGIN (SWF_SYMBOLCLASS); for(i = 0; i < sblock->SymbolCount; ++i) { struct AS_SYMBOL* sym = &(sblock->SymbolList[i]); sprintf(cname, "character%d", sym->SymbolId ); printf("%s(" VAR "%s, \"%s\")"STMNTEND"\n", methodcall("m", "assignSymbol"), cname, sym->SymbolName); } } void outputSWF_DEFINESCENEANDFRAMEDATA (SWF_Parserstruct * pblock) { int i; OUT_BEGIN (SWF_DEFINESCENEANDFRAMEDATA); for(i = 0; i < sblock->SceneCount; ++i) { struct SCENE_DATA* sc = &(sblock->Scenes[i]); // SWFMovie_defineScene(m, 0, "test0"); printf("%s(%lu, \"%s\")"STMNTEND"\n", methodcall("m", "defineScene"), sc->Offset, sc->Name); } for(i = 0; i < sblock->FrameLabelCount; ++i) { /* TODO: output a method for this! */ struct FRAME_DATA* fd = &(sblock->Frames[i]); printf (COMMSTART " Label for frame %lu : %s " COMMEND "\n", fd->FrameNum, fd->FrameLabel); } } void outputHeader (struct Movie *m) { int npending=0; if( m->version == 4 ) { m->version=5; /* a note for user follows after language dependent part */ npending=1; } #ifdef SWFPHP if( swftargetfile != NULL ) { printf ("#!/usr/bin/php\n"); } printf ("version == 5 ) printf ("%s();\n\n", newobj ("m", "Movie")); else printf ("%s(%d);\n\n", newobj ("m", "Movie"), m->version); printf ("ming_setscale(1.0);\n"); #endif #ifdef SWFPERL printf ("#!/usr/bin/perl -w\n"); printf ("# Generated by swftoperl converter included with ming. Have fun. \n\n"); printf ("# Change this to your needs. If you installed perl-ming global you don't need this.\n"); printf ("#use lib(\"/home/peter/mystuff/lib/site_perl\");\n\n"); printf ("# We import all because our converter is not so clever to select only needed. ;-)\n"); printf ("use SWF qw(:ALL);\n"); printf ("# Just copy from a sample, needed to use Constants like SWFFILL_RADIAL_GRADIENT\n"); printf ("use SWF::Constants qw(:Text :Button :DisplayItem :Fill);\n\n"); if( m->version == 5 ) printf ("%s();\n\n", newobj ("m", "Movie")); else printf ("$m = %s(%d);\n\n", "SWF::Movie::newSWFMovieWithVersion", m->version); printf ("SWF::setScale(1.0);\n"); #endif #ifdef SWFPYTHON printf ("#!/usr/bin/python\n"); printf ("from ming import *\n\n"); if( m->version != 5 ) printf ("Ming_useSWFVersion(%d);\n\n", m->version); printf ("%s();\n\n", newobj ("m", "Movie")); printf ("Ming_setScale(1.0);\n"); #endif #ifdef SWFPLUSPLUS printf ("#include \n"); printf ("\n\nmain(){\n"); if( m->version == 5 ) printf ("%s();\n\n", newobj ("m", "Movie")); else printf ("%s(%d);\n\n", newobj ("m", "Movie"), m->version); printf ("Ming_setScale(1.0);\n"); #endif #ifdef SWFTCL printf ("load mingc.so mingc\n"); printf ("%s\n", newobj ("m", "Movie")); if( m->version != 5 ) { printf ("#%s(%d);\n\n", newobj ("m", "Movie"), m->version); // XXX: // printf ("#add setversion here\n\n", "m", m->version); } printf (COMMSTART "add setscale here" COMMEND "\n"); #endif if( npending ) printf( "\n" COMMSTART " Note: using v5+ syntax for script blocks (original SWF file version was 4)! " COMMEND "\n\n"); if( m->rate != 12.0 ) printf ("%s(%f);\n", methodcall ("m", "setRate"), m->rate); if( m->frame.xMax != 6400 || m->frame.yMax != 4800 ) printf ("%s(%d, %d);\n", methodcall ("m", "setDimension"), m->frame.xMax - m->frame.xMin, m->frame.yMax - m->frame.yMin); if (m->frame.xMin || m->frame.yMin) { offsetX= m->frame.xMin; offsetY= m->frame.yMin; printf( "\n" COMMSTART " Note: xMin and/or yMin are not 0! " COMMEND "\n\n"); } if( m->nFrames != 1 ) printf ("%s(%i);\n", methodcall ("m", "setFrames"), m->nFrames); } void outputTrailer (struct Movie *m) { if( swftargetfile == NULL ) { #ifdef SWFPHP printf ("\n\theader('Content-type: application/x-shockwave-flash');\n"); #endif #ifdef SWFPERL printf ("#print('Content-type: application/x-shockwave-flash\\n\\n');\n"); #endif #ifdef SWFPYTHON printf ("#print('Content-type: application/x-shockwave-flash\\n\\n');\n"); #endif if( m->version > 5 ) { printf ("%s(%i);\n", methodcall ("m", "output"), 9); } else { printf ("%s();\n", methodcall ("m", "output")); } } else { printf ("%s", methodcall ("m", "save")); params (1, "\"%s\"", swftargetfile); printf ( STMNTEND "\n"); } #ifdef SWFPHP printf ("?>\n"); #endif #ifdef SWFPLUSPLUS printf ("}\n"); #endif } void outputBlock (int type, SWF_Parserstruct * blockp, FILE* stream) { int i; if (type < 0) return; init_script(); for (i = 0; i < numOutputs; i++){ if (outputs[i].type == type){ outputs[i].output (blockp); return; } } printf( COMMSTART "Unknown block type %d" COMMEND "\n", type ); return; } ming-0.4.5/util/TODO0000644000175000017500000000350111454264373011050 00000000000000* listswf, swftophp and swftoperl should be sharing more code- they're both almost 2000 lines long, and most of it is more or less the same.. overall: definefont, definefont2 flash6 stuff? * hextools: How about combining listswf with hextools and show different colors for each block. Output could be colored text (with ncurses, but limited colors) or easier: a HTML page with a table with many /