diff --git a/plug-ins/mathmap/Makefile b/plug-ins/mathmap/Makefile deleted file mode 100644 index b4c1af188e..0000000000 --- a/plug-ins/mathmap/Makefile +++ /dev/null @@ -1,255 +0,0 @@ -# Generated automatically from Makefile.in by configure. -# Makefile.in generated automatically by automake 1.2c from Makefile.am - -# Copyright (C) 1994, 1995, 1996, 1997 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. - - -SHELL = /bin/sh - -srcdir = . -top_srcdir = ../.. -prefix = /usr -exec_prefix = ${prefix} - -bindir = ${exec_prefix}/bin -sbindir = ${exec_prefix}/sbin -libexecdir = ${exec_prefix}/libexec -datadir = ${prefix}/share -sysconfdir = ${prefix}/etc -sharedstatedir = ${prefix}/com -localstatedir = ${prefix}/var -libdir = ${exec_prefix}/lib -infodir = ${prefix}/info -mandir = ${prefix}/man -includedir = ${prefix}/include -oldincludedir = /usr/include - -pkgdatadir = $(datadir)/gimp -pkglibdir = $(libdir)/gimp -pkgincludedir = $(includedir)/gimp - -top_builddir = ../.. - -ACLOCAL = aclocal -AUTOCONF = autoconf -AUTOMAKE = automake -AUTOHEADER = autoheader - -INSTALL = /usr/bin/install -c -INSTALL_PROGRAM = ${INSTALL} -INSTALL_DATA = ${INSTALL} -m 644 -INSTALL_SCRIPT = ${INSTALL_PROGRAM} -transform = s,x,x, - -NORMAL_INSTALL = true -PRE_INSTALL = true -POST_INSTALL = true -NORMAL_UNINSTALL = true -PRE_UNINSTALL = true -POST_UNINSTALL = true -host_alias = i486-pc-linux-gnu -host_triplet = i486-pc-linux-gnu -CC = gcc -CPP = gcc -E -EMACS = /usr/bin/emacs -GIMPTCL = gimptcl -JPEG = jpeg -LD = /usr/lib/gcc-lib/i386-linux/egcs-2.90.18/ld -LIBJPEG_LIB = -ljpeg -LIBMPEG_LIB = -LIBPNG_LIB = -lpng -lz -LIBTCL_LIB = -ltcl -ltk -LIBTIFF_LIB = -ltiff -LIBTOOL = $(SHELL) $(top_builddir)/libtool -LIBXDELTA_LIB = -LIBXPM_LIB = -lXpm -LN_S = ln -s -MAINT = #M# -MAKEINFO = makeinfo -MPEG = -NM = /usr/bin/nm -B -PACKAGE = gimp -PNG = png -RANLIB = ranlib -TIFF = tiff -VERSION = 0.99.15 -XD = -XPM = xpm -gimpdatadir = ${prefix}/share/gimp -gimpdir = .gimp -gimpplugindir = ${exec_prefix}/lib/gimp/0.99.15 - -pluginlibdir = $(gimpplugindir)/plug-ins - -pluginlib_PROGRAMS = #STD# - -INCLUDES = \ - $(X_CFLAGS) \ - -I$(top_srcdir) \ - -I$(includedir) - -LDADD = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimp/libgimp.la \ - $(X_LIBS) \ - -lc - -DEPS = \ - $(top_builddir)/libgimp/libgimpui.la \ - $(top_builddir)/libgimp/libgimp.la -mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs -CONFIG_HEADER = ../../config.h -CONFIG_CLEAN_FILES = -PROGRAMS = $(pluginlib_PROGRAMS) - -DIST_COMMON = Makefile.am Makefile.in - - -DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - -TAR = tar -GZIP = --best -default: all - -.SUFFIXES: -$(srcdir)/Makefile.in: #M# Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu plug-ins/mathmap/Makefile - -Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) - cd $(top_builddir) \ - && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status - - -mostlyclean-pluginlibPROGRAMS: - -clean-pluginlibPROGRAMS: - -test -z "$(pluginlib_PROGRAMS)" || rm -f $(pluginlib_PROGRAMS) - -distclean-pluginlibPROGRAMS: - -maintainer-clean-pluginlibPROGRAMS: - -install-pluginlibPROGRAMS: $(pluginlib_PROGRAMS) - @$(NORMAL_INSTALL) - $(mkinstalldirs) $(pluginlibdir) - @list='$(pluginlib_PROGRAMS)'; for p in $$list; do \ - if test -f $$p; then \ - echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(pluginlibdir)/`echo $$p|sed '$(transform)'`"; \ - $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(pluginlibdir)/`echo $$p|sed '$(transform)'`; \ - else :; fi; \ - done - -uninstall-pluginlibPROGRAMS: - $(NORMAL_UNINSTALL) - list='$(pluginlib_PROGRAMS)'; for p in $$list; do \ - rm -f $(pluginlibdir)/`echo $$p|sed '$(transform)'`; \ - done -tags: TAGS -TAGS: - - -distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) - -subdir = plug-ins/mathmap - -distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu plug-ins/mathmap/Makefile - @for file in $(DISTFILES); do \ - d=$(srcdir); \ - test -f $(distdir)/$$file \ - || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ - || cp -p $$d/$$file $(distdir)/$$file; \ - done -info: -dvi: -check: all - $(MAKE) -installcheck: -install-exec: - @$(NORMAL_INSTALL) - -install-data: install-pluginlibPROGRAMS - @$(NORMAL_INSTALL) - -install: install-exec install-data all - @: - -uninstall: uninstall-pluginlibPROGRAMS - -all: Makefile $(PROGRAMS) - -install-strip: - $(MAKE) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' INSTALL_SCRIPT='$(INSTALL_PROGRAM)' install -installdirs: - $(mkinstalldirs) $(pluginlibdir) - - -mostlyclean-generic: - -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) - -clean-generic: - -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) - -distclean-generic: - -rm -f Makefile $(DISTCLEANFILES) - -rm -f config.cache config.log stamp-h stamp-h[0-9]* - -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) - -maintainer-clean-generic: - -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) - -test -z "$(BUILT_SOURCES)" || rm -f $(BUILT_SOURCES) -mostlyclean: mostlyclean-pluginlibPROGRAMS mostlyclean-generic - -clean: clean-pluginlibPROGRAMS clean-generic mostlyclean - -distclean: distclean-pluginlibPROGRAMS distclean-generic clean - -rm -f config.status - -rm -f libtool - -maintainer-clean: maintainer-clean-pluginlibPROGRAMS \ - maintainer-clean-generic distclean - @echo "This command is intended for maintainers to use;" - @echo "it deletes files that may require special tools to rebuild." - -.PHONY: default mostlyclean-pluginlibPROGRAMS \ -distclean-pluginlibPROGRAMS clean-pluginlibPROGRAMS \ -maintainer-clean-pluginlibPROGRAMS uninstall-pluginlibPROGRAMS \ -install-pluginlibPROGRAMS tags distdir info dvi installcheck \ -install-exec install-data install uninstall all installdirs \ -mostlyclean-generic distclean-generic clean-generic \ -maintainer-clean-generic clean mostlyclean distclean maintainer-clean - - -#STD#_SOURCES = \ - #STD#.c - -#STD#_DEPENDENCIES = $(DEPS) - -.PHONY: files - -files: - @files=`ls $(DISTFILES) 2> /dev/null`; for p in $$files; do \ - echo $$p; \ - done - @for subdir in $(SUBDIRS); do \ - files=`cd $$subdir; $(MAKE) files | grep -v "make\[[1-9]\]"`; \ - for file in $$files; do \ - echo $$subdir/$$file; \ - done; \ - done - -# 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: diff --git a/plug-ins/mathmap/vars.c b/plug-ins/mathmap/vars.c new file mode 100644 index 0000000000..baebcf861f --- /dev/null +++ b/plug-ins/mathmap/vars.c @@ -0,0 +1,41 @@ +#include + +#include "vars.h" + +variable *firstVariable = 0; + +variable* +register_variable (char *name) +{ + variable *var; + + assert(strlen(name) < VAR_MAX_LENGTH); + + for (var = firstVariable; var != 0; var = var->next) + if (strcmp(name, var->name) == 0) + return var; + + var = (variable*)malloc(sizeof(variable)); + strcpy(var->name, name); + var->value = 0.0; + var->next = firstVariable; + firstVariable = var; + + return var; +} + +void +clear_all_variables (void) +{ + variable *var = firstVariable; + + while (var != 0) + { + variable *next = var->next; + + free(var); + var = next; + } + + firstVariable = 0; +} diff --git a/plug-ins/mathmap/vars.h b/plug-ins/mathmap/vars.h new file mode 100644 index 0000000000..03b0f722bc --- /dev/null +++ b/plug-ins/mathmap/vars.h @@ -0,0 +1,18 @@ +#ifndef __VARS_H__ +#define __VARS_H__ + +#define VAR_MAX_LENGTH 32 + +typedef struct _variable +{ + char name[VAR_MAX_LENGTH]; + double value; + + struct _variable *next; +} variable; + +variable* register_variable (char *name); + +void clear_all_variables (void); + +#endif