Newsgroups: comp.sources.unix From: pmiller@bmr.gov.au (Peter Miller) Subject: v28i107: cook - a file construction tool, V1.6, Part14/19 References: <1.775008949.28543@gw.home.vix.com> Sender: unix-sources-moderator@gw.home.vix.com Approved: vixie@gw.home.vix.com Submitted-By: pmiller@bmr.gov.au (Peter Miller) Posting-Number: Volume 28, Issue 107 Archive-Name: cook-1.6/part14 #! /bin/sh # This is a shell archive. Remove anything before this line, then unpack # it by saving it into a file and typing "sh file". To overwrite existing # files, type "sh file -c". You can also feed this as standard input via # unshar, or by typing "sh 'Manifest.author' <<'END_OF_FILE' X X XMANIFEST This file. XBUILDING Instructions how to build, test and install cook XLICENSE GNU General Public License XMakefile.in Template for Makefile, used by configure XREADME Blurb about cook Xaux/BUILDING.man source of the BUILDING file Xaux/CHANGES.1.2 Change history of cook Xaux/CHANGES.1.3 Change history of cook Xaux/CHANGES.1.4 Change history of cook Xaux/CHANGES.1.5 Change history of cook Xaux/CHANGES.sh Change history of cook Xaux/Howto.cook instructions to cook, how to build project Xaux/MANIFEST.sh shell script to generate the MANIFEST file Xaux/Makefi.file.sh shell script to generate Makefile fragment for each source file Xaux/Makefile.awk helper file for generating Makefile file Xaux/Makefile.head instructions to make, how to build the cook package Xaux/Makefile.sh shell script to generate Makefile file Xaux/README.man source of the README file Xaux/config.h.in Xaux/configure.in how to configure cook, input to the GNU autoconf program Xaux/new.1.4.so document describing new 1.4 features Xaux/new.1.5.so document describing new 1.5 features Xaux/new.1.6.so document describing new 1.6 features Xaux/new.so Indirection to release note for this release. Xaux/patch.file.sh shell script to generate the patch for one file Xaux/patches.sh shell script to generate the patch file Xaux/template/c New file template. Xaux/template/generic New file template. Xaux/template/h New file template. Xaux/template/man New file template. Xaux/template/ms New file template. Xaux/template/sh New file template. Xaux/template/test New file template. Xc_incl/cache.c functions to manipulate include file cache Xc_incl/cache.h interface definition for c_incl/cache.c Xc_incl/lang_c.c functions to scan C language files Xc_incl/lang_roff.c functions to scan *roff source files Xc_incl/main.c operating system entry point, and command line argument parsing Xc_incl/os.c functions to isolate operating system interface Xc_incl/os.h interface definition for c_incl/os.c Xc_incl/sniff.c functions to scan source files looking for include files Xc_incl/sniff.h interface definition for c_incl/sniff.c Xcommon/ac/ar.h isolate differences Xcommon/ac/dirent.h isolate dirent.h/ndir.h differences Xcommon/ac/fcntl.h isolate vs differences Xcommon/ac/limits.h isolate limits.h presence/absence Xcommon/ac/stddef.h isolate stddef.h presence/absence Xcommon/ac/stdlib.h isolate stdlib.h presence/absence Xcommon/ac/string.h isolate string.h/strings.h differences Xcommon/ac/time.h isolate time.h differences Xcommon/ac/unistd.h isolate unistd.h presnce/absence Xcommon/ansi.c functions to implement missing ANSI C mandated functions Xcommon/arglex.c functions to perform lexical analysis on command line arguments Xcommon/arglex.h interface definition for common/arglex.c Xcommon/config.h.in Template for common/config.h, used by configure Xcommon/error.c functions to report errors Xcommon/error.h interface definition for common/error.c Xcommon/fp.c functions to manipulate fingerprints Xcommon/fp.h interface definition for common/fp.c Xcommon/fp/README Xcommon/fp/cksum.c functions to manipulate POSIX cksum fingerprints Xcommon/fp/cksum.h interface definition for common/fp/cksum.c Xcommon/fp/combined.c functions to manipulate combined fingerprints Xcommon/fp/combined.h interface definition for common/fp/combined.c Xcommon/fp/crc32.c functions to manipulate crc32 fingerprints Xcommon/fp/crc32.h interface definition for common/fp/crc32.c Xcommon/fp/len.c functions to manipulate length fingerprints Xcommon/fp/len.h interface definition for common/fp/len.c Xcommon/fp/md5.c functions to manipulate md5 fingerprints Xcommon/fp/md5.h interface definition for common/fp/md5.c Xcommon/fp/snefru.c functions to manipulate snefru fingerprints Xcommon/fp/snefru.h interface definition for common/fp/snefru.c Xcommon/help.c functions to provide consistent -Help behaviour Xcommon/help.h interface definition for comon/help.c Xcommon/main.h common defined, including DEBUG define Xcommon/mem.c functions to manipulate dynamic memory Xcommon/mem.h interface definition for common/mem.c Xcommon/mprintf.c functions to manipulate mprintfs Xcommon/mprintf.h interface definition for common/mprintf.c Xcommon/patchlevel.h The patch level of this distribution. Xcommon/s-v-arg.h isolate varargs.h vs stdarg.h differences Xcommon/str.c functions to manipulate shared strings Xcommon/str.h interface definition for common/str.c Xcommon/symtab.c functions to manipulate symbol tables Xcommon/symtab.h interface definition for common/symtab.c Xcommon/trace.c functions to report execution traces Xcommon/trace.h interface definition for common/trace.c Xcommon/version-stmp.c functions to manipulate version-stmps Xcommon/version-stmp.h interface definition for common/version-stmp.c Xcommon/version.c functions to provide common -VERSion behaviour Xcommon/version.h interface definition for common/version.c Xcommon/word.c functions to manipulate lists of strings Xcommon/word.h interface definition for common/word.c Xconfig instructions to aegis, per-project configuration Xconfigure Shell script to construct Makefile and common/config.h Xcook/archive.c functions to manipulate archive files Xcook/archive.h interface definition for cook/archive.c Xcook/builtin.c functions to access the builtin functions Xcook/builtin.h interface definition for cook/builtin.c Xcook/builtin/addprefix.c functions to implement the builtin addprefix function Xcook/builtin/addprefix.h interface definition for cook/builtin/addprefix.c Xcook/builtin/addsuffix.c functions to implement the builtin addsuffix function Xcook/builtin/addsuffix.h interface definition for cook/builtin/addsuffix.c Xcook/builtin/basename.c functions to implement the builtin basename function Xcook/builtin/basename.h interface definition for cook/builtin/basename.c Xcook/builtin/boolean.c functions to implement the builtin functions Xcook/builtin/boolean.h interface definition for boolean.h Xcook/builtin/collect.c functions to implement the builtin collect functions Xcook/builtin/collect.h interface definition for collect.h Xcook/builtin/cook.c functions to implement the builtin functions Xcook/builtin/cook.h interface definition for cook/builtin/cook.c Xcook/builtin/defined.c functions to implement the builtin defined function Xcook/builtin/defined.h interface definition for defined.h Xcook/builtin/execute.c functions to implement the builtin execute function Xcook/builtin/execute.h interface definition for execute.h Xcook/builtin/exists.c functions to implement the builtin exists function Xcook/builtin/exists.h interface definition for exists.h Xcook/builtin/filter_out.c functions to implement the builtin filter_out function Xcook/builtin/filter_out.h interface definition for filter_out.h Xcook/builtin/find_command.c functions to implement the builtin functions Xcook/builtin/find_command.h interface definition for find_command.h Xcook/builtin/findstring.c functions to implement the findstring builtin function Xcook/builtin/findstring.h interface definition for cook/builtin/findstring.c Xcook/builtin/getenv.c functions to implement the builtin getenv function Xcook/builtin/getenv.h interface definition for getenv.h Xcook/builtin/glob.c functions to perform shell-style file pattern matching Xcook/builtin/glob.h interface definition for cook/builtin/glob.c Xcook/builtin/home.c functions to implement the home builtin function Xcook/builtin/home.h interface definition for home.h Xcook/builtin/join.c functions to implement the builtin join function Xcook/builtin/join.h interface definition for cook/builtin/join.c Xcook/builtin/match.c functions to implement the builtin functions Xcook/builtin/match.h interface definition for match.h Xcook/builtin/opsys.c functions to implement the builtin os function Xcook/builtin/opsys.h interface definition for opsys.h Xcook/builtin/pathname.c functions to implement the builtin pathname functions Xcook/builtin/pathname.h interface definition for cook/builtin/pathname.c Xcook/builtin/split.c functions to implement the split builtin function Xcook/builtin/split.h interface definition for cook/builtin/split.c Xcook/builtin/stringset.c functions to implement the builtin stringset function Xcook/builtin/stringset.h interface definition for stringset.h Xcook/builtin/strip.c functions to implement the strip builtin function Xcook/builtin/strip.h interface definition for cook/builtin/strip.c Xcook/builtin/subst.c functions to implement builtin subst function Xcook/builtin/subst.h interface definition for cook/builtin/subst.c Xcook/builtin/suffix.c functions to implement the builtin suffix function Xcook/builtin/suffix.h interface definition for cook/builtin/suffix.c Xcook/builtin/text.c functions to implement the builtin text functions Xcook/builtin/text.h interface definition for text.h Xcook/builtin/unsplit.c functions to implement the unsplit builtin function Xcook/builtin/unsplit.h interface definition for cook/builtin/unsplit.c Xcook/builtin/word.c functions to implement builtin word function Xcook/builtin/word.h interface definition for cook/builtin/word.c Xcook/cook.c functions to cook targets Xcook/cook.h interface definition for cook/cook.c Xcook/env.c functions to manipulate environment variables Xcook/env.h interface definition for cook/env.c Xcook/expr.c functions to manipulate expression trees Xcook/expr.h interface definition for cook/expr.c Xcook/fngrprnt.h interface definition for cook/fngrprnt.c Xcook/fngrprnt.y functions to manipulate the persistent fingerprint cache Xcook/fngrprnt_lex.c functions to do lexical analysis on the fingerprint cache file Xcook/fngrprnt_lex.h interface definition for cook/fngrprnt_lex.c Xcook/hashline.h interface definition for cook/hashline.y Xcook/hashline.y functions to parse #directive lines in cookbooks Xcook/id.c functions to manipulate the symbol table Xcook/id.h interface definition for cook/id.c Xcook/lex.c functions to perform lexical analysis on cookbooks Xcook/lex.h interface definition for cook/lex.c Xcook/listing.c functions to open and close the listing file Xcook/listing.h interface definition for cook/listing.c Xcook/main.c operating system start point, and command line argument parsing Xcook/match.c functions to perform recipe pattern matching Xcook/match.h interface definition for cook/match.c Xcook/option.c functions to manage command line options Xcook/option.h interface definition for cook/option.c Xcook/os.c functions to isolate operating system interface Xcook/os.h interface definition for cook/os.c Xcook/parse.h interface definition for cook/parse.y Xcook/parse.y functions to parse cookbooks Xcook/stat.cache.c functions to manipulate the stat cache Xcook/stat.cache.h interface definition for cook/stat.cache.c Xcook/stmt.c functions to manage statement trees Xcook/stmt.h interface definition for cook/stmt.c Xcookfp/main.c operating system start point, and command line argument parsing Xcooktime/date.h interface definition for cooktime/date.y Xcooktime/date.y functions to parse dates Xcooktime/main.c operating system start point, and parse command line arguments Xdoc/builtin.so Reference Manual, Built-In Functions Xdoc/cmdline.so Reference Manual, The Command Line Xdoc/conditions.so Reference Manual, License Xdoc/function.sh shell script to generate doc/function.so Xdoc/function.so Xdoc/function/addprefix.so Reference Manual, Builtin Functions, Addprefix Xdoc/function/addsuffix.so Reference Manual, Builtin Functions, Addsuffix Xdoc/function/and.so Refernce Manual, Builtin Functions, And Xdoc/function/basename.so Reference Manual, Builtin Functions, Basename Xdoc/function/cando.so Reference Manual, Builtin Functions, Cando Xdoc/function/catenate.so Reference Manual, Built-In Functions, Catenate Xdoc/function/collect.so Reference Manual, Built-In Functions, Collect Xdoc/function/collect_ln.so Reference Manual, Built-In Functions, Collect_lines Xdoc/function/count.so Reference Manual, Built-In Functions, Count Xdoc/function/defined.so Reference Manual, Built-In Functions, Defined Xdoc/function/dir.so Reference Manual, Built-In Functions, Dir Xdoc/function/dirname.so Reference Manual, Built-In Functions, Dirname Xdoc/function/downcase.so Reference Manual, Built-In Functions, Downcase Xdoc/function/entryname.so Reference Manual, Built-In Functions, Entryname Xdoc/function/execute.so Reference Manual, Built-In Functions, Execute Xdoc/function/exists.so Reference Manual, Built-In Functions, Exists Xdoc/function/filter.so Reference Manual, Built-In Functions, Filter Xdoc/function/filter_out.so Reference Manual, Built-In Functions, Filter_out Xdoc/function/find_cmd.so Reference Manual, Built-In Functions, Find_command Xdoc/function/findstring.so Reference Manual, Builtin Functions, Findstring Xdoc/function/fromto.so Reference Manual, Built-In Functions, Fromto Xdoc/function/getenv.so Reference Manual, Built-In Functions, Getenv Xdoc/function/glob.so Reference Manual, Built-In Functions, Glob Xdoc/function/head.so Reference Manual, Built-In Functions, Head Xdoc/function/home.so Reference Manual, Builtin Functions, Home Xdoc/function/if.so Reference Manual, Built-In Functions, If Xdoc/function/in.so Reference Manual, Built-In Functions, In Xdoc/function/join.so Reference Manual, Builtin Functions, Join Xdoc/function/match_mask.so Reference Manual, Built-In Functions, Match_mask Xdoc/function/matches.so Reference Manual, Built-In Functions, Matches Xdoc/function/mtime.so Reference Manual, Built-In Functions, Mtime Xdoc/function/not.so Reference Manual, Built-In Functions, Not Xdoc/function/opsys.so Reference Manual, Built-In Functions, Operating_System Xdoc/function/or.so Reference Manual, Built-In Functions, Or Xdoc/function/pathname.so Reference Manual, Built-In Functions, Pathname Xdoc/function/patsubst.so Reference Manual, Built-In Functions, Patsubst Xdoc/function/prepost.so Reference Manual, Built-In Functions, Prepost Xdoc/function/quote.so Reference Manual, Built-In Functions, Quote Xdoc/function/resolve.so Reference Manual, Built-In Functions, Resolve Xdoc/function/shell.so Reference Manual, Built-In Functions, Shell Xdoc/function/sort.so Reference Manual, Built-In Functions, Sort Xdoc/function/sort_newest.so Reference Manual, Built-In Functions, Sort_newest Xdoc/function/split.so Reference Manual, Builtin Functions, Split Xdoc/function/stringset.so Reference Manual, Built-In Functions, Stringset Xdoc/function/strip.so Reference Manual, Builtin Functions, Strip Xdoc/function/subst.so Referemce Manual, Builtin Functions, Subst Xdoc/function/suffix.so Reference Manual, Builtin Functions, Suffix Xdoc/function/tail.so Reference Manual, Built-In Functions, Tail Xdoc/function/unsplit.so Reference Manual, Builtin Functions, Unsplit Xdoc/function/upcase.so Reference Manual, Built-In Functions, Upcase Xdoc/function/uptodate.so Reference Manual, Built-In Functions, Uptodate Xdoc/function/wildcard.so Reference Manual, Built-In Functions, Wildcard Xdoc/function/word.so Reference Manula, Builtin Functions, Word Xdoc/function/words.so Reference Manual, Built-In Functions, Words Xdoc/glossary.so Reference Manual, Glosary Xdoc/history.so Reference Manual, Ancient History Xdoc/how.so Reference Manual, Actions when Cooking Xdoc/intro.so Reference Manual, Introduction Xdoc/intro1.so Reference Manual, Cook from the Outside Xdoc/intro2.so Reference Manual, Cook from a Cookbook Xdoc/language.so Reference Manual, Cookbook Lanuage Definition Xdoc/match.so Reference Manual, File name patterns Xdoc/option.so Reference Manual, Option Precedence Xdoc/refman.t Reference Manual Xdoc/system.so Reference Manual, Supplied Cookbooks Xdoc/variables.so Reference Manual, Predefined Variables Xdoc/version.so The patch level of this distribution. Xfind_libs/main.c operating system start point, and parse command line options Xfind_libs/os.c functions to isolate operating system interface Xfind_libs/os.h interface definition for find_libs/os.c Xlib/as cookbook for using assembler Xlib/bison cookbook for using bison Xlib/c cookbook for using C Xlib/gcc cookbook for using gcc Xlib/home cookbook for locations in home directory Xlib/lex cookbook for using lex Xlib/library cookbook for constructing libraries Xlib/print cookbook for printing files Xlib/program cookbook for constructing programs Xlib/rcs cookbook for using RCS Xlib/sccs cookbook for using SCCS Xlib/text cookbook for formatting documents Xlib/usr cookbook for locations in system directories Xlib/usr.local cookbook for locations in local system directories Xlib/yacc cookbook for using yacc Xlib/yacc_many cookbook for using yacc more than once in same program Xmake2cook/blob.c functions to manipulate blobs Xmake2cook/blob.h interface definition for make2cook/blob.c Xmake2cook/emit.c functions to emit the result Xmake2cook/emit.h interface definition for make2cook/emit.c Xmake2cook/gram.h interface definition for make2cook/gram.y Xmake2cook/gram.y functions to parse Makefiles Xmake2cook/lex.c functions to perform lexical analysis on Makefiles Xmake2cook/lex.h interface definition for make2cook/lex.c Xmake2cook/main.c operating system entry point Xmake2cook/stmt.c functions to manipulate statements Xmake2cook/stmt.h interface definition for make2cook/stmt.c Xmake2cook/stmt/assign.c functions to manipulate assign statements Xmake2cook/stmt/assign.h interface definition for make2cook/stmt/assign.c Xmake2cook/stmt/blank.c functions to manipulate blank statements Xmake2cook/stmt/blank.h interface definition for make2cook/stmt/blank.c Xmake2cook/stmt/comment.c functions to manipulate comment statements Xmake2cook/stmt/comment.h interface definition for make2cook/stmt/comment.c Xmake2cook/stmt/compound.c functions to manipulate compound statements Xmake2cook/stmt/compound.h interface definition for make2cook/stmt/compound.c Xmake2cook/stmt/define.c functions to manipulate define statements Xmake2cook/stmt/define.h interface definition for make2cook/stmt/define.c Xmake2cook/stmt/if.c functions to manipulate if statements Xmake2cook/stmt/if.h interface definition for make2cook/stmt/if.c Xmake2cook/stmt/include.c functions to manipulate include statements Xmake2cook/stmt/include.h interface definition for include.h Xmake2cook/stmt/rule.c functions to manipulate rule statements Xmake2cook/stmt/rule.h interface definition for make2cook/stmt/rule.c Xmake2cook/stmt/vpath.c functions to manipulate vpath statementss Xmake2cook/stmt/vpath.h interface definition for make2cook/stmt/vpath.c Xmake2cook/vargram.h interface definition for make2cook/vargram.y Xmake2cook/vargram.y functions to parse variable references Xmake2cook/variable.c functions to manipulate variables Xmake2cook/variable.h interface definition for make2cook/variable.c Xman1/c_incl.1 manual entry for c_incl Xman1/cook.1 manual entry for the cook command Xman1/cookfp.1 manual entry for the cookfp command Xman1/cooktime.1 manual entry for the cooktime command Xman1/copyright.so copyright notice for manual entries Xman1/find_libs.1 manual entry for the find_libs command Xman1/make2cook.1 manual entry for the make2cook command Xman1/o__rules.so description of option up/down case convention Xman1/roffpp.1 manual entry for the roffpp command Xman1/z_exit.so description of exit status for manual entries Xman1/z_name.so document describing z_name.so Xroffpp/main.c operating system start point, and parse command line arguments Xroffpp/preprocess.c functions to eliminate include files Xroffpp/preprocess.h interface definition for roffpp/preprocess.c Xtest/00/t0001a.sh test the "and" builtin function Xtest/00/t0002a.sh test "catenate" builtin function Xtest/00/t0003a.sh test "collect" builtin function Xtest/00/t0004a.sh test "collect_lines" builtin function Xtest/00/t0005a.sh test the "count" builtin function Xtest/00/t0006a.sh test the "defined" builtin function Xtest/00/t0007a.sh test the "dirname" builtin function Xtest/00/t0008a.sh test the "downcase" builtin function Xtest/00/t0009a.sh test the "entryname" builtin function Xtest/00/t0010a.sh test the "execute" builtin function Xtest/00/t0011a.sh test the "exists" builtin function Xtest/00/t0012a.sh test the "find_command" builtin function Xtest/00/t0013a.sh test the "fromto" builtin function Xtest/00/t0014a.sh test the "getenv" builtin function Xtest/00/t0015a.sh test the "glob" builtin function Xtest/00/t0016a.sh test the "match" builtin function Xtest/00/t0017a.sh test the "head" builtin function Xtest/00/t0018a.sh test the "if" builtin function Xtest/00/t0019a.sh test the "in" builtin function Xtest/00/t0020a.sh test the "match_mask" builtin function Xtest/00/t0021a.sh test the "mtime" builtin function Xtest/00/t0022a.sh test the "not" builtin function Xtest/00/t0023a.sh test the "or" builtin function Xtest/00/t0024a.sh test the "pathname" builtin function Xtest/00/t0025a.sh test the "prepost" builtin function Xtest/00/t0026a.sh test the "quote" builtin function Xtest/00/t0027a.sh test the "stringset" builtin function Xtest/00/t0028a.sh test the "tail" builtin function Xtest/00/t0029a.sh test the cook -Book option Xtest/00/t0030a.sh test the "-version" command line option Xtest/00/t0031a.sh test the os_stat_cache() function Xtest/00/t0032a.sh test the "sort" builtin function Xtest/00/t0033a.sh test the c_incl program Xtest/00/t0034a.sh test the "%0" pattern replacement - it may be empty Xtest/00/t0035a.sh test the %0 pattern, it must not match absolute paths Xtest/00/t0036a.sh test the %1, etc, patterns Xtest/00/t0037a.sh test the c_incl -no_cache option Xtest/00/t0038a.sh test roffpp functionality Xtest/00/t0039a.sh test the c_incl -Roff option Xtest/00/t0040a.sh test the cooktime program Xtest/00/t0041a.sh Test the "resolve" builtin function Xtest/00/t0042a.sh test the "sort_newest" builtin function Xtest/00/t0043a.sh Test the c_incl .. flattening Xtest/00/t0044a.sh Test c_incl on missing files Xtest/00/t0045a.sh Test recipes with no ingredients Xtest/00/t0046a.sh Test the fingerprint functionality Xtest/00/t0047a.sh Test the fingerprint short-circuit functionality Xtest/00/t0048a.sh Test the include-cooked functionality Xtest/00/t0049a.sh Test the cookfp repeat functionality Xtest/00/t0050a.sh Test the include-cooked functionality Xtest/00/t0051a.sh Test the newest/oldest mtime functionality Xtest/00/t0052a.sh Test the cmd line var functionality Xtest/00/t0053a.sh Test the nodefault recipe flag Xtest/00/t0054a.sh Test the fingerprint functionality Xtest/00/t0055a.sh Test the include-cooked functionality Xtest/00/t0056a.sh Test the search-list functionality Xtest/00/t0057a.sh Test the addprefix builtin function Xtest/00/t0058a.sh Test the addsuffix builtin function Xtest/00/t0059a.sh Test the filter_out builtin function Xtest/00/t0060a.sh Test the subst builtin function Xtest/00/t0061a.sh Test the word builtin function Xtest/00/t0062a.sh Test the builtin basename function Xtest/00/t0063a.sh Test the suffix builtin function Xtest/00/t0064a.sh Test the join builtin function Xtest/00/t0065a.sh Test the make2cook functionality Xtest/00/t0066a.sh Test the make2cook functionality Xtest/00/t0067a.sh Test the default recipe anti-looping heuristic Xtest/00/t0068a.sh Test the make2cook include functionality Xtest/00/t0069a.sh Test the archive file functionality Xtest/00/t0070a.sh Test the make2cook archive functionality Xtest/00/t0071a.sh Test the make2cook vpath functionality Xtest/00/t0072a.sh Test the home builtin function Xtest/00/t0073a.sh Test the findstring builtin function Xtest/00/t0074a.sh Test the split builtin function Xtest/00/t0075a.sh Test the unsplit builtin function Xtest/00/t0076a.sh Test the strip builtin function Xtest/00/t0077a.sh Test the archive long name functionality Xtest/00/t0078a.sh Test the strip-dot functionality Xtest/00/t0079a.sh Test the mtime depth functionality Xtxt2c/main.c operating system start-up point Xtxt2c/txt2c.c functions to turn text into C strings Xtxt2c/txt2c.h interface definition for txt2c/txt2c.c Xaux/CHANGES.1.6 Change history of cook END_OF_FILE if test 23990 -ne `wc -c <'Manifest.author'`; then echo shar: \"'Manifest.author'\" unpacked with wrong size! fi # end of 'Manifest.author' fi if test -f 'aux/CHANGES.1.3' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'aux/CHANGES.1.3'\" else echo shar: Extracting \"'aux/CHANGES.1.3'\" \(25482 characters\) sed "s/^X//" >'aux/CHANGES.1.3' <<'END_OF_FILE' X X X XProject "cook.1.3" Page 1 XList of Changes Tue Jan 5 15:55:44 1993 X XChange State Description X------- ------- ------------- X 1 completed New release derived from cook.1.2. X 2 completed make it work on the dg X 3 completed make it ignore auto-mounter symlinks X 4 completed do not automagically append the program name to X the library path X 5 completed change roffpp to use groff .lf directive X 6 completed add search list for mtimes X 7 completed Change cookboot to take advantage of search_ X list functionality X 8 completed add a MANIFEST file X 9 completed add a patch file X 10 being_ add a patch file, more X integrated X X X XProject "cook.1.3", Change 1 Page 1 XChange Details Tue Jan 5 15:55:48 1993 X XNAME X Project "cook.1.3", Delta 1, Change 1. X XSUMMARY X New release derived from cook.1.2. X XDESCRIPTION X New release derived from cook.1.2. X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source create 1 CHANGES.sh X source create 1 COPYING X source create 1 Howto.cook X source create 1 Makefile.awk X source create 1 Makefile.sh X source create 1 c_incl/cache.c X source create 1 c_incl/cache.h X source create 1 c_incl/lang_c.c X source create 1 c_incl/lang_roff.c X source create 1 c_incl/main.c X source create 1 c_incl/os.c X source create 1 c_incl/os.h X source create 1 c_incl/sniff.c X source create 1 c_incl/sniff.h X source create 1 common/ansi.c X source create 1 common/arglex.c X source create 1 common/arglex.h X source create 1 common/error.c X source create 1 common/error.h X source create 1 common/help.c X source create 1 common/help.h X source create 1 common/main.h X source create 1 common/mem.c X source create 1 common/mem.h X source create 1 common/str.c X source create 1 common/str.h X source create 1 common/trace.c X source create 1 common/trace.h X source create 1 common/version.c X source create 1 common/version.h X source create 1 common/word.c X source create 1 common/word.h X source create 1 conf/ConvexOS-10 X source create 1 conf/SunOS-4.1.2 X source create 1 conf/SysV-4.0 X source create 1 config X source create 1 cook/builtin.c X source create 1 cook/builtin.h X source create 1 cook/cook.c X X X XProject "cook.1.3", Change 1 Page 2 XChange Details Tue Jan 5 15:55:48 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X source create 1 cook/cook.h X source create 1 cook/env.c X source create 1 cook/env.h X source create 1 cook/expr.c X source create 1 cook/expr.h X source create 1 cook/glob.c X source create 1 cook/glob.h X source create 1 cook/hashline.y X source create 1 cook/id.c X source create 1 cook/id.h X source create 1 cook/lex.c X source create 1 cook/lex.h X source create 1 cook/listing.c X source create 1 cook/listing.h X source create 1 cook/main.c X source create 1 cook/match.c X source create 1 cook/match.h X source create 1 cook/option.c X source create 1 cook/option.h X source create 1 cook/os.c X source create 1 cook/os.h X source create 1 cook/parse.y X source create 1 cook/stmt.c X source create 1 cook/stmt.h X source create 1 cooktime/date.y X source create 1 cooktime/main.c X source create 1 doc/building.man X source create 1 doc/builtin X source create 1 doc/cmdline X source create 1 doc/conditions X source create 1 doc/glossary X source create 1 doc/history X source create 1 doc/how X source create 1 doc/intro X source create 1 doc/intro.aa X source create 1 doc/intro.bb X source create 1 doc/language X source create 1 doc/match X source create 1 doc/option X source create 1 doc/readme.man X source create 1 doc/refman.t X source create 1 doc/system X source create 1 doc/variables X source create 1 find_libs/main.c X source create 1 find_libs/os.c X source create 1 find_libs/os.h X source create 1 h/float.h X source create 1 h/limits.h X source create 1 h/stdarg.h-min X source create 1 h/stddef.h X source create 1 h/stdlib.h X source create 1 h/string.h X source create 1 h/time.h X source create 1 lib/as X source create 1 lib/bison X X X XProject "cook.1.3", Change 1 Page 3 XChange Details Tue Jan 5 15:55:48 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X source create 1 lib/c X source create 1 lib/gcc X source create 1 lib/home X source create 1 lib/lex X source create 1 lib/library X source create 1 lib/print X source create 1 lib/program X source create 1 lib/sccs X source create 1 lib/text X source create 1 lib/usr X source create 1 lib/usr.local X source create 1 lib/yacc X source create 1 lib/yacc_many X source create 1 man1/c_incl.1 X source create 1 man1/cook.1 X source create 1 man1/cooktime.1 X source create 1 man1/find_libs.1 X source create 1 man1/roffpp.1 X source create 1 roffpp/main.c X source create 1 roffpp/preprocess.c X source create 1 roffpp/preprocess.h X test create 1 test/00/t0001a.sh X test create 1 test/00/t0002a.sh X test create 1 test/00/t0003a.sh X test create 1 test/00/t0004a.sh X test create 1 test/00/t0005a.sh X test create 1 test/00/t0006a.sh X test create 1 test/00/t0007a.sh X test create 1 test/00/t0008a.sh X test create 1 test/00/t0009a.sh X test create 1 test/00/t0010a.sh X test create 1 test/00/t0011a.sh X test create 1 test/00/t0012a.sh X test create 1 test/00/t0013a.sh X test create 1 test/00/t0014a.sh X test create 1 test/00/t0015a.sh X test create 1 test/00/t0016a.sh X test create 1 test/00/t0017a.sh X test create 1 test/00/t0018a.sh X test create 1 test/00/t0019a.sh X test create 1 test/00/t0020a.sh X test create 1 test/00/t0021a.sh X test create 1 test/00/t0022a.sh X test create 1 test/00/t0023a.sh X test create 1 test/00/t0024a.sh X test create 1 test/00/t0025a.sh X test create 1 test/00/t0026a.sh X test create 1 test/00/t0027a.sh X test create 1 test/00/t0028a.sh X test create 1 test/00/t0029a.sh X test create 1 test/00/t0030a.sh X test create 1 test/00/t0031a.sh X test create 1 test/00/t0032a.sh X test create 1 test/00/t0033a.sh X test create 1 test/00/t0034a.sh X X X XProject "cook.1.3", Change 1 Page 4 XChange Details Tue Jan 5 15:55:48 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X test create 1 test/00/t0035a.sh X test create 1 test/00/t0036a.sh X test create 1 test/00/t0037a.sh X test create 1 test/00/t0038a.sh X test create 1 test/00/t0039a.sh X test create 1 test/00/t0040a.sh X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Mon Jul 20 pmiller X 13:17:57 1992 X develop_begin Mon Jul 20 pmiller X 13:17:57 1992 X develop_end Mon Jul 20 pmiller X 13:17:57 1992 X review_pass Mon Jul 20 pmiller X 13:17:57 1992 X integrate_begin Mon Jul 20 pmiller X 13:17:57 1992 X integrate_pass Mon Jul 20 pmiller X 13:22:40 1992 X X X XProject "cook.1.3", Change 2 Page 1 XChange Details Tue Jan 5 15:55:49 1993 X XNAME X Project "cook.1.3", Delta 3, Change 2. X XSUMMARY X make it work on the dg X XDESCRIPTION X make it work on the dg X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 2 CHANGES.sh X source modify 2 Howto.cook X source modify 2 Makefile.sh X source modify 2 c_incl/cache.h X source modify 2 c_incl/os.h X source modify 2 common/arglex.h X source modify 2 common/error.c X source modify 2 common/error.h X source modify 2 common/help.h X source modify 2 common/main.h X source modify 2 common/mem.h X source create 1 common/s-v-arg.h X source modify 2 common/str.c X source modify 2 common/str.h X source modify 2 common/trace.c X source modify 2 common/trace.h X source modify 2 common/version.h X source modify 2 common/word.h X source create 1 conf/dgux-5.4.1 X source modify 2 config X source modify 2 cook/builtin.c X source modify 2 cook/builtin.h X source modify 2 cook/cook.c X source modify 2 cook/cook.h X source modify 2 cook/env.h X source modify 2 cook/expr.c X source modify 2 cook/expr.h X source modify 2 cook/glob.c X source modify 2 cook/glob.h X source create 1 cook/hashline.h X source modify 2 cook/hashline.y X source modify 2 cook/id.h X source modify 2 cook/lex.c X source modify 2 cook/lex.h X source modify 2 cook/listing.h X source modify 2 cook/main.c X source modify 2 cook/match.h X source modify 2 cook/option.h X source modify 2 cook/os.h X X X XProject "cook.1.3", Change 2 Page 2 XChange Details Tue Jan 5 15:55:49 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X source create 1 cook/parse.h X source modify 2 cook/parse.y X source modify 2 cook/stmt.h X source create 1 cooktime/date.h X source modify 2 cooktime/date.y X source modify 2 cooktime/main.c X source modify 2 doc/building.man X source modify 2 doc/readme.man X source modify 2 find_libs/os.h X source modify 2 roffpp/preprocess.h X test modify 2 test/00/t0012a.sh X test modify 2 test/00/t0037a.sh X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Thu Oct 22 pmiller Elapsed time: 0.082 X 15:19:04 1992 days. X develop_begin Thu Oct 22 pmiller Elapsed time: 0.054 X 15:56:05 1992 days. X develop_end Fri Oct 23 pmiller X 08:50:32 1992 X review_pass Fri Oct 23 pmiller X 08:50:41 1992 X integrate_begin Fri Oct 23 pmiller Elapsed time: 0.246 X 08:51:11 1992 days. X integrate_fail Fri Oct 23 pmiller * The common/s-v-arg.h X 10:42:00 1992 file has a mistake X (should be CONF_NO_ X stdarg). X * The README and X BUILDING files need X updating. X Elapsed time: 0.190 X days. X develop_end Fri Oct 23 pmiller X 12:07:31 1992 X review_pass Fri Oct 23 pmiller X 12:07:47 1992 X integrate_begin Fri Oct 23 pmiller Elapsed time: 0.000 X 12:09:05 1992 days. X integrate_pass Sat Oct 24 pmiller X 21:25:01 1992 X X X XProject "cook.1.3", Change 3 Page 1 XChange Details Tue Jan 5 15:55:50 1993 X XNAME X Project "cook.1.3", Delta 4, Change 3. X XSUMMARY X make it ignore auto-mounter symlinks X XDESCRIPTION X make it ignore auto-mounter symlinks X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 2 cook/os.c X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Sat Oct 24 pmiller X 21:28:38 1992 X develop_begin Sat Oct 24 pmiller Elapsed time: 0.160 X 21:35:52 1992 days. X develop_end Sat Oct 24 pmiller X 22:47:49 1992 X review_pass Sat Oct 24 pmiller X 22:48:05 1992 X integrate_begin Sat Oct 24 pmiller X 22:48:43 1992 X integrate_pass Sat Oct 24 pmiller X 22:55:37 1992 X X X XProject "cook.1.3", Change 4 Page 1 XChange Details Tue Jan 5 15:55:51 1993 X XNAME X Project "cook.1.3", Delta 5, Change 4. X XSUMMARY X do not automagically append the program name to the library path X XDESCRIPTION X do not automagically append the program name to the library path X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 3 Howto.cook X source modify 3 Makefile.sh X source modify 2 cook/option.c X source modify 2 doc/how X source modify 2 doc/system X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Sat Oct 24 pmiller X 22:56:46 1992 X develop_begin Sat Oct 24 pmiller Elapsed time: 0.097 X 22:56:54 1992 days. X develop_end Sat Oct 24 pmiller X 23:40:39 1992 X review_pass Sat Oct 24 pmiller X 23:42:18 1992 X integrate_begin Sat Oct 24 pmiller X 23:42:48 1992 X integrate_pass Sat Oct 24 pmiller X 23:47:24 1992 X X X XProject "cook.1.3", Change 5 Page 1 XChange Details Tue Jan 5 15:55:51 1993 X XNAME X Project "cook.1.3", Delta 6, Change 5. X XSUMMARY X change roffpp to use groff .lf directive X XDESCRIPTION X 1. change roffpp to use groff .lf directive X 2. fix gcc initializer warnings. X 3. change to use strict prototype warnings of gcc. X 4. fix problems revealed by the above warnings. X X This change is exempt from testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 4 Howto.cook X source modify 2 c_incl/cache.c X source modify 2 c_incl/main.c X source modify 2 common/arglex.c X source modify 3 common/error.c X source modify 2 common/mem.c X source modify 3 common/str.c X source modify 3 common/trace.c X source modify 3 common/trace.h X source modify 2 common/version.c X source modify 3 cook/builtin.c X source modify 3 cook/glob.c X source modify 3 cook/hashline.y X source modify 2 cook/id.c X source modify 3 cook/lex.c X source modify 2 cook/listing.c X source modify 3 cook/main.c X source modify 2 cook/match.c X source modify 3 cook/option.c X source modify 3 cook/os.c X source modify 3 cook/parse.y X source modify 3 cooktime/date.y X source modify 3 cooktime/main.c X source modify 2 find_libs/main.c X source modify 2 roffpp/main.c X source modify 2 roffpp/preprocess.c X test modify 2 test/00/t0038a.sh X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Tue Dec 15 pmiller X 10:13:42 1992 X develop_begin Tue Dec 15 pmiller Elapsed time: 0.792 X 10:13:48 1992 days. X develop_end Wed Dec 16 pmiller X 08:40:21 1992 X X X XProject "cook.1.3", Change 5 Page 2 XChange Details Tue Jan 5 15:55:51 1993 X X What When Who Comment X ------ ------ ----- --------- X review_pass Wed Dec 16 pmiller X 08:40:31 1992 X integrate_begin Wed Dec 16 pmiller Elapsed time: 0.037 X 08:41:08 1992 days. X integrate_pass Wed Dec 16 pmiller X 08:57:43 1992 X X X XProject "cook.1.3", Change 6 Page 1 XChange Details Tue Jan 5 15:55:52 1993 X XNAME X Project "cook.1.3", Delta 8, Change 6. X XSUMMARY X add search list for mtimes X XDESCRIPTION X Add a search list for for files, so that hierachical source X structures may be supported. X 1. add the search_list predefined variable, a list of X directories to search. dot (.) is always the first item, no X matter what the user says. X 2. the resolve biltin function may be used to determine where X cook actually found the file (says in the current directory if X it does not exist) X 3. update the reference manual to reflect the existence of the X above X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 2 common/word.c X source modify 3 common/word.h X source create 1 conf/SunOS-4.1.3 X source modify 3 config X source modify 4 cook/builtin.c X source modify 3 cook/cook.c X source modify 3 cook/cook.h X source modify 3 cook/id.c X source modify 3 cook/id.h X source modify 2 doc/builtin X source modify 2 doc/variables X test modify 2 test/00/t0033a.sh X test create 1 test/00/t0041a.sh X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Sun Jan 3 pmiller X 21:41:08 1993 X develop_begin Sun Jan 3 pmiller Elapsed time: 1.067 X 21:41:28 1993 days. X develop_end Mon Jan 4 pmiller X 22:11:32 1993 X review_pass Mon Jan 4 pmiller X 22:11:43 1993 X integrate_begin Mon Jan 4 pmiller Elapsed time: 0.025 X 22:12:27 1993 days. X integrate_fail Mon Jan 4 pmiller test 33 needs repairs X 22:23:51 1993 X develop_end Mon Jan 4 pmiller X 22:30:39 1993 X review_pass Mon Jan 4 pmiller X 22:30:50 1993 X X X XProject "cook.1.3", Change 6 Page 2 XChange Details Tue Jan 5 15:55:52 1993 X X What When Who Comment X ------ ------ ----- --------- X integrate_begin Mon Jan 4 pmiller X 22:31:21 1993 X integrate_pass Mon Jan 4 pmiller X 22:39:19 1993 X X X XProject "cook.1.3", Change 7 Page 1 XChange Details Tue Jan 5 15:55:53 1993 X XNAME X Project "cook.1.3", Delta 10, Change 7. X XSUMMARY X Change cookboot to take advantage of search_list functionality X XDESCRIPTION X 1. Change cookboot to take advantage of search_list X functionality X 2. Repair typos in reference manual X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 5 Howto.cook X source create 1 aux/BUILDING.man X source create 1 aux/README.man X source remove 2 doc/building.man X source modify 3 doc/builtin X source modify 2 doc/conditions X source modify 2 doc/intro.bb X source modify 2 doc/language X source remove 2 doc/readme.man X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Mon Jan 4 pmiller X 22:40:58 1993 X develop_begin Mon Jan 4 pmiller Elapsed time: 0.000 X 22:41:14 1993 days. X develop_end Tue Jan 5 pmiller X 10:36:04 1993 X review_pass Tue Jan 5 pmiller X 10:37:55 1993 X integrate_begin Tue Jan 5 pmiller X 10:38:22 1993 X integrate_fail Tue Jan 5 pmiller Howto.cook needs minor X 10:43:25 1993 repairs X develop_end Tue Jan 5 pmiller X 10:49:09 1993 X review_pass Tue Jan 5 pmiller X 10:49:18 1993 X integrate_begin Tue Jan 5 pmiller Elapsed time: 0.182 X 10:49:48 1993 days. X integrate_pass Tue Jan 5 pmiller X 12:11:29 1993 X X X XProject "cook.1.3", Change 8 Page 1 XChange Details Tue Jan 5 15:55:54 1993 X XNAME X Project "cook.1.3", Delta 11, Change 8. X XSUMMARY X add a MANIFEST file X XDESCRIPTION X Add a MANIFEST file, add recipes to cause it to be constructed X at integrate build, and add a manifest line to each source file. X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 3 CHANGES.sh X source modify 6 Howto.cook X source modify 2 Makefile.awk X source modify 4 Makefile.sh X source create 1 aux/MANIFEST.sh X source modify 3 c_incl/cache.c X source modify 3 c_incl/cache.h X source modify 2 c_incl/lang_c.c X source modify 2 c_incl/lang_roff.c X source modify 3 c_incl/main.c X source modify 2 c_incl/os.c X source modify 3 c_incl/os.h X source modify 2 c_incl/sniff.c X source modify 2 c_incl/sniff.h X source modify 2 common/ansi.c X source modify 3 common/arglex.c X source modify 3 common/arglex.h X source modify 4 common/error.c X source modify 3 common/error.h X source modify 2 common/help.c X source modify 3 common/help.h X source modify 3 common/main.h X source modify 3 common/mem.c X source modify 3 common/mem.h X source modify 2 common/s-v-arg.h X source modify 4 common/str.c X source modify 3 common/str.h X source modify 4 common/trace.c X source modify 4 common/trace.h X source modify 3 common/version.c X source modify 3 common/version.h X source modify 3 common/word.c X source modify 4 common/word.h X source modify 2 conf/ConvexOS-10 X source modify 2 conf/SunOS-4.1.2 X source modify 2 conf/SunOS-4.1.3 X source modify 2 conf/SysV-4.0 X source modify 2 conf/dgux-5.4.1 X X X XProject "cook.1.3", Change 8 Page 2 XChange Details Tue Jan 5 15:55:54 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 4 config X source modify 3 cook/builtin.h X source modify 4 cook/cook.c X source modify 4 cook/cook.h X source modify 2 cook/env.c X source modify 3 cook/env.h X source modify 3 cook/expr.c X source modify 3 cook/expr.h X source modify 4 cook/glob.c X source modify 3 cook/glob.h X source modify 2 cook/hashline.h X source modify 4 cook/hashline.y X source modify 4 cook/id.c X source modify 4 cook/id.h X source modify 4 cook/lex.c X source modify 3 cook/lex.h X source modify 3 cook/listing.c X source modify 3 cook/listing.h X source modify 4 cook/main.c X source modify 3 cook/match.c X source modify 3 cook/match.h X source modify 4 cook/option.c X source modify 3 cook/option.h X source modify 4 cook/os.c X source modify 3 cook/os.h X source modify 2 cook/parse.h X source modify 4 cook/parse.y X source modify 2 cook/stmt.c X source modify 3 cook/stmt.h X source modify 2 cooktime/date.h X source modify 4 cooktime/date.y X source modify 4 cooktime/main.c X source modify 4 doc/builtin X source modify 2 doc/cmdline X source modify 3 doc/conditions X source modify 2 doc/glossary X source modify 2 doc/history X source modify 3 doc/how X source modify 2 doc/intro X source modify 2 doc/intro.aa X source modify 3 doc/intro.bb X source modify 3 doc/language X source modify 2 doc/match X source modify 2 doc/option X source modify 2 doc/refman.t X source modify 3 doc/system X source modify 3 doc/variables X source modify 3 find_libs/main.c X source modify 2 find_libs/os.c X source modify 3 find_libs/os.h X source modify 2 h/float.h X source modify 2 h/limits.h X source modify 2 h/stdarg.h-min X source modify 2 h/stddef.h X source modify 2 h/stdlib.h X X X XProject "cook.1.3", Change 8 Page 3 XChange Details Tue Jan 5 15:55:54 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 2 h/string.h X source modify 2 h/time.h X source modify 2 lib/as X source modify 2 lib/bison X source modify 2 lib/c X source modify 2 lib/gcc X source modify 2 lib/home X source modify 2 lib/lex X source modify 2 lib/library X source modify 2 lib/print X source modify 2 lib/program X source modify 2 lib/sccs X source modify 2 lib/text X source modify 2 lib/usr X source modify 2 lib/usr.local X source modify 2 lib/yacc X source modify 2 lib/yacc_many X source modify 2 man1/c_incl.1 X source modify 2 man1/cook.1 X source modify 2 man1/cooktime.1 X source modify 2 man1/find_libs.1 X source modify 2 man1/roffpp.1 X source modify 3 roffpp/main.c X source modify 3 roffpp/preprocess.c X source modify 3 roffpp/preprocess.h X test modify 2 test/00/t0001a.sh X test modify 2 test/00/t0002a.sh X test modify 2 test/00/t0003a.sh X test modify 2 test/00/t0004a.sh X test modify 2 test/00/t0005a.sh X test modify 2 test/00/t0006a.sh X test modify 2 test/00/t0007a.sh X test modify 2 test/00/t0008a.sh X test modify 2 test/00/t0009a.sh X test modify 2 test/00/t0010a.sh X test modify 2 test/00/t0011a.sh X test modify 3 test/00/t0012a.sh X test modify 2 test/00/t0013a.sh X test modify 2 test/00/t0014a.sh X test modify 2 test/00/t0015a.sh X test modify 2 test/00/t0016a.sh X test modify 2 test/00/t0017a.sh X test modify 2 test/00/t0018a.sh X test modify 2 test/00/t0019a.sh X test modify 2 test/00/t0020a.sh X test modify 2 test/00/t0021a.sh X test modify 2 test/00/t0022a.sh X test modify 2 test/00/t0023a.sh X test modify 2 test/00/t0024a.sh X test modify 2 test/00/t0025a.sh X test modify 2 test/00/t0026a.sh X test modify 2 test/00/t0027a.sh X test modify 2 test/00/t0028a.sh X test modify 2 test/00/t0029a.sh X test modify 2 test/00/t0030a.sh X X X XProject "cook.1.3", Change 8 Page 4 XChange Details Tue Jan 5 15:55:54 1993 X X Type Action Edit File Name X ------- ------- ------- ----------- X test modify 2 test/00/t0031a.sh X test modify 2 test/00/t0032a.sh X test modify 2 test/00/t0034a.sh X test modify 2 test/00/t0035a.sh X test modify 2 test/00/t0036a.sh X test modify 3 test/00/t0037a.sh X test modify 3 test/00/t0038a.sh X test modify 2 test/00/t0039a.sh X test modify 2 test/00/t0040a.sh X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Tue Jan 5 pmiller X 12:12:34 1993 X develop_begin Tue Jan 5 pmiller Elapsed time: 0.303 X 12:12:43 1993 days. X develop_end Tue Jan 5 pmiller X 14:29:01 1993 X review_pass Tue Jan 5 pmiller X 14:34:43 1993 X integrate_begin Tue Jan 5 pmiller Elapsed time: 0.026 X 14:35:32 1993 days. X integrate_pass Tue Jan 5 pmiller X 14:47:07 1993 X X X XProject "cook.1.3", Change 9 Page 1 XChange Details Tue Jan 5 15:55:54 1993 X XNAME X Project "cook.1.3", Delta 12, Change 9. X XSUMMARY X add a patch file X XDESCRIPTION X 1. Integration build is to construct a patch file, in addition X to the shar and tar formats. X 2. Move some of the auxilliary files into the aux directory. X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by internal_enhancement. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source remove 3 CHANGES.sh X source remove 6 Howto.cook X source remove 2 Makefile.awk X source remove 4 Makefile.sh X source create 1 aux/CHANGES.sh X source create 1 aux/Howto.cook X source modify 2 aux/MANIFEST.sh X source create 1 aux/Makefile.awk X source create 1 aux/Makefile.sh X source create 1 aux/patches.sh X source modify 5 config X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Tue Jan 5 pmiller X 14:51:54 1993 X develop_begin Tue Jan 5 pmiller Elapsed time: 0.048 X 14:58:50 1993 days. X develop_end Tue Jan 5 pmiller X 15:20:25 1993 X review_pass Tue Jan 5 pmiller X 15:20:37 1993 X integrate_begin Tue Jan 5 pmiller Elapsed time: 0.059 X 15:21:17 1993 days. X integrate_pass Tue Jan 5 pmiller X 15:47:49 1993 X X X XProject "cook.1.3", Change 10 Page 1 XChange Details Tue Jan 5 15:55:55 1993 X XNAME X Project "cook.1.3", Delta 13, Change 10. X XSUMMARY X add a patch file, more X XDESCRIPTION X add a patch file, more X X This change is exempt from testing. This change is exempt from X testing against the baseline. X XCAUSE X This change was caused by chain. X XSTATE X This change is in 'being_integrated' state. X XFILES X Type Action Edit File Name X ------- ------- ------- ----------- X source modify 1 aux/Makefile.sh X XHISTORY X What When Who Comment X ------ ------ ----- --------- X new_change Tue Jan 5 pmiller X 15:49:09 1993 X develop_begin Tue Jan 5 pmiller X 15:49:23 1993 X develop_end Tue Jan 5 pmiller X 15:53:25 1993 X review_pass Tue Jan 5 pmiller X 15:53:33 1993 X integrate_begin Tue Jan 5 pmiller X 15:54:06 1993 END_OF_FILE if test 25482 -ne `wc -c <'aux/CHANGES.1.3'`; then echo shar: \"'aux/CHANGES.1.3'\" unpacked with wrong size! fi # end of 'aux/CHANGES.1.3' fi if test -f 'cook/os.c' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'cook/os.c'\" else echo shar: Extracting \"'cook/os.c'\" \(24403 characters\) sed "s/^X//" >'cook/os.c' <<'END_OF_FILE' X/* X * cook - file construction tool X * Copyright (C) 1991, 1992, 1993, 1994 Peter Miller. X * All rights reserved. X * X * This program is free software; you can redistribute it and/or modify X * it under the terms of the GNU General Public License as published by X * the Free Software Foundation; either version 2 of the License, or X * (at your option) any later version. X * X * This program is distributed in the hope that it will be useful, X * but WITHOUT ANY WARRANTY; without even the implied warranty of X * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X * GNU General Public License for more details. X * X * You should have received a copy of the GNU General Public License X * along with this program; if not, write to the Free Software X * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X * X * MANIFEST: functions to isolate operating system interface X */ X X#include X#include X#include X#include X#include X#include X#include X#include X#include X X#include X#include X#include X#include X X#include X#include X#include X#include X#include X#include X#include X X#ifdef HAVE_GETRUSAGE X#include X#else X#include X#endif X X X/* X * NAME X * os_mtime - return the last-modified time of a file X * X * SYNOPSIS X * time_t os_mtime(string_ty *path); X * X * DESCRIPTION X * Os_mtime returns the time the named file was last modified. X * It returns 0 if the file does not exist. X * X * CAVEAT X * Assumes time will be the UNIX format. X */ X Xtime_t Xos_mtime_oldest(path) X string_ty *path; X{ X return stat_cache_oldest(path); X} X Xtime_t Xos_mtime_newest(path) X string_ty *path; X{ X return stat_cache_newest(path); X} X X X/* X * NAME X * os_mtime_adjust - indicate change X * X * SYNOPSIS X * int os_mtime_adjust(string_ty *path); X * X * DESCRIPTION X * The os_mtime_adjust function is used to adjust the value in the stat X * cache to indicate that a recipe has constructed a file, and thus X * changed it last-modified time. No change to the actual file system X * occurs. X * X * RETURNS X * int; -1 on error, 0 on success X */ X Xint Xos_mtime_adjust(path, min_age) X string_ty *path; X time_t min_age; X{ X time_t mtime; X int err; X X if (option_test(OPTION_UPDATE)) X { X stat_cache_clear(path); X mtime = os_mtime_newest(path); X if (mtime < 0) X return -1; X if (mtime) X { X if (mtime < min_age) X { X struct utimbuf ut; X X if (!option_test(OPTION_SILENT)) X { X long nsec; X X nsec = min_age - mtime; X error X ( X "adjusting \"%s\" forward %ld second%s", X path->str_text, X nsec, X (nsec == 1 ? "" : "s") X ); X } X ut.modtime = min_age; X ut.actime = min_age; X err = utime(path->str_text, &ut); X if (err && errno == ENOENT) X err = archive_utime(path, &ut); X if (err) X { X nerror("utime(\"%s\")", path->str_text); X option_set_errors(); X return -1; X } X stat_cache_set(path, min_age, 1); X } X } X else X { X /* X * file was deleted (or was a dummy) X * so pretend it was changed "now" X */ X time(&mtime); X if (mtime > min_age) X min_age = mtime; X stat_cache_set(path, min_age, 0); X } X } X else X { X time(&mtime); X if (mtime > min_age) X min_age = mtime; X stat_cache_set(path, min_age, 0); X } X return 0; X} X X X/* X * NAME X * os_clear_stat - invalidate cache X * X * SYNOPSIS X * int os_clear_stat(string_ty *path); X * X * DESCRIPTION X * The os_clear_stat function is used to invalidate the the stat X * cache to indicate that a recipe has constructed a file, and thus X * changed it last-modified time. No change to the actual file system X * occurs. X * X * RETURNS X * int; 0 on success, -1 on error X * X * CAVEAT X * This is used in situations where the recipe changes a file not named X * in the targets of the recipe. This usually occurs around mkdir, rm X * and mv commands, used in conjunction with the [exists] builtin function. X */ X Xint Xos_clear_stat(path) X string_ty *path; X{ X stat_cache_clear(path); X return 0; X} X X X/* X * NAME X * os_touch - update the modify time of the file X * X * SYNOPSIS X * int os_touch(string_ty *path); X * X * DESCRIPTION X * Os_touch updates the last-modified time of the file to the present. X * If the named file does not exist, then nothing is done. X * X * RETURNS X * int; 0 on success, -1 on error X */ X Xint Xos_touch(path) X string_ty *path; X{ X struct utimbuf ut; X int err; X X time(&ut.modtime); X if (ut.modtime < 0) X ut.modtime = 0; X ut.actime = ut.modtime; X err = utime(path->str_text, &ut); X if (err && errno == ENOENT) X err = archive_utime(path, &ut); X if (err) X { X if (errno == ENOENT) X { X stat_cache_clear(path); X return 0; X } X nerror("utime(\"%s\")", path->str_text); X option_set_errors(); X return -1; X } X stat_cache_set(path, ut.modtime, 1); X return 0; X} X X X/* X * NAME X * os_delete - delete a file X * X * SYNOPSIS X * int os_delete(string_ty *path); X * X * DESCRIPTION X * Os_delete deletes the named file. X * If it does not exist, no error is given. X * X * RETURNS X * int; -1 on error, 0 on success X */ X Xint Xos_delete(path) X string_ty *path; X{ X if (unlink(path->str_text) && errno != ENOENT) X { X nerror("unlink(\"%s\")", path->str_text); X option_set_errors(); X return -1; X } X X /* X * if the knew about the existence of the file before we deleted X * it, then we will have to adjust the stat cache. X */ X stat_cache_clear(path); X return 0; X} X X X/* X * NAME X * signal_name - find it X * X * SYNOPSIS X * char *signal_name(int n); X * X * DESCRIPTION X * The signal_name function is used to find the name of a signal from its X * number. X * X * RETURNS X * char *: pointer to the signal name. X * X * CAVEAT X * The signal name may not be written on. Subsequent calls may alter the X * area pointed to. X */ X Xchar * Xsignal_name(n) X int n; X{ X static char buffer[16]; X X switch (n) X { X#ifdef SIGHUP X case SIGHUP: X return "hang up [SIGHUP]"; X#endif /* SIGHUP */ X X#ifdef SIGINT X case SIGINT: X return "user interrupt [SIGINT]"; X#endif /* SIGINT */ X X#ifdef SIGQUIT X case SIGQUIT: X return "user quit [SIGQUIT]"; X#endif /* SIGQUIT */ X X#ifdef SIGILL X case SIGILL: X return "illegal instruction [SIGILL]"; X#endif /* SIGILL */ X X#ifdef SIGTRAP X case SIGTRAP: X return "trace trap [SIGTRAP]"; X#endif /* SIGTRAP */ X X#ifdef SIGIOT X case SIGIOT: X return "abort [SIGIOT]"; X#endif /* SIGIOT */ X X#ifdef SIGEMT X case SIGEMT: X return "EMT instruction [SIGEMT]"; X#endif /* SIGEMT */ X X#ifdef SIGFPE X case SIGFPE: X return "floating point exception [SIGFPE]"; X#endif /* SIGFPE */ X X#ifdef SIGKILL X case SIGKILL: X return "kill [SIGKILL]"; X#endif /* SIGKILL */ X X#ifdef SIGBUS X case SIGBUS: X return "bus error [SIGBUS]"; X#endif /* SIGBUS */ X X#ifdef SIGSEGV X case SIGSEGV: X return "segmentation violation [SIGSEGV]"; X#endif /* SIGSEGV */ X X#ifdef SIGSYS X case SIGSYS: X return "bad argument to system call [SIGSYS]"; X#endif /* SIGSYS */ X X#ifdef SIGPIPE X case SIGPIPE: X return "write on a pipe with no one to read it [SIGPIPE]"; X#endif /* SIGPIPE */ X X#ifdef SIGALRM X case SIGALRM: X return "alarm clock [SIGALRM]"; X#endif /* SIGALRM */ X X#ifdef SIGTERM X case SIGTERM: X return "software termination [SIGTERM]"; X#endif /* SIGTERM */ X X#ifdef SIGUSR1 X case SIGUSR1: X return "user defined signal one [SIGUSR1]"; X#endif /* SIGUSR1 */ X X#ifdef SIGUSR2 X case SIGUSR2: X return "user defined signal two [SIGUSR2]"; X#endif /* SIGUSR2 */ X X#ifdef SIGCLD X case SIGCLD: X return "death of child [SIGCLD]"; X#endif /* SIGCLD */ X X#ifdef SIGPWR X case SIGPWR: X return "power failure [SIGPWR]"; X#endif /* SIGPWR */ X X default: X sprintf(buffer, "signal %d", n); X return buffer; X } X} X X X/* X * NAME X * exit_status - pretty print X * X * SYNOPSIS X * int exit_status(char *cmd, int status, int errok); X * X * DESCRIPTION X * The exit_status function is used to pretty print the meaning of the X * exit status of the given command. No output is generated for normal X * (0) termination. X * X * RETURNS X * int: zero if the command succeeded, 1 if it failed. X * X * CAVEAT X * This function should be static, but func_collect (builtin.c) uses it. X */ X Xint Xexit_status(cmd, status, errok) X char *cmd; X int status; X int errok; X{ X int a, b, c; X X a = (status >> 8) & 0xFF; X b = (status >> 7) & 1; X c = status & 0x7F; X switch (c) X { X case 0x7F: X /* X * process was stopped, X * since we didn't do it, treat it as an error X */ X error("%s: stopped", cmd); X return 1; X X case 0: X /* normal termination */ X if (a) X { X error X ( X "%s: exit status: %d%s", X cmd, X a, X (errok ? " (ignored)" : "") X ); X if (errok) X return 0; X return 1; X } X return 0; X X default: X /* X * process dies from unhandled condition X */ X error X ( X "%s: terminated by %s%s", X cmd, X signal_name(c), X (b ? " (core dumped)" : "") X ); X return 1; X } X} X X X/* X * NAME X * execute - do a command X * X * SYNOPSIS X * int execute(wlist *cmd, int fd, int errok); X * X * DESCRIPTION X * The execute function is used to execute the command in the word list. X * If the file descriptor is >= 0, it indicates a file to use as stdin to X * the command. X * X * RETURNS X * int: zero if the commands succeeds, nonzero if it fails. X * X * CAVEAT X */ X Xstatic int execute _((wlist *, int, int)); X Xstatic int Xexecute(cmd, fd, errok) X wlist *cmd; X int fd; X int errok; X{ X int child; X int pid; X int status; X static char **argv; X static size_t argvlen; X int j; X X if (!argv) X { X argvlen = cmd->wl_nwords + 1; X argv = mem_alloc(argvlen * sizeof(char*)); X } X else X { X if (argvlen < cmd->wl_nwords + 1) X { X argvlen = cmd->wl_nwords + 1; X argv = mem_change_size(argv, argvlen * sizeof(char *)); X } X } X for (j = 0; j < cmd->wl_nwords; ++j) X argv[j] = cmd->wl_word[j]->str_text; X argv[cmd->wl_nwords] = 0; X switch (child = fork()) X { X case -1: X nerror("fork()"); X return -1; X X case 0: X if (fd >= 0) X { X if (close(0) && errno != EBADF) X nfatal("close(0)"); X if (dup(fd) < 0) X nfatal("dup()"); X } X if (argv[0][0] == '/') X execv(argv[0], argv); X else X execvp(argv[0], argv); X nfatal("exec(\"%s\")", argv[0]); X X default: X for (;;) X { X pid = wait(&status); X if (pid == child) X return exit_status(argv[0], status, errok); X if (pid < 0 && errno != EINTR) X { X nerror("wait()"); X option_set_errors(); X return -1; X } X } X } X} X X X/* X * NAME X * os_execute - execute a command X * X * SYNOPSIS X * int os_execute(wlist *args, string_ty *input, int errok); X * X * DESCRIPTION X * Os_execute performs the given command. X * If the command succeeds 0 is returned. X * If the command fails a diagnostic message is given X * and 1 is returned. X */ X Xint Xos_execute(args, input, errok) X wlist *args; X string_ty *input; X int errok; X{ X int j; X FILE *fp; X char iname[L_tmpnam]; X int retval; X X assert(args); X assert(args->wl_nwords > 0); X X fp = 0; X if (input) X { X /* X * He has given a string to be used as input to the command, X * so write it out to a file, and then redirect the input. X */ X tmpnam(iname); X fp = fopen(iname, "w"); X if (!fp) X { X nerror("create %s", iname); X exec_fails: X option_set_errors(); X retval = -1; X goto ret; X } X if (unlink(iname)) X { X nerror("unlink(\"%s\")", iname); X goto exec_fails; X } X fputs(input->str_text, fp); X if (ferror(fp) || fseek(fp, 0L, 0)) X { X nerror("write %s", iname); X goto exec_fails; X } X } X X for (j = 1; j < args->wl_nwords; j++) X { X char *s; X X s = args->wl_word[j]->str_text; X while (*s) X { X if (strchr("#|=^();&<>*?[]:$`'\"\\\n", *s)) X { X string_ty *str; X wlist newcmd; X char *cp; X X cp = getenv("SHELL"); X if (!cp || !*cp) X cp = CONF_SHELL; X wl_zero(&newcmd); X str = str_from_c(cp); X wl_append(&newcmd, str); X str_free(str); X if (option_test(OPTION_ERROK)) X str = str_from_c("-c"); X else X str = str_from_c("-ce"); X wl_append(&newcmd, str); X str_free(str); X str = X wl2str X ( X args, X 0, X args->wl_nwords - 1, X (char *)0 X ); X wl_append(&newcmd, str); X str_free(str); X retval = X execute X ( X &newcmd, X (input ? fileno(fp) : -1), X errok X ); X wl_free(&newcmd); X if (input) X fclose(fp); X return retval; X } X ++s; X } X } X retval = execute(args, (input ? fileno(fp) : -1), errok); X if (input) X fclose(fp); Xret: X return retval; X} X X X/* X * NAME X * os_exists - tests for the existence of a file X * X * SYNOPSIS X * int os_exists(string_ty *path); X * X * DESCRIPTION X * The os_exists function is used to determine the existence of a file. X * X * RETURNS X * int; 1 if the file exists, 0 if it does not. -1 on error X */ X Xint Xos_exists(path) X string_ty *path; X{ X time_t mtime; X X mtime = stat_cache_newest(path); X if (mtime < 0) X return -1; X return (mtime != 0); X} X X X/* X * NAME X * os_accdir - return the directory path of the users account X * X * SYNOPSIS X * string_ty *os_accdir(void); X * X * DESCRIPTION X * The full pathname of the user's account is returned. X * The string will have been dynamically allocated. X * X * RETURNS X * A pointer to a string in dynamic memory is returned. X * A null pointer is returned on error. X * X * CAVEAT X * Use str_free() when you are done with the value returned. X */ X Xstring_ty * Xos_accdir() X{ X static char home[] = "HOME"; X static string_ty *s; X X if (!s) X { X char *cp; X X cp = getenv(home); X if (!cp) X { X error("%s: environment variable not defined", home); X option_set_errors(); X return 0; X } X s = str_from_c(cp); X } X return str_copy(s); X} X X X/* X * NAME X * os_curdir - full current directory path X * X * SYNOPSIS X * string_ty *os_curdir(void); X * X * DESCRIPTION X * Os_curdir is used to determine the full pathname X * of the current directory. X * X * RETURNS X * A pointer to a string in dynamic memory is returned. X * A null pointer is returned on error. X * X * CAVEAT X * Use str_free() when you are done with the value returned. X */ X Xstring_ty * Xos_curdir() X{ X static string_ty *s; X X if (!s) X { X char buffer[1200]; X X if (!getcwd(buffer, sizeof(buffer))) X { X nerror("getcwd"); X option_set_errors(); X return 0; X } X s = str_from_c(buffer); X } X return str_copy(s); X} X X X/* X * NAME X * os_pathname - determine full file name X * X * SYNOPSIS X * string_ty *os_pathname(string_ty *path); X * X * DESCRIPTION X * Os_pathname is used to determine the full path name X * of a partial path given. X * X * RETURNS X * pointer to dynamically allocated string. X * X * CAVEAT X * Use str_free() when you are done with the value returned. X */ X Xstring_ty * Xos_pathname(path) X string_ty *path; X{ X static char *tmp; X static size_t tmplen; X static size_t ipos; X static size_t opos; X int c; X int found; X#ifdef S_IFLNK X char link[2000]; X int nbytes; X wlist loop; X string_ty *s; X#endif X X /* X * Change relative pathnames to absolute X */ X trace(("os_pathname(path = %08lX)\n{\n"/*}*/, path)); X trace_string(path->str_text); X if (path->str_text[0] != '/') X { X string_ty *cwd; X X cwd = os_curdir(); X assert(cwd); X path = str_format("%S/%S", cwd, path); X str_free(cwd); X } X else X path = str_copy(path); X if (!tmp) X { X tmplen = 200; X tmp = mem_alloc(tmplen); X } X X /* X * Take kinks out of the pathname X */ X ipos = 0; X opos = 0; X found = 0; X#ifdef S_IFLNK X wl_zero(&loop); X#endif X while (!found) X { X /* X * get the next character X */ X c = path->str_text[ipos]; X if (c) X ipos++; X else X { X found = 1; X c = '/'; X } X X /* X * remember the normal characters X * until get to slash X */ X if (c != '/') X goto remember; X X /* X * leave root alone X */ X if (!opos) X goto remember; X X /* X * "/.." -> "/" X */ X if (opos == 3 && tmp[1] == '.' && tmp[2] == '.') X { X opos = 1; X continue; X } X X /* X * "a//" -> "a/" X */ X if (tmp[opos - 1] == '/') X continue; X X /* X * "a/./" -> "a/" X */ X if (opos >= 2 && tmp[opos - 1] == '.' && tmp[opos - 2] == '/') X { X opos--; X continue; X } X X /* X * "a/b/../" -> "a/" X */ X if X ( X opos > 3 X && X tmp[opos - 1] == '.' X && X tmp[opos - 2] == '.' X && X tmp[opos - 3] == '/' X ) X { X opos -= 4; X assert(opos > 0); X while (tmp[opos - 1] != '/') X opos--; X continue; X } X X /* X * see if the path so far is a symbolic link X */ X#ifdef S_IFLNK X s = str_n_from_c(tmp, opos); X if (wl_member(&loop, s)) X { X fatal X ( X "symbolic link loop \"%s\" detected", X s->str_text X ); X } X nbytes = readlink(s->str_text, link, sizeof(link) - 1); X if (nbytes < 0) X { X /* X * probably not a symbolic link X */ X if X ( X errno != ENXIO X && X errno != EINVAL X && X errno != ENOENT X ) X nfatal("readlink(\"%s\")", s->str_text); X not_a_symlink: X str_free(s); X } X else X { X string_ty *newpath; X X if (nbytes == 0) X { X fatal X ( X "readlink(\"%s\") returned \"\"", X s->str_text X ); X } X link[nbytes] = 0; X X /* X * ignore auto-mounter temporary mount links, X * they will change with each mount. X */ X if (!strncmp(link, "/tmp_mnt/", 9)) X goto not_a_symlink; X X wl_append(&loop, s); X str_free(s); X if (link[0] == '/') X tmp[1] = 0; X else X { X while (tmp[opos - 1] != '/') X opos--; X tmp[opos] = 0; X } X newpath = X str_format X ( X "%s/%s/%s", X tmp, X link, X path->str_text + ipos X ); X str_free(path); X path = newpath; X ipos = 0; X opos = 0; X found = 0; X continue; X } X#endif X X /* X * keep the slash X */ X remember: X if (opos >= tmplen) X { X tmplen += 100; X tmp = mem_change_size(tmp, tmplen); X } X tmp[opos++] = c; X } X#ifdef S_IFLNK X wl_free(&loop); X#endif X str_free(path); X assert(opos >= 1); X assert(tmp[0] == '/'); X assert(tmp[opos - 1] == '/'); X if (opos >= 2) X opos--; X path = str_n_from_c(tmp, opos); X trace_string(path->str_text); X trace((/*{*/"}\n")); X return path; X} X X X/* X * NAME X * os_entryname - take path apart X * X * SYNOPSIS X * string_ty *os_entryname(string_ty *path); X * X * DESCRIPTION X * Os_entryname is used to extract the entry part X * from a pathname. X * X * RETURNS X * pointer to dynamically allocated string. X * X * CAVEAT X * Use str_free() when you are done with the return value. X */ X Xstring_ty * Xos_entryname(path) X string_ty *path; X{ X char *cp; X X trace(("os_entryname(path = %08lX) entry", path)); X trace_string(path->str_text); X cp = strrchr(path->str_text, '/'); X if (cp) X path = str_from_c(cp + 1); X else X path = str_copy(path); X trace_string(path->str_text); X trace(("return %08lX;\n", path)); X trace((/*{*/"}\n")); X return path; X} X X X/* X * NAME X * os_dirname - take path apart X * X * SYNOPSIS X * string_ty *os_dirname(string_ty *path); X * X * DESCRIPTION X * Os_dirname is used to extract the directory part X * of a pathname. X * X * RETURNS X * pointer to dynamically allocated string. X * A null pointer is returned on error. X * X * CAVEAT X * Use str_free() when you are done with the value returned. X */ X Xstring_ty * Xos_dirname(path) X string_ty *path; X{ X char *cp; X X trace(("os_dirname(path = %08lX)\n{\n"/*}*/, path)); X trace_string(path->str_text); X cp = strrchr(path->str_text, '/'); X if (cp) X { X if (cp > path->str_text) X path = str_n_from_c(path->str_text, cp - path->str_text); X else X path = str_from_c("/"); X } X else X path = os_curdir(); X trace_string(path->str_text); X trace(("return %08lX;\n", path)); X trace((/*{*/"}\n")); X return path; X} X X X/* X * NAME X * os_meter_grab - get metering snapshot X * X * SYNOPSIS X * void os_meter_grab(grab*); X * X * DESCRIPTION X * The os_meter_gram function is used to take a snapshot of metering X * information. X * X * RETURNS X * void X */ X Xtypedef struct grab grab; Xstruct grab X{ X double g_elapsed; X double g_cpu; X double g_io; X}; X Xstatic void os_meter_grab _((grab *)); X Xstatic void Xos_meter_grab(gp) X grab *gp; X{ X#ifdef HAVE_GETRUSAGE X struct rusage ru; X struct timeval tv; X struct timezone tz; X X int getrusage _((int, struct rusage *)); X int gettimeofday _((struct timeval *, struct timezone *)); X X if (getrusage(RUSAGE_CHILDREN, &ru)) X nfatal("getrusage"); X if (gettimeofday(&tv, &tz)) X nfatal("gettimeofday"); X gp->g_cpu = ru.ru_utime.tv_sec + ru.ru_utime.tv_usec * 1.0e-6; X gp->g_io = ru.ru_stime.tv_sec + ru.ru_stime.tv_usec * 1.0e-6; X gp->g_elapsed = tv.tv_sec + tv.tv_usec * 1.0e-6; X#else X struct tms buffer; X time_t n; X X n = times(&buffer); X gp->g_elapsed = n / (double)HZ; X gp->g_cpu = buffer.tms_cutime / (double)HZ; X gp->g_io = buffer.tms_cstime / (double)HZ; X#endif X} X X X/* X * NAME X * os_meter_ptime - print timing info X * X * SYNOPSIS X * void os_meter_ptime(double t, char *s, double elapsed); X * X * DESCRIPTION X * The os_meter_ptime function is used to print e representation of the X * time, in seconds, given in the `t' argument. If `elapsed' is >0, it is X * the elapsed time taken, for percentage figures. The `s' argument is a X * title string. X * X * RETURNS X * void X */ X Xstatic void os_meter_ptime _((double, char *, double)); X Xstatic void Xos_meter_ptime(t,s,e) X double t; X char *s; X double e; X{ X char buffer[32]; X char temp[32]; X long hour, min, sec, frac; X X frac = t * 1000 + 0.5; X sec = frac / 1000; X frac %= 1000; X min = sec / 60; X sec %= 60; X hour = min / 60; X min %= 60; X if (e > 0.0) X { X sprintf(temp, "(%.2f%%)", 100. * t / e); X sprintf(buffer, "%-4s%9s", s, temp); X s = buffer; X } X fprintf(stderr, "%2ld:%02ld:%02ld.%03ld %s\n", hour, min, sec, frac, s); X} X X X/* X * NAME X * os_meter_begin - start metering interval X * X * SYNOPSIS X * void os_meter_begin(void); X * X * DESCRIPTION X * The os_meter_begin function is used to start a metring interval. X * X * RETURNS X * void X */ X Xstatic grab os_meter_start; X Xvoid Xos_meter_begin() X{ X os_meter_grab(&os_meter_start); X} X X X/* X * NAME X * os_meter_end - end a metering interval X * X * SYNOPSIS X * void os_meter_end(void); X * X * DESCRIPTION X * The os_meter_end function is used to end a metering interval and print X * the metered information. X * X * RETURNS X * void X */ X Xvoid Xos_meter_end() X{ X grab end; X double elapsed; X double cpu; X double io; X X os_meter_grab(&end); X X elapsed = end.g_elapsed - os_meter_start.g_elapsed; X os_meter_ptime(elapsed, "elapsed", 0.0); X cpu = end.g_cpu - os_meter_start.g_cpu; X os_meter_ptime(cpu, "usr", elapsed); X io = end.g_io - os_meter_start.g_io; X os_meter_ptime(io, "sys", elapsed); X} X X Xstatic int os_pathconf_path_max _((char *)); X Xstatic int Xos_pathconf_path_max(path) X char *path; X{ X long result; X X#ifdef _PC_PATH_MAX X result = pathconf(path, _PC_PATH_MAX); X if (result < 0 && errno == EINVAL) X { X /* X * probably NFSv2 mounted X * assume is samer as root X */ X result = pathconf("/", _PC_PATH_MAX); X } X if (result < 0) X nfatal("pathconf(\"%s\", {PATH_MAX})", path); X#else X result = 1024; X#endif X return result; X} X X Xstatic int os_pathconf_name_max _((char *)); X Xstatic int Xos_pathconf_name_max(path) X char *path; X{ X long result; X X#ifdef _PC_NAME_MAX X result = pathconf(path, _PC_NAME_MAX); X if (result < 0 && errno == EINVAL) X { X /* X * probably NFSv2 mounted X * assume is samer as root X */ X result = pathconf("/", _PC_NAME_MAX); X } X if (result < 0) X nfatal("pathconf(\"%s\", {NAME_MAX})", path); X#else X#ifdef HAVE_LONG_FILE_NAMES X result = 255; X#else X result = 14; X#endif X#endif X return result; X} X X X/* X * NAME X * os_legal_path - test if path is legal X * X * SYNOPSIS X * int os_legal_path(string_ty *path); X * X * DESCRIPTION X * The os_legal_path function is used to test if each of the components of X * the given path are legal to the underlying operating system. X * X * RETURNS X * int: zero if it is an illegal path, nonzero it is a legal path. X */ X Xint Xos_legal_path(str) X string_ty *str; X{ X char *s; X char *ep; X int max; X X max = os_pathconf_path_max("."); X if (str->str_length < 1 || str->str_length > max) X return 0; X max = os_pathconf_name_max("."); X s = str->str_text; X for (;;) X { X ep = strchr(s, '/'); X if (!ep) X return (strlen(s) <= max); X if (ep - s > max) X return 0; X s = ep + 1; X } X} X X X#ifdef TIMING X Xstatic long os_totals_baseline; X Xvoid Xos_totals_start() X{ X struct tms buffer; X X os_totals_baseline = times(&buffer); X} X Xvoid Xos_totals() X{ X struct tms buffer; X time_t n; X double elapsed; X double t; X X error("timing totals..."); X n = times(&buffer); X elapsed = (n - os_totals_baseline) / (double)HZ; X os_meter_ptime(elapsed, "elapsed", 0.0); X t = buffer.tms_utime / (double)HZ; X os_meter_ptime(t, "usr", elapsed); X t = buffer.tms_stime / (double)HZ; X os_meter_ptime(t, "sys", elapsed); X t = buffer.tms_cutime / (double)HZ; X os_meter_ptime(t, "cusr", elapsed); X t = buffer.tms_cstime / (double)HZ; X os_meter_ptime(t, "csys", elapsed); X} X X#endif END_OF_FILE if test 24403 -ne `wc -c <'cook/os.c'`; then echo shar: \"'cook/os.c'\" unpacked with wrong size! fi # end of 'cook/os.c' fi if test -f 'doc/language.so' -a "${1}" != "-c" ; then echo shar: Will not clobber existing file \"'doc/language.so'\" else echo shar: Extracting \"'doc/language.so'\" \(24840 characters\) sed "s/^X//" >'doc/language.so' <<'END_OF_FILE' X.\" X.\" cook - file construction tool X.\" Copyright (C) 1990, 1991, 1992, 1993, 1994 Peter Miller. X.\" All rights reserved. X.\" X.\" This program is free software; you can redistribute it and/or modify X.\" it under the terms of the GNU General Public License as published by X.\" the Free Software Foundation; either version 2 of the License, or X.\" (at your option) any later version. X.\" X.\" This program is distributed in the hope that it will be useful, X.\" but WITHOUT ANY WARRANTY; without even the implied warranty of X.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the X.\" GNU General Public License for more details. X.\" X.\" You should have received a copy of the GNU General Public License X.\" along with this program; if not, write to the Free Software X.\" Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. X.\" X.\" MANIFEST: Reference Manual, Cookbook Lanuage Definition X.\" X.H 1 "Cookbook Language Definition" XThis chapter defines that language which cookbooks Xare written in. XWhile some of its properties are similar to C, Xdo not be misled. X.P XA number of sections appear within this chapter. X.AL X.LI XThe X.I "Lexical Analysis" Xsection describes what the words of the cookbook language look like. X.LI XThe X.I Preprocessor Xsection describes Xthe include mechanism Xand the conditional compilation mechanism. X.LI XThe X.I "Syntax Descriptions" Xsection describes how to read the syntax definitions Xin the following section. X.LI XThe X.I "Syntax and Semantics" Xsection describes Xhow words in the cookbook may be combined to form valid constructs X(the X.IR syntax ), Xand what these constructs Xmean (the X.IR semantics ). X.LE X.P XThe sections are laid out in the recommended reading order. X.SK X.H 2 "Lexical Analysis" XThe cookbook is made of a number of recipes, Xwhich are in turn made of words. XThis section describes what constitutes a word, and what does not. X.H 3 "Words and Keywords" XWords are made of sequences of almost any character, Xand are separated by white space (including end-of-line) or the Xspecial symbols. X.B Cook Xis always case sensitive Xwhen reading cookbooks. X.P XThe characters X.B ":;={}[]" Xare the special symbols, Xand are words in themselves, Xneeding no delimiting. X.P XIn addition to the special symbols, Xsome words, Xknown as X.IR keywords , Xhave special meaning to X.BR cook . XThe keywords are: X.TS Xcenter, tab(;); Xce ce ce ce. Xif;then;else;set Xloop;loopstop;fail;unsetenv X.TE XYou will meet the keywords in later sections. X.H 3 "Escape Sequences" XThe character X.B \e Xis the X.I escape Xcharacter. XIf a character is preceded by a X.B \e Xany specialness, Xif it had any, Xwill be removed. XIf it had no specialness it may have some added. X.P XThis means that, Xif you want to use X.B if Xas a word, Xrather than a keyword, Xat least one of its characters needs to be escaped, Xfor example X.BR \eif . X.P XThe escape sequences which are special are as follows. X.TS Xcenter, tab(;); Xcf(B) lw(2.2i). X\eb;The backspace character X\ef;The form feed character X\en;The newline or linefeed character X\er;The carriage return character X\et;The horizontal tab character X\e\fInnn\fP;T{ XA character with a value of X.IR nnn , Xwhere X.I nnn Xis an octal number of at most 3 digits. XT} X.TE XAn escaped end-of-line is totally ignored. XIt should be noted that a cookbook may not have any non-printing Xascii characters in it other than space, tab and end-of-line. X.H 3 "Quoting" XWords, and sections of words, may be quoted. XIf any part of a word is quoted it cannot be a keyword. X.P XThis means that, Xif you want to use X.B if Xas a word, rather than a keyword, Xat least one of its characters needs to be quoted, Xfor example X.BR "\&'if'" . X.P XBoth single X.RB ( ' ) Xand double X.RB ( \\" ) Xquotes are understood by X.BR cook , Xand one may enclose the other. XIf a quote is escaped it does not open or close a quote as it usually Xwould. X.P X.B Cook Xdoes not like newlines within quotes. XThis is a generally good heuristic for catching unbalanced quotes. X.H 3 "Comments" XComments are delimited on the left by X.BR /* , Xand on the right by X.BR */ , XIf the X.B / Xcharacter has been escaped or quoted, Xit doesn't introduce a comment. XComments may be nested. XComments may span multiple lines. XComments are replaced by one logical space. X.SK X.H 2 "Preprocessor" XThe preprocessor may be thought of as doing a little work before the X.I "Syntax and Semantics" Xsection has its turn. X.P XThe preprocessor is driven by X.IR "preprocessor directives" . XA preprocessor directive is a line Xwhich starts with a hash X.RB ( # ) Xcharacter. XEach of the preprocessor directives is described below. X.H 3 "include" XThe most common preprocessor directive is X.eB X#include "\f(CIfilename\fP" X.eE X.P XThis preprocessor directive is processed as if the contents Xof the named file had appeared in the cookbook, Xrather than the preprocessor include directive. X.P XThe most common use of the #include directive is to include Xsystem cookbooks. X.P XThe standard places to search are first any path specified with the X.B -Include Xcommand line option, Xand then X.I $HOME/.cook Xand Xthen X.IR /usr/local/lib/cook Xin that order. X.H 3 "include-cooked" XThis directive looks similar to the one above, Xbut do not be deceived. X.eB X#include-cooked \fIfilename\fP... X.eE XYou may name several filenames on the line, Xand they may be expressions. X.P XThe search path used for these files Xis the same as that used for other cooked files, Xsee the X.I search_list Xvariable and the X.I resolve Xbuilt-in function for more information. XThe order in which you set the X.I search_list Xand the the X.I #include-cooked Xdirectives is important. XAlways set the X.I search_list Xvariable first, Xif you are going to use it. X.P XFiles included in this way are checked, Xafter they have been read, Xto make sure they are up-to-date. XIf they are not, X.B cook Xbrings them up-to-date Xand then re-reads the cookbook and starts over. X.P XYou will only get a warning if the files are not found. XUsually, X.B cook Xwill either succeed in constructing them, Xin which case they will be present the second time around, Xor a fatal error will result from attempting to construct them. XNote that it is possible to go into an infinite loop, Xif the files are constantly out-of-date. X.P XThe commonest use of this construct Xis maintaining include file dependency lists Xfor source files. X.eB Xobj = [fromto %.c %.o [glob *.c]]; X X%.o: %.c X{ X [cc] [cc_flags] -c %.c; X} X X%.d: %.c X{ X c_incl -prefix "'%.o %.d: %.c'" -suffix "';'" X -nc -nc %.c > %.d; X} X X#include-cooked [fromto %.o %.d [obj]] X.eE XThis cookbook fragment shows how include file dependencies are maintained. XNotice how the \fI.d\fP files have a recipe to construct them, Xand that they are also included. X.B Cook Xwill bring them up-to-date if necessary, Xand then re-read the cookbook, Xso that it is always working with the current incude dependencies. X(The doubly nested quotes are to insulate the spaces Xand special characters from both X.B cook Xand the shell.) X.P XYou could use X.I "gcc -MM" Xif you prefer (you will need some extra shell script). XThe X.I c_incl Xprogram understands absent files better Xbut doesn't understand conditional compilation, Xand X.I gcc Xunderstands conditional compilation but Xgives fatal errors for absent include files. XWarning: XIf you are using X.I search_list Xyou X.B must Xuse X.IR c_incl . XGcc returns complete paths, Xwhich will result in X.B cook Xfailing to notice when Xan include file is copied from later in the seach list to earlier, Xand then modified. X.H 3 "include-cooked-nowarn" XThis directive is almost identical to the one above, Xbut no warning is issued for absent files. X.eB X#include-cooked-nowarn \fIfilename\fP... X.eE XYou may name several filenames on the line, Xand they may be expressions. X.H 3 "if" XThe #if directive may be used to conditionally pass tokens to Xthe syntax and semantics processing. XDirectives take the form X.eB X#if \fIexpression1\fP X\fIsomething1\fP X#elif \fIexpression2\fP X\fIsomething2\fP X#else X\fIsomething3\fP X#endif X.eE XThere may be any number of \f(CWelif\fP clauses, Xand the \f(CWelse\fP Xclause is optional. XOnly one of the X.I somethings Xwill be passed through. X.H 3 "ifdef" XThis directive takes a similar form to the \f(CWif\fP directive, Xbut with a different first line: X.eB X#ifdef \fIvariable\fP X.eE XThis is syntactic sugar for X.eB X#if [defined \fIsymbol\fP] X.eE XThis is of most use in bracketing \f(CW#include\fP directives. X.H 3 "ifndef" XThis directive takes a similar form to the \f(CWif\fP directive, Xbut with a different first line: X.eB X#ifndef \fIvariable\fP X.eE XThis is syntactic sugar for X.eB X#if [not [defined \fIsymbol\fP]] X.eE XThis is of most use in bracketing \f(CW#include\fP directives. X.H 3 "pragma" XThis is for the addition of extensions. X.H 4 "once" XThis directive is to ensure that include files in which it appears are included exactly once. X.P XThis directive has the form X.eB X#pragma once X.eE X.H 4 "unknown extensions" XAny extensions not recognised will be ignored. X.SK X.H 2 "Syntax Descriptions" XIn the syntax descriptions which follow Xthere are several meta symbols, Xdefined as follows. X.TS Xcenter, tab(;); Xcf(B) lw(2.5i). X\&=;A definition symbol. X\&|;The alternative symbol. X\&.;The end-of-production symbol. X\&/*\fItext\fB*/;This is a comment. X\&'\fItext\fB';T{ XThe X.I text Xis a literal terminal symbol of the grammar being defined. XT} X.TE X.P XLike all real languages, Xthe format is free form, Xno columns or end-of-line are significant. X.P XAs an example, the syntax description format is described using itself. X.eB Xsyntax X = /* empty */ X | syntax production X . X.eE XA syntax definition may consist of zero or more productions. X.eB Xproduction X = name '\fB=\fP' term '\fB.\fP' X . X.eE XA production names a non-terminal symbol of the grammar being defined Xon the left, Xand its expansion on the right. X.eB Xterm X = factor X | term \fB'|'\fP term X . X.eE XA term may consist of a factor; Xor Xa term may consist of zero or more of the above terms Xseparated by X.I alternative Xsymbols. X.eB Xfactor X = /* empty */ X | factor name X | factor literal X . X.eE XA factor consists of Xzero or more symbol names (terminal or non-terminal) Xor literals in a row. X.P XA symbol is terminal if it is not named on the left-hand-side of a production, Xor it is a literal. X.SK X.H 2 "Syntax and Semantics" X.H 3 "Overall Structure" XThe general form of the cookbook is defined as X.eB Xcookbook X = /* empty */ X | cookbook statement X . X.eE XA cookbook is defined as a sequence of statements. XEach statement statement is executed. XFor a definition of what it means when a statement is executed, Xsee the individual statement definitions. X.P XThe nonterminal symbol X.I statement Xwill be defined in the sections below. X.P XPlease note that a statement is not always evaluated when is is read, Xbut at specific, well defined times. X.H 3 "The Compound Statement" XA nonterminal symbol which will be referred to below is the X.I compound_statement Xsymbol, Xdefined as follows: X.eB Xcompound_statement X = '\fB{\fP' statements '\fB}\fP' X . Xstatements X = /* empty */ X | statements statement X . X.eE XThe compound statement may be used anywhere a statement may be, Xand in particular X.eB Xstatement X = compound_statement X . X.eE X.H 3 "Variables and Expressions" X.B Cook Xprovides variables to the user to simplify things. X.H 4 "The Assignment Statement" XIt is possible to assign to variables with the following statement. X.eB Xstatement X = expr '\fB=\fP' exprs '\fB;\fP' X . X.eE XWhen this statement is executed, Xthe variable whose name the left hand expression evaluates to will be Xassigned the value that the right hand expression list evaluates to. X.H 4 "Expressions" XMany definitions make reference to the X.IR expr, X.I elist Xand X.I exprs Xnonterminal symbols. XThese are defined as follows. X.P XThe X.I elist Xis a list of at least one expression, Xwhereas the X.I exprs Xis a list of zero or more expressions. X.eB Xelist X = expr X | elist expr X . Xexprs X = /* empty */ X | exprs expr X . X.eE X.P XAn expression is composed of variable references, Xfunction invocations, Xwords, Xor concatenation of expressions. XThe concatenation is implied by abutting the two parts of the expression Xtogether, Xe.g.: "\f(CW[fred]>thing\fP" is an Xindirection on X.I fred Xconcatenated with the literal word "\f(CW>thing\fP". X.eB Xexpr X = WORD X | '\fB[\fP' elist '\fB]\fP' X | expr \fIcat\fP expr X . X.eE X.P XWhen an X.BI [ elist ] Xexpression is evaluated, Xthe X.I elist Xis evaluated first. XIf the result is a single word, then a variable of that name is Xsearched for. XIf found the value of an expression of this form is the value of the variable. X.P XIf there is no variable of the given name, Xor the X.I elist Xevaluated to more than one word, Xthe first word is taken to be a built-in function name. XIf there is no function of this name it is an error. X.P XThe X.I cat Xoperator works as one would expect, Xjoining the last word of the left Xexpression and the first word of the right expression together, Xand otherwise leaving the order of the expressions alone. XOne usually uses the trivial case of single word expressions. X.H 3 "Recipes" XA number of forms of X.I statement Xare concerned with telling X.B cook Xhow to cook things. XThere are three forms, Xthe X.I explicit Xrecipe, Xthe X.I implicit Xrecipe, Xand the X.I ingredients Xrecipe. X.H 4 "The Explicit Recipe Statement" XThe explicit recipe has the form X.eB Xstatement X = elist '\fB:\fP' exprs flags compound_statement X . X.eE XThe target(s) of the recipe are to the left of the colon, Xand the ingredients, if any, are to the right. XThe statements, usually commands, to perform to cook the target(s) Xare contained in the compound statement. XThe expressions are only evaluated into words when the recipe is Xinstanciated. X.P XThe \fIflags\fP are defined as follows. X.eB Xflags X = /* empty */ X | '\fBset\fP' words X . X.eE XA number of flags may be used X.VL 1i X.LI clearstat XThe last-modified time of the files named in executed commands will be Xremoved from the last-modified time cache. XThis is essential for commands such as X.IR rm (1) Xand X.IR mv (1). X.LI noclearstat XDo not clear entries from the last-modified tim ecache. XThis is usually the default. X.LI default XIf no targests are specified on the command line, Xthe first recipe with the X.I default Xflag will be used. XNot meaningful for implicit recipes. X.LI nodefault XIf no targests are specified on the command line, Xand there are no recipes with the X.I default Xflag set, Xthe first recipe X.B without Xthe X.I nodefault Xflag will be used. XNot meaningful for implicit recipes. X.LI errok XIf the X.I errok Xflag is specified, Xthe commands within the actions bound to the recipe must always be successful. X.LI noerrok XExit status from commands will be ignored. XThis is usually the default. X.LI fingerprint XFile fingerprints are used to supplement last-modified time Xinformation about files, Xwhich is how X.I cook Xdetermines if a file is out-of-date and needs to be cooked. XIf a file appears to have changed, Xfind the last-modified time, Xit is fingerprinted, Xand the fingerprint compared with what it was in the past. XThe file has change if and only if the fingerprint has also changed. XA cryptographically strong hash is used, Xso the chance of a file edit producing an identical fingerprint is Xless than 1 in 2**200. XFingerprinting is disabled by default. X.LI nofingerprint XDo not use file fingerprinting. XThis is usually the default. X.LI forced XIf the X.I forced Xflag is specified, Xthe actions bound to the recipe will always be evaluated. X.LI noforced XIf the X.I noforced Xflag is specified, Xthe actions bound to the recipe will be evaluated Xwhen the recipe is logically out-of-date. XThis is usually the default. X.LI precious XIf the X.I precious Xflag is specified, Xif the actions bound to the recipe fail, Xthe targets of the recipe will not be deleted. X.LI noprecious XIf the X.I noprecious Xflag is specified, Xif the actions bound to the recipe fail, Xthe targets of the recipe will be deleted. XThis is usually the default. X.LI silent XIf the X.I silent Xflag is specified, Xthe command within the actions bound to the recipe will not be echoed. X.LI nosilent XCommands will be echoed. XThis is usually the default. X.LI wildpath XIf the X.I wildpath Xflag is specified in an implicit recipe, Xleading path on pattern matches will be prepended to reconstructions. X.LI nowildpath XLeading path will not be prepended to reconstructions. XThis is usually the default. X.LI meter XIf the X.I meter Xflag is specified, Xa summary of the CPU usage by the commands within this recipe Xwill be printed after each command. XThe silent options override this option. X.LI nometer XDo not meter commands. XThis is usually the default. X.LI update XThis option causes X.B cook Xto check the last-modified time of the targets of recipes, Xand updates them if necessary, Xto make sure they are consistent with (younger than) the last-modified Xtimes of the ingredients. XThis results in more system calls, Xand can slow things down on some systems. X.LI noupdate XDo not update the file last-modified times after performing Xthe body of a recipe. XThis is usually the default. X.LI stripdot XThis option causes X.B cook Xto remove leading "./" prefixes from filenames. XThis is usually the default. X.LI nostripdot XThis option causes X.B cook Xto leave leading "./" prefixes on filenames. X.LE X.P XEach flag may also be specified in the negative, Xby adding a "no" prefix, Xto override any existing positive default setting. XThere is a strict precedence defined for the various levels of flag setting, Xsee the end of the "How Cook Works" chapter for details. X.H 4 "The Implicit Recipe Statement" XImplicit recipes are distinguished from explicit recipes in that Xand implicit recipe has a target with a '\fB%\fP' character in it. X.H 5 "Simple Form" X.P XIn general the user will rarely need to use the implicit recipe Xform, as there are a huge range of implicit recipes already Xdefined in the system default recipes. X.P XAn example of this recipe form is X.eB X%: %.Z X { X uncompress %; X } X.eE XThis recipe tells X.B cook Xhow to use the X.IR uncompress (1) Xprogram. X.H 5 "Complex Form" XThe implicit recipe recipe has a second form X.eB Xstatement X = elist '\fB:\fP' exprs1 '\fB:\fP' exprs2 flags compound_statement X . X.eE XIn this form, Xthe ingredients specified in X.I exprs1 Xare used to determine the applicability of the recipe; Xif these are all constructable then the recipe will be applied, Xif any are not constructable then the recipe will not be applied. XIf the recipe is applied, Xthe ingredients specified in X.I exprs2 Xare required to be constructable. XThe X.I exprs2 Xsection is known as the X.I "forced ingredients" Xsection. X.P XAn example of this is the C recipe X.eB X%.o: %.c: [collect c_incl %.c] X { X cc -c %.c; X } X.eE XThis recipe is applied if the X.I %.c Xfile can be constructed, Xand is not applied if it cannot be constructed. XThe include dependencies are only expressed if the recipe Xis going to be applied; Xbut if they are expressed, they X.I must Xbe constructable. XThis means that absent include files generate an error. X.P XThe naive form of this recipe X.eB X%.o: %.c [collect c_incl %.c] X { X cc -c %.c; X } X.eE Xwill attempt to apply the X.I c_incl Xcommand before the X.I %.c Xfile is guaranteed to exist. XThis is because the X.I exprs2 Xis performed after the X.I exprs1 Xall exist (because they are constructable, they have been constructed). XIn this naive form, Xabsent include files result in the recipe not being applied. X.H 4 "The Ingredients Recipe Statement" XThe ingredients recipe has the form X.eB Xstatement X = elist '\fB:\fP' elist '\fB;\fP' X . X.eE XThe target(s) of the recipe are to the left of the colon, Xand the prerequisites are to the right. XThere are no statements to perform to cook the targets Xof this recipe, it is simply supplementary to any other recipe, Xusually an implicit recipe. X.P XThe expressions are only evaluated into words when the recipe is instanciated. X.H 3 "Commands" XCommands may take several forms in X.BR cook . XThey all have one thing in common; they execute a command. X.eB Xstatement X = command X . X.eE X.H 4 "The Simple Command Statement" XThe simplest command form is X.eB Xcommand X = simple_command X . Xsimple_command X = elist flags '\fB;\fP' X . X.eE XWhen executed, Xthe X.I elist Xis evaluated into a word list Xand used as a command to be passed to the operating system. XWhile this is usually sufficient, Xsome programs, Xnotably X.IR newgrp (1), Xrequire slightly more. X.P XThe X.I flags Xare those which may be specified Xin the explicit recipe statement. XThey have a higher precedence than either the X.I set Xstatement or the Xrecipe flags. X.H 4 "The Data Command Statement" XFor programs which require X.I stdin Xto be supplied by X.B cook Xto perform their functions, Xthe data command statement has been provided. X.eB Xcommand X = simple_command X '\fBdata\fP' X expr X '\fBdataend\fP' X . X.eE XIn this form, Xthe X.I expr Xis evaluated and used as input to the Xcommand. XBetween the X.B data Xand X.B dataend Xkeywords the definition of the special symbols and whitespace change. XThere are only two special symbols, X.B [ Xand X.BR ] , Xto allow functions and variable references to appear in the expression. XIn addition, Xwhitespace ceases to have its usual specialness; Xit is handed to the command, Xinstead. X.P XThe X.B data Xkeyword must be the last on a line, Xwhitespace after the X.B data Xkeyword up to and including end-of-line, Xwill X.I not Xbe given to the command. X.P XThe X.B dataend Xkeyword must appear alone on a line, Xoptionally surrounded by whitespace; Xit is is not alone, Xit is not a X.B dataend Xkeyword and will not terminate the expression. X.P XAn example of this may be useful. X.eB X/usr/fred/%: % X { X newgrp fred; X data X cp % /usr/fred/% X dataend X } X.eE XIf the directory X.I /usr/fred Xhas read-only permissions for others, Xand group write permissions, Xand belonged to group X.IR fred , Xand you were a member of group X.IR fred , Xthe above implicit recipe could be used to copy the file. X.H 4 "The Set Statement" XIt is possible to override the defaults Xused by X.B cook Xor even those specified by the X.I COOK Xenvironment variable, Xby using the X.I set Xstatement. X.eB Xstatement X = '\fBset\fP' words '\fB;\fP' X . X.eE XThe flag values are those mentioned in the X.I flags Xclause of the explicit recipe statement. XMany command-line options have equivalent flag settings. XThere is no ``unset'' statement, Xto restore the default settings, Xbut it is possible to set flags the other way, Xby adding or removing the ``no'' prefix. X.P XTo set flags for individual recipes, Xuse the X.I flags Xclause of the recipe statements. X.P XTo set flags for individual commands, Xuse the X.I flags Xclause of the command statements. X.H 5 "Examples" XFingerprinting is not used by default, Xbecause it can cause a few surprises, Xand takes a little more CPU. XTo enable fingerprinting for you project, Xplace the statement X.eB Xset fingerprint; X.eE Xsomewhere in your X.I Howto.cook Xfile. XThe X.B -No_FingerPrint Xcommand line option can still override this, Xbut the default behaviour will be to use fingerprints. X.P XTo prevent echoing of commands as they are executed, Xplace X.eB Xset silent; X.eE Xsomewhere in your X.I Howto.cook Xfile. XThe X.B -NoSilent Xcommand line option can still override this, Xbut the default behaviour will be not to echo commands. X.H 4 "The Fail Statement" X.B Cook Xcan be forced to think that a recipe has failed Xby the uses of the X.B fail Xstatement. X.eB Xstatement X = '\fBfail\fP' '\fB;\fP' X . X.eE XThis is hugely useful when programs do not return a useful exit Xstatus, Xbut X.I do Xfail to produce the goods. X.P XAnother variation of this statement is X.eB Xstatement X = '\fBfail\fP' '\fBbacktrack\fP' '\fB;\fP' X . X.eE XThis enables you to write a recipe which will succeed if all of the ingredients are up-to-date, Xbut cause X.B cook Xto backtrack if any of the ingredients are out-of-date. XIt is useful with some software configuration management systems. X.H 3 "Flow Control" XThis section details statement forms which the casual user will never need. X.H 4 "The If Statement" XThe if statement has one of two forms. X.eB Xstatement X = '\fBif\fP' expr '\fBthen\fP' statement X | '\fBif\fP' expr '\fBthen\fP' statement '\fBelse\fP' statement X . X.eE XIn nested if statements, Xthe X.B else Xwill bind to the closest X.BR else -less X.BR if . X.P XAn expression is false if and only if all of its words are null or it Xhas no words. X.H 4 "The Loop and Loopend Statements" XLooping is provided for in X.B cook Xby the generic infinite loop construct defined below. XA facility is provided to break out of a loop at any point. X.eB Xstatement X = '\fBloop\fP' statement X | '\fBloopstop\fP' '\fB;\fP' X . X.eE XThe statement following the X.B loop Xdirective is executed repeatedly forever. XThe X.B loopstop Xstatement is only semantically valid within the scope of a X.B loop Xstatement. END_OF_FILE if test 24840 -ne `wc -c <'doc/language.so'`; then echo shar: \"'doc/language.so'\" unpacked with wrong size! fi # end of 'doc/language.so' fi echo shar: End of archive 14 \(of 19\). cp /dev/null ark14isdone MISSING="" for I in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 ; do if test ! -f ark${I}isdone ; then MISSING="${MISSING} ${I}" fi done if test "${MISSING}" = "" ; then echo You have unpacked all 19 archives. rm -f ark[1-9]isdone ark[1-9][0-9]isdone else echo You still need to unpack the following archives: echo " " ${MISSING} fi ## End of shell archive. exit 0