Index: trunk/Makefile.am =================================================================== --- trunk/Makefile.am (revision 96) +++ trunk/Makefile.am (nonexistent) @@ -1,20 +0,0 @@ -## -*- makefile -*- -## $Id$ -## -## Top level automake file for PCB - -DIRS= w32 intl gts src data lib newlib example tools tutorial README_FILES po tests -SUBDIRS= ${DIRS} @DOC@ -DIST_SUBDIRS= ${DIRS} doc - -INTLTOOL_FILES = intltool-extract.in intltool-merge.in intltool-update.in - -EXTRA_DIST= config.rpath globalconst.h README.git README.w32 icon-theme-installer $(INTLTOOL_FILES) - -DISTCLEANFILES= configure.lineno intltool-extract intltool-merge intltool-update po/.intltool-merge-cache - -MAINTAINERCLEANFILES= $(INTLTOOL_FILES) - -ACLOCAL_AMFLAGS = -I m4 -DISTCHECK_CONFIGURE_FLAGS := ${DISTCHECK_CONFIGURE_FLAGS} --disable-update-mime-database --disable-update-desktop-database GTK_UPDATE_ICON_THEME_BIN=true - Index: trunk/Makefile =================================================================== --- trunk/Makefile (nonexistent) +++ trunk/Makefile (revision 97) @@ -0,0 +1,2 @@ +all: + cd src && make Index: trunk/doc-rnd/TODO =================================================================== --- trunk/doc-rnd/TODO (revision 96) +++ trunk/doc-rnd/TODO (revision 97) @@ -6,3 +6,6 @@ - merge pcb-gpmi in pcb-rnd - rethink/rewrite the action/change infrastructure - too many void *ptr1 pointers, too many code duplication +- scconfig: + - generate makefile for gts + - when gpcb menu res is empty, pcb segfaults on startup Index: trunk/gts/Makefile.am =================================================================== --- trunk/gts/Makefile.am (revision 96) +++ trunk/gts/Makefile.am (nonexistent) @@ -1,48 +0,0 @@ -## Process this file with automake to produce Makefile.in - -INCLUDES = -I$(srcdir) -DG_LOG_DOMAIN=\"Gts\" - -lib_LIBRARIES = libgts.a - -libgts_a_SOURCES = \ - object.c \ - point.c \ - vertex.c \ - segment.c \ - edge.c \ - triangle.c \ - face.c \ - kdtree.c \ - bbtree.c \ - misc.c \ - gts.h \ - gts-private.h \ - predicates.c \ - predicates.h \ - rounding.h \ - heap.c \ - eheap.c \ - fifo.c \ - matrix.c \ - surface.c \ - stripe.c \ - vopt.c \ - refine.c \ - iso.c \ - isotetra.c \ - split.c \ - psurface.c \ - hsurface.c \ - cdt.c \ - boolean.c \ - named.c \ - oocs.c \ - container.c \ - graph.c \ - pgraph.c \ - partition.c \ - curvature.c \ - tribox3.c - -include_HEADERS = \ - gts.h Index: trunk/gts/Makefile =================================================================== --- trunk/gts/Makefile (nonexistent) +++ trunk/gts/Makefile (revision 97) @@ -0,0 +1,42 @@ +# plain old Makefile for now - should be scconfig generated for explicit rules + +CFLAGS = -I.. -DG_LOG_DOMAIN=\"Gts\" $(shell pkg-config --cflags glib-2.0) + +OBJS = \ + object.o \ + point.o \ + vertex.o \ + segment.o \ + edge.o \ + triangle.o \ + face.o \ + kdtree.o \ + bbtree.o \ + misc.o \ + predicates.o \ + heap.o \ + eheap.o \ + fifo.o \ + matrix.o \ + surface.o \ + stripe.o \ + vopt.o \ + refine.o \ + iso.o \ + isotetra.o \ + split.o \ + psurface.o \ + hsurface.o \ + cdt.o \ + boolean.o \ + named.o \ + oocs.o \ + container.o \ + graph.o \ + pgraph.o \ + partition.o \ + curvature.o \ + tribox3.o + +libgts.a: $(OBJS) + ar rvu libgts.a $(OBJS) Index: trunk/scconfig/hooks.c =================================================================== --- trunk/scconfig/hooks.c (revision 96) +++ trunk/scconfig/hooks.c (revision 97) @@ -39,7 +39,7 @@ /* Runs when things should be detected for the target system */ int hook_detect_target() { - /* if there was no custom requirement from the command line, run all requirements in non-fatal mode */ + require("fstools/mkdir", 0, 1); require("libs/gui/gtk2", 0, 1); require("libs/gui/gd", 0, 1); return 0; @@ -57,7 +57,11 @@ /* Runs after detection hooks, should generate the output (Makefiles, etc.) */ int hook_generate() { - printf("Generation (A.in -> A.out): %d\n", generate("A.in", "A.out")); + db_mkdir("/local"); + +#warning TODO: need a better include search path mechanism + chdir("../src"); + printf("Generating pcb/Makefile\n", generate("Makefile.in", "Makefile")); return 0; } Index: trunk/src/pcbtest.sh.in =================================================================== --- trunk/src/pcbtest.sh.in (revision 96) +++ trunk/src/pcbtest.sh.in (nonexistent) @@ -1,95 +0,0 @@ -#! /bin/sh -# -# COPYRIGHT -# -# PCB, interactive printed circuit board design -# Copyright (C) 1994,1995,1996 Thomas Nau -# -# 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., 675 Mass Ave, Cambridge, MA 02139, USA. -# -# Contact addresses for paper mail and Email: -# Thomas Nau, Schlehenweg 15, 88471 Baustetten, Germany -# Thomas.Nau@rz.uni-ulm.de -# -# RCS: $Id$ -# -# -# -# starts a test installation of pcb - -# execute pcb - -# If the first argument is "-gdb" then run PCB inside the gdb -# debugger. -# -# Use --g-fatal-warnings with the gtk HID to cause gtk-WARNING's to -# abort. - -TEST_PATHS="--lib-path @TOP_BUILDDIR@/lib --lib-newlib @TOPSRCDIR@/newlib:@TOPSRCDIR@/lib/pcblib-newlib --element-path @TOP_BUILDDIR@/lib --font-path @TOPSRCDIR@/src" -TEST_CMDS="--lib-command-dir @TOP_BUILDDIR@/lib" - -# note: To do command line exporting, pcb requires the "-x " command to appear first. For example -# -# pcb -x bom [other args] pcbfile -# -# as opposed to -# -# pcb [other args] -x bom pcbfile -# - -use_gdb=no -if [ "X$1" = "X-gdb" ]; then - use_gdb=yes - shift -fi - -args="" -export_args="" - -while test $# -ne 0 ; do - case $1 in - -x) - export_args="$1 $2" - shift 2 - ;; - *) - args="$args $1" - shift - ;; - esac -done - -# build up the complete argument list -arg_list="$export_args $TEST_PATHS $TEST_CMDS $args" - -if test $use_gdb = yes ; then - tmpd=/tmp/pcbtest.$$ - tmpf=${tmpd}/pcbtest.gdb - mkdir -p -m 0700 ${tmpd} - rc=$? - if test $rc -ne 0 ; then - echo "$0: Could not create ${tmpd} with mode = 0700" - echo " mkdir returned $rc" - exit 1 - fi - cat > $tmpf << EOF -set args $arg_list -EOF - exec gdb -x $tmpf ./pcb - rm -fr $tmpd -else - exec @TOP_BUILDDIR@/src/pcb $arg_list -fi - Property changes on: trunk/src/pcbtest.sh.in ___________________________________________________________________ Deleted: svn:executable ## -1 +0,0 ## -* \ No newline at end of property Index: trunk/src/Makefile.am =================================================================== --- trunk/src/Makefile.am (revision 96) +++ trunk/src/Makefile.am (nonexistent) @@ -1,484 +0,0 @@ -## -*- makefile -*- -## $Id$ -## - -SUBDIRS= icons - -CC = @CC_OR_CXX@ -AM_CFLAGS = @CC_OR_CXX_FLAGS@ - -pcbtreedir= @PCBTREEDIR@ -pcblibdir= @PCBLIBDIR@ - -AUTOMAKE_OPTIONS = subdir-objects -HIDLIST = @HIDLIST@ -noinst_LIBRARIES = @HIDLIBS@ -EXTRA_LIBRARIES = \ - libgtk.a liblesstif.a libbatch.a \ - liblpr.a libgerber.a libbom.a libpng.a libps.a libnelma.a \ - libgcode.a - -pcblib_DATA= \ - default_font \ - gpcb-menu.res \ - pcb-menu.res - -bin_PROGRAMS= pcb - -if DEBUG_BUILD -# don't disable assert() -else -AM_CFLAGS += -DNDEBUG -endif - -PCB_SRCS = \ - action.c \ - action.h \ - autoplace.c \ - autoplace.h \ - autoroute.c \ - autoroute.h \ - box.h \ - buffer.c \ - buffer.h \ - change.c \ - change.h \ - clip.c \ - clip.h \ - command.c \ - command.h \ - compat.c \ - compat.h \ - const.h \ - copy.c \ - copy.h \ - create.c \ - create.h \ - crosshair.c \ - crosshair.h \ - data.c \ - data.h \ - djopt.c \ - djopt.h \ - dolists.h \ - draw.c \ - draw.h \ - drill.c \ - drill.h \ - edif.y \ - edif_parse.h \ - error.c \ - error.h \ - file.c \ - file.h \ - find.c \ - find.h \ - flags.c \ - fontmode.c \ - free_atexit.c \ - free_atexit.h \ - global.h \ - heap.c \ - heap.h \ - hid.h \ - insert.c \ - insert.h \ - intersect.c \ - intersect.h \ - line.c \ - line.h \ - lrealpath.c \ - lrealpath.h \ - macro.h \ - main.c \ - mirror.c \ - mirror.h \ - misc.c \ - misc.h \ - move.c \ - move.h \ - mtspace.c \ - mtspace.h \ - mymem.c \ - mymem.h \ - netlist.c \ - parse_l.h \ - parse_l.l \ - parse_y.h \ - parse_y.y \ - pcb-printf.c \ - pcb-printf.h \ - polygon.c \ - polygon.h \ - polygon1.c \ - polyarea.h \ - puller.c \ - print.c \ - print.h \ - rats.c \ - rats_mincut.c \ - rats.h \ - remove.c \ - remove.h \ - report.c \ - report.h \ - res_parse.y \ - res_lex.l \ - resource.h \ - rotate.c \ - rotate.h \ - rtree.c \ - rtree.h \ - rubberband.c \ - rubberband.h \ - search.c \ - search.h \ - select.c \ - select.h \ - set.c \ - set.h \ - strflags.c \ - strflags.h \ - thermal.c \ - thermal.h \ - undo.c \ - undo.h \ - vector.c \ - vector.h \ - vendor.c \ - vendor.h \ - hid/common/actions.c \ - hid/common/actions.h \ - hid/common/flags.c \ - hid/common/hidinit.c \ - hid/common/hidinit.h \ - hid/common/hidnogui.c \ - hid/common/hidnogui.h \ - hid/common/extents.c \ - hid/common/draw_helpers.c \ - hid/common/draw_helpers.h \ - hid/common/hid_resource.c \ - hid/common/hid_resource.h \ - hid/hidint.h \ - pcb-mincut/graph.c \ - pcb-mincut/graph.h \ - pcb-mincut/solve.c \ - pcb-mincut/solve.h - -EXTRA_pcb_SOURCES = ${DBUS_SRCS} ${GL_SRCS} toporouter.c toporouter.h -DBUS_SRCS= \ - dbus-pcbmain.c \ - dbus-pcbmain.h \ - dbus.h \ - dbus.c - -LIBGTK_GDK_SRCS= \ - hid/gtk/gtkhid-gdk.c - -LIBGTK_GL_SRCS= \ - hid/gtk/gtkhid-gl.c - -GL_SRCS= \ - hid/common/hidgl.c \ - hid/common/hidgl.h - -BUILT_SOURCES = \ - core_lists.h \ - gpcb-menu.h \ - hid/gtk/gtk_lists.h \ - hid/lesstif/lesstif_lists.h \ - hid/batch/batch_lists.h \ - hid/png/png_lists.h \ - hid/gcode/gcode_lists.h \ - hid/nelma/nelma_lists.h \ - hid/ps/ps_lists.h \ - parse_y.h \ - pcb-menu.h \ - res_parse.h \ - hid/common/hidlist.h - -pcb_LDADD = @HIDLIBS@ -pcb_DEPENDENCIES = @HIDLIBS@ - -if WITH_TOPOROUTER -PCB_SRCS += toporouter.c toporouter.h -pcb_LDADD += ../gts/libgts.a -pcb_DEPENDENCIES += ../gts/libgts.a -endif - -pcb_SOURCES = ${PCB_SRCS} core_lists.h - -# Action, Attribute, and Flag lists. -core_lists.h : ${PCB_SRCS} Makefile - true > $@ - (for f in ${PCB_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -# for globalconst.h -INCLUDES= -I$(top_srcdir) -I$(srcdir)/icons -I$(srcdir)/../gts - -DEFS= -DLOCALEDIR=\"$(localedir)\" @DEFS@ - -EXTRA_DIST= \ - check_icon.data \ - default_font \ - $(srcdir)/hid/batch/hid.conf \ - $(srcdir)/hid/bom/hid.conf \ - $(srcdir)/hid/gcode/hid.conf \ - $(srcdir)/hid/gerber/hid.conf \ - $(srcdir)/hid/gtk/gui-icons-misc.data \ - $(srcdir)/hid/gtk/gui-icons-mode-buttons.data \ - $(srcdir)/hid/gtk/hid.conf \ - $(srcdir)/hid/gtk/pcb.rc \ - $(srcdir)/hid/lesstif/hid.conf \ - $(srcdir)/hid/lpr/hid.conf \ - $(srcdir)/hid/png/hid.conf \ - $(srcdir)/hid/nelma/hid.conf \ - $(srcdir)/hid/ps/hid.conf \ - gpcb-menu.res.in \ - pcb-menu.res.in \ - pcbtest.sh.in \ - dbus.xml - -AM_YFLAGS= -d - -all-local: pcbtest.sh - -pcb-menu.res : pcb-menu.res.in - echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res.in DO NOT EDIT */' > $@ - cat ${srcdir}/pcb-menu.res.in >> $@ - -pcb-menu.h : pcb-menu.res - echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > $@ - echo 'const char *pcb_menu_default[] = {' >> $@ - sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < pcb-menu.res >> $@ - echo '0};' >> $@ - -gpcb-menu.res : gpcb-menu.res.in - echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res.in DO NOT EDIT */' > $@ - cat ${srcdir}/gpcb-menu.res.in >> $@ - -gpcb-menu.h : gpcb-menu.res - echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res DO NOT EDIT */' > $@ - echo 'const char *gpcb_menu_default[] = {' >> $@ - sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < gpcb-menu.res >> $@ - echo '0};' >> $@ - -hid/common/hidlist.h : Makefile - $(MKDIR_P) hid/common - true > $@ - for e in ${HIDLIST}; do \ - echo "HID_DEF($${e})" >> $@; \ - done - -libgtk_a_CPPFLAGS = -I./hid/gtk -LIBGTK_SRCS = \ - dolists.h \ - hid/hidint.h \ - hid/gtk/ghid-cell-renderer-visibility.c \ - hid/gtk/ghid-cell-renderer-visibility.h \ - hid/gtk/ghid-coord-entry.c \ - hid/gtk/ghid-coord-entry.h \ - hid/gtk/ghid-layer-selector.c \ - hid/gtk/ghid-layer-selector.h \ - hid/gtk/ghid-main-menu.c \ - hid/gtk/ghid-main-menu.h \ - hid/gtk/ghid-route-style-selector.c \ - hid/gtk/ghid-route-style-selector.h \ - hid/gtk/gtkhid-main.c \ - hid/gtk/gtkhid.h \ - hid/gtk/gui.h \ - hid/gtk/gui-command-window.c \ - hid/gtk/gui-config.c \ - hid/gtk/gui-dialog-print.c \ - hid/gtk/gui-dialog.c \ - hid/gtk/gui-drc-window.c \ - hid/gtk/gui-drc-window.h \ - hid/gtk/gui-keyref-window.c \ - hid/gtk/gui-library-window.c \ - hid/gtk/gui-library-window.h \ - hid/gtk/gui-log-window.c \ - hid/gtk/gui-misc.c \ - hid/gtk/gui-netlist-window.c \ - hid/gtk/gui-output-events.c \ - hid/gtk/gui-pinout-preview.c \ - hid/gtk/gui-pinout-preview.h \ - hid/gtk/gui-pinout-window.c \ - hid/gtk/gui-top-window.c \ - hid/gtk/gui-utils.c -libgtk_a_SOURCES = ${LIBGTK_SRCS} hid/gtk/gtk_lists.h - -hid/gtk/gtk_lists.h : ${LIBGTK_SRCS} Makefile - $(MKDIR_P) hid/gtk - true > $@ - (for f in ${LIBGTK_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -# If we are building with dbus support, we need some extra files -if WITH_DBUS -dbus-introspect.h : dbus.xml Makefile - echo '/* AUTOMATICALLY GENERATED FROM dbus.xml DO NOT EDIT */' > $@.tmp - echo "static char *pcb_dbus_introspect_xml =" > $@.tmp - sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/"/' < $(srcdir)/dbus.xml >> $@.tmp - echo ";" >> $@.tmp - mv $@.tmp $@ - -PCB_SRCS+= ${DBUS_SRCS} -BUILT_SOURCES+= dbus-introspect.h - -endif - -# If we are building with GL support, we need some extra files -if USE_GL -PCB_SRCS+= ${GL_SRCS} -LIBGTK_SRCS+= ${LIBGTK_GL_SRCS} -else -LIBGTK_SRCS+= ${LIBGTK_GDK_SRCS} -endif - -# If we are building on win32, then compile in some icons for the -# desktop and application toolbar -if WIN32 -pcb_icon.o : pcb_icon.ico $(srcdir)/hid/gtk/pcb.rc - $(WINDRES) $(srcdir)/hid/gtk/pcb.rc $@ - -pcb_icon.ico: $(top_srcdir)/data/pcb_icon.ico - cp $(top_srcdir)/data/pcb_icon.ico $@ - -pcb_LDADD+= pcb_icon.o -pcb_DEPENDENCIES+= pcb_icon.o - -endif - - -liblesstif_a_CPPFLAGS = -I./hid/lesstif -LIBLESSTIF_SRCS = \ - dolists.h \ - hid/hidint.h \ - hid/lesstif/dialogs.c \ - hid/lesstif/lesstif.h \ - hid/lesstif/library.c \ - hid/lesstif/main.c \ - hid/lesstif/menu.c \ - hid/lesstif/netlist.c \ - hid/lesstif/styles.c \ - hid/lesstif/xincludes.h -liblesstif_a_SOURCES = ${LIBLESSTIF_SRCS} hid/lesstif/lesstif_lists.h - -hid/lesstif/lesstif_lists.h : ${LIBLESSTIF_SRCS} Makefile - $(MKDIR_P) hid/lesstif - true > $@ - (for f in ${LIBLESSTIF_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -libbatch_a_CPPFLAGS = -I./hid/batch -LIBBATCH_SRCS = \ - hid/hidint.h \ - hid/batch/batch.c -libbatch_a_SOURCES = ${LIBBATCH_SRCS} hid/batch/batch_lists.h - -hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile - $(MKDIR_P) hid/batch - true > $@ - (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -libgerber_a_SOURCES = \ - hid/hidint.h \ - hid/gerber/gerber.c - -libbom_a_SOURCES = \ - hid/hidint.h \ - hid/bom/bom.c - -libps_a_CPPFLAGS = -I./hid/ps -LIBPS_SRCS = \ - dolists.h \ - hid/hidint.h \ - hid/ps/ps.c \ - hid/ps/ps.h \ - hid/ps/eps.c -libps_a_SOURCES = ${LIBPS_SRCS} hid/ps/ps_lists.h - -hid/ps/ps_lists.h : ${LIBPS_SRCS} Makefile - $(MKDIR_P) hid/ps - true > $@ - (for f in ${LIBPS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -libpng_a_CPPFLAGS = -I./hid/png -LIBPNG_SRCS = \ - dolists.h \ - hid/hidint.h \ - hid/png/png.c \ - hid/png/png.h -libpng_a_SOURCES = ${LIBPNG_SRCS} hid/png/png_lists.h - -hid/png/png_lists.h : ${LIBPNG_SRCS} Makefile - $(MKDIR_P) hid/png - true > $@ - (for f in ${LIBPNG_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -libgcode_a_CPPFLAGS = -I./hid/gcode -LIBGCODE_SRCS = \ - dolists.h \ - hid/hidint.h \ - hid/gcode/gcode.c \ - hid/gcode/gcode.h \ - hid/gcode/decompose.c \ - hid/gcode/decompose.h \ - hid/gcode/trace.c \ - hid/gcode/trace.h \ - hid/gcode/curve.c \ - hid/gcode/curve.h \ - hid/gcode/auxiliary.h \ - hid/gcode/bitmap.h \ - hid/gcode/lists.h \ - hid/gcode/potracelib.h -libgcode_a_SOURCES = ${LIBGCODE_SRCS} hid/gcode/gcode_lists.h - -hid/gcode/gcode_lists.h : ${LIBGCODE_SRCS} Makefile - $(MKDIR_P) hid/gcode - true > $@ - (for f in ${LIBGCODE_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -libnelma_a_CPPFLAGS = -I./hid/nelma -LIBNELMA_SRCS = \ - dolists.h \ - hid/hidint.h \ - hid/nelma/nelma.c -libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h - -hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile - $(MKDIR_P) hid/nelma - true > $@ - (for f in ${LIBNELMA_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp - mv $@.tmp $@ - -liblpr_a_SOURCES = \ - hid/hidint.h \ - hid/lpr/lpr.c - -DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \ - hid/batch/batch_lists.h \ - hid/common/hidlist.h \ - hid/gtk/gtk_lists.h \ - hid/lesstif/lesstif_lists.h \ - hid/png/png_lists.h \ - hid/gcode/gcode_lists.h \ - hid/nelma/nelma_lists.h \ - hid/ps/ps_lists.h \ - core_lists.h \ - dbus-introspect.h \ - gpcb-menu.res \ - pcb-menu.res - -# create wrapper script that lets you test pcb prior to installation -pcbtest.sh: $(srcdir)/pcbtest.sh.in Makefile - sed -e 's;@BUILDDIR@;${abs_builddir};g' -e 's;@TOP_BUILDDIR@;${abs_top_builddir};g' \ - -e 's;@TOPSRCDIR@;${abs_top_srcdir};g' \ - $(srcdir)/pcbtest.sh.in > $@ - chmod 755 $@ - Index: trunk/src/Makefile.in =================================================================== --- trunk/src/Makefile.in (nonexistent) +++ trunk/src/Makefile.in (revision 97) @@ -0,0 +1,196 @@ +HIDLIST = gtk +# lpr bom gcode gerber nelma png ps +###put /local/pcb/CFLAGS -std=gnu99 -I. -I.. -Iicons -DHAVE_CONFIG_H -g ### +###append /local/pcb/OBJS + action.o + autoplace.o + autoroute.o + buffer.o + change.o + clip.o + command.o + compat.o + copy.o + create.o + crosshair.o + data.o + djopt.o + draw.o + drill.o + error.o + file.o + find.o + flags.o + fontmode.o + free_atexit.o + heap.o + insert.o + intersect.o + line.o + lrealpath.o + main.o + mirror.o + misc.o + move.o + mtspace.o + mymem.o + netlist.o + pcb-printf.o + polygon.o + polygon1.o + puller.o + print.o + rats.o + rats_mincut.o + remove.o + report.o + rotate.o + rtree.o + rubberband.o + search.o + select.o + set.o + strflags.o + thermal.o + undo.o + vector.o + vendor.o + hid/common/actions.o + hid/common/flags.o + hid/common/hidinit.o + hid/common/hidnogui.o + hid/common/extents.o + hid/common/draw_helpers.o + hid/common/hid_resource.o + pcb-mincut/graph.o + pcb-mincut/solve.o + res_parse.o + res_lex.o + edif.o + parse_y.o + parse_l.o +### + +###append /local/pcb/YACC edif res_parse parse_y### +###append /local/pcb/LEX res_parse.l parse_l.l### + + + +###include Makefile.in.mod/gtk-gdk### +###include Makefile.in.mod/toporouter### + + +OBJS=###gsub /local/pcb/OBJS [\ + \ ]+ ### +CFLAGS=###gsub /local/pcb/CFLAGS [\ + \ ]+ ### +LDFLAGS=###gsub /local/pcb/LDFLAGS [\ + \ ]+ ### +LIBS=###gsub /local/pcb/LIBS [\ + \ ]+ ### + +all: pcb + +pcb: $(OBJS) + $(CC) $(LDFLAGS) $(OBJS) -o pcb $(LIBS) + +#-------- + + +pcblib_DATA= \ + default_font \ + gpcb-menu.res \ + pcb-menu.res + +#CFLAGS += -DNDEBUG + + + +###foreach /local/n /local/pcb/YACC### +###/local/n###.c ###/local/n###.h: ###/local/n###.y + bison -d ###/local/n###.y + mv ###/local/n###.tab.h ###/local/n###.h + mv ###/local/n###.tab.c ###/local/n###.c +###done### + +###foreach /local/n /local/pcb/LEX### +###/local/n###.c: ###/local/n###.l + flex -d ###/local/n###.l + mv lex.yy.c ###/local/n###.tab.h ###/local/n###.c +###done### + + + +EXTRA_DIST= \ + check_icon.data \ + default_font \ + hid/batch/hid.conf \ + hid/bom/hid.conf \ + hid/gcode/hid.conf \ + hid/gerber/hid.conf \ + hid/gtk/gui-icons-misc.data \ + hid/gtk/gui-icons-mode-buttons.data \ + hid/gtk/hid.conf \ + hid/gtk/pcb.rc \ + hid/lesstif/hid.conf \ + hid/lpr/hid.conf \ + hid/png/hid.conf \ + hid/nelma/hid.conf \ + hid/ps/hid.conf \ + gpcb-menu.res.in \ + pcb-menu.res.in \ + pcbtest.sh.in \ + dbus.xml + +all-local: pcbtest.sh + +pcb-menu.res : pcb-menu.res.in + echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res.in DO NOT EDIT */' > $@ + cat pcb-menu.res.in >> $@ + +pcb-menu.h : pcb-menu.res + echo '/* AUTOMATICALLY GENERATED FROM pcb-menu.res DO NOT EDIT */' > $@ + echo 'const char *pcb_menu_default[] = {' >> $@ + sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < pcb-menu.res >> $@ + echo '0};' >> $@ + +gpcb-menu.res : gpcb-menu.res.in + echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res.in DO NOT EDIT */' > $@ + cat gpcb-menu.res.in >> $@ + +gpcb-menu.h : gpcb-menu.res + echo '/* AUTOMATICALLY GENERATED FROM gpcb-menu.res DO NOT EDIT */' > $@ + echo 'const char *gpcb_menu_default[] = {' >> $@ + sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/",/' < gpcb-menu.res >> $@ + echo '0};' >> $@ + +hid/common/hidlist.h : Makefile + ###fstools/mkdir### hid/common + true > $@ + for e in ${HIDLIST}; do \ + echo "HID_DEF($${e})" >> $@; \ + done + + +hid/gtk/gtk_lists.h : ${LIBGTK_SRCS} Makefile + $(MKDIR_P) hid/gtk + true > $@ + (for f in ${LIBGTK_SRCS} ; do cat $$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ + +DISTCLEANFILES= pcbtest.sh gpcb-menu.h pcb-menu.h \ + hid/batch/batch_lists.h \ + hid/common/hidlist.h \ + hid/gtk/gtk_lists.h \ + hid/lesstif/lesstif_lists.h \ + hid/png/png_lists.h \ + hid/gcode/gcode_lists.h \ + hid/nelma/nelma_lists.h \ + hid/ps/ps_lists.h \ + core_lists.h \ + dbus-introspect.h \ + gpcb-menu.res \ + pcb-menu.res + +clean: + -rm pcb $(OBJS) Index: trunk/src/Makefile.in.mod/batch =================================================================== --- trunk/src/Makefile.in.mod/batch (nonexistent) +++ trunk/src/Makefile.in.mod/batch (revision 97) @@ -0,0 +1,12 @@ +libbatch_a_CPPFLAGS = -I./hid/batch +LIBBATCH_SRCS = \ + hid/hidint.h \ + hid/batch/batch.c +libbatch_a_SOURCES = ${LIBBATCH_SRCS} hid/batch/batch_lists.h + +hid/batch/batch_lists.h : ${LIBBATCH_SRCS} Makefile + $(MKDIR_P) hid/batch + true > $@ + (for f in ${LIBBATCH_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ + Index: trunk/src/Makefile.in.mod/bom =================================================================== --- trunk/src/Makefile.in.mod/bom (nonexistent) +++ trunk/src/Makefile.in.mod/bom (revision 97) @@ -0,0 +1,4 @@ +libbom_a_SOURCES = \ + hid/hidint.h \ + hid/bom/bom.c + Index: trunk/src/Makefile.in.mod/dbus =================================================================== --- trunk/src/Makefile.in.mod/dbus (nonexistent) +++ trunk/src/Makefile.in.mod/dbus (revision 97) @@ -0,0 +1,25 @@ +#DBUS_SRCS= \ +# dbus-pcbmain.c \ +# dbus-pcbmain.h \ +# dbus.h \ +# dbus.c +#LIBGTK_GL_SRCS= \ +# hid/gtk/gtkhid-gl.c +#GL_SRCS= \ +# hid/common/hidgl.c \ +# hid/common/hidgl.h + + +# If we are building with dbus support, we need some extra files +if WITH_DBUS +dbus-introspect.h : dbus.xml Makefile + echo '/* AUTOMATICALLY GENERATED FROM dbus.xml DO NOT EDIT */' > $@.tmp + echo "static char *pcb_dbus_introspect_xml =" > $@.tmp + sed 's/\\/\\\\/g; s/"/\\"/g; s/^/"/; s/$$/"/' < $(srcdir)/dbus.xml >> $@.tmp + echo ";" >> $@.tmp + mv $@.tmp $@ + +PCB_SRCS+= ${DBUS_SRCS} +BUILT_SOURCES+= dbus-introspect.h + +endif Index: trunk/src/Makefile.in.mod/gcode =================================================================== --- trunk/src/Makefile.in.mod/gcode (nonexistent) +++ trunk/src/Makefile.in.mod/gcode (revision 97) @@ -0,0 +1,24 @@ +libgcode_a_CPPFLAGS = -I./hid/gcode +LIBGCODE_SRCS = \ + dolists.h \ + hid/hidint.h \ + hid/gcode/gcode.c \ + hid/gcode/gcode.h \ + hid/gcode/decompose.c \ + hid/gcode/decompose.h \ + hid/gcode/trace.c \ + hid/gcode/trace.h \ + hid/gcode/curve.c \ + hid/gcode/curve.h \ + hid/gcode/auxiliary.h \ + hid/gcode/bitmap.h \ + hid/gcode/lists.h \ + hid/gcode/potracelib.h +libgcode_a_SOURCES = ${LIBGCODE_SRCS} hid/gcode/gcode_lists.h + +hid/gcode/gcode_lists.h : ${LIBGCODE_SRCS} Makefile + $(MKDIR_P) hid/gcode + true > $@ + (for f in ${LIBGCODE_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ + Index: trunk/src/Makefile.in.mod/gerber =================================================================== --- trunk/src/Makefile.in.mod/gerber (nonexistent) +++ trunk/src/Makefile.in.mod/gerber (revision 97) @@ -0,0 +1,4 @@ +libgerber_a_SOURCES = \ + hid/hidint.h \ + hid/gerber/gerber.c + Index: trunk/src/Makefile.in.mod/gl =================================================================== --- trunk/src/Makefile.in.mod/gl (nonexistent) +++ trunk/src/Makefile.in.mod/gl (revision 97) @@ -0,0 +1,7 @@ +# If we are building with GL support, we need some extra files +if USE_GL +PCB_SRCS+= ${GL_SRCS} +LIBGTK_SRCS+= ${LIBGTK_GL_SRCS} +else +LIBGTK_SRCS+= ${LIBGTK_GDK_SRCS} +endif Index: trunk/src/Makefile.in.mod/gtk-gdk =================================================================== --- trunk/src/Makefile.in.mod/gtk-gdk (nonexistent) +++ trunk/src/Makefile.in.mod/gtk-gdk (revision 97) @@ -0,0 +1,28 @@ +# gtk option +###append /local/pcb/CFLAGS -I./hid/gtk### +###nappend /local/pcb/CFLAGS /target/libs/gui/gtk2/cflags### +###nappend /local/pcb/LIBS /target/libs/gui/gtk2/ldflags### +###append /local/pcb/OBJS + hid/gtk/ghid-cell-renderer-visibility.o + hid/gtk/ghid-coord-entry.o + hid/gtk/ghid-layer-selector.o + hid/gtk/ghid-main-menu.o + hid/gtk/ghid-route-style-selector.o + hid/gtk/gtkhid-main.o + hid/gtk/gui-command-window.o + hid/gtk/gui-config.o + hid/gtk/gui-dialog-print.o + hid/gtk/gui-dialog.o + hid/gtk/gui-drc-window.o + hid/gtk/gui-keyref-window.o + hid/gtk/gui-library-window.o + hid/gtk/gui-log-window.o + hid/gtk/gui-misc.o + hid/gtk/gui-netlist-window.o + hid/gtk/gui-output-events.o + hid/gtk/gui-pinout-preview.o + hid/gtk/gui-pinout-window.o + hid/gtk/gui-top-window.o + hid/gtk/gui-utils.o + hid/gtk/gtkhid-gdk.o +### Index: trunk/src/Makefile.in.mod/lesstif =================================================================== --- trunk/src/Makefile.in.mod/lesstif (nonexistent) +++ trunk/src/Makefile.in.mod/lesstif (revision 97) @@ -0,0 +1,19 @@ +liblesstif_a_CPPFLAGS = -I./hid/lesstif +LIBLESSTIF_SRCS = \ + dolists.h \ + hid/hidint.h \ + hid/lesstif/dialogs.c \ + hid/lesstif/lesstif.h \ + hid/lesstif/library.c \ + hid/lesstif/main.c \ + hid/lesstif/menu.c \ + hid/lesstif/netlist.c \ + hid/lesstif/styles.c \ + hid/lesstif/xincludes.h +liblesstif_a_SOURCES = ${LIBLESSTIF_SRCS} hid/lesstif/lesstif_lists.h + +hid/lesstif/lesstif_lists.h : ${LIBLESSTIF_SRCS} Makefile + $(MKDIR_P) hid/lesstif + true > $@ + (for f in ${LIBLESSTIF_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ Index: trunk/src/Makefile.in.mod/lpr =================================================================== --- trunk/src/Makefile.in.mod/lpr (nonexistent) +++ trunk/src/Makefile.in.mod/lpr (revision 97) @@ -0,0 +1,4 @@ +liblpr_a_SOURCES = \ + hid/hidint.h \ + hid/lpr/lpr.c + Index: trunk/src/Makefile.in.mod/nelma =================================================================== --- trunk/src/Makefile.in.mod/nelma (nonexistent) +++ trunk/src/Makefile.in.mod/nelma (revision 97) @@ -0,0 +1,13 @@ +libnelma_a_CPPFLAGS = -I./hid/nelma +LIBNELMA_SRCS = \ + dolists.h \ + hid/hidint.h \ + hid/nelma/nelma.c +libnelma_a_SOURCES = ${LIBNELMA_SRCS} hid/nelma/nelma_lists.h + +hid/nelma/nelma_lists.h : ${LIBNELMA_SRCS} Makefile + $(MKDIR_P) hid/nelma + true > $@ + (for f in ${LIBNELMA_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ + Index: trunk/src/Makefile.in.mod/png =================================================================== --- trunk/src/Makefile.in.mod/png (nonexistent) +++ trunk/src/Makefile.in.mod/png (revision 97) @@ -0,0 +1,13 @@ +libpng_a_CPPFLAGS = -I./hid/png +LIBPNG_SRCS = \ + dolists.h \ + hid/hidint.h \ + hid/png/png.c \ + hid/png/png.h +libpng_a_SOURCES = ${LIBPNG_SRCS} hid/png/png_lists.h + +hid/png/png_lists.h : ${LIBPNG_SRCS} Makefile + $(MKDIR_P) hid/png + true > $@ + (for f in ${LIBPNG_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ Index: trunk/src/Makefile.in.mod/ps =================================================================== --- trunk/src/Makefile.in.mod/ps (nonexistent) +++ trunk/src/Makefile.in.mod/ps (revision 97) @@ -0,0 +1,15 @@ +libps_a_CPPFLAGS = -I./hid/ps +LIBPS_SRCS = \ + dolists.h \ + hid/hidint.h \ + hid/ps/ps.c \ + hid/ps/ps.h \ + hid/ps/eps.c +libps_a_SOURCES = ${LIBPS_SRCS} hid/ps/ps_lists.h + +hid/ps/ps_lists.h : ${LIBPS_SRCS} Makefile + $(MKDIR_P) hid/ps + true > $@ + (for f in ${LIBPS_SRCS} ; do cat $(srcdir)/$$f ; done) | grep "^REGISTER" > $@.tmp + mv $@.tmp $@ + Index: trunk/src/Makefile.in.mod/toporouter =================================================================== --- trunk/src/Makefile.in.mod/toporouter (nonexistent) +++ trunk/src/Makefile.in.mod/toporouter (revision 97) @@ -0,0 +1,3 @@ +###append /local/pcb/OBJS toporouter.o### +###append /local/pcb/LIBS ../gts/libgts.a### +###append /local/pcb/CFLAGS -I../gts### Index: trunk/src/Makefile.in.mod/win32 =================================================================== --- trunk/src/Makefile.in.mod/win32 (nonexistent) +++ trunk/src/Makefile.in.mod/win32 (revision 97) @@ -0,0 +1,13 @@ +# If we are building on win32, then compile in some icons for the +# desktop and application toolbar +if WIN32 +pcb_icon.o : pcb_icon.ico $(srcdir)/hid/gtk/pcb.rc + $(WINDRES) $(srcdir)/hid/gtk/pcb.rc $@ + +pcb_icon.ico: $(top_srcdir)/data/pcb_icon.ico + cp $(top_srcdir)/data/pcb_icon.ico $@ + +pcb_LDADD+= pcb_icon.o +pcb_DEPENDENCIES+= pcb_icon.o + +endif Index: trunk/src/gen_core_lists.sh =================================================================== --- trunk/src/gen_core_lists.sh (nonexistent) +++ trunk/src/gen_core_lists.sh (revision 97) @@ -0,0 +1,7 @@ +#!/bin/sh +for f in $* +do + cat $f +done | grep "^REGISTER" + + Property changes on: trunk/src/gen_core_lists.sh ___________________________________________________________________ Added: svn:executable ## -0,0 +1 ## +* \ No newline at end of property Index: trunk/src/main.c =================================================================== --- trunk/src/main.c (revision 96) +++ trunk/src/main.c (revision 97) @@ -1778,10 +1778,12 @@ setbuf (stdout, 0); InitPaths (argv[0]); +#ifdef LOCALEDIR bindtextdomain (GETTEXT_PACKAGE, LOCALEDIR); textdomain(GETTEXT_PACKAGE); bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8"); setlocale(LC_ALL,""); +#endif srand ( time(NULL) ); /* Set seed for rand() */ Index: trunk/src/res_parse.c =================================================================== --- trunk/src/res_parse.c (revision 96) +++ trunk/src/res_parse.c (revision 97) @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.7.12-4996. */ -/* Skeleton implementation for Bison's Yacc-like parsers in C +/* Bison implementation for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 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 @@ -45,7 +44,7 @@ #define YYBISON 1 /* Bison version. */ -#define YYBISON_VERSION "2.4.3" +#define YYBISON_VERSION "2.7.12-4996" /* Skeleton name. */ #define YYSKELETON_NAME "yacc.c" @@ -59,8 +58,6 @@ /* Pull parsers. */ #define YYPULL 1 -/* Using locations. */ -#define YYLSP_NEEDED 0 /* Substitute the variable and function names. */ #define yyparse resparse @@ -71,10 +68,8 @@ #define yydebug resdebug #define yynerrs resnerrs - /* Copy the first part of user declarations. */ - -/* Line 189 of yacc.c */ +/* Line 371 of yacc.c */ #line 3 "res_parse.y" @@ -114,15 +109,17 @@ #define f(x) current_res->flags |= x +/* Line 371 of yacc.c */ +#line 114 "res_parse.tab.c" -/* Line 189 of yacc.c */ -#line 120 "res_parse.c" +# ifndef YY_NULL +# if defined __cplusplus && 201103L <= __cplusplus +# define YY_NULL nullptr +# else +# define YY_NULL 0 +# endif +# endif -/* Enabling traces. */ -#ifndef YYDEBUG -# define YYDEBUG 0 -#endif - /* Enabling verbose error messages. */ #ifdef YYERROR_VERBOSE # undef YYERROR_VERBOSE @@ -131,12 +128,18 @@ # define YYERROR_VERBOSE 0 #endif -/* Enabling the token table. */ -#ifndef YYTOKEN_TABLE -# define YYTOKEN_TABLE 0 +/* In a future release of Bison, this section will be replaced + by #include "res_parse.tab.h". */ +#ifndef YY_RES_RES_PARSE_TAB_H_INCLUDED +# define YY_RES_RES_PARSE_TAB_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 #endif +#if YYDEBUG +extern int resdebug; +#endif - /* Tokens. */ #ifndef YYTOKENTYPE # define YYTOKENTYPE @@ -147,18 +150,12 @@ INCLUDE = 259 }; #endif -/* Tokens. */ -#define STRING 258 -#define INCLUDE 259 - - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { - -/* Line 214 of yacc.c */ +/* Line 387 of yacc.c */ #line 45 "res_parse.y" int ival; @@ -166,9 +163,8 @@ Resource *rval; - -/* Line 214 of yacc.c */ -#line 172 "res_parse.c" +/* Line 387 of yacc.c */ +#line 168 "res_parse.tab.c" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -175,13 +171,29 @@ # define YYSTYPE_IS_DECLARED 1 #endif +extern YYSTYPE reslval; +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int resparse (void *YYPARSE_PARAM); +#else +int resparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int resparse (void); +#else +int resparse (); +#endif +#endif /* ! YYPARSE_PARAM */ + +#endif /* !YY_RES_RES_PARSE_TAB_H_INCLUDED */ + /* Copy the second part of user declarations. */ +/* Line 390 of yacc.c */ +#line 196 "res_parse.tab.c" -/* Line 264 of yacc.c */ -#line 184 "res_parse.c" - #ifdef short # undef short #endif @@ -233,24 +245,33 @@ # if defined YYENABLE_NLS && YYENABLE_NLS # if ENABLE_NLS # include /* INFRINGES ON USER NAME SPACE */ -# define YY_(msgid) dgettext ("bison-runtime", msgid) +# define YY_(Msgid) dgettext ("bison-runtime", Msgid) # endif # endif # ifndef YY_ -# define YY_(msgid) msgid +# define YY_(Msgid) Msgid # endif #endif +#ifndef __attribute__ +/* This feature is available in gcc versions 2.5 and later. */ +# if (! defined __GNUC__ || __GNUC__ < 2 \ + || (__GNUC__ == 2 && __GNUC_MINOR__ < 5)) +# define __attribute__(Spec) /* empty */ +# endif +#endif + /* Suppress unused-variable warnings by "using" E. */ #if ! defined lint || defined __GNUC__ -# define YYUSE(e) ((void) (e)) +# define YYUSE(E) ((void) (E)) #else -# define YYUSE(e) /* empty */ +# define YYUSE(E) /* empty */ #endif + /* Identity function, used to suppress warnings about constant conditions. */ #ifndef lint -# define YYID(n) (n) +# define YYID(N) (N) #else #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) @@ -283,11 +304,12 @@ # define alloca _alloca # else # define YYSTACK_ALLOC alloca -# if ! defined _ALLOCA_H && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 + /* Use EXIT_SUCCESS as a witness for stdlib.h. */ +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # endif @@ -310,17 +332,17 @@ # ifndef YYSTACK_ALLOC_MAXIMUM # define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM # endif -# if (defined __cplusplus && ! defined _STDLIB_H \ +# if (defined __cplusplus && ! defined EXIT_SUCCESS \ && ! ((defined YYMALLOC || defined malloc) \ && (defined YYFREE || defined free))) # include /* INFRINGES ON USER NAME SPACE */ -# ifndef _STDLIB_H -# define _STDLIB_H 1 +# ifndef EXIT_SUCCESS +# define EXIT_SUCCESS 0 # endif # endif # ifndef YYMALLOC # define YYMALLOC malloc -# if ! defined malloc && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined malloc && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */ # endif @@ -327,7 +349,7 @@ # endif # ifndef YYFREE # define YYFREE free -# if ! defined free && ! defined _STDLIB_H && (defined __STDC__ || defined __C99__FUNC__ \ +# if ! defined free && ! defined EXIT_SUCCESS && (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) void free (void *); /* INFRINGES ON USER NAME SPACE */ # endif @@ -356,23 +378,7 @@ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \ + YYSTACK_GAP_MAXIMUM) -/* Copy COUNT objects from FROM to TO. The source and destination do - not overlap. */ -# ifndef YYCOPY -# if defined __GNUC__ && 1 < __GNUC__ -# define YYCOPY(To, From, Count) \ - __builtin_memcpy (To, From, (Count) * sizeof (*(From))) -# else -# define YYCOPY(To, From, Count) \ - do \ - { \ - YYSIZE_T yyi; \ - for (yyi = 0; yyi < (Count); yyi++) \ - (To)[yyi] = (From)[yyi]; \ - } \ - while (YYID (0)) -# endif -# endif +# define YYCOPY_NEEDED 1 /* Relocate STACK from its old location to the new one. The local variables YYSIZE and YYSTACKSIZE give the old and new number of @@ -392,6 +398,26 @@ #endif +#if defined YYCOPY_NEEDED && YYCOPY_NEEDED +/* Copy COUNT objects from SRC to DST. The source and destination do + not overlap. */ +# ifndef YYCOPY +# if defined __GNUC__ && 1 < __GNUC__ +# define YYCOPY(Dst, Src, Count) \ + __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src))) +# else +# define YYCOPY(Dst, Src, Count) \ + do \ + { \ + YYSIZE_T yyi; \ + for (yyi = 0; yyi < (Count); yyi++) \ + (Dst)[yyi] = (Src)[yyi]; \ + } \ + while (YYID (0)) +# endif +# endif +#endif /* !YYCOPY_NEEDED */ + /* YYFINAL -- State number of the termination state. */ #define YYFINAL 3 /* YYLAST -- Last index in YYTABLE. */ @@ -470,13 +496,13 @@ }; #endif -#if YYDEBUG || YYERROR_VERBOSE || YYTOKEN_TABLE +#if YYDEBUG || YYERROR_VERBOSE || 0 /* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM. First, the terminals, then, starting at YYNTOKENS, nonterminals. */ static const char *const yytname[] = { "$end", "error", "$undefined", "STRING", "INCLUDE", "'{'", "'}'", "'='", - "$accept", "top_res", "$@1", "res", "$@2", "res_item_zm", "res_item", 0 + "$accept", "top_res", "$@1", "res", "$@2", "res_item_zm", "res_item", YY_NULL }; #endif @@ -503,8 +529,8 @@ 1, 1, 3, 1 }; -/* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state - STATE-NUM when YYTABLE doesn't specify something else to do. Zero +/* YYDEFACT[STATE-NAME] -- Default reduction number in state STATE-NUM. + Performed when YYTABLE doesn't specify something else to do. Zero means the default is an error. */ static const yytype_uint8 yydefact[] = { @@ -535,8 +561,7 @@ /* YYTABLE[YYPACT[STATE-NUM]]. What to do in state STATE-NUM. If positive, shift that token. If negative, reduce the rule which - number is the opposite. If zero, do what YYDEFACT says. - If YYTABLE_NINF, syntax error. */ + number is the opposite. If YYTABLE_NINF, syntax error. */ #define YYTABLE_NINF -8 static const yytype_int8 yytable[] = { @@ -545,6 +570,12 @@ 11, 16, 17, 0, 0, 15 }; +#define yypact_value_is_default(Yystate) \ + (!!((Yystate) == (-1))) + +#define yytable_value_is_error(Yytable_value) \ + YYID (0) + static const yytype_int8 yycheck[] = { 0, 1, 0, 3, 4, 5, 6, 0, 1, 5, @@ -587,72 +618,35 @@ #define YYRECOVERING() (!!yyerrstatus) -#define YYBACKUP(Token, Value) \ -do \ - if (yychar == YYEMPTY && yylen == 1) \ - { \ - yychar = (Token); \ - yylval = (Value); \ - yytoken = YYTRANSLATE (yychar); \ - YYPOPSTACK (1); \ - goto yybackup; \ - } \ - else \ - { \ +#define YYBACKUP(Token, Value) \ +do \ + if (yychar == YYEMPTY) \ + { \ + yychar = (Token); \ + yylval = (Value); \ + YYPOPSTACK (yylen); \ + yystate = *yyssp; \ + goto yybackup; \ + } \ + else \ + { \ yyerror (YY_("syntax error: cannot back up")); \ YYERROR; \ } \ while (YYID (0)) - +/* Error token number */ #define YYTERROR 1 #define YYERRCODE 256 -/* YYLLOC_DEFAULT -- Set CURRENT to span from RHS[1] to RHS[N]. - If N is 0, then set CURRENT to the empty location which ends - the previous symbol: RHS[0] (always defined). */ - -#define YYRHSLOC(Rhs, K) ((Rhs)[K]) -#ifndef YYLLOC_DEFAULT -# define YYLLOC_DEFAULT(Current, Rhs, N) \ - do \ - if (YYID (N)) \ - { \ - (Current).first_line = YYRHSLOC (Rhs, 1).first_line; \ - (Current).first_column = YYRHSLOC (Rhs, 1).first_column; \ - (Current).last_line = YYRHSLOC (Rhs, N).last_line; \ - (Current).last_column = YYRHSLOC (Rhs, N).last_column; \ - } \ - else \ - { \ - (Current).first_line = (Current).last_line = \ - YYRHSLOC (Rhs, 0).last_line; \ - (Current).first_column = (Current).last_column = \ - YYRHSLOC (Rhs, 0).last_column; \ - } \ - while (YYID (0)) -#endif - - -/* YY_LOCATION_PRINT -- Print the location on the stream. - This macro was not mandated originally: define only if we know - we won't break user code: when these are the locations we know. */ - +/* This macro is provided for backward compatibility. */ #ifndef YY_LOCATION_PRINT -# if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL -# define YY_LOCATION_PRINT(File, Loc) \ - fprintf (File, "%d.%d-%d.%d", \ - (Loc).first_line, (Loc).first_column, \ - (Loc).last_line, (Loc).last_column) -# else -# define YY_LOCATION_PRINT(File, Loc) ((void) 0) -# endif +# define YY_LOCATION_PRINT(File, Loc) ((void) 0) #endif /* YYLEX -- calling `yylex' with the right arguments. */ - #ifdef YYLEX_PARAM # define YYLEX yylex (YYLEX_PARAM) #else @@ -702,6 +696,8 @@ YYSTYPE const * const yyvaluep; #endif { + FILE *yyo = yyoutput; + YYUSE (yyo); if (!yyvaluep) return; # ifdef YYPRINT @@ -710,11 +706,7 @@ # else YYUSE (yyoutput); # endif - switch (yytype) - { - default: - break; - } + YYUSE (yytype); } @@ -839,7 +831,6 @@ # define YYMAXDEPTH 10000 #endif - #if YYERROR_VERBOSE @@ -942,115 +933,145 @@ } # endif -/* Copy into YYRESULT an error message about the unexpected token - YYCHAR while in state YYSTATE. Return the number of bytes copied, - including the terminating null byte. If YYRESULT is null, do not - copy anything; just return the number of bytes that would be - copied. As a special case, return 0 if an ordinary "syntax error" - message will do. Return YYSIZE_MAXIMUM if overflow occurs during - size calculation. */ -static YYSIZE_T -yysyntax_error (char *yyresult, int yystate, int yychar) +/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message + about the unexpected token YYTOKEN for the state stack whose top is + YYSSP. + + Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is + not large enough to hold the message. In that case, also set + *YYMSG_ALLOC to the required number of bytes. Return 2 if the + required number of bytes is too large to store. */ +static int +yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg, + yytype_int16 *yyssp, int yytoken) { - int yyn = yypact[yystate]; + YYSIZE_T yysize0 = yytnamerr (YY_NULL, yytname[yytoken]); + YYSIZE_T yysize = yysize0; + enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; + /* Internationalized format string. */ + const char *yyformat = YY_NULL; + /* Arguments of yyformat. */ + char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; + /* Number of reported tokens (one for the "unexpected", one per + "expected"). */ + int yycount = 0; - if (! (YYPACT_NINF < yyn && yyn <= YYLAST)) - return 0; - else + /* There are many possibilities here to consider: + - Assume YYFAIL is not used. It's too flawed to consider. See + + for details. YYERROR is fine as it does not invoke this + function. + - If this state is a consistent state with a default action, then + the only way this function was invoked is if the default action + is an error action. In that case, don't check for expected + tokens because there are none. + - The only way there can be no lookahead present (in yychar) is if + this state is a consistent state with a default action. Thus, + detecting the absence of a lookahead is sufficient to determine + that there is no unexpected or expected token to report. In that + case, just report a simple "syntax error". + - Don't assume there isn't a lookahead just because this state is a + consistent state with a default action. There might have been a + previous inconsistent state, consistent state with a non-default + action, or user semantic action that manipulated yychar. + - Of course, the expected token list depends on states to have + correct lookahead information, and it depends on the parser not + to perform extra reductions after fetching a lookahead from the + scanner and before detecting a syntax error. Thus, state merging + (from LALR or IELR) and default reductions corrupt the expected + token list. However, the list is correct for canonical LR with + one exception: it will still contain any token that will not be + accepted due to an error action in a later state. + */ + if (yytoken != YYEMPTY) { - int yytype = YYTRANSLATE (yychar); - YYSIZE_T yysize0 = yytnamerr (0, yytname[yytype]); - YYSIZE_T yysize = yysize0; - YYSIZE_T yysize1; - int yysize_overflow = 0; - enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 }; - char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM]; - int yyx; + int yyn = yypact[*yyssp]; + yyarg[yycount++] = yytname[yytoken]; + if (!yypact_value_is_default (yyn)) + { + /* Start YYX at -YYN if negative to avoid negative indexes in + YYCHECK. In other words, skip the first -YYN actions for + this state because they are default actions. */ + int yyxbegin = yyn < 0 ? -yyn : 0; + /* Stay within bounds of both yycheck and yytname. */ + int yychecklim = YYLAST - yyn + 1; + int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; + int yyx; -# if 0 - /* This is so xgettext sees the translatable formats that are - constructed on the fly. */ - YY_("syntax error, unexpected %s"); - YY_("syntax error, unexpected %s, expecting %s"); - YY_("syntax error, unexpected %s, expecting %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s"); - YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"); -# endif - char *yyfmt; - char const *yyf; - static char const yyunexpected[] = "syntax error, unexpected %s"; - static char const yyexpecting[] = ", expecting %s"; - static char const yyor[] = " or %s"; - char yyformat[sizeof yyunexpected - + sizeof yyexpecting - 1 - + ((YYERROR_VERBOSE_ARGS_MAXIMUM - 2) - * (sizeof yyor - 1))]; - char const *yyprefix = yyexpecting; + for (yyx = yyxbegin; yyx < yyxend; ++yyx) + if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR + && !yytable_value_is_error (yytable[yyx + yyn])) + { + if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) + { + yycount = 1; + yysize = yysize0; + break; + } + yyarg[yycount++] = yytname[yyx]; + { + YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULL, yytname[yyx]); + if (! (yysize <= yysize1 + && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } + } + } + } - /* Start YYX at -YYN if negative to avoid negative indexes in - YYCHECK. */ - int yyxbegin = yyn < 0 ? -yyn : 0; + switch (yycount) + { +# define YYCASE_(N, S) \ + case N: \ + yyformat = S; \ + break + YYCASE_(0, YY_("syntax error")); + YYCASE_(1, YY_("syntax error, unexpected %s")); + YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s")); + YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s")); + YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s")); + YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s")); +# undef YYCASE_ + } - /* Stay within bounds of both yycheck and yytname. */ - int yychecklim = YYLAST - yyn + 1; - int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS; - int yycount = 1; + { + YYSIZE_T yysize1 = yysize + yystrlen (yyformat); + if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)) + return 2; + yysize = yysize1; + } - yyarg[0] = yytname[yytype]; - yyfmt = yystpcpy (yyformat, yyunexpected); + if (*yymsg_alloc < yysize) + { + *yymsg_alloc = 2 * yysize; + if (! (yysize <= *yymsg_alloc + && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM)) + *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM; + return 1; + } - for (yyx = yyxbegin; yyx < yyxend; ++yyx) - if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR) - { - if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM) - { - yycount = 1; - yysize = yysize0; - yyformat[sizeof yyunexpected - 1] = '\0'; - break; - } - yyarg[yycount++] = yytname[yyx]; - yysize1 = yysize + yytnamerr (0, yytname[yyx]); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - yyfmt = yystpcpy (yyfmt, yyprefix); - yyprefix = yyor; - } - - yyf = YY_(yyformat); - yysize1 = yysize + yystrlen (yyf); - yysize_overflow |= (yysize1 < yysize); - yysize = yysize1; - - if (yysize_overflow) - return YYSIZE_MAXIMUM; - - if (yyresult) - { - /* Avoid sprintf, as that infringes on the user's name space. - Don't have undefined behavior even if the translation - produced a string with the wrong number of "%s"s. */ - char *yyp = yyresult; - int yyi = 0; - while ((*yyp = *yyf) != '\0') - { - if (*yyp == '%' && yyf[1] == 's' && yyi < yycount) - { - yyp += yytnamerr (yyp, yyarg[yyi++]); - yyf += 2; - } - else - { - yyp++; - yyf++; - } - } - } - return yysize; - } + /* Avoid sprintf, as that infringes on the user's name space. + Don't have undefined behavior even if the translation + produced a string with the wrong number of "%s"s. */ + { + char *yyp = *yymsg; + int yyi = 0; + while ((*yyp = *yyformat) != '\0') + if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount) + { + yyp += yytnamerr (yyp, yyarg[yyi++]); + yyformat += 2; + } + else + { + yyp++; + yyformat++; + } + } + return 0; } #endif /* YYERROR_VERBOSE */ - /*-----------------------------------------------. | Release the memory associated to this symbol. | @@ -1075,45 +1096,35 @@ yymsg = "Deleting"; YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp); - switch (yytype) - { - - default: - break; - } + YYUSE (yytype); } -/* Prevent warnings from -Wmissing-prototypes. */ -#ifdef YYPARSE_PARAM -#if defined __STDC__ || defined __cplusplus -int yyparse (void *YYPARSE_PARAM); -#else -int yyparse (); -#endif -#else /* ! YYPARSE_PARAM */ -#if defined __STDC__ || defined __cplusplus -int yyparse (void); -#else -int yyparse (); -#endif -#endif /* ! YYPARSE_PARAM */ + /* The lookahead symbol. */ int yychar; + +#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN +# define YY_IGNORE_MAYBE_UNINITIALIZED_END +#endif +#ifndef YY_INITIAL_VALUE +# define YY_INITIAL_VALUE(Value) /* Nothing. */ +#endif + /* The semantic value of the lookahead symbol. */ -YYSTYPE yylval; +YYSTYPE yylval YY_INITIAL_VALUE(yyval_default); /* Number of syntax errors so far. */ int yynerrs; +/*----------. +| yyparse. | +`----------*/ -/*-------------------------. -| yyparse or yypush_parse. | -`-------------------------*/ - #ifdef YYPARSE_PARAM #if (defined __STDC__ || defined __C99__FUNC__ \ || defined __cplusplus || defined _MSC_VER) @@ -1136,8 +1147,6 @@ #endif #endif { - - int yystate; /* Number of tokens to shift before error messages enabled. */ int yyerrstatus; @@ -1146,7 +1155,7 @@ `yyss': related to states. `yyvs': related to semantic values. - Refer to the stacks thru separate pointers, to allow yyoverflow + Refer to the stacks through separate pointers, to allow yyoverflow to reallocate them elsewhere. */ /* The state stack. */ @@ -1164,7 +1173,7 @@ int yyn; int yyresult; /* Lookahead token as an internal (translated) token number. */ - int yytoken; + int yytoken = 0; /* The variables used to return semantic value and location from the action routines. */ YYSTYPE yyval; @@ -1182,9 +1191,8 @@ Keep to zero when no symbol should be popped. */ int yylen = 0; - yytoken = 0; - yyss = yyssa; - yyvs = yyvsa; + yyssp = yyss = yyssa; + yyvsp = yyvs = yyvsa; yystacksize = YYINITDEPTH; YYDPRINTF ((stderr, "Starting parse\n")); @@ -1193,14 +1201,6 @@ yyerrstatus = 0; yynerrs = 0; yychar = YYEMPTY; /* Cause a token to be read. */ - - /* Initialize stack pointers. - Waste one element of value and location stack - so that they stay on the same level as the state stack. - The wasted elements are never initialized. */ - yyssp = yyss; - yyvsp = yyvs; - goto yysetstate; /*------------------------------------------------------------. @@ -1292,7 +1292,7 @@ /* First try to decide what to do without reference to lookahead token. */ yyn = yypact[yystate]; - if (yyn == YYPACT_NINF) + if (yypact_value_is_default (yyn)) goto yydefault; /* Not known => get a lookahead token if don't already have one. */ @@ -1323,8 +1323,8 @@ yyn = yytable[yyn]; if (yyn <= 0) { - if (yyn == 0 || yyn == YYTABLE_NINF) - goto yyerrlab; + if (yytable_value_is_error (yyn)) + goto yyerrlab; yyn = -yyn; goto yyreduce; } @@ -1341,7 +1341,9 @@ yychar = YYEMPTY; yystate = yyn; + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END goto yynewstate; @@ -1378,67 +1380,69 @@ switch (yyn) { case 2: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 57 "res_parse.y" { current_res = parsed_res = resource_create(NULL); } break; case 4: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 62 "res_parse.y" { current_res = resource_create(current_res); } break; case 5: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 64 "res_parse.y" { (yyval.rval) = current_res; current_res = current_res->parent; } break; case 8: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 69 "res_parse.y" { resource_add_val(current_res, 0, (yyvsp[(1) - (1)].sval), 0); f(FLAG_V); } break; case 9: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 70 "res_parse.y" { resource_add_val(current_res, (yyvsp[(1) - (3)].sval), (yyvsp[(3) - (3)].sval), 0); f(FLAG_NV); } break; case 10: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 71 "res_parse.y" { resource_add_val(current_res, 0, (yyvsp[(1) - (1)].sval), 0); f(FLAG_S); } break; case 11: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 72 "res_parse.y" { resource_add_val(current_res, 0, 0, (yyvsp[(1) - (1)].rval)); f(FLAG_S); } break; case 12: - -/* Line 1464 of yacc.c */ +/* Line 1787 of yacc.c */ #line 73 "res_parse.y" { resource_add_val(current_res, (yyvsp[(1) - (3)].sval), 0, (yyvsp[(3) - (3)].rval)); f(FLAG_NS); } break; - -/* Line 1464 of yacc.c */ -#line 1440 "res_parse.c" +/* Line 1787 of yacc.c */ +#line 1433 "res_parse.tab.c" default: break; } + /* User semantic actions sometimes alter yychar, and that requires + that yytoken be updated with the new translation. We take the + approach of translating immediately before every use of yytoken. + One alternative is translating here after every semantic action, + but that translation would be missed if the semantic action invokes + YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or + if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an + incorrect destructor might then be invoked immediately. In the + case of YYERROR or YYBACKUP, subsequent parser actions might lead + to an incorrect destructor call or verbose syntax error message + before the lookahead is translated. */ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc); YYPOPSTACK (yylen); @@ -1466,6 +1470,10 @@ | yyerrlab -- here on detecting error | `------------------------------------*/ yyerrlab: + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar); + /* If not already recovering from an error, report this error. */ if (!yyerrstatus) { @@ -1473,37 +1481,36 @@ #if ! YYERROR_VERBOSE yyerror (YY_("syntax error")); #else +# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \ + yyssp, yytoken) { - YYSIZE_T yysize = yysyntax_error (0, yystate, yychar); - if (yymsg_alloc < yysize && yymsg_alloc < YYSTACK_ALLOC_MAXIMUM) - { - YYSIZE_T yyalloc = 2 * yysize; - if (! (yysize <= yyalloc && yyalloc <= YYSTACK_ALLOC_MAXIMUM)) - yyalloc = YYSTACK_ALLOC_MAXIMUM; - if (yymsg != yymsgbuf) - YYSTACK_FREE (yymsg); - yymsg = (char *) YYSTACK_ALLOC (yyalloc); - if (yymsg) - yymsg_alloc = yyalloc; - else - { - yymsg = yymsgbuf; - yymsg_alloc = sizeof yymsgbuf; - } - } - - if (0 < yysize && yysize <= yymsg_alloc) - { - (void) yysyntax_error (yymsg, yystate, yychar); - yyerror (yymsg); - } - else - { - yyerror (YY_("syntax error")); - if (yysize != 0) - goto yyexhaustedlab; - } + char const *yymsgp = YY_("syntax error"); + int yysyntax_error_status; + yysyntax_error_status = YYSYNTAX_ERROR; + if (yysyntax_error_status == 0) + yymsgp = yymsg; + else if (yysyntax_error_status == 1) + { + if (yymsg != yymsgbuf) + YYSTACK_FREE (yymsg); + yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc); + if (!yymsg) + { + yymsg = yymsgbuf; + yymsg_alloc = sizeof yymsgbuf; + yysyntax_error_status = 2; + } + else + { + yysyntax_error_status = YYSYNTAX_ERROR; + yymsgp = yymsg; + } + } + yyerror (yymsgp); + if (yysyntax_error_status == 2) + goto yyexhaustedlab; } +# undef YYSYNTAX_ERROR #endif } @@ -1562,7 +1569,7 @@ for (;;) { yyn = yypact[yystate]; - if (yyn != YYPACT_NINF) + if (!yypact_value_is_default (yyn)) { yyn += YYTERROR; if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR) @@ -1585,7 +1592,9 @@ YY_STACK_PRINT (yyss, yyssp); } + YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN *++yyvsp = yylval; + YY_IGNORE_MAYBE_UNINITIALIZED_END /* Shift the error token. */ @@ -1609,7 +1618,7 @@ yyresult = 1; goto yyreturn; -#if !defined(yyoverflow) || YYERROR_VERBOSE +#if !defined yyoverflow || YYERROR_VERBOSE /*-------------------------------------------------. | yyexhaustedlab -- memory exhaustion comes here. | `-------------------------------------------------*/ @@ -1621,8 +1630,13 @@ yyreturn: if (yychar != YYEMPTY) - yydestruct ("Cleanup: discarding lookahead", - yytoken, &yylval); + { + /* Make sure we have latest lookahead translation. See comments at + user semantic actions for why this is necessary. */ + yytoken = YYTRANSLATE (yychar); + yydestruct ("Cleanup: discarding lookahead", + yytoken, &yylval); + } /* Do not reclaim the symbols of the rule which action triggered this YYABORT or YYACCEPT. */ YYPOPSTACK (yylen); @@ -1646,8 +1660,7 @@ } - -/* Line 1684 of yacc.c */ +/* Line 2050 of yacc.c */ #line 77 "res_parse.y" @@ -1797,4 +1810,3 @@ dump_res (r, 0); } - Index: trunk/src/res_parse.h =================================================================== --- trunk/src/res_parse.h (revision 96) +++ trunk/src/res_parse.h (revision 97) @@ -1,9 +1,8 @@ -/* A Bison parser, made by GNU Bison 2.4.3. */ +/* A Bison parser, made by GNU Bison 2.7.12-4996. */ -/* Skeleton interface for Bison's Yacc-like parsers in C +/* Bison interface for Yacc-like parsers in C - Copyright (C) 1984, 1989, 1990, 2000, 2001, 2002, 2003, 2004, 2005, 2006, - 2009, 2010 Free Software Foundation, Inc. + Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc. 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 @@ -31,6 +30,15 @@ This special exception was added by the Free Software Foundation in version 2.2 of Bison. */ +#ifndef YY_RES_RES_PARSE_TAB_H_INCLUDED +# define YY_RES_RES_PARSE_TAB_H_INCLUDED +/* Enabling traces. */ +#ifndef YYDEBUG +# define YYDEBUG 0 +#endif +#if YYDEBUG +extern int resdebug; +#endif /* Tokens. */ #ifndef YYTOKENTYPE @@ -42,18 +50,12 @@ INCLUDE = 259 }; #endif -/* Tokens. */ -#define STRING 258 -#define INCLUDE 259 - - #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED typedef union YYSTYPE { - -/* Line 1685 of yacc.c */ +/* Line 2053 of yacc.c */ #line 45 "res_parse.y" int ival; @@ -61,9 +63,8 @@ Resource *rval; - -/* Line 1685 of yacc.c */ -#line 67 "res_parse.h" +/* Line 2053 of yacc.c */ +#line 68 "res_parse.tab.h" } YYSTYPE; # define YYSTYPE_IS_TRIVIAL 1 # define yystype YYSTYPE /* obsolescent; will be withdrawn */ @@ -72,4 +73,18 @@ extern YYSTYPE reslval; +#ifdef YYPARSE_PARAM +#if defined __STDC__ || defined __cplusplus +int resparse (void *YYPARSE_PARAM); +#else +int resparse (); +#endif +#else /* ! YYPARSE_PARAM */ +#if defined __STDC__ || defined __cplusplus +int resparse (void); +#else +int resparse (); +#endif +#endif /* ! YYPARSE_PARAM */ +#endif /* !YY_RES_RES_PARSE_TAB_H_INCLUDED */