summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/ctangleboot.cin
AgeCommit message (Collapse)Author
2023-12-02[CWEB] New release 4.11.Andreas Scherer
This commit rounds up the line of changes for CWEB 4.11. Major changes since CWEB 4.10: * Factor out 'cwebacromac.tex' with hypertext macros * Support for LuaTeX as backend engine * Consistent formatting of terminal output in error situations * Suppress reference to 'l. 0' in error messages * Updates in 'cwebman.tex' git-svn-id: svn://tug.org/texlive/trunk@69017 c570f23f-e606-0410-a88d-b1316a301751
2023-11-18[CWEB] Use zero-initialisation.Andreas Scherer
This trick works, because 'ignore' and 'NULL' are in fact '0'. git-svn-id: svn://tug.org/texlive/trunk@68894 c570f23f-e606-0410-a88d-b1316a301751
2023-09-24[CWEB] Avoid shadow variables.Andreas Scherer
There are far too many single-character variables around. Sigh! (See also https://github.com/ascherer/mmix/commit/ed0c894d09df3b35479fdd18c8f5564f0b8bf691 for a similar situation in MMIX, where such global (sic!) variables weren't even put in the index across module borders.) git-svn-id: svn://tug.org/texlive/trunk@68358 c570f23f-e606-0410-a88d-b1316a301751
2023-09-20[CWEB] Factor out cwebacromac.tex.Andreas Scherer
Extract common macros from cwebmac.tex and the PDF variants of the CTWILL macros. Update cwebman.tex accordingly. Fixes in CWEB code: - Consistent formatting of terminal output in cases of error - Revert fputs back to printf - Add curly braces for progress report (harmless glitch in CWEB 2.0) git-svn-id: svn://tug.org/texlive/trunk@68327 c570f23f-e606-0410-a88d-b1316a301751
2023-08-19[CWEB] New release 4.10.Andreas Scherer
This is a major update for CWEB 4.9 from May 2023. The base package received fixes, internal changes, and significant revisions: Fixes: * Fix issue #43: 'out_buf' overflow on malign user input - Handle border case from bug report - Discard rest of input lines exceeding 'buf_size' characters - Purge 'ungetc' from the TeX part as well * Fix typo in 'examples/wordtest.w' (reported by DEK) * 'Ilk' is of type 'eight_bits' * Avoid over-/underflow of section depth with malicious user input Internal changes: * Unroll 'init_p' helper function in COMMON - it is used for CWEAVE only (and CTWILL downstream) * Match 'common.w' and 'common.h' - Reshuffle declarations and some code sections - Add starred section titles * Demote all starred sections in 'common.w' (single star) * Code cleanup - Make 'pop_level' a simple macro in CWEAVE - Use structure assignment (as in CTANGLE) - More compact 'stack' handling - Make use of type 'mode' - Purge a few 'goto' statements (and add some others) - Replace some 'sprintf' with 'snprintf' - Syntactic sugar for functional macros - Straighten 'byte_start' arithmetic - Desolve former section 19 of CWEAVE with internal array sizes - Hide 'print_text' analytics function from C compiler with DEBUG - Streamline 'phase_two' of CTANGLE - Refurbish 'phase_three' of CWEAVE * Insert blank line after '\ch' in TeX output (cf. CWEB 3.0) Macro changes * Cleanup some '\acro' macros in 'cwebmac.tex' Also the CWEBbin package received updates and amendments: Preparation: * Fix a bug in 'twinxmac.tex' (3rd patch file applied in 'cwebbin.spec') * Apply a 5th patch file to adapt CTWILL macros to CWEB 4.9/4.10 Special formatting: * Format 'common.w' with CTWILL using 'comm-mini.ch' * Format 'ctwill.w' with HiTeX using 'proofmac.tex' and 'ctwill-hint.ch' * New 'pdfproofmac.tex' for use with HiTeX and pdfTeX and XeTeX - pdfctwimac.tex will no longer work with HiTeX * Add 'proofsort' script in addition to 'refsort' program * Minor improvements in all pdf macros TeX Live: * CTWILL in TeX Live uses 'kpse_find_file' to look up 'bux' files * Slightly extend arrays in 'ctwill' and 'refsort' for TeX Live * Max out 'max_refs' for CWEAVE/CTWILL * Add 'ctwill.test' for TeX Live Revise formatted sources: * e.g., 'twinx' * 'ctwill' in all its incarnations git-svn-id: svn://tug.org/texlive/trunk@67978 c570f23f-e606-0410-a88d-b1316a301751
2023-08-13[CWEB] Move 'print_stats' prototype in common.h.Andreas Scherer
It is used in 'wrap_up'. Also, add a comment for 'cb_show_banner'. git-svn-id: svn://tug.org/texlive/trunk@67906 c570f23f-e606-0410-a88d-b1316a301751
2023-08-09[CWEB] Purge single-use macro.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67855 c570f23f-e606-0410-a88d-b1316a301751
2023-08-07[CWEB] Code cleanup in COMMON and CTANGLE.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67830 c570f23f-e606-0410-a88d-b1316a301751
2023-08-02[CWEB] Replace 'sprintf' with 'snprintf'.Andreas Scherer
Apple's XCode 14 (Clang) issues deprecation warnings for the 'sprintf' system function (from <stdio.h>) when used with C++. As I am compiling CWEB as C++ code (locally, not in TeX Live), I became aware of this possible future issue. While common.w diligently checks user-provided file names for possible buffer overflows before invoking 'sprintf' (sections 77--79), I replace the uses of 'sprintf' in ctangle.w and cweave.w and cweav-twill.ch with the safer 'snprintf' alternative. git-svn-id: svn://tug.org/texlive/trunk@67794 c570f23f-e606-0410-a88d-b1316a301751
2023-07-30[CWEB] Straighten 'byte_start' arithmetic."Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67770 c570f23f-e606-0410-a88d-b1316a301751
2023-07-29[CWEB] Syntactic sugar.Andreas Scherer
See 'too_long()' macro in common.w. git-svn-id: svn://tug.org/texlive/trunk@67762 c570f23f-e606-0410-a88d-b1316a301751
2023-07-29[CWEB] Ilk is of type eight_bis.Andreas Scherer
See signatures of id_lookup and names_match. git-svn-id: svn://tug.org/texlive/trunk@67760 c570f23f-e606-0410-a88d-b1316a301751
2023-07-28[CWEB] Format 'common' with 'ctwill'.Andreas Scherer
$ ctie -m common-twill.w common.w comm-{w2c,mini}.ch $ mv common-twill.w common.w $ ctwill -f -lpdf common (twice) $ pdftex common $ ctwill-refsort < common.ref > common.sref $ pdftex common TODO: Study the application of 'ctwill-twinx' and create a general index for COMMON and CTWILL. git-svn-id: svn://tug.org/texlive/trunk@67749 c570f23f-e606-0410-a88d-b1316a301751
2023-07-26[CWEB] Purge 'init_p'.Andreas Scherer
This helper function had a non-trivial implementation in CWEAVE only. The extra stuff for CTWILL is moved to 'init_node' with special provisions for the 'name_dir' pointer. git-svn-id: svn://tug.org/texlive/trunk@67734 c570f23f-e606-0410-a88d-b1316a301751
2023-07-22[CWEB] Purge empty line in comm-w2c.h.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67701 c570f23f-e606-0410-a88d-b1316a301751
2023-07-21[CWEB] Match common.w with common.h.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67688 c570f23f-e606-0410-a88d-b1316a301751
2023-07-13[CWEB] Merge 'cur_state' into 'stack'.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67618 c570f23f-e606-0410-a88d-b1316a301751
2023-06-21[CWEB] Move variables to better placesAndreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@67424 c570f23f-e606-0410-a88d-b1316a301751
2023-06-20[CWEB] Use 'kpse_find_file' for '*.bux' files.Andreas Scherer
In addition to '*.aux' files that CTWILL creates dynamically on the first run ("Prime the pump"), it uses several '*.bux' files to resolve external definitions, e.g., in other CWEB modules or in system headers. The '*.aux' file(s) are always created in the "current" directory, but the auxiliary '*.bux' file(s) can reside elsewhere in the file system. Just like other '@i'nclude files, these '*.bux' files can be addressed through the CWEBINPUTS environment variable. git-svn-id: svn://tug.org/texlive/trunk@67416 c570f23f-e606-0410-a88d-b1316a301751
2023-05-15[CWEB] Release 4.9.Andreas Scherer
This commit bumps the version number to 4.9. And it reverts a few occurrences of '\ifacro' as synonym for '\ifpdf'. All other changes since CWEB 4.8 were committed as rolling releases. git-svn-id: svn://tug.org/texlive/trunk@67119 c570f23f-e606-0410-a88d-b1316a301751
2022-08-20[CWEB] Add option '+u' for CTANGLE.Andreas Scherer
Option 'ctangle +u' extends the transliteration mechanism for ``poor man's UTF-8'. Instead of extending the 'translit' table (or replacing it with a dynamic data structure), CTANGLE skips all but the last of a sequence of high-bit bytes representing a single UTF-8 character. Only the last high-bit byte is used as the index into 'translit' as before. Example: In ``classic ASCII'', the German word 'grün' was transformed into 'gruen' with the transliteration '@l fc ue' (from the Western European codepage ISO/IEC 8859-1; see file cweb_ecma94.w for context). With UTF-8 encoded input and 'ctangle +u', the first (starter) byte 'c3' (1100.0011) is skipped and the second (continuing) byte 'bc' is used to look up the transliteration for 'ü' (latin small letter u with diaeresis), so '@l bc ue' can be used to get 'gruen' in the C output. Note that this is not a general UTF-8 transliteration because there are tons of possible collisions, e.g., '¼' (vulgar fraction one quarter) is 'c2 bc' in UTF-8 and would be transformed into 'ue' as well. git-svn-id: svn://tug.org/texlive/trunk@64157 c570f23f-e606-0410-a88d-b1316a301751
2022-06-05[CWEB] Release 4.8.Andreas Scherer
This new release provides the following features: * @<Code sections@> can be used freely in any #if -- #elif -- #else -- #endif preprocessor branches without bashing the debugger * The GCC compiler can be invoked with option -Wimplicit-fallthrough=2 on all CWEB code modules and will acknowledge /* fall through */ comments in the tangled C code * Simple C casts like '(double)x' are formatted with non-breaking small spaces as '(double)\,x' in the woven TeX output * The HINT boolean macros are now in lowercase (as in ifhint.tex) * Comma-separated lists of variable declarations are formatted in accordance with function parameter lists and enumerations, i.e., comma is handled in math-mode with associated small spacing and it fixes these bugs: * Section @<Preprocessor definitions@> isn't overprinted (in PDF) * Trivial CWEB code is formatted correctly (issue #36) * Nested type definitions are recognized (issue #34) Major remaining bug (as of CWEB 4.3.1): * Issue #38 as described earlier git-svn-id: svn://tug.org/texlive/trunk@63490 c570f23f-e606-0410-a88d-b1316a301751
2022-03-10[CWEB] Make 'fall thru' comments active.Andreas Scherer
This is specific for GCC, but totally harmless for any other C compiler: GCC accepts 'fall thru' comments from the CWEB sources with its option '-Wimplicit-fallthrough=2', when we push these comments over to the tangled C code. git-svn-id: svn://tug.org/texlive/trunk@62584 c570f23f-e606-0410-a88d-b1316a301751
2022-02-19[CWEB] Permit indentation of preprocessing directives.Andreas Scherer
The C processor allows whitespace before and after the '#' of preprocessing directives, e.g., some MetaPost code uses this feature. In order to permit more liberal code layout, we only expect the '#' to be the first character in the buffer, followed by some optional whitespace. CWEB takes care that 'id_first' is the first non-whitespace character in the 'buffer' (and 'id_loc' is the first character _after_ the directive name). git-svn-id: svn://tug.org/texlive/trunk@62084 c570f23f-e606-0410-a88d-b1316a301751
2022-02-18[CWEB] Remove redundancy.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@62068 c570f23f-e606-0410-a88d-b1316a301751
2022-02-18[CWEB] Avoid preprocessor calamities.Andreas Scherer
Trying to fix all loopholes in weird stuff like https://github.com/ascherer/cweb/blob/cweb-4.8-dev/if.w by repeating '#line' directives after all '#elif', '#else', and '#endif' preprocessor statements. In almost all cases this information is redundant, but in the past years people have come up with the idea to jump to '@<code sections@>' in '#if' blocks. git-svn-id: svn://tug.org/texlive/trunk@62066 c570f23f-e606-0410-a88d-b1316a301751
2022-02-15[CWEB] Rebuild the CWEB boot sources.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@62035 c570f23f-e606-0410-a88d-b1316a301751
2022-02-14[CWEB] Add '#line' after '#endif'.Andreas Scherer
Some people incorporate '@<Section code@>' in preprocessor #if-blocks. (AFAIKS, DEK did this exactly _once_ in his 'reflect.w' example code, but never in any larger system program.) This adds material (lines of code) in the ctangle'd C code wrapped in '#line' directives for the benefit of the compiler/debugger/w.h.y. Depending on the #if-condition, the #line directives in the #if-block get eliminated and the resulting status from previous #line directives kicks the compiler (__LINE__ and possibly __FILE__) and the debugger (e.g., gdb, MSVS) off the track. git-svn-id: svn://tug.org/texlive/trunk@62021 c570f23f-e606-0410-a88d-b1316a301751
2022-02-05[CWEB] Release 4.7.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@61893 c570f23f-e606-0410-a88d-b1316a301751
2021-12-26[CWEB] New release 4.6.Andreas Scherer
Major changes since CWEB 4.5: * Restore '\T' macro backward compatibility. CWEB 4.3 introduced a major change in the '\T' macro to allow C++ 'hex exponent' notation (e.g., 0x1FFFFp10). This made CWEAVE/CTWILL mutually incompatible with non-matching versions of their set of macros and v.v. This release tries to reestablish the standard behavior at least for numeric constants. Of course, 'old' CWEAVE/CTWILL won't deliver on 'hex exponents' in the CWEB input, but those should be rare anyway. * Restore 'classic' PDF page dimensions. Heiko's PDF files of 2014 used 'Executive' page dimensions, i.e., 7.5in times 10in. C/WEB's internal inch values suggest to use those plus a 0.5in border on each side. * Revert meaning of option 'c'. Option 'c' is OFF by default to avoid spurious entries in build.log. * 'squash'/'reduce' have been straightened out for k=1,..,4. * Code beautifications for 'make fullmanual'. * Code cleanup for internal reasons. * Cleanup in 'prod.w' (indentation et al.). * New 'prod-cweave.w' (along 'prod-twill.w') for material from CWEBbin. * Fixes for option '-o' (didn't work as advertised in border cases). * New signature for the 'make_ministring' function in CTWILL. git-svn-id: svn://tug.org/texlive/trunk@61411 c570f23f-e606-0410-a88d-b1316a301751
2021-10-11[CWEB] Pre-release candidate 2 for CWEB 4.6.Andreas Scherer
When the CWEB programs are called with option '-c' (the default), no intermediate output files are created at all. After thoroughly testing these programs, I'll prepare the final release of CWEB 4.6 in the coming weeks (months). git-svn-id: svn://tug.org/texlive/trunk@60728 c570f23f-e606-0410-a88d-b1316a301751
2021-09-16[CWEB] Pre-release of version 4.6.Andreas Scherer
This is a service update due to general demand: * Option 'c' is OFF by default to avoid spurious entries in build.log. * 'squash'/'reduce' have been straightened out for k=1,..,4. * Code beautifications for 'make fullmanual'. * Code cleanup for internal reasons. * Cleanup in 'prod.w' (indentation et al.). * New 'prod-cweave.w' (along 'prod-twill.w') for material from CWEBbin. * Fixes for option '-o' (didn't work as advertised in border cases). * New signature for the 'make_ministring' function in CTWILL. git-svn-id: svn://tug.org/texlive/trunk@60519 c570f23f-e606-0410-a88d-b1316a301751
2021-07-14[CWEB] New release 4.5.Andreas Scherer
This is a service release for CWEB 4.0. * Upstream CWEB 4.5 was reviewed with the 'splint' utility. This resulted in lots of cast changes and a few code improvements. * All 'length' variables are retyped to 'size_t'. * <stdbool.h> is replaced by <kpathsea/simpletypes.h> to keep CWEB compatible with antique systems that still support TeX Live. git-svn-id: svn://tug.org/texlive/trunk@59926 c570f23f-e606-0410-a88d-b1316a301751
2021-06-06[CWEB] New release 4.4.Andreas Scherer
This is yet another service release for CWEB 4.0. * Upstream CWEB 4.4 has been reset to the original buffer sizes of CWEB 3.64c. These are now also used in stand-alone CWEBbin. CWEB for TeX Live uses extended/maxed-out buffer settings. * A few minor typographical bugs were fixed. * Tons of minutiae were addressed in the 'fullmanual' documents. git-svn-id: svn://tug.org/texlive/trunk@59486 c570f23f-e606-0410-a88d-b1316a301751
2021-05-03[CWEB] New release 4.3.1.Andreas Scherer
This release is almost the same as CWEB 4.3 of 2021-04-16, but * it fixes the indexing bug in CWEAVE/CTWILL that got retracted * it extracts and collects all additions made in CTWILL, so that the section numbers of CWEAVE are retained up to §272 and new material is described in the (first) appendix, including the CTWILL user manual * it provides fully revised and (hopefully) corrected mini-indexes for CTWILL, if it is processed by itself (to be published in package 'knuth-pdf' on CTAN) git-svn-id: svn://tug.org/texlive/trunk@59061 c570f23f-e606-0410-a88d-b1316a301751
2021-05-02Revert "[CWEB] New release 4.3."Andreas Scherer
This reverts commit 3ccac2a7d0f4a19dde861c6f4c178e853d90f0cc. CWEB 4.3 is seriously broken. git-svn-id: svn://tug.org/texlive/trunk@59048 c570f23f-e606-0410-a88d-b1316a301751
2021-04-16[CWEB] New release 4.3.Andreas Scherer
This release introduces new features to CWEB 4: * Former option '-t' is now called '-c'. - New option '-t' for CWEAVE when dealing with 'typename' in C++ templates. - New option '-k' for CTANGLE to keep '-separators in numeric literals. * Support for "variadic macros" along "variadic functions". * @d is printed similar to #define (and vice versa): - '#' is no longer printed in boldface. - Spacing is similar in most cases. * Support for extended C99/C++ numeric literals: - hexadecimal, octal, and -- new! -- binary numbers. - NOTE: 'cwebmac.tex 4.3' is NOT compatible with CWEAVE 4.2 and older and vice versa. * Long parameter lists in ANSI function definitions are indented similar to old-style function parameters. - Option '-i' works similar for old-style and modern function headers. * Additional C99/C++ keywords -- from 'alignas' to 'thread_local' -- are supported internally. * '@i'nclude file 'iso_types.w' for numeric types (in addition to 'c++lib.w'). * Countless code modifications, including some corrections amd improvements. Thanks and cudos to Github user "@texdraft" for numerous contributions to this feature release! git-svn-id: svn://tug.org/texlive/trunk@58884 c570f23f-e606-0410-a88d-b1316a301751
2021-02-25restore Build,TODO from r57911Karl Berry
git-svn-id: svn://tug.org/texlive/trunk@57915 c570f23f-e606-0410-a88d-b1316a301751
2021-02-25French translation for tlmgr updatedDenis Bitouzé
git-svn-id: svn://tug.org/texlive/trunk@57912 c570f23f-e606-0410-a88d-b1316a301751
2021-02-25[CWEB] New release 4.2.Andreas Scherer
This second service release wraps up the major code overhaul of CWEB 4.0. New features will take more time. git-svn-id: svn://tug.org/texlive/trunk@57895 c570f23f-e606-0410-a88d-b1316a301751
2021-02-24[CWEB] Code review.Andreas Scherer
Compactify single function declarations. git-svn-id: svn://tug.org/texlive/trunk@57874 c570f23f-e606-0410-a88d-b1316a301751
2021-02-22[CWEB] Code review.Andreas Scherer
* Decouple CTANGLE and CWEAVE from COMMON by using 'static' variables. * Reshuffle variable declarations in 'common.h' to match the definitions in 'common.w'. * Eliminate some unused stuff in CTWILL. git-svn-id: svn://tug.org/texlive/trunk@57841 c570f23f-e606-0410-a88d-b1316a301751
2021-02-20[CWEB] New release 4.1.Andreas Scherer
Enough changes have accumulated since the major release of CWEB 4.0 to warrant a new revision number. git-svn-id: svn://tug.org/texlive/trunk@57806 c570f23f-e606-0410-a88d-b1316a301751
2021-02-19[CWEB] Replace 'boolean' values upstream.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@57795 c570f23f-e606-0410-a88d-b1316a301751
2021-02-18[CWEB] Reshuffle a few variables (upstream).Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@57782 c570f23f-e606-0410-a88d-b1316a301751
2021-02-16[CWEB] Reshuffle byte_mem pointer.Andreas Scherer
git-svn-id: svn://tug.org/texlive/trunk@57763 c570f23f-e606-0410-a88d-b1316a301751
2021-02-08[CWEB] Don't repeat yourself.Andreas Scherer
Purge repeated lines in *.w by uncommenting line in common.h. Unfortunately, this shifts all #line numbers. ;o) git-svn-id: svn://tug.org/texlive/trunk@57676 c570f23f-e606-0410-a88d-b1316a301751
2021-02-07CWEB – release 4.0, 2021-02-07.Andreas Scherer
In the course of the "2021 TeX tuneup", Don Knuth kindly transferred the responsibility for CWEB to me; see the original CWEB home page (https://www-cs-faculty.stanford.edu/~knuth/cweb.html), section "CWEB 4.0" and the updated CWEB development project (https://github.com/ascherer/cweb). This first new release draws heavily on the multi-decade work collected in my "CWEBbin" project (https://github.com/ascherer/cwebbin). I moved (almost) all stuff from the "*-patch.*" changefiles into the new CWEB sources and applied all of the "*-ansi.*" changes as well. Moreover, I made "common.h" the full interface of "common.w" in order to avoid code redundancy. And I tried to fix as many of the bugs reported by email to DEK and/or tex-k@tug.org. In total, "make; make cautiously; make fullmanual" runs flawlessly with GCC on Linux and with LLVM on MacOS. After the release of "CWEB 4.0", also "CWEBbin 2021" has also been fully revised. Thousands of lines of changefiles could be purged. What's left are the clearcut extensions for CWEB and the additional stuff for integration in "TeX Live 2021". git-svn-id: svn://tug.org/texlive/trunk@57658 c570f23f-e606-0410-a88d-b1316a301751
2020-07-30[CWEB] Fix typographic inconsistency.Andreas Scherer
'Extensions' was the only major section with the 'header' separated from the first text paragraph. git-svn-id: svn://tug.org/texlive/trunk@55993 c570f23f-e606-0410-a88d-b1316a301751
2020-07-15[CWEB] Clearer exposition re external type definitions.Andreas Scherer
A few underlined index entries added and one index entry removed. git-svn-id: svn://tug.org/texlive/trunk@55841 c570f23f-e606-0410-a88d-b1316a301751