From 76a0df4c6511c3c61a524638133fd8aacfa0e45f Mon Sep 17 00:00:00 2001 From: Lucas Holt Date: Thu, 7 Nov 2024 17:39:43 -0500 Subject: [PATCH] update patchset and remove unused files. --- contrib/bmake/.gitattributes | 660 ------------------------- contrib/bmake/bmake.cat1 | 4 +- contrib/bmake/job.c | 23 +- contrib/bmake/lst.lib/Makefile | 0 contrib/bmake/lst.lib/lstAppend.c | 121 ----- contrib/bmake/lst.lib/lstAtEnd.c | 79 --- contrib/bmake/lst.lib/lstAtFront.c | 76 --- contrib/bmake/lst.lib/lstClose.c | 85 ---- contrib/bmake/lst.lib/lstConcat.c | 184 ------- contrib/bmake/lst.lib/lstDatum.c | 76 --- contrib/bmake/lst.lib/lstDeQueue.c | 86 ---- contrib/bmake/lst.lib/lstDestroy.c | 101 ---- contrib/bmake/lst.lib/lstDupl.c | 107 ---- contrib/bmake/lst.lib/lstEnQueue.c | 77 --- contrib/bmake/lst.lib/lstFind.c | 73 --- contrib/bmake/lst.lib/lstFindFrom.c | 89 ---- contrib/bmake/lst.lib/lstFirst.c | 76 --- contrib/bmake/lst.lib/lstForEach.c | 75 --- contrib/bmake/lst.lib/lstForEachFrom.c | 124 ----- contrib/bmake/lst.lib/lstInit.c | 85 ---- contrib/bmake/lst.lib/lstInsert.c | 121 ----- contrib/bmake/lst.lib/lstInt.h | 105 ---- contrib/bmake/lst.lib/lstIsAtEnd.c | 86 ---- contrib/bmake/lst.lib/lstIsEmpty.c | 74 --- contrib/bmake/lst.lib/lstLast.c | 76 --- contrib/bmake/lst.lib/lstMember.c | 77 --- contrib/bmake/lst.lib/lstNext.c | 119 ----- contrib/bmake/lst.lib/lstOpen.c | 86 ---- contrib/bmake/lst.lib/lstPrev.c | 78 --- contrib/bmake/lst.lib/lstRemove.c | 134 ----- contrib/bmake/lst.lib/lstReplace.c | 77 --- contrib/bmake/lst.lib/lstSucc.c | 78 --- contrib/bmake/mk/meta2deps.sh | 2 - contrib/bmake/nonints.h | 212 -------- contrib/bmake/sprite.h | 116 ----- contrib/bmake/strlist.c | 93 ---- contrib/bmake/strlist.h | 62 --- contrib/bmake/unit-tests/Makefile.in | 151 ------ contrib/bmake/unit-tests/cond2.exp | 7 - contrib/bmake/unit-tests/cond2.mk | 29 -- contrib/bmake/unit-tests/hash.exp | 9 - contrib/bmake/unit-tests/hash.mk | 18 - contrib/bmake/unit-tests/misc.exp | 1 - contrib/bmake/unit-tests/misc.mk | 16 - contrib/bmake/unit-tests/modorder.exp | 12 - contrib/bmake/unit-tests/modorder.mk | 24 - contrib/bmake/unit-tests/modts.exp | 39 -- contrib/bmake/unit-tests/modts.mk | 44 -- contrib/bmake/unit-tests/modword.exp | 122 ----- contrib/bmake/unit-tests/modword.mk | 151 ------ contrib/bmake/unit-tests/qequals.exp | 2 - contrib/bmake/unit-tests/qequals.mk | 8 - contrib/bmake/unit-tests/suffixes.exp | 35 -- contrib/bmake/unit-tests/suffixes.mk | 89 ---- contrib/bmake/unit-tests/sysv.exp | 16 - contrib/bmake/unit-tests/sysv.mk | 48 -- contrib/bmake/unit-tests/varshell.exp | 10 - contrib/bmake/unit-tests/varshell.mk | 19 - 58 files changed, 20 insertions(+), 4627 deletions(-) delete mode 100644 contrib/bmake/.gitattributes delete mode 100644 contrib/bmake/lst.lib/Makefile delete mode 100644 contrib/bmake/lst.lib/lstAppend.c delete mode 100644 contrib/bmake/lst.lib/lstAtEnd.c delete mode 100644 contrib/bmake/lst.lib/lstAtFront.c delete mode 100644 contrib/bmake/lst.lib/lstClose.c delete mode 100644 contrib/bmake/lst.lib/lstConcat.c delete mode 100644 contrib/bmake/lst.lib/lstDatum.c delete mode 100644 contrib/bmake/lst.lib/lstDeQueue.c delete mode 100644 contrib/bmake/lst.lib/lstDestroy.c delete mode 100644 contrib/bmake/lst.lib/lstDupl.c delete mode 100644 contrib/bmake/lst.lib/lstEnQueue.c delete mode 100644 contrib/bmake/lst.lib/lstFind.c delete mode 100644 contrib/bmake/lst.lib/lstFindFrom.c delete mode 100644 contrib/bmake/lst.lib/lstFirst.c delete mode 100644 contrib/bmake/lst.lib/lstForEach.c delete mode 100644 contrib/bmake/lst.lib/lstForEachFrom.c delete mode 100644 contrib/bmake/lst.lib/lstInit.c delete mode 100644 contrib/bmake/lst.lib/lstInsert.c delete mode 100644 contrib/bmake/lst.lib/lstInt.h delete mode 100644 contrib/bmake/lst.lib/lstIsAtEnd.c delete mode 100644 contrib/bmake/lst.lib/lstIsEmpty.c delete mode 100644 contrib/bmake/lst.lib/lstLast.c delete mode 100644 contrib/bmake/lst.lib/lstMember.c delete mode 100644 contrib/bmake/lst.lib/lstNext.c delete mode 100644 contrib/bmake/lst.lib/lstOpen.c delete mode 100644 contrib/bmake/lst.lib/lstPrev.c delete mode 100644 contrib/bmake/lst.lib/lstRemove.c delete mode 100644 contrib/bmake/lst.lib/lstReplace.c delete mode 100644 contrib/bmake/lst.lib/lstSucc.c delete mode 100644 contrib/bmake/nonints.h delete mode 100644 contrib/bmake/sprite.h delete mode 100644 contrib/bmake/strlist.c delete mode 100644 contrib/bmake/strlist.h delete mode 100644 contrib/bmake/unit-tests/Makefile.in delete mode 100644 contrib/bmake/unit-tests/cond2.exp delete mode 100644 contrib/bmake/unit-tests/cond2.mk delete mode 100644 contrib/bmake/unit-tests/hash.exp delete mode 100644 contrib/bmake/unit-tests/hash.mk delete mode 100644 contrib/bmake/unit-tests/misc.exp delete mode 100644 contrib/bmake/unit-tests/misc.mk delete mode 100644 contrib/bmake/unit-tests/modorder.exp delete mode 100644 contrib/bmake/unit-tests/modorder.mk delete mode 100644 contrib/bmake/unit-tests/modts.exp delete mode 100644 contrib/bmake/unit-tests/modts.mk delete mode 100644 contrib/bmake/unit-tests/modword.exp delete mode 100644 contrib/bmake/unit-tests/modword.mk delete mode 100644 contrib/bmake/unit-tests/qequals.exp delete mode 100644 contrib/bmake/unit-tests/qequals.mk delete mode 100644 contrib/bmake/unit-tests/suffixes.exp delete mode 100644 contrib/bmake/unit-tests/suffixes.mk delete mode 100644 contrib/bmake/unit-tests/sysv.exp delete mode 100644 contrib/bmake/unit-tests/sysv.mk delete mode 100644 contrib/bmake/unit-tests/varshell.exp delete mode 100644 contrib/bmake/unit-tests/varshell.mk diff --git a/contrib/bmake/.gitattributes b/contrib/bmake/.gitattributes deleted file mode 100644 index e3d4c74f412..00000000000 --- a/contrib/bmake/.gitattributes +++ /dev/null @@ -1,660 +0,0 @@ -* text=auto !eol -20140620/ChangeLog -text -20140620/FILES -text -20140620/Makefile -text -20140620/Makefile.config.in -text -20140620/PSD.doc/Makefile -text -20140620/PSD.doc/tutorial.ms -text -20140620/README -text -20140620/aclocal.m4 -text -20140620/arch.c -text -20140620/bmake.1 -text -20140620/bmake.cat1 -text -20140620/boot-strap -text -20140620/bsd.after-import.mk -text -20140620/buf.c -text -20140620/buf.h -text -20140620/compat.c -text -20140620/cond.c -text -20140620/config.h.in -text -20140620/configure -text -20140620/configure.in -text -20140620/dir.c -text -20140620/dir.h -text -20140620/dirname.c -text -20140620/find_lib.sh -text -20140620/for.c -text -20140620/getopt.c -text -20140620/hash.c -text -20140620/hash.h -text -20140620/install-sh -text -20140620/job.c -text -20140620/job.h -text -20140620/lst.h -text -20140620/lst.lib/Makefile -text -20140620/lst.lib/lstAppend.c -text -20140620/lst.lib/lstAtEnd.c -text -20140620/lst.lib/lstAtFront.c -text -20140620/lst.lib/lstClose.c -text -20140620/lst.lib/lstConcat.c -text -20140620/lst.lib/lstDatum.c -text -20140620/lst.lib/lstDeQueue.c -text -20140620/lst.lib/lstDestroy.c -text -20140620/lst.lib/lstDupl.c -text -20140620/lst.lib/lstEnQueue.c -text -20140620/lst.lib/lstFind.c -text -20140620/lst.lib/lstFindFrom.c -text -20140620/lst.lib/lstFirst.c -text -20140620/lst.lib/lstForEach.c -text -20140620/lst.lib/lstForEachFrom.c -text -20140620/lst.lib/lstInit.c -text -20140620/lst.lib/lstInsert.c -text -20140620/lst.lib/lstInt.h -text -20140620/lst.lib/lstIsAtEnd.c -text -20140620/lst.lib/lstIsEmpty.c -text -20140620/lst.lib/lstLast.c -text -20140620/lst.lib/lstMember.c -text -20140620/lst.lib/lstNext.c -text -20140620/lst.lib/lstOpen.c -text -20140620/lst.lib/lstPrev.c -text -20140620/lst.lib/lstRemove.c -text -20140620/lst.lib/lstReplace.c -text -20140620/lst.lib/lstSucc.c -text -20140620/machine.sh -text -20140620/main.c -text -20140620/make-bootstrap.sh.in -text -20140620/make-conf.h -text -20140620/make.1 -text -20140620/make.c -text -20140620/make.h -text -20140620/make_malloc.c -text -20140620/make_malloc.h -text -20140620/makefile.in -text -20140620/meta.c -text -20140620/meta.h -text -20140620/missing/sys/cdefs.h -text -20140620/mk/ChangeLog -text -20140620/mk/FILES -text -20140620/mk/README -text -20140620/mk/auto.dep.mk -text -20140620/mk/auto.obj.mk -text -20140620/mk/autoconf.mk -text -20140620/mk/autodep.mk -text -20140620/mk/dep.mk -text -20140620/mk/dirdeps.mk -text -20140620/mk/doc.mk -text -20140620/mk/dpadd.mk -text -20140620/mk/final.mk -text -20140620/mk/gendirdeps.mk -text -20140620/mk/host-target.mk -text -20140620/mk/host.libnames.mk -text -20140620/mk/inc.mk -text -20140620/mk/init.mk -text -20140620/mk/install-mk -text -20140620/mk/install-new.mk -text -20140620/mk/java.mk -text -20140620/mk/lib.mk -text -20140620/mk/libnames.mk -text -20140620/mk/libs.mk -text -20140620/mk/links.mk -text -20140620/mk/man.mk -text -20140620/mk/meta.autodep.mk -text -20140620/mk/meta.stage.mk -text -20140620/mk/meta.subdir.mk -text -20140620/mk/meta.sys.mk -text -20140620/mk/meta2deps.py -text -20140620/mk/meta2deps.sh -text -20140620/mk/mk-files.txt -text -20140620/mk/nls.mk -text -20140620/mk/obj.mk -text -20140620/mk/options.mk -text -20140620/mk/own.mk -text -20140620/mk/prlist.mk -text -20140620/mk/prog.mk -text -20140620/mk/progs.mk -text -20140620/mk/rst2htm.mk -text -20140620/mk/scripts.mk -text -20140620/mk/srctop.mk -text -20140620/mk/stage-install.sh -text -20140620/mk/subdir.mk -text -20140620/mk/sys.clean-env.mk -text -20140620/mk/sys.dependfile.mk -text -20140620/mk/sys.mk -text -20140620/mk/sys/AIX.mk -text -20140620/mk/sys/Darwin.mk -text -20140620/mk/sys/Generic.mk -text -20140620/mk/sys/HP-UX.mk -text -20140620/mk/sys/IRIX.mk -text -20140620/mk/sys/Linux.mk -text -20140620/mk/sys/NetBSD.mk -text -20140620/mk/sys/OSF1.mk -text -20140620/mk/sys/OpenBSD.mk -text -20140620/mk/sys/SunOS.mk -text -20140620/mk/sys/UnixWare.mk -text -20140620/mk/target-flags.mk -text -20140620/mk/warnings.mk -text -20140620/mk/yacc.mk -text -20140620/mkdeps.sh -text -20140620/nonints.h -text -20140620/os.sh -text -20140620/parse.c -text -20140620/pathnames.h -text -20140620/ranlib.h -text -20140620/realpath.c -text -20140620/setenv.c -text -20140620/sigcompat.c -text -20140620/sprite.h -text -20140620/str.c -text -20140620/stresep.c -text -20140620/strlcpy.c -text -20140620/strlist.c -text -20140620/strlist.h -text -20140620/suff.c -text -20140620/targ.c -text -20140620/trace.c -text -20140620/trace.h -text -20140620/unit-tests/Makefile.in -text -20140620/unit-tests/comment -text -20140620/unit-tests/cond1 -text -20140620/unit-tests/doterror -text -20140620/unit-tests/dotwait -text -20140620/unit-tests/error -text -20140620/unit-tests/export -text -20140620/unit-tests/export-all -text -20140620/unit-tests/export-env -text -20140620/unit-tests/forloop -text -20140620/unit-tests/forsubst -text -20140620/unit-tests/hash -text -20140620/unit-tests/misc -text -20140620/unit-tests/moderrs -text -20140620/unit-tests/modmatch -text -20140620/unit-tests/modmisc -text -20140620/unit-tests/modorder -text -20140620/unit-tests/modts -text -20140620/unit-tests/modword -text -20140620/unit-tests/order -text -20140620/unit-tests/phony-end -text -20140620/unit-tests/posix -text -20140620/unit-tests/qequals -text -20140620/unit-tests/sunshcmd -text -20140620/unit-tests/sysv -text -20140620/unit-tests/ternary -text -20140620/unit-tests/test.exp -text -20140620/unit-tests/unexport -text -20140620/unit-tests/unexport-env -text -20140620/unit-tests/varcmd -text -20140620/util.c -text -20140620/var.c -text -20140620/wait.h -text -20170720/ChangeLog -text -20170720/FILES -text -20170720/Makefile -text -20170720/Makefile.config.in -text -20170720/PSD.doc/Makefile -text -20170720/PSD.doc/tutorial.ms -text -20170720/README -text -20170720/aclocal.m4 -text -20170720/arch.c -text -20170720/bmake.1 -text -20170720/bmake.cat1 -text -20170720/boot-strap -text -20170720/bsd.after-import.mk -text -20170720/buf.c -text -20170720/buf.h -text -20170720/compat.c -text -20170720/cond.c -text -20170720/config.h.in -text -20170720/configure -text -20170720/configure.in -text -20170720/dir.c -text -20170720/dir.h -text -20170720/dirname.c -text -20170720/find_lib.sh -text -20170720/for.c -text -20170720/getopt.c -text -20170720/hash.c -text -20170720/hash.h -text -20170720/install-sh -text -20170720/job.c -text -20170720/job.h -text -20170720/lst.h -text -20170720/lst.lib/Makefile -text -20170720/lst.lib/lstAppend.c -text -20170720/lst.lib/lstAtEnd.c -text -20170720/lst.lib/lstAtFront.c -text -20170720/lst.lib/lstClose.c -text -20170720/lst.lib/lstConcat.c -text -20170720/lst.lib/lstDatum.c -text -20170720/lst.lib/lstDeQueue.c -text -20170720/lst.lib/lstDestroy.c -text -20170720/lst.lib/lstDupl.c -text -20170720/lst.lib/lstEnQueue.c -text -20170720/lst.lib/lstFind.c -text -20170720/lst.lib/lstFindFrom.c -text -20170720/lst.lib/lstFirst.c -text -20170720/lst.lib/lstForEach.c -text -20170720/lst.lib/lstForEachFrom.c -text -20170720/lst.lib/lstInit.c -text -20170720/lst.lib/lstInsert.c -text -20170720/lst.lib/lstInt.h -text -20170720/lst.lib/lstIsAtEnd.c -text -20170720/lst.lib/lstIsEmpty.c -text -20170720/lst.lib/lstLast.c -text -20170720/lst.lib/lstMember.c -text -20170720/lst.lib/lstNext.c -text -20170720/lst.lib/lstOpen.c -text -20170720/lst.lib/lstPrev.c -text -20170720/lst.lib/lstRemove.c -text -20170720/lst.lib/lstReplace.c -text -20170720/lst.lib/lstSucc.c -text -20170720/machine.sh -text -20170720/main.c -text -20170720/make-bootstrap.sh.in -text -20170720/make-conf.h -text -20170720/make.1 -text -20170720/make.c -text -20170720/make.h -text -20170720/make_malloc.c -text -20170720/make_malloc.h -text -20170720/makefile.in -text -20170720/meta.c -text -20170720/meta.h -text -20170720/metachar.c -text -20170720/metachar.h -text -20170720/mk/ChangeLog -text -20170720/mk/FILES -text -20170720/mk/README -text -20170720/mk/auto.dep.mk -text -20170720/mk/auto.obj.mk -text -20170720/mk/autoconf.mk -text -20170720/mk/autodep.mk -text -20170720/mk/cython.mk -text -20170720/mk/dep.mk -text -20170720/mk/dirdeps.mk -text -20170720/mk/doc.mk -text -20170720/mk/dpadd.mk -text -20170720/mk/files.mk -text -20170720/mk/final.mk -text -20170720/mk/gendirdeps.mk -text -20170720/mk/host-target.mk -text -20170720/mk/host.libnames.mk -text -20170720/mk/inc.mk -text -20170720/mk/init.mk -text -20170720/mk/install-mk -text -20170720/mk/install-new.mk -text -20170720/mk/java.mk -text -20170720/mk/lib.mk -text -20170720/mk/libnames.mk -text -20170720/mk/libs.mk -text -20170720/mk/links.mk -text -20170720/mk/man.mk -text -20170720/mk/manifest.mk -text -20170720/mk/meta.autodep.mk -text -20170720/mk/meta.stage.mk -text -20170720/mk/meta.subdir.mk -text -20170720/mk/meta.sys.mk -text -20170720/mk/meta2deps.py -text -20170720/mk/meta2deps.sh -text -20170720/mk/mk-files.txt -text -20170720/mk/mkopt.sh -text -20170720/mk/nls.mk -text -20170720/mk/obj.mk -text -20170720/mk/options.mk -text -20170720/mk/own.mk -text -20170720/mk/prlist.mk -text -20170720/mk/prog.mk -text -20170720/mk/progs.mk -text -20170720/mk/rst2htm.mk -text -20170720/mk/scripts.mk -text -20170720/mk/srctop.mk -text -20170720/mk/stage-install.sh -text -20170720/mk/subdir.mk -text -20170720/mk/sys.clean-env.mk -text -20170720/mk/sys.debug.mk -text -20170720/mk/sys.dependfile.mk -text -20170720/mk/sys.mk -text -20170720/mk/sys.vars.mk -text -20170720/mk/sys/AIX.mk -text -20170720/mk/sys/Darwin.mk -text -20170720/mk/sys/Generic.mk -text -20170720/mk/sys/HP-UX.mk -text -20170720/mk/sys/IRIX.mk -text -20170720/mk/sys/Linux.mk -text -20170720/mk/sys/NetBSD.mk -text -20170720/mk/sys/OSF1.mk -text -20170720/mk/sys/OpenBSD.mk -text -20170720/mk/sys/SunOS.mk -text -20170720/mk/sys/UnixWare.mk -text -20170720/mk/target-flags.mk -text -20170720/mk/warnings.mk -text -20170720/mk/whats.mk -text -20170720/mk/yacc.mk -text -20170720/mkdeps.sh -text -20170720/nonints.h -text -20170720/os.sh -text -20170720/parse.c -text -20170720/pathnames.h -text -20170720/ranlib.h -text -20170720/realpath.c -text -20170720/setenv.c -text -20170720/sigcompat.c -text -20170720/sprite.h -text -20170720/str.c -text -20170720/stresep.c -text -20170720/strlcpy.c -text -20170720/strlist.c -text -20170720/strlist.h -text -20170720/suff.c -text -20170720/targ.c -text -20170720/trace.c -text -20170720/trace.h -text -20170720/unit-tests/Makefile.in -text -20170720/unit-tests/comment.exp -text -20170720/unit-tests/comment.mk -text -20170720/unit-tests/cond1.exp -text -20170720/unit-tests/cond1.mk -text -20170720/unit-tests/cond2.exp -text -20170720/unit-tests/cond2.mk -text -20170720/unit-tests/doterror.exp -text -20170720/unit-tests/doterror.mk -text -20170720/unit-tests/dotwait.exp -text -20170720/unit-tests/dotwait.mk -text -20170720/unit-tests/error.exp -text -20170720/unit-tests/error.mk -text -20170720/unit-tests/escape.exp -text -20170720/unit-tests/escape.mk -text -20170720/unit-tests/export-all.exp -text -20170720/unit-tests/export-all.mk -text -20170720/unit-tests/export-env.exp -text -20170720/unit-tests/export-env.mk -text -20170720/unit-tests/export.exp -text -20170720/unit-tests/export.mk -text -20170720/unit-tests/forloop.exp -text -20170720/unit-tests/forloop.mk -text -20170720/unit-tests/forsubst.exp -text -20170720/unit-tests/forsubst.mk -text -20170720/unit-tests/hash.exp -text -20170720/unit-tests/hash.mk -text -20170720/unit-tests/impsrc.exp -text -20170720/unit-tests/impsrc.mk -text -20170720/unit-tests/misc.exp -text -20170720/unit-tests/misc.mk -text -20170720/unit-tests/moderrs.exp -text -20170720/unit-tests/moderrs.mk -text -20170720/unit-tests/modmatch.exp -text -20170720/unit-tests/modmatch.mk -text -20170720/unit-tests/modmisc.exp -text -20170720/unit-tests/modmisc.mk -text -20170720/unit-tests/modorder.exp -text -20170720/unit-tests/modorder.mk -text -20170720/unit-tests/modts.exp -text -20170720/unit-tests/modts.mk -text -20170720/unit-tests/modword.exp -text -20170720/unit-tests/modword.mk -text -20170720/unit-tests/order.exp -text -20170720/unit-tests/order.mk -text -20170720/unit-tests/phony-end.exp -text -20170720/unit-tests/phony-end.mk -text -20170720/unit-tests/posix.exp -text -20170720/unit-tests/posix.mk -text -20170720/unit-tests/posix1.exp -text -20170720/unit-tests/posix1.mk -text -20170720/unit-tests/qequals.exp -text -20170720/unit-tests/qequals.mk -text -20170720/unit-tests/suffixes.exp -text -20170720/unit-tests/suffixes.mk -text -20170720/unit-tests/sunshcmd.exp -text -20170720/unit-tests/sunshcmd.mk -text -20170720/unit-tests/sysv.exp -text -20170720/unit-tests/sysv.mk -text -20170720/unit-tests/ternary.exp -text -20170720/unit-tests/ternary.mk -text -20170720/unit-tests/unexport-env.exp -text -20170720/unit-tests/unexport-env.mk -text -20170720/unit-tests/unexport.exp -text -20170720/unit-tests/unexport.mk -text -20170720/unit-tests/varcmd.exp -text -20170720/unit-tests/varcmd.mk -text -20170720/unit-tests/varmisc.exp -text -20170720/unit-tests/varmisc.mk -text -20170720/unit-tests/varshell.exp -text -20170720/unit-tests/varshell.mk -text -20170720/util.c -text -20170720/var.c -text -20170720/wait.h -text -dist/ChangeLog -text -dist/FILES -text -dist/Makefile -text -dist/Makefile.config.in -text -dist/PSD.doc/Makefile -text -dist/PSD.doc/tutorial.ms -text -dist/README -text -dist/aclocal.m4 -text -dist/arch.c -text -dist/bmake.1 -text -dist/bmake.cat1 -text -dist/boot-strap -text -dist/bsd.after-import.mk -text -dist/buf.c -text -dist/buf.h -text -dist/compat.c -text -dist/cond.c -text -dist/config.h.in -text -dist/configure -text -dist/configure.in -text -dist/dir.c -text -dist/dir.h -text -dist/dirname.c -text -dist/find_lib.sh -text -dist/for.c -text -dist/getopt.c -text -dist/hash.c -text -dist/hash.h -text -dist/install-sh -text -dist/job.c -text -dist/job.h -text -dist/lst.h -text -dist/lst.lib/Makefile -text -dist/lst.lib/lstAppend.c -text -dist/lst.lib/lstAtEnd.c -text -dist/lst.lib/lstAtFront.c -text -dist/lst.lib/lstClose.c -text -dist/lst.lib/lstConcat.c -text -dist/lst.lib/lstDatum.c -text -dist/lst.lib/lstDeQueue.c -text -dist/lst.lib/lstDestroy.c -text -dist/lst.lib/lstDupl.c -text -dist/lst.lib/lstEnQueue.c -text -dist/lst.lib/lstFind.c -text -dist/lst.lib/lstFindFrom.c -text -dist/lst.lib/lstFirst.c -text -dist/lst.lib/lstForEach.c -text -dist/lst.lib/lstForEachFrom.c -text -dist/lst.lib/lstInit.c -text -dist/lst.lib/lstInsert.c -text -dist/lst.lib/lstInt.h -text -dist/lst.lib/lstIsAtEnd.c -text -dist/lst.lib/lstIsEmpty.c -text -dist/lst.lib/lstLast.c -text -dist/lst.lib/lstMember.c -text -dist/lst.lib/lstNext.c -text -dist/lst.lib/lstOpen.c -text -dist/lst.lib/lstPrev.c -text -dist/lst.lib/lstRemove.c -text -dist/lst.lib/lstReplace.c -text -dist/lst.lib/lstSucc.c -text -dist/machine.sh -text -dist/main.c -text -dist/make-bootstrap.sh.in -text -dist/make-conf.h -text -dist/make.1 -text -dist/make.c -text -dist/make.h -text -dist/make_malloc.c -text -dist/make_malloc.h -text -dist/makefile.in -text -dist/meta.c -text -dist/meta.h -text -dist/metachar.c -text -dist/metachar.h -text -dist/mk/ChangeLog -text -dist/mk/FILES -text -dist/mk/README -text -dist/mk/auto.dep.mk -text -dist/mk/auto.obj.mk -text -dist/mk/autoconf.mk -text -dist/mk/autodep.mk -text -dist/mk/cython.mk -text -dist/mk/dep.mk -text -dist/mk/dirdeps.mk -text -dist/mk/doc.mk -text -dist/mk/dpadd.mk -text -dist/mk/files.mk -text -dist/mk/final.mk -text -dist/mk/gendirdeps.mk -text -dist/mk/host-target.mk -text -dist/mk/host.libnames.mk -text -dist/mk/inc.mk -text -dist/mk/init.mk -text -dist/mk/install-mk -text -dist/mk/install-new.mk -text -dist/mk/java.mk -text -dist/mk/lib.mk -text -dist/mk/libnames.mk -text -dist/mk/libs.mk -text -dist/mk/links.mk -text -dist/mk/man.mk -text -dist/mk/manifest.mk -text -dist/mk/meta.autodep.mk -text -dist/mk/meta.stage.mk -text -dist/mk/meta.subdir.mk -text -dist/mk/meta.sys.mk -text -dist/mk/meta2deps.py -text -dist/mk/meta2deps.sh -text -dist/mk/mk-files.txt -text -dist/mk/mkopt.sh -text -dist/mk/nls.mk -text -dist/mk/obj.mk -text -dist/mk/options.mk -text -dist/mk/own.mk -text -dist/mk/prlist.mk -text -dist/mk/prog.mk -text -dist/mk/progs.mk -text -dist/mk/rst2htm.mk -text -dist/mk/scripts.mk -text -dist/mk/srctop.mk -text -dist/mk/stage-install.sh -text -dist/mk/subdir.mk -text -dist/mk/sys.clean-env.mk -text -dist/mk/sys.debug.mk -text -dist/mk/sys.dependfile.mk -text -dist/mk/sys.mk -text -dist/mk/sys.vars.mk -text -dist/mk/sys/AIX.mk -text -dist/mk/sys/Darwin.mk -text -dist/mk/sys/Generic.mk -text -dist/mk/sys/HP-UX.mk -text -dist/mk/sys/IRIX.mk -text -dist/mk/sys/Linux.mk -text -dist/mk/sys/NetBSD.mk -text -dist/mk/sys/OSF1.mk -text -dist/mk/sys/OpenBSD.mk -text -dist/mk/sys/SunOS.mk -text -dist/mk/sys/UnixWare.mk -text -dist/mk/target-flags.mk -text -dist/mk/warnings.mk -text -dist/mk/whats.mk -text -dist/mk/yacc.mk -text -dist/mkdeps.sh -text -dist/nonints.h -text -dist/os.sh -text -dist/parse.c -text -dist/pathnames.h -text -dist/ranlib.h -text -dist/realpath.c -text -dist/setenv.c -text -dist/sigcompat.c -text -dist/sprite.h -text -dist/str.c -text -dist/stresep.c -text -dist/strlcpy.c -text -dist/strlist.c -text -dist/strlist.h -text -dist/suff.c -text -dist/targ.c -text -dist/trace.c -text -dist/trace.h -text -dist/unit-tests/Makefile.in -text -dist/unit-tests/comment.exp -text -dist/unit-tests/comment.mk -text -dist/unit-tests/cond1.exp -text -dist/unit-tests/cond1.mk -text -dist/unit-tests/cond2.exp -text -dist/unit-tests/cond2.mk -text -dist/unit-tests/doterror.exp -text -dist/unit-tests/doterror.mk -text -dist/unit-tests/dotwait.exp -text -dist/unit-tests/dotwait.mk -text -dist/unit-tests/error.exp -text -dist/unit-tests/error.mk -text -dist/unit-tests/escape.exp -text -dist/unit-tests/escape.mk -text -dist/unit-tests/export-all.exp -text -dist/unit-tests/export-all.mk -text -dist/unit-tests/export-env.exp -text -dist/unit-tests/export-env.mk -text -dist/unit-tests/export.exp -text -dist/unit-tests/export.mk -text -dist/unit-tests/forloop.exp -text -dist/unit-tests/forloop.mk -text -dist/unit-tests/forsubst.exp -text -dist/unit-tests/forsubst.mk -text -dist/unit-tests/hash.exp -text -dist/unit-tests/hash.mk -text -dist/unit-tests/impsrc.exp -text -dist/unit-tests/impsrc.mk -text -dist/unit-tests/misc.exp -text -dist/unit-tests/misc.mk -text -dist/unit-tests/moderrs.exp -text -dist/unit-tests/moderrs.mk -text -dist/unit-tests/modmatch.exp -text -dist/unit-tests/modmatch.mk -text -dist/unit-tests/modmisc.exp -text -dist/unit-tests/modmisc.mk -text -dist/unit-tests/modorder.exp -text -dist/unit-tests/modorder.mk -text -dist/unit-tests/modts.exp -text -dist/unit-tests/modts.mk -text -dist/unit-tests/modword.exp -text -dist/unit-tests/modword.mk -text -dist/unit-tests/order.exp -text -dist/unit-tests/order.mk -text -dist/unit-tests/phony-end.exp -text -dist/unit-tests/phony-end.mk -text -dist/unit-tests/posix.exp -text -dist/unit-tests/posix.mk -text -dist/unit-tests/posix1.exp -text -dist/unit-tests/posix1.mk -text -dist/unit-tests/qequals.exp -text -dist/unit-tests/qequals.mk -text -dist/unit-tests/suffixes.exp -text -dist/unit-tests/suffixes.mk -text -dist/unit-tests/sunshcmd.exp -text -dist/unit-tests/sunshcmd.mk -text -dist/unit-tests/sysv.exp -text -dist/unit-tests/sysv.mk -text -dist/unit-tests/ternary.exp -text -dist/unit-tests/ternary.mk -text -dist/unit-tests/unexport-env.exp -text -dist/unit-tests/unexport-env.mk -text -dist/unit-tests/unexport.exp -text -dist/unit-tests/unexport.mk -text -dist/unit-tests/varcmd.exp -text -dist/unit-tests/varcmd.mk -text -dist/unit-tests/varmisc.exp -text -dist/unit-tests/varmisc.mk -text -dist/unit-tests/varshell.exp -text -dist/unit-tests/varshell.mk -text -dist/util.c -text -dist/var.c -text -dist/wait.h -text diff --git a/contrib/bmake/bmake.cat1 b/contrib/bmake/bmake.cat1 index 11b0c4381b7..3ff884589f1 100644 --- a/contrib/bmake/bmake.cat1 +++ b/contrib/bmake/bmake.cat1 @@ -1,4 +1,4 @@ -BMAKE(1) MidnightBSD General Commands Manual BMAKE(1) +BMAKE(1) MidnightBSD General Commands Manual BMAKE(1) NAME bmake -- maintain program dependencies @@ -1622,4 +1622,4 @@ BMAKE(1) MidnightBSD General Commands Manual BMAKE( There is no way of escaping a space character in a filename. -MidnightBSD 4.0 January 28, 2022 MidnightBSD 4.0 +MidnightBSD 4.0 January 28, 2022 MidnightBSD 4.0 diff --git a/contrib/bmake/job.c b/contrib/bmake/job.c index 289add5ce62..0dd202394e4 100644 --- a/contrib/bmake/job.c +++ b/contrib/bmake/job.c @@ -263,16 +263,16 @@ typedef struct ShellWriter { * pass jobs queue to sub-makes. * Use .MAKE.ALWAYS_PASS_JOB_QUEUE=no to disable. */ -#define MAKE_ALWAYS_PASS_JOB_QUEUE ".MAKE.ALWAYS_PASS_JOB_QUEUE" -static int Always_pass_job_queue = TRUE; +#define MAKE_ALWAYS_PASS_JOB_QUEUE "${.MAKE.ALWAYS_PASS_JOB_QUEUE:U}" +static bool Always_pass_job_queue = true; /* * FreeBSD: aborting entire parallel make isn't always * desired. When doing tinderbox for example, failure of * one architecture should not stop all. * We still want to bail on interrupt though. */ -#define MAKE_JOB_ERROR_TOKEN "MAKE_JOB_ERROR_TOKEN" -static int Job_error_token = TRUE; +#define MAKE_JOB_ERROR_TOKEN "${MAKE_JOB_ERROR_TOKEN:U}" +static bool Job_error_token = true; /* * error handling variables @@ -1501,7 +1501,8 @@ JobExec(Job *job, char **argv) if (lseek(0, 0, SEEK_SET) == -1) execDie("lseek to 0", "stdin"); - if (job->node->type & (OP_MAKE | OP_SUBMAKE)) { + if (Always_pass_job_queue || + (job->node->type & (OP_MAKE | OP_SUBMAKE))) { /* * Pass job token pipe to submakes. */ @@ -2276,6 +2277,12 @@ Job_Init(void) aborting = ABORT_NONE; job_errors = 0; + Always_pass_job_queue = GetBooleanExpr(MAKE_ALWAYS_PASS_JOB_QUEUE, + Always_pass_job_queue); + + Job_error_token = GetBooleanExpr(MAKE_JOB_ERROR_TOKEN, Job_error_token); + + /* * There is a non-zero chance that we already have children. * eg after 'make -f- < -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstAppend.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstAppend.c,v 1.15 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstAppend.c -- - * Add a new node with a new datum after an existing node - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_InsertAfter -- - * Create a new node and add it to the given list after the given node. - * - * Input: - * l affected list - * ln node after which to append the datum - * d said datum - * - * Results: - * SUCCESS if all went well. - * - * Side Effects: - * A new ListNode is created and linked in to the List. The lastPtr - * field of the List will be altered if ln is the last node in the - * list. lastPtr and firstPtr will alter if the list was empty and - * ln was NULL. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_InsertAfter(Lst l, LstNode ln, void *d) -{ - List list; - ListNode lNode; - ListNode nLNode; - - if (LstValid (l) && (ln == NULL && LstIsEmpty (l))) { - goto ok; - } - - if (!LstValid (l) || LstIsEmpty (l) || ! LstNodeValid (ln, l)) { - return FAILURE; - } - ok: - - list = l; - lNode = ln; - - PAlloc (nLNode, ListNode); - nLNode->datum = d; - nLNode->useCount = nLNode->flags = 0; - - if (lNode == NULL) { - if (list->isCirc) { - nLNode->nextPtr = nLNode->prevPtr = nLNode; - } else { - nLNode->nextPtr = nLNode->prevPtr = NULL; - } - list->firstPtr = list->lastPtr = nLNode; - } else { - nLNode->prevPtr = lNode; - nLNode->nextPtr = lNode->nextPtr; - - lNode->nextPtr = nLNode; - if (nLNode->nextPtr != NULL) { - nLNode->nextPtr->prevPtr = nLNode; - } - - if (lNode == list->lastPtr) { - list->lastPtr = nLNode; - } - } - - return SUCCESS; -} diff --git a/contrib/bmake/lst.lib/lstAtEnd.c b/contrib/bmake/lst.lib/lstAtEnd.c deleted file mode 100644 index 4eadfdb0e7f..00000000000 --- a/contrib/bmake/lst.lib/lstAtEnd.c +++ /dev/null @@ -1,79 +0,0 @@ -/* $NetBSD: lstAtEnd.c,v 1.14 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstAtEnd.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstAtEnd.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstAtEnd.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstAtEnd.c -- - * Add a node at the end of the list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_AtEnd -- - * Add a node to the end of the given list - * - * Input: - * l List to which to add the datum - * d Datum to add - * - * Results: - * SUCCESS if life is good. - * - * Side Effects: - * A new ListNode is created and added to the list. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_AtEnd(Lst l, void *d) -{ - LstNode end; - - end = Lst_Last(l); - return Lst_InsertAfter(l, end, d); -} diff --git a/contrib/bmake/lst.lib/lstAtFront.c b/contrib/bmake/lst.lib/lstAtFront.c deleted file mode 100644 index 724713c092e..00000000000 --- a/contrib/bmake/lst.lib/lstAtFront.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $NetBSD: lstAtFront.c,v 1.14 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstAtFront.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstAtFront.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstAtFront.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstAtFront.c -- - * Add a node at the front of the list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_AtFront -- - * Place a piece of data at the front of a list - * - * Results: - * SUCCESS or FAILURE - * - * Side Effects: - * A new ListNode is created and stuck at the front of the list. - * hence, firstPtr (and possible lastPtr) in the list are altered. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_AtFront(Lst l, void *d) -{ - LstNode front; - - front = Lst_First(l); - return Lst_InsertBefore(l, front, d); -} diff --git a/contrib/bmake/lst.lib/lstClose.c b/contrib/bmake/lst.lib/lstClose.c deleted file mode 100644 index a1a3e9da80d..00000000000 --- a/contrib/bmake/lst.lib/lstClose.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $NetBSD: lstClose.c,v 1.12 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstClose.c,v 1.12 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstClose.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstClose.c,v 1.12 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstClose.c -- - * Close a list for sequential access. - * The sequential functions access the list in a slightly different way. - * CurPtr points to their idea of the current node in the list and they - * access the list based on it. Because the list is circular, Lst_Next - * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be - * used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Close -- - * Close a list which was opened for sequential access. - * - * Input: - * l The list to close - * - * Results: - * None. - * - * Side Effects: - * The list is closed. - * - *----------------------------------------------------------------------- - */ -void -Lst_Close(Lst l) -{ - List list = l; - - if (LstValid(l) == TRUE) { - list->isOpen = FALSE; - list->atEnd = Unknown; - } -} diff --git a/contrib/bmake/lst.lib/lstConcat.c b/contrib/bmake/lst.lib/lstConcat.c deleted file mode 100644 index 2f667c5b011..00000000000 --- a/contrib/bmake/lst.lib/lstConcat.c +++ /dev/null @@ -1,184 +0,0 @@ -/* $NetBSD: lstConcat.c,v 1.17 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstConcat.c,v 1.17 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstConcat.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstConcat.c,v 1.17 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * listConcat.c -- - * Function to concatentate two lists. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Concat -- - * Concatenate two lists. New elements are created to hold the data - * elements, if specified, but the elements themselves are not copied. - * If the elements should be duplicated to avoid confusion with another - * list, the Lst_Duplicate function should be called first. - * If LST_CONCLINK is specified, the second list is destroyed since - * its pointers have been corrupted and the list is no longer useable. - * - * Input: - * l1 The list to which l2 is to be appended - * l2 The list to append to l1 - * flags LST_CONCNEW if LstNode's should be duplicated - * LST_CONCLINK if should just be relinked - * - * Results: - * SUCCESS if all went well. FAILURE otherwise. - * - * Side Effects: - * New elements are created and appended the first list. - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Concat(Lst l1, Lst l2, int flags) -{ - ListNode ln; /* original LstNode */ - ListNode nln; /* new LstNode */ - ListNode last; /* the last element in the list. Keeps - * bookkeeping until the end */ - List list1 = l1; - List list2 = l2; - - if (!LstValid (l1) || !LstValid (l2)) { - return FAILURE; - } - - if (flags == LST_CONCLINK) { - if (list2->firstPtr != NULL) { - /* - * We set the nextPtr of the - * last element of list two to be NIL to make the loop easier and - * so we don't need an extra case should the first list turn - * out to be non-circular -- the final element will already point - * to NIL space and the first element will be untouched if it - * existed before and will also point to NIL space if it didn't. - */ - list2->lastPtr->nextPtr = NULL; - /* - * So long as the second list isn't empty, we just link the - * first element of the second list to the last element of the - * first list. If the first list isn't empty, we then link the - * last element of the list to the first element of the second list - * The last element of the second list, if it exists, then becomes - * the last element of the first list. - */ - list2->firstPtr->prevPtr = list1->lastPtr; - if (list1->lastPtr != NULL) { - list1->lastPtr->nextPtr = list2->firstPtr; - } else { - list1->firstPtr = list2->firstPtr; - } - list1->lastPtr = list2->lastPtr; - } - if (list1->isCirc && list1->firstPtr != NULL) { - /* - * If the first list is supposed to be circular and it is (now) - * non-empty, we must make sure it's circular by linking the - * first element to the last and vice versa - */ - list1->firstPtr->prevPtr = list1->lastPtr; - list1->lastPtr->nextPtr = list1->firstPtr; - } - free(l2); - } else if (list2->firstPtr != NULL) { - /* - * We set the nextPtr of the last element of list 2 to be nil to make - * the loop less difficult. The loop simply goes through the entire - * second list creating new LstNodes and filling in the nextPtr, and - * prevPtr to fit into l1 and its datum field from the - * datum field of the corresponding element in l2. The 'last' node - * follows the last of the new nodes along until the entire l2 has - * been appended. Only then does the bookkeeping catch up with the - * changes. During the first iteration of the loop, if 'last' is nil, - * the first list must have been empty so the newly-created node is - * made the first node of the list. - */ - list2->lastPtr->nextPtr = NULL; - for (last = list1->lastPtr, ln = list2->firstPtr; - ln != NULL; - ln = ln->nextPtr) - { - PAlloc (nln, ListNode); - nln->datum = ln->datum; - if (last != NULL) { - last->nextPtr = nln; - } else { - list1->firstPtr = nln; - } - nln->prevPtr = last; - nln->flags = nln->useCount = 0; - last = nln; - } - - /* - * Finish bookkeeping. The last new element becomes the last element - * of list one. - */ - list1->lastPtr = last; - - /* - * The circularity of both list one and list two must be corrected - * for -- list one because of the new nodes added to it; list two - * because of the alteration of list2->lastPtr's nextPtr to ease the - * above for loop. - */ - if (list1->isCirc) { - list1->lastPtr->nextPtr = list1->firstPtr; - list1->firstPtr->prevPtr = list1->lastPtr; - } else { - last->nextPtr = NULL; - } - - if (list2->isCirc) { - list2->lastPtr->nextPtr = list2->firstPtr; - } - } - - return SUCCESS; -} diff --git a/contrib/bmake/lst.lib/lstDatum.c b/contrib/bmake/lst.lib/lstDatum.c deleted file mode 100644 index c8ccb558f3d..00000000000 --- a/contrib/bmake/lst.lib/lstDatum.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $NetBSD: lstDatum.c,v 1.14 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDatum.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDatum.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDatum.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstDatum.c -- - * Return the datum associated with a list node. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Datum -- - * Return the datum stored in the given node. - * - * Results: - * The datum or NULL if the node is invalid. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -void * -Lst_Datum(LstNode ln) -{ - if (ln != NULL) { - return ln->datum; - } else { - return NULL; - } -} diff --git a/contrib/bmake/lst.lib/lstDeQueue.c b/contrib/bmake/lst.lib/lstDeQueue.c deleted file mode 100644 index 0f1452e4ac7..00000000000 --- a/contrib/bmake/lst.lib/lstDeQueue.c +++ /dev/null @@ -1,86 +0,0 @@ -/* $NetBSD: lstDeQueue.c,v 1.15 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDeQueue.c,v 1.15 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDeQueue.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDeQueue.c,v 1.15 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstDeQueue.c -- - * Remove the node and return its datum from the head of the list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_DeQueue -- - * Remove and return the datum at the head of the given list. - * - * Results: - * The datum in the node at the head or NULL if the list - * is empty. - * - * Side Effects: - * The head node is removed from the list. - * - *----------------------------------------------------------------------- - */ -void * -Lst_DeQueue(Lst l) -{ - void *rd; - ListNode tln; - - tln = Lst_First(l); - if (tln == NULL) { - return NULL; - } - - rd = tln->datum; - if (Lst_Remove(l, tln) == FAILURE) { - return NULL; - } else { - return rd; - } -} diff --git a/contrib/bmake/lst.lib/lstDestroy.c b/contrib/bmake/lst.lib/lstDestroy.c deleted file mode 100644 index 92c5b2b2050..00000000000 --- a/contrib/bmake/lst.lib/lstDestroy.c +++ /dev/null @@ -1,101 +0,0 @@ -/* $NetBSD: lstDestroy.c,v 1.16 2008/12/13 15:19:29 dsl Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDestroy.c,v 1.16 2008/12/13 15:19:29 dsl Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDestroy.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDestroy.c,v 1.16 2008/12/13 15:19:29 dsl Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstDestroy.c -- - * Nuke a list and all its resources - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Destroy -- - * Destroy a list and free all its resources. If the freeProc is - * given, it is called with the datum from each node in turn before - * the node is freed. - * - * Results: - * None. - * - * Side Effects: - * The given list is freed in its entirety. - * - *----------------------------------------------------------------------- - */ -void -Lst_Destroy(Lst list, FreeProc *freeProc) -{ - ListNode ln; - ListNode tln = NULL; - - if (list == NULL) - return; - - /* To ease scanning */ - if (list->lastPtr != NULL) - list->lastPtr->nextPtr = NULL; - else { - free(list); - return; - } - - if (freeProc) { - for (ln = list->firstPtr; ln != NULL; ln = tln) { - tln = ln->nextPtr; - freeProc(ln->datum); - free(ln); - } - } else { - for (ln = list->firstPtr; ln != NULL; ln = tln) { - tln = ln->nextPtr; - free(ln); - } - } - - free(list); -} diff --git a/contrib/bmake/lst.lib/lstDupl.c b/contrib/bmake/lst.lib/lstDupl.c deleted file mode 100644 index 6318ee4e462..00000000000 --- a/contrib/bmake/lst.lib/lstDupl.c +++ /dev/null @@ -1,107 +0,0 @@ -/* $NetBSD: lstDupl.c,v 1.17 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstDupl.c,v 1.17 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstDupl.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstDupl.c,v 1.17 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * listDupl.c -- - * Duplicate a list. This includes duplicating the individual - * elements. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Duplicate -- - * Duplicate an entire list. If a function to copy a void *is - * given, the individual client elements will be duplicated as well. - * - * Input: - * l the list to duplicate - * copyProc A function to duplicate each void * - * - * Results: - * The new Lst structure or NULL if failure. - * - * Side Effects: - * A new list is created. - *----------------------------------------------------------------------- - */ -Lst -Lst_Duplicate(Lst l, DuplicateProc *copyProc) -{ - Lst nl; - ListNode ln; - List list = l; - - if (!LstValid (l)) { - return NULL; - } - - nl = Lst_Init(list->isCirc); - if (nl == NULL) { - return NULL; - } - - ln = list->firstPtr; - while (ln != NULL) { - if (copyProc != NULL) { - if (Lst_AtEnd(nl, copyProc(ln->datum)) == FAILURE) { - return NULL; - } - } else if (Lst_AtEnd(nl, ln->datum) == FAILURE) { - return NULL; - } - - if (list->isCirc && ln == list->lastPtr) { - ln = NULL; - } else { - ln = ln->nextPtr; - } - } - - return nl; -} diff --git a/contrib/bmake/lst.lib/lstEnQueue.c b/contrib/bmake/lst.lib/lstEnQueue.c deleted file mode 100644 index c6941a8eb9d..00000000000 --- a/contrib/bmake/lst.lib/lstEnQueue.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstEnQueue.c,v 1.14 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstEnQueue.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstEnQueue.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstEnQueue.c,v 1.14 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstEnQueue.c-- - * Treat the list as a queue and place a datum at its end - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_EnQueue -- - * Add the datum to the tail of the given list. - * - * Results: - * SUCCESS or FAILURE as returned by Lst_InsertAfter. - * - * Side Effects: - * the lastPtr field is altered all the time and the firstPtr field - * will be altered if the list used to be empty. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_EnQueue(Lst l, void *d) -{ - if (LstValid (l) == FALSE) { - return FAILURE; - } - - return Lst_InsertAfter(l, Lst_Last(l), d); -} diff --git a/contrib/bmake/lst.lib/lstFind.c b/contrib/bmake/lst.lib/lstFind.c deleted file mode 100644 index a1d27d3ad68..00000000000 --- a/contrib/bmake/lst.lib/lstFind.c +++ /dev/null @@ -1,73 +0,0 @@ -/* $NetBSD: lstFind.c,v 1.16 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstFind.c,v 1.16 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstFind.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstFind.c,v 1.16 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstFind.c -- - * Find a node on a list. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Find -- - * Find a node on the given list using the given comparison function - * and the given datum. - * - * Results: - * The found node or NULL if none matches. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Find(Lst l, const void *d, int (*cProc)(const void *, const void *)) -{ - return Lst_FindFrom(l, Lst_First(l), d, cProc); -} diff --git a/contrib/bmake/lst.lib/lstFindFrom.c b/contrib/bmake/lst.lib/lstFindFrom.c deleted file mode 100644 index 676c0739203..00000000000 --- a/contrib/bmake/lst.lib/lstFindFrom.c +++ /dev/null @@ -1,89 +0,0 @@ -/* $NetBSD: lstFindFrom.c,v 1.16 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstFindFrom.c,v 1.16 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstFindFrom.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstFindFrom.c,v 1.16 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstFindFrom.c -- - * Find a node on a list from a given starting point. Used by Lst_Find. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_FindFrom -- - * Search for a node starting and ending with the given one on the - * given list using the passed datum and comparison function to - * determine when it has been found. - * - * Results: - * The found node or NULL - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_FindFrom(Lst l, LstNode ln, const void *d, - int (*cProc)(const void *, const void *)) -{ - ListNode tln; - - if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { - return NULL; - } - - tln = ln; - - do { - if ((*cProc)(tln->datum, d) == 0) - return tln; - tln = tln->nextPtr; - } while (tln != ln && tln != NULL); - - return NULL; -} diff --git a/contrib/bmake/lst.lib/lstFirst.c b/contrib/bmake/lst.lib/lstFirst.c deleted file mode 100644 index a79db57120d..00000000000 --- a/contrib/bmake/lst.lib/lstFirst.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $NetBSD: lstFirst.c,v 1.13 2020/07/03 08:37:56 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstFirst.c,v 1.13 2020/07/03 08:37:56 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstFirst.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstFirst.c,v 1.13 2020/07/03 08:37:56 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstFirst.c -- - * Return the first node of a list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_First -- - * Return the first node on the given list. - * - * Results: - * The first node or NULL if the list is empty. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_First(Lst l) -{ - if (!LstValid (l) || LstIsEmpty (l)) { - return NULL; - } else { - return l->firstPtr; - } -} diff --git a/contrib/bmake/lst.lib/lstForEach.c b/contrib/bmake/lst.lib/lstForEach.c deleted file mode 100644 index dc2fdd8bfc5..00000000000 --- a/contrib/bmake/lst.lib/lstForEach.c +++ /dev/null @@ -1,75 +0,0 @@ -/* $NetBSD: lstForEach.c,v 1.14 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstForEach.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstForEach.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstForEach.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstForeach.c -- - * Perform a given function on all elements of a list. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_ForEach -- - * Apply the given function to each element of the given list. The - * function should return 0 if Lst_ForEach should continue and non- - * zero if it should abort. - * - * Results: - * None. - * - * Side Effects: - * Only those created by the passed-in function. - * - *----------------------------------------------------------------------- - */ -/*VARARGS2*/ -int -Lst_ForEach(Lst l, int (*proc)(void *, void *), void *d) -{ - return Lst_ForEachFrom(l, Lst_First(l), proc, d); -} diff --git a/contrib/bmake/lst.lib/lstForEachFrom.c b/contrib/bmake/lst.lib/lstForEachFrom.c deleted file mode 100644 index a08ddf35935..00000000000 --- a/contrib/bmake/lst.lib/lstForEachFrom.c +++ /dev/null @@ -1,124 +0,0 @@ -/* $NetBSD: lstForEachFrom.c,v 1.18 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstForEachFrom.c,v 1.18 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstForEachFrom.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstForEachFrom.c,v 1.18 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * lstForEachFrom.c -- - * Perform a given function on all elements of a list starting from - * a given point. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_ForEachFrom -- - * Apply the given function to each element of the given list. The - * function should return 0 if traversal should continue and non- - * zero if it should abort. - * - * Results: - * None. - * - * Side Effects: - * Only those created by the passed-in function. - * - *----------------------------------------------------------------------- - */ -/*VARARGS2*/ -int -Lst_ForEachFrom(Lst l, LstNode ln, int (*proc)(void *, void *), - void *d) -{ - ListNode tln = ln; - List list = l; - ListNode next; - Boolean done; - int result; - - if (!LstValid (list) || LstIsEmpty (list)) { - return 0; - } - - do { - /* - * Take care of having the current element deleted out from under - * us. - */ - - next = tln->nextPtr; - - /* - * We're done with the traversal if - * - the next node to examine is the first in the queue or - * doesn't exist and - * - nothing's been added after the current node (check this - * after proc() has been called). - */ - done = (next == NULL || next == list->firstPtr); - - (void) tln->useCount++; - result = (*proc) (tln->datum, d); - (void) tln->useCount--; - - /* - * Now check whether a node has been added. - * Note: this doesn't work if this node was deleted before - * the new node was added. - */ - if (next != tln->nextPtr) { - next = tln->nextPtr; - done = 0; - } - - if (tln->flags & LN_DELETED) { - free((char *)tln); - } - tln = next; - } while (!result && !LstIsEmpty(list) && !done); - - return result; -} diff --git a/contrib/bmake/lst.lib/lstInit.c b/contrib/bmake/lst.lib/lstInit.c deleted file mode 100644 index 3255da7e59a..00000000000 --- a/contrib/bmake/lst.lib/lstInit.c +++ /dev/null @@ -1,85 +0,0 @@ -/* $NetBSD: lstInit.c,v 1.13 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstInit.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstInit.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstInit.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * init.c -- - * Initialize a new linked list. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Init -- - * Create and initialize a new list. - * - * Input: - * circ TRUE if the list should be made circular - * - * Results: - * The created list. - * - * Side Effects: - * A list is created, what else? - * - *----------------------------------------------------------------------- - */ -Lst -Lst_Init(Boolean circ) -{ - List nList; - - PAlloc (nList, List); - - nList->firstPtr = NULL; - nList->lastPtr = NULL; - nList->isOpen = FALSE; - nList->isCirc = circ; - nList->atEnd = Unknown; - - return nList; -} diff --git a/contrib/bmake/lst.lib/lstInsert.c b/contrib/bmake/lst.lib/lstInsert.c deleted file mode 100644 index 845b8899e03..00000000000 --- a/contrib/bmake/lst.lib/lstInsert.c +++ /dev/null @@ -1,121 +0,0 @@ -/* $NetBSD: lstInsert.c,v 1.15 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstInsert.c,v 1.15 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstInsert.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstInsert.c,v 1.15 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstInsert.c -- - * Insert a new datum before an old one - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_InsertBefore -- - * Insert a new node with the given piece of data before the given - * node in the given list. - * - * Input: - * l list to manipulate - * ln node before which to insert d - * d datum to be inserted - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * the firstPtr field will be changed if ln is the first node in the - * list. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_InsertBefore(Lst l, LstNode ln, void *d) -{ - ListNode nLNode; /* new lnode for d */ - ListNode lNode = ln; - List list = l; - - - /* - * check validity of arguments - */ - if (LstValid (l) && (LstIsEmpty (l) && ln == NULL)) - goto ok; - - if (!LstValid (l) || LstIsEmpty (l) || !LstNodeValid (ln, l)) { - return FAILURE; - } - - ok: - PAlloc (nLNode, ListNode); - - nLNode->datum = d; - nLNode->useCount = nLNode->flags = 0; - - if (ln == NULL) { - if (list->isCirc) { - nLNode->prevPtr = nLNode->nextPtr = nLNode; - } else { - nLNode->prevPtr = nLNode->nextPtr = NULL; - } - list->firstPtr = list->lastPtr = nLNode; - } else { - nLNode->prevPtr = lNode->prevPtr; - nLNode->nextPtr = lNode; - - if (nLNode->prevPtr != NULL) { - nLNode->prevPtr->nextPtr = nLNode; - } - lNode->prevPtr = nLNode; - - if (lNode == list->firstPtr) { - list->firstPtr = nLNode; - } - } - - return SUCCESS; -} diff --git a/contrib/bmake/lst.lib/lstInt.h b/contrib/bmake/lst.lib/lstInt.h deleted file mode 100644 index ac53dcb67d7..00000000000 --- a/contrib/bmake/lst.lib/lstInt.h +++ /dev/null @@ -1,105 +0,0 @@ -/* $NetBSD: lstInt.h,v 1.22 2014/09/07 20:55:34 joerg Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)lstInt.h 8.1 (Berkeley) 6/6/93 - */ - -/*- - * lstInt.h -- - * Internals for the list library - */ -#ifndef _LSTINT_H_ -#define _LSTINT_H_ - -#include "../lst.h" -#include "../make_malloc.h" - -typedef struct ListNode { - struct ListNode *prevPtr; /* previous element in list */ - struct ListNode *nextPtr; /* next in list */ - unsigned int useCount:8, /* Count of functions using the node. - * node may not be deleted until count - * goes to 0 */ - flags:8; /* Node status flags */ - void *datum; /* datum associated with this element */ -} *ListNode; -/* - * Flags required for synchronization - */ -#define LN_DELETED 0x0001 /* List node should be removed when done */ - -typedef enum { - Head, Middle, Tail, Unknown -} Where; - -typedef struct List { - ListNode firstPtr; /* first node in list */ - ListNode lastPtr; /* last node in list */ - Boolean isCirc; /* true if the list should be considered - * circular */ -/* - * fields for sequential access - */ - Where atEnd; /* Where in the list the last access was */ - Boolean isOpen; /* true if list has been Lst_Open'ed */ - ListNode curPtr; /* current node, if open. NULL if - * *just* opened */ - ListNode prevPtr; /* Previous node, if open. Used by - * Lst_Remove */ -} *List; - -/* - * PAlloc (var, ptype) -- - * Allocate a pointer-typedef structure 'ptype' into the variable 'var' - */ -#define PAlloc(var,ptype) var = (ptype) bmake_malloc(sizeof *(var)) - -/* - * LstValid (l) -- - * Return TRUE if the list l is valid - */ -#define LstValid(l) ((Lst)(l) != NULL) - -/* - * LstNodeValid (ln, l) -- - * Return TRUE if the LstNode ln is valid with respect to l - */ -#define LstNodeValid(ln, l) ((ln) != NULL) - -/* - * LstIsEmpty (l) -- - * TRUE if the list l is empty. - */ -#define LstIsEmpty(l) (((List)(l))->firstPtr == NULL) - -#endif /* _LSTINT_H_ */ diff --git a/contrib/bmake/lst.lib/lstIsAtEnd.c b/contrib/bmake/lst.lib/lstIsAtEnd.c deleted file mode 100644 index c5add4d9867..00000000000 --- a/contrib/bmake/lst.lib/lstIsAtEnd.c +++ /dev/null @@ -1,86 +0,0 @@ -/* $NetBSD: lstIsAtEnd.c,v 1.14 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstIsAtEnd.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstIsAtEnd.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstIsAtEnd.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstIsAtEnd.c -- - * Tell if the current node is at the end of the list. - * The sequential functions access the list in a slightly different way. - * CurPtr points to their idea of the current node in the list and they - * access the list based on it. Because the list is circular, Lst_Next - * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be - * used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_IsAtEnd -- - * Return true if have reached the end of the given list. - * - * Results: - * TRUE if at the end of the list (this includes the list not being - * open or being invalid) or FALSE if not. We return TRUE if the list - * is invalid or unopend so as to cause the caller to exit its loop - * asap, the assumption being that the loop is of the form - * while (!Lst_IsAtEnd (l)) { - * ... - * } - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -Boolean -Lst_IsAtEnd(Lst l) -{ - List list = l; - - return !LstValid (l) || !list->isOpen || - list->atEnd == Head || list->atEnd == Tail; -} diff --git a/contrib/bmake/lst.lib/lstIsEmpty.c b/contrib/bmake/lst.lib/lstIsEmpty.c deleted file mode 100644 index ccf4525a350..00000000000 --- a/contrib/bmake/lst.lib/lstIsEmpty.c +++ /dev/null @@ -1,74 +0,0 @@ -/* $NetBSD: lstIsEmpty.c,v 1.12 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstIsEmpty.c,v 1.12 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstIsEmpty.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstIsEmpty.c,v 1.12 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstIsEmpty.c -- - * A single function to decide if a list is empty - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_IsEmpty -- - * Return TRUE if the given list is empty. - * - * Results: - * TRUE if the list is empty, FALSE otherwise. - * - * Side Effects: - * None. - * - * A list is considered empty if its firstPtr == NULL (or if - * the list itself is NULL). - *----------------------------------------------------------------------- - */ -Boolean -Lst_IsEmpty(Lst l) -{ - return !LstValid(l) || LstIsEmpty(l); -} diff --git a/contrib/bmake/lst.lib/lstLast.c b/contrib/bmake/lst.lib/lstLast.c deleted file mode 100644 index 1d65bf19473..00000000000 --- a/contrib/bmake/lst.lib/lstLast.c +++ /dev/null @@ -1,76 +0,0 @@ -/* $NetBSD: lstLast.c,v 1.13 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstLast.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstLast.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstLast.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstLast.c -- - * Return the last element of a list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Last -- - * Return the last node on the list l. - * - * Results: - * The requested node or NULL if the list is empty. - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Last(Lst l) -{ - if (!LstValid(l) || LstIsEmpty (l)) { - return NULL; - } else { - return l->lastPtr; - } -} diff --git a/contrib/bmake/lst.lib/lstMember.c b/contrib/bmake/lst.lib/lstMember.c deleted file mode 100644 index e9046aca143..00000000000 --- a/contrib/bmake/lst.lib/lstMember.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstMember.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstMember.c,v 1.14 2013/11/14 00:01:28 sjg Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * lstMember.c -- - * See if a given datum is on a given list. - */ - -#include "lstInt.h" - -LstNode -Lst_Member(Lst l, void *d) -{ - List list = l; - ListNode lNode; - - if (list == NULL) { - return NULL; - } - lNode = list->firstPtr; - if (lNode == NULL) { - return NULL; - } - - do { - if (lNode->datum == d) { - return lNode; - } - lNode = lNode->nextPtr; - } while (lNode != NULL && lNode != list->firstPtr); - - return NULL; -} diff --git a/contrib/bmake/lst.lib/lstNext.c b/contrib/bmake/lst.lib/lstNext.c deleted file mode 100644 index 9c180d2cfad..00000000000 --- a/contrib/bmake/lst.lib/lstNext.c +++ /dev/null @@ -1,119 +0,0 @@ -/* $NetBSD: lstNext.c,v 1.13 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstNext.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstNext.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstNext.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstNext.c -- - * Return the next node for a list. - * The sequential functions access the list in a slightly different way. - * CurPtr points to their idea of the current node in the list and they - * access the list based on it. Because the list is circular, Lst_Next - * and Lst_Prev will go around the list forever. Lst_IsAtEnd must be - * used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Next -- - * Return the next node for the given list. - * - * Results: - * The next node or NULL if the list has yet to be opened. Also - * if the list is non-circular and the end has been reached, NULL - * is returned. - * - * Side Effects: - * the curPtr field is updated. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Next(Lst l) -{ - ListNode tln; - List list = l; - - if ((LstValid (l) == FALSE) || - (list->isOpen == FALSE)) { - return NULL; - } - - list->prevPtr = list->curPtr; - - if (list->curPtr == NULL) { - if (list->atEnd == Unknown) { - /* - * If we're just starting out, atEnd will be Unknown. - * Then we want to start this thing off in the right - * direction -- at the start with atEnd being Middle. - */ - list->curPtr = tln = list->firstPtr; - list->atEnd = Middle; - } else { - tln = NULL; - list->atEnd = Tail; - } - } else { - tln = list->curPtr->nextPtr; - list->curPtr = tln; - - if (tln == list->firstPtr || tln == NULL) { - /* - * If back at the front, then we've hit the end... - */ - list->atEnd = Tail; - } else { - /* - * Reset to Middle if gone past first. - */ - list->atEnd = Middle; - } - } - - return tln; -} diff --git a/contrib/bmake/lst.lib/lstOpen.c b/contrib/bmake/lst.lib/lstOpen.c deleted file mode 100644 index 919dd6d5000..00000000000 --- a/contrib/bmake/lst.lib/lstOpen.c +++ /dev/null @@ -1,86 +0,0 @@ -/* $NetBSD: lstOpen.c,v 1.13 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstOpen.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstOpen.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstOpen.c,v 1.13 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstOpen.c -- - * Open a list for sequential access. The sequential functions access the - * list in a slightly different way. CurPtr points to their idea of the - * current node in the list and they access the list based on it. - * If the list is circular, Lst_Next and Lst_Prev will go around - * the list forever. Lst_IsAtEnd must be used to determine when to stop. - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Open -- - * Open a list for sequential access. A list can still be searched, - * etc., without confusing these functions. - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * isOpen is set TRUE and curPtr is set to NULL so the - * other sequential functions no it was just opened and can choose - * the first element accessed based on this. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Open(Lst l) -{ - if (LstValid (l) == FALSE) { - return FAILURE; - } - (l)->isOpen = TRUE; - (l)->atEnd = LstIsEmpty (l) ? Head : Unknown; - (l)->curPtr = NULL; - - return SUCCESS; -} diff --git a/contrib/bmake/lst.lib/lstPrev.c b/contrib/bmake/lst.lib/lstPrev.c deleted file mode 100644 index b6c548d9a52..00000000000 --- a/contrib/bmake/lst.lib/lstPrev.c +++ /dev/null @@ -1,78 +0,0 @@ -/* $NetBSD: lstPrev.c,v 1.4 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstPrev.c,v 1.4 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstPrev.c,v 1.4 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstPrev.c -- - * return the predecessor to a given node - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Prev -- - * Return the predecessor to the given node on its list. - * - * Results: - * The predecessor of the node, if it exists (note that on a circular - * list, if the node is the only one in the list, it is its own - * predecessor). - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Prev(LstNode ln) -{ - if (ln == NULL) { - return NULL; - } else { - return ln->prevPtr; - } -} diff --git a/contrib/bmake/lst.lib/lstRemove.c b/contrib/bmake/lst.lib/lstRemove.c deleted file mode 100644 index 59245499bdc..00000000000 --- a/contrib/bmake/lst.lib/lstRemove.c +++ /dev/null @@ -1,134 +0,0 @@ -/* $NetBSD: lstRemove.c,v 1.17 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstRemove.c,v 1.17 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstRemove.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstRemove.c,v 1.17 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstRemove.c -- - * Remove an element from a list - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Remove -- - * Remove the given node from the given list. - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * The list's firstPtr will be set to NULL if ln is the last - * node on the list. firsPtr and lastPtr will be altered if ln is - * either the first or last node, respectively, on the list. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Remove(Lst l, LstNode ln) -{ - List list = l; - ListNode lNode = ln; - - if (!LstValid (l) || !LstNodeValid (ln, l)) { - return FAILURE; - } - - /* - * unlink it from the list - */ - if (lNode->nextPtr != NULL) { - lNode->nextPtr->prevPtr = lNode->prevPtr; - } - if (lNode->prevPtr != NULL) { - lNode->prevPtr->nextPtr = lNode->nextPtr; - } - - /* - * if either the firstPtr or lastPtr of the list point to this node, - * adjust them accordingly - */ - if (list->firstPtr == lNode) { - list->firstPtr = lNode->nextPtr; - } - if (list->lastPtr == lNode) { - list->lastPtr = lNode->prevPtr; - } - - /* - * Sequential access stuff. If the node we're removing is the current - * node in the list, reset the current node to the previous one. If the - * previous one was non-existent (prevPtr == NULL), we set the - * end to be Unknown, since it is. - */ - if (list->isOpen && (list->curPtr == lNode)) { - list->curPtr = list->prevPtr; - if (list->curPtr == NULL) { - list->atEnd = Unknown; - } - } - - /* - * the only way firstPtr can still point to ln is if ln is the last - * node on the list (the list is circular, so lNode->nextptr == lNode in - * this case). The list is, therefore, empty and is marked as such - */ - if (list->firstPtr == lNode) { - list->firstPtr = NULL; - } - - /* - * note that the datum is unmolested. The caller must free it as - * necessary and as expected. - */ - if (lNode->useCount == 0) { - free(ln); - } else { - lNode->flags |= LN_DELETED; - } - - return SUCCESS; -} diff --git a/contrib/bmake/lst.lib/lstReplace.c b/contrib/bmake/lst.lib/lstReplace.c deleted file mode 100644 index f30cb00855e..00000000000 --- a/contrib/bmake/lst.lib/lstReplace.c +++ /dev/null @@ -1,77 +0,0 @@ -/* $NetBSD: lstReplace.c,v 1.14 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstReplace.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstReplace.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstReplace.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstReplace.c -- - * Replace the datum in a node with a new datum - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Replace -- - * Replace the datum in the given node with the new datum - * - * Results: - * SUCCESS or FAILURE. - * - * Side Effects: - * The datum field fo the node is altered. - * - *----------------------------------------------------------------------- - */ -ReturnStatus -Lst_Replace(LstNode ln, void *d) -{ - if (ln == NULL) { - return FAILURE; - } else { - (ln)->datum = d; - return SUCCESS; - } -} diff --git a/contrib/bmake/lst.lib/lstSucc.c b/contrib/bmake/lst.lib/lstSucc.c deleted file mode 100644 index b3f73bb15fd..00000000000 --- a/contrib/bmake/lst.lib/lstSucc.c +++ /dev/null @@ -1,78 +0,0 @@ -/* $NetBSD: lstSucc.c,v 1.14 2020/07/03 08:37:57 rillig Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: lstSucc.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"; -#else -#include -#ifndef lint -#if 0 -static char sccsid[] = "@(#)lstSucc.c 8.1 (Berkeley) 6/6/93"; -#else -__RCSID("$NetBSD: lstSucc.c,v 1.14 2020/07/03 08:37:57 rillig Exp $"); -#endif -#endif /* not lint */ -#endif - -/*- - * LstSucc.c -- - * return the successor to a given node - */ - -#include "lstInt.h" - -/*- - *----------------------------------------------------------------------- - * Lst_Succ -- - * Return the successor to the given node on its list. - * - * Results: - * The successor of the node, if it exists (note that on a circular - * list, if the node is the only one in the list, it is its own - * successor). - * - * Side Effects: - * None. - * - *----------------------------------------------------------------------- - */ -LstNode -Lst_Succ(LstNode ln) -{ - if (ln == NULL) { - return NULL; - } else { - return ln->nextPtr; - } -} diff --git a/contrib/bmake/mk/meta2deps.sh b/contrib/bmake/mk/meta2deps.sh index 3bcfe89f4d3..4b7f9588987 100755 --- a/contrib/bmake/mk/meta2deps.sh +++ b/contrib/bmake/mk/meta2deps.sh @@ -49,8 +49,6 @@ # The output, is a set of absolute paths with "SB" like: #.nf # -# $SB/obj-i386/bsd/gnu/lib/csu -# $SB/obj-i386/bsd/gnu/lib/libgcc # $SB/obj-i386/bsd/include # $SB/obj-i386/bsd/lib/csu/i386 # $SB/obj-i386/bsd/lib/libc diff --git a/contrib/bmake/nonints.h b/contrib/bmake/nonints.h deleted file mode 100644 index 3126650c9b5..00000000000 --- a/contrib/bmake/nonints.h +++ /dev/null @@ -1,212 +0,0 @@ -/* $NetBSD: nonints.h,v 1.78 2020/07/03 07:40:13 rillig Exp $ */ - -/*- - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)nonints.h 8.3 (Berkeley) 3/19/94 - */ - -/*- - * Copyright (c) 1989 by Berkeley Softworks - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)nonints.h 8.3 (Berkeley) 3/19/94 - */ - -/* arch.c */ -ReturnStatus Arch_ParseArchive(char **, Lst, GNode *); -void Arch_Touch(GNode *); -void Arch_TouchLib(GNode *); -time_t Arch_MTime(GNode *); -time_t Arch_MemMTime(GNode *); -void Arch_FindLib(GNode *, Lst); -Boolean Arch_LibOODate(GNode *); -void Arch_Init(void); -void Arch_End(void); -int Arch_IsLib(GNode *); - -/* compat.c */ -int CompatRunCommand(void *, void *); -void Compat_Run(Lst); -int Compat_Make(void *, void *); - -/* cond.c */ -struct If; -int Cond_EvalExpression(const struct If *, char *, Boolean *, int, Boolean); -int Cond_Eval(char *); -void Cond_restore_depth(unsigned int); -unsigned int Cond_save_depth(void); - -/* for.c */ -int For_Eval(char *); -int For_Accum(char *); -void For_Run(int); - -/* job.c */ -#ifdef WAIT_T -void JobReapChild(pid_t, WAIT_T, Boolean); -#endif - -/* main.c */ -void Main_ParseArgLine(const char *); -void MakeMode(const char *); -char *Cmd_Exec(const char *, const char **); -void Error(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2); -void Fatal(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; -void Punt(const char *, ...) MAKE_ATTR_PRINTFLIKE(1, 2) MAKE_ATTR_DEAD; -void DieHorribly(void) MAKE_ATTR_DEAD; -int PrintAddr(void *, void *); -void Finish(int) MAKE_ATTR_DEAD; -int eunlink(const char *); -void execError(const char *, const char *); -char *getTmpdir(void); -Boolean s2Boolean(const char *, Boolean); -Boolean getBoolean(const char *, Boolean); -char *cached_realpath(const char *, char *); - -/* parse.c */ -void Parse_Error(int, const char *, ...) MAKE_ATTR_PRINTFLIKE(2, 3); -Boolean Parse_AnyExport(void); -Boolean Parse_IsVar(char *); -void Parse_DoVar(char *, GNode *); -void Parse_AddIncludeDir(char *); -void Parse_File(const char *, int); -void Parse_Init(void); -void Parse_End(void); -void Parse_SetInput(const char *, int, int, char *(*)(void *, size_t *), void *); -Lst Parse_MainName(void); - -/* str.c */ -char *str_concat(const char *, const char *, int); -char **brk_string(const char *, int *, Boolean, char **); -char *Str_FindSubstring(const char *, const char *); -Boolean Str_Match(const char *, const char *); -char *Str_SYSVMatch(const char *, const char *, size_t *, Boolean *); -void Str_SYSVSubst(Buffer *, char *, char *, size_t, Boolean); - -#ifndef HAVE_STRLCPY -/* strlcpy.c */ -size_t strlcpy(char *, const char *, size_t); -#endif - -/* suff.c */ -void Suff_ClearSuffixes(void); -Boolean Suff_IsTransform(char *); -GNode *Suff_AddTransform(char *); -int Suff_EndTransform(void *, void *); -void Suff_AddSuffix(char *, GNode **); -Lst Suff_GetPath(char *); -void Suff_DoPaths(void); -void Suff_AddInclude(char *); -void Suff_AddLib(char *); -void Suff_FindDeps(GNode *); -Lst Suff_FindPath(GNode *); -void Suff_SetNull(char *); -void Suff_Init(void); -void Suff_End(void); -void Suff_PrintAll(void); - -/* targ.c */ -void Targ_Init(void); -void Targ_End(void); -Lst Targ_List(void); -GNode *Targ_NewGN(const char *); -GNode *Targ_FindNode(const char *, int); -Lst Targ_FindList(Lst, int); -Boolean Targ_Ignore(GNode *); -Boolean Targ_Silent(GNode *); -Boolean Targ_Precious(GNode *); -void Targ_SetMain(GNode *); -int Targ_PrintCmd(void *, void *); -int Targ_PrintNode(void *, void *); -char *Targ_FmtTime(time_t); -void Targ_PrintType(int); -void Targ_PrintGraph(int); -void Targ_Propagate(void); -void Targ_Propagate_Wait(void); - -/* var.c */ - -typedef enum { - VARF_UNDEFERR = 1, - VARF_WANTRES = 2, - VARF_ASSIGN = 4 -} Varf_Flags; - -void Var_Delete(const char *, GNode *); -void Var_Set(const char *, const char *, GNode *); -void Var_Append(const char *, const char *, GNode *); -Boolean Var_Exists(const char *, GNode *); -char *Var_Value(const char *, GNode *, char **); -char *Var_Parse(const char *, GNode *, Varf_Flags, int *, void **); -char *Var_Subst(const char *, const char *, GNode *, Varf_Flags); -char *Var_GetTail(const char *); -char *Var_GetHead(const char *); -void Var_Init(void); -void Var_End(void); -void Var_Dump(GNode *); -void Var_ExportVars(void); -void Var_Export(char *, int); -void Var_UnExport(char *); - -/* util.c */ -void (*bmake_signal(int, void (*)(int)))(int); diff --git a/contrib/bmake/sprite.h b/contrib/bmake/sprite.h deleted file mode 100644 index cdcffd99abe..00000000000 --- a/contrib/bmake/sprite.h +++ /dev/null @@ -1,116 +0,0 @@ -/* $NetBSD: sprite.h,v 1.14 2017/05/31 22:02:06 maya Exp $ */ - -/* - * Copyright (c) 1988, 1989, 1990, 1993 - * The Regents of the University of California. All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 - */ - -/* - * Copyright (c) 1989 by Berkeley Softworks - * All rights reserved. - * - * This code is derived from software contributed to Berkeley by - * Adam de Boor. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND - * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE - * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS - * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT - * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY - * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF - * SUCH DAMAGE. - * - * from: @(#)sprite.h 8.1 (Berkeley) 6/6/93 - */ - -/* - * sprite.h -- - * - * Common constants and type declarations for Sprite. - */ - -#ifndef MAKE_SPRITE_H -#define MAKE_SPRITE_H - - -/* - * A boolean type is defined as an integer, not an enum. This allows a - * boolean argument to be an expression that isn't strictly 0 or 1 valued. - */ - -typedef int Boolean; -#ifndef TRUE -#define TRUE 1 -#endif /* TRUE */ -#ifndef FALSE -#define FALSE 0 -#endif /* FALSE */ - -/* - * Functions that must return a status can return a ReturnStatus to - * indicate success or type of failure. - */ - -typedef int ReturnStatus; - -/* - * The following statuses overlap with the first 2 generic statuses - * defined in status.h: - * - * SUCCESS There was no error. - * FAILURE There was a general error. - */ - -#define SUCCESS 0x00000000 -#define FAILURE 0x00000001 - -#endif /* MAKE_SPRITE_H */ diff --git a/contrib/bmake/strlist.c b/contrib/bmake/strlist.c deleted file mode 100644 index 3fb2f7dbb6c..00000000000 --- a/contrib/bmake/strlist.c +++ /dev/null @@ -1,93 +0,0 @@ -/* $NetBSD: strlist.c,v 1.4 2009/01/24 11:59:39 dsl Exp $ */ - -/*- - * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by David Laight. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: strlist.c,v 1.4 2009/01/24 11:59:39 dsl Exp $"; -#else -#include -#ifndef lint -__RCSID("$NetBSD: strlist.c,v 1.4 2009/01/24 11:59:39 dsl Exp $"); -#endif /* not lint */ -#endif - -#include -#include -#include "strlist.h" -#include "make_malloc.h" - -void -strlist_init(strlist_t *sl) -{ - sl->sl_num = 0; - sl->sl_max = 0; - sl->sl_items = NULL; -} - -void -strlist_clean(strlist_t *sl) -{ - char *str; - int i; - - STRLIST_FOREACH(str, sl, i) - free(str); - free(sl->sl_items); - - sl->sl_num = 0; - sl->sl_max = 0; - sl->sl_items = NULL; -} - -void -strlist_add_str(strlist_t *sl, char *str, unsigned int info) -{ - unsigned int n; - strlist_item_t *items; - - if (str == NULL) - return; - - n = sl->sl_num + 1; - sl->sl_num = n; - items = sl->sl_items; - if (n >= sl->sl_max) { - items = bmake_realloc(items, (n + 7) * sizeof *sl->sl_items); - sl->sl_items = items; - sl->sl_max = n + 6; - } - items += n - 1; - items->si_str = str; - items->si_info = info; - items[1].si_str = NULL; /* STRLIST_FOREACH() terminator */ -} diff --git a/contrib/bmake/strlist.h b/contrib/bmake/strlist.h deleted file mode 100644 index 2fc049e8643..00000000000 --- a/contrib/bmake/strlist.h +++ /dev/null @@ -1,62 +0,0 @@ -/* $NetBSD: strlist.h,v 1.3 2009/01/16 21:15:34 dsl Exp $ */ - -/*- - * Copyright (c) 2008 - 2009 The NetBSD Foundation, Inc. - * All rights reserved. - * - * This code is derived from software contributed to The NetBSD Foundation - * by David Laight. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * 3. Neither the name of The NetBSD Foundation nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS - * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED - * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE - * POSSIBILITY OF SUCH DAMAGE. - */ - -#ifndef _STRLIST_H -#define _STRLIST_H - -typedef struct { - char *si_str; - unsigned int si_info; -} strlist_item_t; - -typedef struct { - unsigned int sl_num; - unsigned int sl_max; - strlist_item_t *sl_items; -} strlist_t; - -void strlist_init(strlist_t *); -void strlist_clean(strlist_t *); -void strlist_add_str(strlist_t *, char *, unsigned int); - -#define strlist_num(sl) ((sl)->sl_num) -#define strlist_str(sl, n) ((sl)->sl_items[n].si_str) -#define strlist_info(sl, n) ((sl)->sl_items[n].si_info) -#define strlist_set_info(sl, n, v) ((void)((sl)->sl_items[n].si_info = (v))) - -#define STRLIST_FOREACH(v, sl, index) \ - if ((sl)->sl_items != NULL) \ - for (index = 0; (v = strlist_str(sl, index)) != NULL; index++) - -#endif /* _STRLIST_H */ diff --git a/contrib/bmake/unit-tests/Makefile.in b/contrib/bmake/unit-tests/Makefile.in deleted file mode 100644 index 4ee94bd87f6..00000000000 --- a/contrib/bmake/unit-tests/Makefile.in +++ /dev/null @@ -1,151 +0,0 @@ -# $Id: Makefile.in,v 1.48 2015/12/07 04:06:29 sjg Exp $ -# -# $NetBSD: Makefile,v 1.52 2015/05/05 21:51:09 sjg Exp $ -# -# Unit tests for make(1) -# The main targets are: -# -# all: run all the tests -# test: run 'all', and compare to expected results -# accept: move generated output to expected results -# -# Adding a test case. -# Each feature should get its own set of tests in its own suitably -# named makefile (*.mk), with its own set of expected results (*.exp), -# and it should be added to the TESTNAMES list. -# - -srcdir= @srcdir@ - -.MAIN: all - -UNIT_TESTS:= ${srcdir} -.PATH: ${UNIT_TESTS} - -# Each test is in a sub-makefile. -# Keep the list sorted. -TESTNAMES= \ - comment \ - cond1 \ - cond2 \ - error \ - export \ - export-all \ - export-env \ - doterror \ - dotwait \ - forloop \ - forsubst \ - hash \ - misc \ - moderrs \ - modmatch \ - modmisc \ - modorder \ - modts \ - modword \ - order \ - posix \ - qequals \ - sunshcmd \ - sysv \ - ternary \ - unexport \ - unexport-env \ - varcmd \ - varmisc \ - varshell - -# these tests were broken by referting POSIX chanegs -STRICT_POSIX_TESTS = \ - escape \ - impsrc \ - phony-end \ - posix1 \ - suffixes - -# Override make flags for certain tests -flags.doterror= -flags.order=-j1 - -OUTFILES= ${TESTNAMES:S/$/.out/} - -all: ${OUTFILES} - -CLEANFILES += *.rawout *.out *.status *.tmp *.core *.tmp -CLEANFILES += obj*.[och] lib*.a # posix1.mk -CLEANFILES += issue* .[ab]* # suffixes.mk -CLEANRECURSIVE += dir dummy # posix1.mk - -clean: - rm -f ${CLEANFILES} -.if !empty(CLEANRECURSIVE) - rm -rf ${CLEANRECURSIVE} -.endif - -TEST_MAKE?= ${.MAKE} -TOOL_SED?= sed -TOOL_TR?= tr -TOOL_DIFF?= diff -DIFF_FLAGS?= @diff_u@ - -.if defined(.PARSEDIR) -# ensure consistent results from sort(1) -LC_ALL= C -LANG= C -.export LANG LC_ALL -.endif - -# some tests need extra post-processing -SED_CMDS.varshell = -e 's,^[a-z]*sh: ,,' \ - -e '/command/s,No such.*,not found,' - -# the tests are actually done with sub-makes. -.SUFFIXES: .mk .rawout .out -.mk.rawout: - @echo ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} - -@cd ${.OBJDIR} && \ - { ${TEST_MAKE} ${flags.${.TARGET:R}:U-k} -f ${.IMPSRC} \ - 2>&1 ; echo $$? >${.TARGET:R}.status ; } > ${.TARGET}.tmp - @mv ${.TARGET}.tmp ${.TARGET} - -# We always pretend .MAKE was called 'make' -# and strip ${.CURDIR}/ from the output -# and replace anything after 'stopped in' with unit-tests -# so the results can be compared. -.rawout.out: - @echo postprocess ${.TARGET} - @${TOOL_SED} -e 's,^${TEST_MAKE:T:C/\./\\\./g}[][0-9]*:,make:,' \ - -e 's,${TEST_MAKE:C/\./\\\./g},make,' \ - -e '/stopped/s, /.*, unit-tests,' \ - -e 's,${.CURDIR:C/\./\\\./g}/,,g' \ - -e 's,${UNIT_TESTS:C/\./\\\./g}/,,g' ${SED_CMDS.${.TARGET:T:R}} \ - < ${.IMPSRC} > ${.TARGET}.tmp - @echo "exit status `cat ${.TARGET:R}.status`" >> ${.TARGET}.tmp - @mv ${.TARGET}.tmp ${.TARGET} - -# Compare all output files -test: ${OUTFILES} .PHONY - @failed= ; \ - for test in ${TESTNAMES}; do \ - ${TOOL_DIFF} ${DIFF_FLAGS} ${UNIT_TESTS}/$${test}.exp $${test}.out \ - || failed="$${failed}$${failed:+ }$${test}" ; \ - done ; \ - if [ -n "$${failed}" ]; then \ - echo "Failed tests: $${failed}" ; false ; \ - else \ - echo "All tests passed" ; \ - fi - -accept: - @for test in ${TESTNAMES}; do \ - cmp -s ${UNIT_TESTS}/$${test}.exp $${test}.out \ - || { echo "Replacing $${test}.exp" ; \ - cp $${test}.out ${UNIT_TESTS}/$${test}.exp ; } \ - done - -.if exists(${TEST_MAKE}) -${TESTNAMES:S/$/.rawout/}: ${TEST_MAKE} -.endif - -.-include diff --git a/contrib/bmake/unit-tests/cond2.exp b/contrib/bmake/unit-tests/cond2.exp deleted file mode 100644 index 22e76a5b2c9..00000000000 --- a/contrib/bmake/unit-tests/cond2.exp +++ /dev/null @@ -1,7 +0,0 @@ -make: Bad conditional expression ` == "empty"' in == "empty"?oops:ok -make: "cond2.mk" line 13: Malformed conditional ({TEST_TYPO} == "Ok") -TEST_NOT_SET is empty or not defined -make: "cond2.mk" line 20: Malformed conditional (${TEST_NOT_SET} == "empty") -make: Fatal errors encountered -- cannot continue -make: stopped in unit-tests -exit status 1 diff --git a/contrib/bmake/unit-tests/cond2.mk b/contrib/bmake/unit-tests/cond2.mk deleted file mode 100644 index 943df43fb62..00000000000 --- a/contrib/bmake/unit-tests/cond2.mk +++ /dev/null @@ -1,29 +0,0 @@ -# $Id: cond2.mk,v 1.1.1.2 2015/12/02 00:34:27 sjg Exp $ - -TEST_UNAME_S= NetBSD - -# this should be ok -X:= ${${TEST_UNAME_S} == "NetBSD":?Ok:fail} -.if $X == "Ok" -Y= good -.endif -# expect: Bad conditional expression ` == "empty"' in == "empty"?oops:ok -X:= ${${TEST_NOT_SET} == "empty":?oops:ok} -# expect: Malformed conditional ({TEST_TYPO} == "Ok") -.if {TEST_TYPO} == "Ok" -Y= oops -.endif -.if empty(TEST_NOT_SET) -Y!= echo TEST_NOT_SET is empty or not defined >&2; echo -.endif -# expect: Malformed conditional (${TEST_NOT_SET} == "empty") -.if ${TEST_NOT_SET} == "empty" -Y= oops -.endif - -.if defined(.NDEF) && ${.NDEF} > 0 -Z= yes -.endif - -all: - @echo $@ diff --git a/contrib/bmake/unit-tests/hash.exp b/contrib/bmake/unit-tests/hash.exp deleted file mode 100644 index 0a2423436e7..00000000000 --- a/contrib/bmake/unit-tests/hash.exp +++ /dev/null @@ -1,9 +0,0 @@ -b2af338b -3360ac65 -7747f046 -9ca87054 -880fe816 -208fcbd3 -d5d376eb -de41416c -exit status 0 diff --git a/contrib/bmake/unit-tests/hash.mk b/contrib/bmake/unit-tests/hash.mk deleted file mode 100644 index 1ed84e776d0..00000000000 --- a/contrib/bmake/unit-tests/hash.mk +++ /dev/null @@ -1,18 +0,0 @@ -STR1= -STR2= a -STR3= ab -STR4= abc -STR5= abcd -STR6= abcde -STR7= abcdef -STR8= abcdefghijklmnopqrstuvwxyz - -all: - @echo ${STR1:hash} - @echo ${STR2:hash} - @echo ${STR3:hash} - @echo ${STR4:hash} - @echo ${STR5:hash} - @echo ${STR6:hash} - @echo ${STR7:hash} - @echo ${STR8:hash} diff --git a/contrib/bmake/unit-tests/misc.exp b/contrib/bmake/unit-tests/misc.exp deleted file mode 100644 index 39a9383953d..00000000000 --- a/contrib/bmake/unit-tests/misc.exp +++ /dev/null @@ -1 +0,0 @@ -exit status 0 diff --git a/contrib/bmake/unit-tests/misc.mk b/contrib/bmake/unit-tests/misc.mk deleted file mode 100644 index 030115079a9..00000000000 --- a/contrib/bmake/unit-tests/misc.mk +++ /dev/null @@ -1,16 +0,0 @@ -# $Id: misc.mk,v 1.1.1.1 2014/08/30 18:57:18 sjg Exp $ - -.if !exists(${.CURDIR}/) -.warning ${.CURDIR}/ doesn't exist ? -.endif - -.if !exists(${.CURDIR}/.) -.warning ${.CURDIR}/. doesn't exist ? -.endif - -.if !exists(${.CURDIR}/..) -.warning ${.CURDIR}/.. doesn't exist ? -.endif - -all: - @: all is well diff --git a/contrib/bmake/unit-tests/modorder.exp b/contrib/bmake/unit-tests/modorder.exp deleted file mode 100644 index 8e0aad2e202..00000000000 --- a/contrib/bmake/unit-tests/modorder.exp +++ /dev/null @@ -1,12 +0,0 @@ -LIST = one two three four five six seven eight nine ten -LIST:O = eight five four nine one seven six ten three two -LIST:Or = two three ten six seven one nine four five eight -LIST:Ox = Ok -LIST:O:Ox = Ok -LISTX = Ok -LISTSX = Ok -make: Bad modifier `:OX' for LIST -BADMOD 1 = } -make: Bad modifier `:OxXX' for LIST -BADMOD 2 = XX} -exit status 0 diff --git a/contrib/bmake/unit-tests/modorder.mk b/contrib/bmake/unit-tests/modorder.mk deleted file mode 100644 index 89e64b43c57..00000000000 --- a/contrib/bmake/unit-tests/modorder.mk +++ /dev/null @@ -1,24 +0,0 @@ -# $NetBSD: modorder.mk,v 1.3 2020/06/09 01:48:17 sjg Exp $ - -LIST= one two three four five six seven eight nine ten -LISTX= ${LIST:Ox} -LISTSX:= ${LIST:Ox} -TEST_RESULT= && echo Ok || echo Failed - -# unit-tests have to produce the same results on each run -# so we cannot actually include :Ox output. -all: - @echo "LIST = ${LIST}" - @echo "LIST:O = ${LIST:O}" - @echo "LIST:Or = ${LIST:Or}" - # Note that 1 in every 10! trials two independently generated - # randomized orderings will be the same. The test framework doesn't - # support checking probabilistic output, so we accept that each of the - # 3 :Ox tests will incorrectly fail with probability 2.756E-7, which - # lets the whole test fail once in 1.209.600 runs, on average. - @echo "LIST:Ox = `test '${LIST:Ox}' != '${LIST:Ox}' ${TEST_RESULT}`" - @echo "LIST:O:Ox = `test '${LIST:O:Ox}' != '${LIST:O:Ox}' ${TEST_RESULT}`" - @echo "LISTX = `test '${LISTX}' != '${LISTX}' ${TEST_RESULT}`" - @echo "LISTSX = `test '${LISTSX}' = '${LISTSX}' ${TEST_RESULT}`" - @echo "BADMOD 1 = ${LIST:OX}" - @echo "BADMOD 2 = ${LIST:OxXX}" diff --git a/contrib/bmake/unit-tests/modts.exp b/contrib/bmake/unit-tests/modts.exp deleted file mode 100644 index 338964963a8..00000000000 --- a/contrib/bmake/unit-tests/modts.exp +++ /dev/null @@ -1,39 +0,0 @@ -LIST="one two three four five six" -LIST:ts,="one,two,three,four,five,six" -LIST:ts/:tu="ONE/TWO/THREE/FOUR/FIVE/SIX" -LIST:ts::tu="ONE:TWO:THREE:FOUR:FIVE:SIX" -LIST:ts:tu="ONETWOTHREEFOURFIVESIX" -LIST:tu:ts/="ONE/TWO/THREE/FOUR/FIVE/SIX" -LIST:ts:="one:two:three:four:five:six" -LIST:ts="onetwothreefourfivesix" -LIST:ts:S/two/2/="one2threefourfivesix" -LIST:S/two/2/:ts="one2threefourfivesix" -LIST:ts/:S/two/2/="one/2/three/four/five/six" -Pretend the '/' in '/n' etc. below are back-slashes. -LIST:ts/n="one -two -three -four -five -six" -LIST:ts/t="one two three four five six" -LIST:ts/012:tu="ONE -TWO -THREE -FOUR -FIVE -SIX" -LIST:ts/xa:tu="ONE -TWO -THREE -FOUR -FIVE -SIX" -make: Bad modifier `:tx' for LIST -LIST:tx="}" -make: Bad modifier `:ts\X' for LIST -LIST:ts/x:tu="\X:tu}" -FU_mod-ts="a/b/cool" -FU_mod-ts:ts:T="cool" == cool? -B.${AAA:ts}="Baaa" == Baaa? -exit status 0 diff --git a/contrib/bmake/unit-tests/modts.mk b/contrib/bmake/unit-tests/modts.mk deleted file mode 100644 index e66dc25a2a0..00000000000 --- a/contrib/bmake/unit-tests/modts.mk +++ /dev/null @@ -1,44 +0,0 @@ - -LIST= one two three -LIST+= four five six - -FU_mod-ts = a / b / cool - -AAA= a a a -B.aaa= Baaa - -all: mod-ts - -# Use print or printf iff they are builtin. -# XXX note that this causes problems, when make decides -# there is no need to use a shell, so avoid where possible. -.if ${(type print) 2> /dev/null || echo:L:sh:Mbuiltin} != "" -PRINT= print -r -- -.elif ${(type printf) 2> /dev/null || echo:L:sh:Mbuiltin} != "" -PRINT= printf '%s\n' -.else -PRINT= echo -.endif - -mod-ts: - @echo 'LIST="${LIST}"' - @echo 'LIST:ts,="${LIST:ts,}"' - @echo 'LIST:ts/:tu="${LIST:ts/:tu}"' - @echo 'LIST:ts::tu="${LIST:ts::tu}"' - @echo 'LIST:ts:tu="${LIST:ts:tu}"' - @echo 'LIST:tu:ts/="${LIST:tu:ts/}"' - @echo 'LIST:ts:="${LIST:ts:}"' - @echo 'LIST:ts="${LIST:ts}"' - @echo 'LIST:ts:S/two/2/="${LIST:ts:S/two/2/}"' - @echo 'LIST:S/two/2/:ts="${LIST:S/two/2/:ts}"' - @echo 'LIST:ts/:S/two/2/="${LIST:ts/:S/two/2/}"' - @echo "Pretend the '/' in '/n' etc. below are back-slashes." - @${PRINT} 'LIST:ts/n="${LIST:ts\n}"' - @${PRINT} 'LIST:ts/t="${LIST:ts\t}"' - @${PRINT} 'LIST:ts/012:tu="${LIST:ts\012:tu}"' - @${PRINT} 'LIST:ts/xa:tu="${LIST:ts\xa:tu}"' - @${PRINT} 'LIST:tx="${LIST:tx}"' - @${PRINT} 'LIST:ts/x:tu="${LIST:ts\X:tu}"' - @${PRINT} 'FU_$@="${FU_${@:ts}:ts}"' - @${PRINT} 'FU_$@:ts:T="${FU_${@:ts}:ts:T}" == cool?' - @${PRINT} 'B.$${AAA:ts}="${B.${AAA:ts}}" == Baaa?' diff --git a/contrib/bmake/unit-tests/modword.exp b/contrib/bmake/unit-tests/modword.exp deleted file mode 100644 index 258d7eadd6c..00000000000 --- a/contrib/bmake/unit-tests/modword.exp +++ /dev/null @@ -1,122 +0,0 @@ -make: Bad modifier `:[]' for LIST -LIST:[]="" is an error -LIST:[0]="one two three four five six" -LIST:[0x0]="one two three four five six" -LIST:[000]="one two three four five six" -LIST:[*]="one two three four five six" -LIST:[@]="one two three four five six" -LIST:[0]:C/ /,/="one,two three four five six" -LIST:[0]:C/ /,/g="one,two,three,four,five,six" -LIST:[0]:C/ /,/1g="one,two,three,four,five,six" -LIST:[*]:C/ /,/="one,two three four five six" -LIST:[*]:C/ /,/g="one,two,three,four,five,six" -LIST:[*]:C/ /,/1g="one,two,three,four,five,six" -LIST:[@]:C/ /,/="one two three four five six" -LIST:[@]:C/ /,/g="one two three four five six" -LIST:[@]:C/ /,/1g="one two three four five six" -LIST:[@]:[0]:C/ /,/="one,two three four five six" -LIST:[0]:[@]:C/ /,/="one two three four five six" -LIST:[@]:[*]:C/ /,/="one,two three four five six" -LIST:[*]:[@]:C/ /,/="one two three four five six" -EMPTY="" -EMPTY:[#]="1" == 1 ? -ESCAPEDSPACE="\ " -ESCAPEDSPACE:[#]="1" == 1 ? -REALLYSPACE=" " -REALLYSPACE:[#]="1" == 1 ? -LIST:[#]="6" -LIST:[0]:[#]="1" == 1 ? -LIST:[*]:[#]="1" == 1 ? -LIST:[@]:[#]="6" -LIST:[1]:[#]="1" -LIST:[1..3]:[#]="3" -EMPTY:[1]="" -ESCAPEDSPACE="\ " -ESCAPEDSPACE:[1]="\ " -REALLYSPACE=" " -REALLYSPACE:[1]="" == "" ? -REALLYSPACE:[*]:[1]=" " == " " ? -LIST:[1]="one" -make: Bad modifier `:[1.]' for LIST -LIST:[1.]="" is an error -make: Bad modifier `:[1].' for LIST -LIST:[1].="}" is an error -LIST:[2]="two" -LIST:[6]="six" -LIST:[7]="" -LIST:[999]="" -make: Bad modifier `:[-]' for LIST -LIST:[-]="" is an error -make: Bad modifier `:[--]' for LIST -LIST:[--]="" is an error -LIST:[-1]="six" -LIST:[-2]="five" -LIST:[-6]="one" -LIST:[-7]="" -LIST:[-999]="" -LONGLIST:[17]="17" -LONGLIST:[0x11]="17" -LONGLIST:[021]="17" -LIST:[0]:[1]="one two three four five six" -LIST:[*]:[1]="one two three four five six" -LIST:[@]:[1]="one" -LIST:[0]:[2]="" -LIST:[*]:[2]="" -LIST:[@]:[2]="two" -LIST:[*]:C/ /,/:[2]="" -LIST:[*]:C/ /,/:[*]:[2]="" -LIST:[*]:C/ /,/:[@]:[2]="three" -make: Bad modifier `:[1.]' for LIST -LIST:[1.]="" is an error -make: Bad modifier `:[1..]' for LIST -LIST:[1..]="" is an error -LIST:[1..1]="one" -make: Bad modifier `:[1..1.]' for LIST -LIST:[1..1.]="" is an error -LIST:[1..2]="one two" -LIST:[2..1]="two one" -LIST:[3..-2]="three four five" -LIST:[-4..4]="three four" -make: Bad modifier `:[0..1]' for LIST -LIST:[0..1]="" is an error -make: Bad modifier `:[-1..0]' for LIST -LIST:[-1..0]="" is an error -LIST:[-1..1]="six five four three two one" -LIST:[0..0]="one two three four five six" -LIST:[3..99]="three four five six" -LIST:[-3..-99]="four three two one" -LIST:[-99..-3]="one two three four" -HASH="#" == "#" ? -LIST:[${HASH}]="6" -LIST:[${ZERO}]="one two three four five six" -LIST:[${ZERO}x${ONE}]="one" -LIST:[${ONE}]="one" -LIST:[${MINUSONE}]="six" -LIST:[${STAR}]="one two three four five six" -LIST:[${AT}]="one two three four five six" -make: Bad modifier `:[${EMPTY' for LIST -LIST:[${EMPTY}]="" is an error -LIST:[${LONGLIST:[21]:S/2//}]="one" -LIST:[${LIST:[#]}]="six" -LIST:[${LIST:[${HASH}]}]="six" -LIST:S/ /,/="one two three four five six" -LIST:S/ /,/W="one,two three four five six" -LIST:S/ /,/gW="one,two,three,four,five,six" -EMPTY:S/^/,/="," -EMPTY:S/^/,/W="," -LIST:C/ /,/="one two three four five six" -LIST:C/ /,/W="one,two three four five six" -LIST:C/ /,/gW="one,two,three,four,five,six" -EMPTY:C/^/,/="," -EMPTY:C/^/,/W="," -LIST:tW="one two three four five six" -LIST:tw="one two three four five six" -LIST:tW:C/ /,/="one,two three four five six" -LIST:tW:C/ /,/g="one,two,three,four,five,six" -LIST:tW:C/ /,/1g="one,two,three,four,five,six" -LIST:tw:C/ /,/="one two three four five six" -LIST:tw:C/ /,/g="one two three four five six" -LIST:tw:C/ /,/1g="one two three four five six" -LIST:tw:tW:C/ /,/="one,two three four five six" -LIST:tW:tw:C/ /,/="one two three four five six" -exit status 0 diff --git a/contrib/bmake/unit-tests/modword.mk b/contrib/bmake/unit-tests/modword.mk deleted file mode 100644 index 1327624f7e1..00000000000 --- a/contrib/bmake/unit-tests/modword.mk +++ /dev/null @@ -1,151 +0,0 @@ -# $Id: modword.mk,v 1.1.1.1 2014/08/30 18:57:18 sjg Exp $ -# -# Test behaviour of new :[] modifier - -all: mod-squarebrackets mod-S-W mod-C-W mod-tW-tw - -LIST= one two three -LIST+= four five six -LONGLIST= 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 - -EMPTY= # the space should be ignored -ESCAPEDSPACE=\ # escaped space before the '#' -REALLYSPACE:=${EMPTY:C/^/ /W} -HASH= \# -AT= @ -STAR= * -ZERO= 0 -ONE= 1 -MINUSONE= -1 - -mod-squarebrackets: mod-squarebrackets-0-star-at \ - mod-squarebrackets-hash \ - mod-squarebrackets-n \ - mod-squarebrackets-start-end \ - mod-squarebrackets-nested - -mod-squarebrackets-0-star-at: - @echo 'LIST:[]="${LIST:[]}" is an error' - @echo 'LIST:[0]="${LIST:[0]}"' - @echo 'LIST:[0x0]="${LIST:[0x0]}"' - @echo 'LIST:[000]="${LIST:[000]}"' - @echo 'LIST:[*]="${LIST:[*]}"' - @echo 'LIST:[@]="${LIST:[@]}"' - @echo 'LIST:[0]:C/ /,/="${LIST:[0]:C/ /,/}"' - @echo 'LIST:[0]:C/ /,/g="${LIST:[0]:C/ /,/g}"' - @echo 'LIST:[0]:C/ /,/1g="${LIST:[0]:C/ /,/1g}"' - @echo 'LIST:[*]:C/ /,/="${LIST:[*]:C/ /,/}"' - @echo 'LIST:[*]:C/ /,/g="${LIST:[*]:C/ /,/g}"' - @echo 'LIST:[*]:C/ /,/1g="${LIST:[*]:C/ /,/1g}"' - @echo 'LIST:[@]:C/ /,/="${LIST:[@]:C/ /,/}"' - @echo 'LIST:[@]:C/ /,/g="${LIST:[@]:C/ /,/g}"' - @echo 'LIST:[@]:C/ /,/1g="${LIST:[@]:C/ /,/1g}"' - @echo 'LIST:[@]:[0]:C/ /,/="${LIST:[@]:[0]:C/ /,/}"' - @echo 'LIST:[0]:[@]:C/ /,/="${LIST:[0]:[@]:C/ /,/}"' - @echo 'LIST:[@]:[*]:C/ /,/="${LIST:[@]:[*]:C/ /,/}"' - @echo 'LIST:[*]:[@]:C/ /,/="${LIST:[*]:[@]:C/ /,/}"' - -mod-squarebrackets-hash: - @echo 'EMPTY="${EMPTY}"' - @echo 'EMPTY:[#]="${EMPTY:[#]}" == 1 ?' - @echo 'ESCAPEDSPACE="${ESCAPEDSPACE}"' - @echo 'ESCAPEDSPACE:[#]="${ESCAPEDSPACE:[#]}" == 1 ?' - @echo 'REALLYSPACE="${REALLYSPACE}"' - @echo 'REALLYSPACE:[#]="${REALLYSPACE:[#]}" == 1 ?' - @echo 'LIST:[#]="${LIST:[#]}"' - @echo 'LIST:[0]:[#]="${LIST:[0]:[#]}" == 1 ?' - @echo 'LIST:[*]:[#]="${LIST:[*]:[#]}" == 1 ?' - @echo 'LIST:[@]:[#]="${LIST:[@]:[#]}"' - @echo 'LIST:[1]:[#]="${LIST:[1]:[#]}"' - @echo 'LIST:[1..3]:[#]="${LIST:[1..3]:[#]}"' - -mod-squarebrackets-n: - @echo 'EMPTY:[1]="${EMPTY:[1]}"' - @echo 'ESCAPEDSPACE="${ESCAPEDSPACE}"' - @echo 'ESCAPEDSPACE:[1]="${ESCAPEDSPACE:[1]}"' - @echo 'REALLYSPACE="${REALLYSPACE}"' - @echo 'REALLYSPACE:[1]="${REALLYSPACE:[1]}" == "" ?' - @echo 'REALLYSPACE:[*]:[1]="${REALLYSPACE:[*]:[1]}" == " " ?' - @echo 'LIST:[1]="${LIST:[1]}"' - @echo 'LIST:[1.]="${LIST:[1.]}" is an error' - @echo 'LIST:[1].="${LIST:[1].}" is an error' - @echo 'LIST:[2]="${LIST:[2]}"' - @echo 'LIST:[6]="${LIST:[6]}"' - @echo 'LIST:[7]="${LIST:[7]}"' - @echo 'LIST:[999]="${LIST:[999]}"' - @echo 'LIST:[-]="${LIST:[-]}" is an error' - @echo 'LIST:[--]="${LIST:[--]}" is an error' - @echo 'LIST:[-1]="${LIST:[-1]}"' - @echo 'LIST:[-2]="${LIST:[-2]}"' - @echo 'LIST:[-6]="${LIST:[-6]}"' - @echo 'LIST:[-7]="${LIST:[-7]}"' - @echo 'LIST:[-999]="${LIST:[-999]}"' - @echo 'LONGLIST:[17]="${LONGLIST:[17]}"' - @echo 'LONGLIST:[0x11]="${LONGLIST:[0x11]}"' - @echo 'LONGLIST:[021]="${LONGLIST:[021]}"' - @echo 'LIST:[0]:[1]="${LIST:[0]:[1]}"' - @echo 'LIST:[*]:[1]="${LIST:[*]:[1]}"' - @echo 'LIST:[@]:[1]="${LIST:[@]:[1]}"' - @echo 'LIST:[0]:[2]="${LIST:[0]:[2]}"' - @echo 'LIST:[*]:[2]="${LIST:[*]:[2]}"' - @echo 'LIST:[@]:[2]="${LIST:[@]:[2]}"' - @echo 'LIST:[*]:C/ /,/:[2]="${LIST:[*]:C/ /,/:[2]}"' - @echo 'LIST:[*]:C/ /,/:[*]:[2]="${LIST:[*]:C/ /,/:[*]:[2]}"' - @echo 'LIST:[*]:C/ /,/:[@]:[2]="${LIST:[*]:C/ /,/:[@]:[2]}"' - -mod-squarebrackets-start-end: - @echo 'LIST:[1.]="${LIST:[1.]}" is an error' - @echo 'LIST:[1..]="${LIST:[1..]}" is an error' - @echo 'LIST:[1..1]="${LIST:[1..1]}"' - @echo 'LIST:[1..1.]="${LIST:[1..1.]}" is an error' - @echo 'LIST:[1..2]="${LIST:[1..2]}"' - @echo 'LIST:[2..1]="${LIST:[2..1]}"' - @echo 'LIST:[3..-2]="${LIST:[3..-2]}"' - @echo 'LIST:[-4..4]="${LIST:[-4..4]}"' - @echo 'LIST:[0..1]="${LIST:[0..1]}" is an error' - @echo 'LIST:[-1..0]="${LIST:[-1..0]}" is an error' - @echo 'LIST:[-1..1]="${LIST:[-1..1]}"' - @echo 'LIST:[0..0]="${LIST:[0..0]}"' - @echo 'LIST:[3..99]="${LIST:[3..99]}"' - @echo 'LIST:[-3..-99]="${LIST:[-3..-99]}"' - @echo 'LIST:[-99..-3]="${LIST:[-99..-3]}"' - -mod-squarebrackets-nested: - @echo 'HASH="${HASH}" == "#" ?' - @echo 'LIST:[$${HASH}]="${LIST:[${HASH}]}"' - @echo 'LIST:[$${ZERO}]="${LIST:[${ZERO}]}"' - @echo 'LIST:[$${ZERO}x$${ONE}]="${LIST:[${ZERO}x${ONE}]}"' - @echo 'LIST:[$${ONE}]="${LIST:[${ONE}]}"' - @echo 'LIST:[$${MINUSONE}]="${LIST:[${MINUSONE}]}"' - @echo 'LIST:[$${STAR}]="${LIST:[${STAR}]}"' - @echo 'LIST:[$${AT}]="${LIST:[${AT}]}"' - @echo 'LIST:[$${EMPTY}]="${LIST:[${EMPTY}]}" is an error' - @echo 'LIST:[$${LONGLIST:[21]:S/2//}]="${LIST:[${LONGLIST:[21]:S/2//}]}"' - @echo 'LIST:[$${LIST:[#]}]="${LIST:[${LIST:[#]}]}"' - @echo 'LIST:[$${LIST:[$${HASH}]}]="${LIST:[${LIST:[${HASH}]}]}"' - -mod-C-W: - @echo 'LIST:C/ /,/="${LIST:C/ /,/}"' - @echo 'LIST:C/ /,/W="${LIST:C/ /,/W}"' - @echo 'LIST:C/ /,/gW="${LIST:C/ /,/gW}"' - @echo 'EMPTY:C/^/,/="${EMPTY:C/^/,/}"' - @echo 'EMPTY:C/^/,/W="${EMPTY:C/^/,/W}"' - -mod-S-W: - @echo 'LIST:S/ /,/="${LIST:S/ /,/}"' - @echo 'LIST:S/ /,/W="${LIST:S/ /,/W}"' - @echo 'LIST:S/ /,/gW="${LIST:S/ /,/gW}"' - @echo 'EMPTY:S/^/,/="${EMPTY:S/^/,/}"' - @echo 'EMPTY:S/^/,/W="${EMPTY:S/^/,/W}"' - -mod-tW-tw: - @echo 'LIST:tW="${LIST:tW}"' - @echo 'LIST:tw="${LIST:tw}"' - @echo 'LIST:tW:C/ /,/="${LIST:tW:C/ /,/}"' - @echo 'LIST:tW:C/ /,/g="${LIST:tW:C/ /,/g}"' - @echo 'LIST:tW:C/ /,/1g="${LIST:tW:C/ /,/1g}"' - @echo 'LIST:tw:C/ /,/="${LIST:tw:C/ /,/}"' - @echo 'LIST:tw:C/ /,/g="${LIST:tw:C/ /,/g}"' - @echo 'LIST:tw:C/ /,/1g="${LIST:tw:C/ /,/1g}"' - @echo 'LIST:tw:tW:C/ /,/="${LIST:tw:tW:C/ /,/}"' - @echo 'LIST:tW:tw:C/ /,/="${LIST:tW:tw:C/ /,/}"' diff --git a/contrib/bmake/unit-tests/qequals.exp b/contrib/bmake/unit-tests/qequals.exp deleted file mode 100644 index 6b2f4dce699..00000000000 --- a/contrib/bmake/unit-tests/qequals.exp +++ /dev/null @@ -1,2 +0,0 @@ -V.i386 ?= OK -exit status 0 diff --git a/contrib/bmake/unit-tests/qequals.mk b/contrib/bmake/unit-tests/qequals.mk deleted file mode 100644 index 67a48ad32ef..00000000000 --- a/contrib/bmake/unit-tests/qequals.mk +++ /dev/null @@ -1,8 +0,0 @@ -# $Id: qequals.mk,v 1.1.1.1 2014/08/30 18:57:18 sjg Exp $ - -M= i386 -V.i386= OK -V.$M ?= bug - -all: - @echo 'V.$M ?= ${V.$M}' diff --git a/contrib/bmake/unit-tests/suffixes.exp b/contrib/bmake/unit-tests/suffixes.exp deleted file mode 100644 index 2a46e1cfa8e..00000000000 --- a/contrib/bmake/unit-tests/suffixes.exp +++ /dev/null @@ -1,35 +0,0 @@ -make: don't know how to make issue3 (continuing) -There should be no text after the colon: -touch .a -There should be no text after the colon: -touch .a.b -There should be no text after the colon: -touch .b.a -touch issue5a.c -first set -cp issue5a.c issue5a.d -touch issue5b.d -first set -cp issue5b.d issue5b.c -touch issue5c.d -first set -cp issue5c.d issue5c -touch issue5d.d -first set -cp issue5d.d issue5d.e -touch issue5e.e -first set -cp issue5e.e issue5e.d -make: don't know how to make issue6.f (continuing) -touch issue10.d -first set -cp issue10.d issue10.e -touch issue11.h -touch issue11.first -.ALLSRC: issue11.h issue11.first -cp issue11.h issue11.i -touch issue11.second -.ALLSRC: issue11.i issue11.second -cp issue11.i issue11.j -`all' not remade because of errors. -exit status 0 diff --git a/contrib/bmake/unit-tests/suffixes.mk b/contrib/bmake/unit-tests/suffixes.mk deleted file mode 100644 index 113484a590a..00000000000 --- a/contrib/bmake/unit-tests/suffixes.mk +++ /dev/null @@ -1,89 +0,0 @@ -# $NetBSD: suffixes.mk,v 1.3 2014/08/30 22:21:08 sjg Exp $ - -# Issues from PR 49086 - -# Issue 3: single suffix rules remain active after .SUFFIXES is cleared -# -# There's a rule for issue3.a, but .a is no longer a known suffix when -# targets are being made, so issue3 should not get made. -all: issue3 - -# Issue 4: suffix rules do not become regular rules when .SUFFIXES is cleared -# -# When the rules were encountered, .a and .b were known suffices, but later -# on they were forgotten. These should get created as regular targets. -all: .a .a.b .b.a - -# Issue 5: adding more suffixes does not make existing rules into suffix rules -# -# When the targets .c.d, .d.c, .d, .d.e, and .e.d were encountered, only .a, -# .b and .c were known suffixes, so all of them were regular rules. Later -# rest of the suffixes were made known, so they should all be suffix -# transformation rules. -all: issue5a.d issue5b.c issue5c issue5d.e issue5e.d - -# Issue 6: transformation search can end up in an infinite loop -# -# There is no file or target from which issue6.f could be made from so -# this should fail. The bug was that because rules .e.f, .d.e and .e.d -# exist, make would try to make .f from .e and then infinitely try -# to do .e from .d and vice versa. -all: issue6.f - -# Issue 10: explicit dependencies affect transformation rule selection -# -# If issue10.e is wanted and both issue10.d and issue10.f are available, -# make should choose the .d.e rule, because .d is before .f in .SUFFIXES. -# The bug was that if issue10.d had an explicit dependency on issue10.f, -# it would choose .f.e instead. -all: issue10.e - -# Issue 11: sources from transformation rules are expanded incorrectly -# -# issue11.j should depend on issue11.i and issue11.second and issue11.i -# should depend on issue11.h and issue11.first. The bug was that -# the dynamic sources were expanded before ${.PREFIX} and ${.TARGET} were -# available, so they would have expanded to a null string. -all: issue11.j - -# we need to clean for repeatable results -.BEGIN: clean -clean: - @rm -f issue* .[ab]* - -.SUFFIXES: .a .b .c - -.a .a.b .b.a: - @echo 'There should be no text after the colon: ${.IMPSRC}' - touch ${.TARGET} - -.c.d .d.c .d .d.e .e.d: - @echo 'first set' - cp ${.IMPSRC} ${.TARGET} - -.SUFFIXES: -.SUFFIXES: .c .d .e .f .g - -.e .e.f .f.e: - @echo 'second set' - cp ${.IMPSRC} ${.TARGET} - -issue3.a: - @echo 'There is a bug if you see this.' - touch ${.TARGET} - -issue5a.c issue5b.d issue5c.d issue5d.d issue5e.e issue10.d issue10.f: - touch ${.TARGET} - -.SUFFIXES: .h .i .j - -.h.i: ${.PREFIX}.first - @echo '.ALLSRC: ${.ALLSRC}' - cp ${.IMPSRC} ${.TARGET} - -.i.j: ${.PREFIX}.second - @echo '.ALLSRC: ${.ALLSRC}' - cp ${.IMPSRC} ${.TARGET} - -issue11.h issue11.first issue11.second: - touch ${.TARGET} diff --git a/contrib/bmake/unit-tests/sysv.exp b/contrib/bmake/unit-tests/sysv.exp deleted file mode 100644 index 780a187783f..00000000000 --- a/contrib/bmake/unit-tests/sysv.exp +++ /dev/null @@ -1,16 +0,0 @@ -FOOBAR = -FOOBAR = foobar fubar -fun -fun -fun -In the Sun -acme -aam.d -sam.c -a%.c -asam.c.c -asam.c -a.c.c - -ax:Q b c d eb -exit status 0 diff --git a/contrib/bmake/unit-tests/sysv.mk b/contrib/bmake/unit-tests/sysv.mk deleted file mode 100644 index 3a987441ee4..00000000000 --- a/contrib/bmake/unit-tests/sysv.mk +++ /dev/null @@ -1,48 +0,0 @@ -# $Id: sysv.mk,v 1.5 2020/07/04 18:16:55 sjg Exp $ - -FOO ?= -FOOBAR = ${FOO:=bar} - -_this := ${.PARSEDIR}/${.PARSEFILE} - -B = /b -S = / -FUN = ${B}${S}fun -SUN = the Sun - -# we expect nothing when FOO is empty -all: foo fun sam bla words - -foo: - @echo FOOBAR = ${FOOBAR} -.if empty(FOO) - @FOO="foo fu" ${.MAKE} -f ${_this} foo -.endif - -fun: - @echo ${FUN:T} - @echo ${FUN:${B}${S}fun=fun} - @echo ${FUN:${B}${S}%=%} - @echo ${In:L:%=% ${SUN}} - - -SAM=sam.c - -sam: - @echo ${SAM:s%.c=acme} - @echo ${SAM:s%.c=a%.d} - @echo ${SAM:s.c=a%.d} - @echo ${SAM:sam.c=a%.c} - @echo ${SAM:%=a%.c} - @echo ${SAM:%.c=a%.c} - @echo ${SAM:sam%=a%.c} - -BLA= - -bla: - @echo $(BLA:%=foo/%x) - -# The :Q looks like a modifier but isn't. -# It is part of the replacement string. -words: - @echo a${a b c d e:L:%a=x:Q}b diff --git a/contrib/bmake/unit-tests/varshell.exp b/contrib/bmake/unit-tests/varshell.exp deleted file mode 100644 index dae2c6b9dff..00000000000 --- a/contrib/bmake/unit-tests/varshell.exp +++ /dev/null @@ -1,10 +0,0 @@ -make: "varshell.mk" line 5: warning: "/bin/no/such/command 2> /dev/null" returned non-zero status -make: "varshell.mk" line 8: warning: "false" returned non-zero status -make: "varshell.mk" line 9: warning: "echo "output before the error"; false" returned non-zero status -EXEC_FAILED='' -TERMINATED_BY_SIGNAL='' -ERROR_NO_OUTPUT='' -ERROR_WITH_OUTPUT='output before the error' -NO_ERROR_NO_OUTPUT='' -NO_ERROR_WITH_OUTPUT='this is good' -exit status 0 diff --git a/contrib/bmake/unit-tests/varshell.mk b/contrib/bmake/unit-tests/varshell.mk deleted file mode 100644 index 9c8baacc647..00000000000 --- a/contrib/bmake/unit-tests/varshell.mk +++ /dev/null @@ -1,19 +0,0 @@ -# $Id: varshell.mk,v 1.4 2015/04/20 03:16:39 sjg Exp $ -# -# Test VAR != shell command - -EXEC_FAILED != /bin/no/such/command 2> /dev/null -# SunOS cannot handle this one -#TERMINATED_BY_SIGNAL != kill -14 $$$$ -ERROR_NO_OUTPUT != false -ERROR_WITH_OUTPUT != echo "output before the error"; false -NO_ERROR_NO_OUTPUT != true -NO_ERROR_WITH_OUTPUT != echo "this is good" - -allvars= EXEC_FAILED TERMINATED_BY_SIGNAL ERROR_NO_OUTPUT ERROR_WITH_OUTPUT \ - NO_ERROR_NO_OUTPUT NO_ERROR_WITH_OUTPUT - -all: -.for v in ${allvars} - @echo ${v}=\'${${v}}\' -.endfor