--- cwebx-3.04.orig/man1/ctanglex.1 +++ cwebx-3.04/man1/ctanglex.1 @@ -0,0 +1 @@ +.so man1/cwebx.1 --- cwebx-3.04.orig/man1/cweavex.1 +++ cwebx-3.04/man1/cweavex.1 @@ -0,0 +1 @@ +.so man1/cwebx.1 --- cwebx-3.04.orig/man1/cweb.1 +++ cwebx-3.04/man1/cweb.1 @@ -1,69 +1,73 @@ -.TH WEB 1L 7/12/90 +.TH CWEBX 1 7/12/90 .SH NAME -ctangle, cweave \- translate CWEB to C (or C++) and/or TeX +ctanglex, cweavex \- translate CWEB(x) to C (or C++) and/or TeX .SH SYNOPSIS -.B ctangle +.B ctanglex [ .B \-bhpl ] [ .B \+cs+ -] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.c]]] +] \fIcwebfile\fR[.w] [(\fIchangefile\fR[.ch]|+|-) [\fIoutputfile\fR[.c]]] .br -.B cweave +.B cweavex [ .B \-bhpx ] [ .B \+cs+dtefauwm ] [ .B +isearchpath -] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.tex]]] +] \fIcwebfile\fR[.w] [(\fIchangefile\fR[.ch]|+|-) [\fIoutputfile\fR[.tex]]] .SH DESCRIPTION The -.I ctangle -program converts a CWEB +.B ctanglex +program converts a CWEB(x) source document into a C program that may be compiled in the usual way. -The output file includes #line specifications so that error reporting and -debugging can be done in terms of the CWEB source file. +The output file includes \fI#line\fR specifications so that error +reporting and debugging can be done in terms of the CWEB(x) source file. .PP The -.I cweave -program converts the same CWEB file into a TeX file that may be +.B cweavex +program converts the same CWEB(x) file into a TeX file that may be formatted and printed in the usual way. It takes appropriate care of typographic details like page layout and the use of indentation, italics, boldface, etc., and it supplies extensive cross-reference information that it gathers automatically. .PP -CWEB allows you to prepare a single +CWEBx allows you to prepare a single document containing all the information that is needed both to produce a compilable C program and to produce a well-formatted document describing the program in as much detail as the writer may desire. The -user of CWEB ought to have some familiarity with TeX as well as knowledge +user of CWEBx ought to have some familiarity with TeX as well as knowledge of C. .PP The command line should have one, two, or three names on it. The first is -taken as the CWEB file (and `.w' is added if there is no extension). If that -file cannot be opened, the extension `.web' is tried instead. If there is a -second name, it is a change file (and `.ch' is added if there is no -extension), otherwise the name of the CWEB file with its extension replaced -by `.ch' is tried as change file name; if there no such file, no change file -is used. Instead of a change file one may specify `-' or `+'; `-' means do -not use a change file, and `+' means use a change file only if a file of the +taken as the CWEB(x) file (and `\fI.w\fR' is added if there is no +extension). If that file cannot be opened, the extension `\fI.web\fR' +is tried instead. If there is a second name, it is a change file (and +`\fI.ch\fR' is added if there is no extension), otherwise the name of +the CWEB(x) file with its extension replaced by `\fI.ch\fR' is tried as +change file name; if there no such file, no change file +is used. Instead of a change file one may specify `\fB-\fR' or +`\fB+\fR'; `\fB-\fR' means do not use a change file, and `\fB+\fR' +means use a change file only if a file of the default name exists (just as if only one name was given). The change file -overrides parts of the CWEB file, as described in the documentation. A third -name, if present, specifies the output file name explicitly. The default -output file name is that of the CWEB file with extension `.c' (for -.I ctangle -) or `.tex' (for -.I cweave +overrides parts of the CWEB(x) file, as described in the +documentation. A third name, if present, specifies the output file +name explicitly. The default output file name is that of the CWEB(x) +file with extension `\fI.c\fR' (for +.B ctanglex +) or `\fI.tex\fR' (for +.B cweavex ); the default extension is also applied if a third name is given without extension. .PP -Options in the command line may be either turned on with `+' -and off with `-'; several characters may follow in the same argument, which +Options in the command line may be either turned on with `\fB+\fR' and +off with `\fB-\fR'; several characters may follow in the same argument, which indicate several options that are turned on respectively off simultaneously. In fact, the options are processed from left to right, -so a sequence like `-b +b' is equivalent to `+b' (which is the default). +so a sequence like `\fB-b +b\fR' is equivalent to `\fB+b\fR' (which is +the default). .PP The .B \+b @@ -72,7 +76,8 @@ option shows a happy message if the processing was successful. The .B \+p option shows progress reports (starred module numbers) as the processing -takes place. If you say `-bhp', you get no terminal output but error messages. +takes place. If you say `\fB-bhp\fR', you get no terminal output but +error messages. .PP The .B \+c @@ -80,7 +85,8 @@ The .B \+s option prints statistics about memory usage at the end of a run -(assuming that the programs have been compiled with the -DSTAT switch). +(assuming that the programs have been compiled with the \fI-DSTAT\fR +switch, as they are by default on Debian systems). By setting the option .B \++ one can select the C++ language instead of C. @@ -88,19 +94,19 @@ The option .B \-l is applicable to -.I ctangle +.B ctanglex only; when selected, the C output is made more readable for humans by omitting .B #line directives and preserving layout and comments. .PP There are several other options applicable to -.I cweave +.B cweavex only. The option .B \-x means omit the index and table of contents. By setting the option .B \+d one causes -.I cweave +.B cweavex to report problems encountered in parsing the program fragments. With .B \+t the the index and module names will be written to separate files. With @@ -144,17 +150,30 @@ right. .PP .SH FILES -/usr/local/lib/tex/macros/cwebxmac.tex TeX macros used by cweave output. +.I /usr/share/texmf/macros/litprog/cwebxmac.tex +TeX macros used by cweavex output. .br -/usr/local/lib/tex/macros/cwebcmac.tex TeX macros used in compatibility -mode. +.I /usr/share/texmf/macros/litprog/cwebcmac.tex +TeX macros used in compatibility mode. .br -/usr/local/doc/cweb/manual.tex The user manual. +.I /usr/share/texmf/macros/litprog/cwebhmac.tex +TeX macros which can be input after \fIcwebxmac\fR to produce +hyperlinks in the output. +.br +.I /usr/doc/cwebx/manual.tex +The user manual source. +.br +.I /usr/doc/cwebx/manual.tex +The user manual in DVI format. .SH "SEE ALSO" .I Literate Programming by D. E. Knuth. (CSLI, Stanford, 1992) .br -tex(1), cc(1), web(1) +.BR tex (1), +.BR cc (1), +.BR cweb (1) +and +.BR web (1). .SH "AUTHORS" Don Knuth wrote WEB for TeX and Pascal. Silvio Levy designed and developed CWEB by adapting the WEB conventions to C and by recoding everything in CWEB. --- cwebx-3.04.orig/Makefile +++ cwebx-3.04/Makefile @@ -10,20 +10,22 @@ # We let CWEAVE report syntax errors by setting +d. # The flag +m makes the TeX output slightly more compact. -# We use the +e flag since our printer is two-sided. -CWFLAGS = +mde +CWFLAGS = +md CTFLAGS = # We keep debugging info around to enable the `+d' option of cweave -CFLAGS = -DDEBUG -DSTAT -g - -# RM and CP are used below in case rm and cp are aliased - -RM= /bin/rm -CP= /bin/cp -RENAME= /bin/mv - +CFLAGS = -DDEBUG -DSTAT -g -Wall +ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) +CFLAGS += -O0 +else +CFLAGS += -O2 +endif + +# This is handled by debhelper's dh_strip +# ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +# INSTALL_PROGRAM += -s +# endif # Set CCHANGES to common-foo.ch if you need changes to common.w in another # file than common.ch @@ -69,32 +71,33 @@ manual doc: manual.dvi listings: common.dvi ctangle.dvi cweave.dvi -cautiously: +cautiously: ctangle make common.c ctangle.c cweave.c - $(RENAME) ctangle SAVEctangle # save version in case things mess up + mv ctangle SAVEctangle # save version in case things mess up make ctangle - $(RENAME) common.c SAVEcommon.c + mv common.c SAVEcommon.c ./ctangle common $(CCHANGES) diff common.c SAVEcommon.c - $(RENAME) SAVEcommon.c common.c # restore date - $(RENAME) ctangle.c SAVEctangle.c + mv SAVEcommon.c common.c # restore date + mv ctangle.c SAVEctangle.c ./ctangle ctangle $(TCHANGES) diff ctangle.c SAVEctangle.c - $(RENAME) SAVEctangle.c ctangle.c # restore date - $(RENAME) cweave.c SAVEcweave.c + mv SAVEctangle.c ctangle.c # restore date + mv cweave.c SAVEcweave.c ./ctangle cweave $(WCHANGES) diff cweave.c SAVEcweave.c - $(RENAME) SAVEcweave.c cweave.c # restore date - $(RM) SAVEctangle # succeeded, use new binary from now on + mv SAVEcweave.c cweave.c # restore date + rm SAVEctangle # succeeded, use new binary from now on SAVEctangle.c: - $(CP) ctangle.c SAVEctangle.c + cp ctangle.c SAVEctangle.c SAVEcommon.c: - $(CP) common.c SAVEcommon.c + cp common.c SAVEcommon.c common.c: common.w $(CCHANGES) common.inc $(CTANGLE) common $(CCHANGES) + common.h: common.w $(CCHANGES) $(CTANGLE) common $(CCHANGES) @@ -120,3 +123,21 @@ $(CWEAVE) cweave $(WCHANGES) manual.dvi: compare.tex + +# Debian additions: we need a clean and install target of course!! + +# Are we going to suffix an `x' on the end of filenames to distinguish +# CWEBx from K&L CWEB? +DESTPREF=x + +INSTALLROOT=debian/cwebx +BINDIR=$(INSTALLROOT)/usr/bin +MACRODIR=$(INSTALLROOT)/usr/share/texmf/tex/plain/litprog + +clean: + -rm -f *.dvi *.log *.o ctangle cweave cweave.c manual.toc + +install: + cp cweave $(BINDIR)/cweave$(DESTPREF) + cp ctangle $(BINDIR)/ctangle$(DESTPREF) + cp cweb?mac.tex $(MACRODIR) --- cwebx-3.04.orig/common.c +++ cwebx-3.04/common.c @@ -846,7 +846,9 @@ break;default:/*105:*/ #line 1688 "common.w" fatal("! Usage:\n" -"c%se [(+|-)options] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.%s]]]" +#line 14 "common.ch" +"c%sex [(+|-)options] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.%s]]]" +#line 1690 "common.w" ,program==ctangle?"tangl":"weav" ,program==ctangle?"c":"tex");/*:105*/ #line 1581 "common.w" @@ -855,7 +857,9 @@ if(files_found==0)/*105:*/ #line 1688 "common.w" fatal("! Usage:\n" -"c%se [(+|-)options] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.%s]]]" +#line 14 "common.ch" +"c%sex [(+|-)options] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.%s]]]" +#line 1690 "common.w" ,program==ctangle?"tangl":"weav" ,program==ctangle?"c":"tex");/*:105*/ #line 1584 "common.w" --- cwebx-3.04.orig/common.ch +++ cwebx-3.04/common.ch @@ -0,0 +1,15 @@ +% Change file for common.w, written by jdg@debian.org, original +% version on 15/5/97 +% +% This change reflects the fact that these two programs will be +% installed as cweavex and ctanglex, instead of the normal cweave and +% ctangle, so the error messages should reflect this. I don't care +% that the banner line says `This is CTANGLE (Version x3.04)' or +% whatever, as that already makes it clear that this is CWEBx and not +% K&L CWEB. +% +@x +"c%se [(+|-)options] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.%s]]]" +@y +"c%sex [(+|-)options] cwebfile[.w] [(changefile[.ch]|+|-) [outputfile[.%s]]]" +@z --- cwebx-3.04.orig/manual.tex +++ cwebx-3.04/manual.tex @@ -99,6 +99,15 @@ \bigskip\bigskip +\noindent +{\bf WARNING: \sl On Debian systems, \kern0.3pt \CWEBx. is installed +as a suite of two programs:\/ \.{cweavex} and\/ \.{ctanglex}, to +distinguish them from\/ \.{cweave} and\/ \.{ctangle}, which are the +original Levy/Knuth versions. Therefore, please be careful to +call the programs by these names rather than\/ \.{cweave} and\/ +\.{ctangle} as used in the remainder of this manual.} + +\bigskip \beginsection Overview --- cwebx-3.04.orig/parser.w +++ cwebx-3.04/parser.w @@ -178,7 +178,7 @@ { unop = 1, /* a unary operator like `|!|' */ binop, /* a binary operator like `|<|' */ unorbinop, /* an operator that can be either, like `|-|' */ - select, /* structure selection: `|.|' or `|->|' */ + selectx, /* structure selection: `|.|' or `|->|' */ question, /* a question mark operator */ lbrace, rbrace, lpar, rpar, lbrack, rbrack, /* `|{|', \ `|}|', `(', \ `)', `[', \ `]' */ @@ -231,7 +231,7 @@ { '/', binop, yes_math, "/" }, @/ { '<', binop, yes_math, "<" }, @/ { '>', binop, yes_math, ">" }, @/ -{ '.', select, yes_math, "." }, @/ +{ '.', selectx, yes_math, "." }, @/ { '=', binop, yes_math, "\\K" }, @/ @.\\K@> { '|', binop, yes_math, "\\OR" }, @.\\OR@> { or, binop, yes_math, "\\OR" }, @/ @@ -264,7 +264,7 @@ { or_or, binop, yes_math, "\\V" }, @/ @.\\V@> { plus_plus, unop, yes_math, "\\PP" }, @/ @.\\PP@> { minus_minus, unop, yes_math, "\\MM" }, @/ @.\\MM@> -{ minus_gt, select, yes_math, "\\MG" }, @/ @.\\MG@> +{ minus_gt, selectx, yes_math, "\\MG" }, @/ @.\\MG@> { gt_gt, binop, yes_math, "\\GG" }, @/ @.\\GG@> { lt_lt, binop, yes_math, "\\LL" }, @/ @.\\LL@> { mul_assign, binop, yes_math, "\\KK*" }, @/ @.\\KK@> @@ -322,7 +322,7 @@ #ifdef DEBUG void print_cat (int c) /* symbolic printout of a category */ { static char* cat_name[]= - { "unop", "binop", "op", "select" + { "unop", "binop", "op", "selectx" , "?", "{", "}", "(", ")", "[", "]", ",", ";", ":", "::", "@@;" , "subscr", "struct_head", "short_{", "short_struct_head" , "cmp_stmt", "stmt" --- cwebx-3.04.orig/rules.w +++ cwebx-3.04/rules.w @@ -62,8 +62,8 @@ { 1, {{expression, unop}}, {expression, NULL}}, @/ { 2, {{expression, binop, expression}}, {expression, NULL}}, @/ { 3, {{expression, unorbinop, expression}}, {expression, NULL}}, @/ -{ 4, {{expression, select, expression}}, {expression, NULL}}, @/ -{ 5, {{expression, select, int_like}}, {expression, "__$_"}}, @/ +{ 4, {{expression, selectx, expression}}, {expression, NULL}}, @/ +{ 5, {{expression, selectx, int_like}}, {expression, "__$_"}}, @/ { 6, {{expression, comma, expression}}, {expression, "__p1_"}}, @/ { 7, {{expression, expression}}, {expression, NULL}}, @/ { 8, {{expression, lpar, rpar}}, {expression, "__,_"}}, @/ --- cwebx-3.04.orig/debian/README.Debian +++ cwebx-3.04/debian/README.Debian @@ -0,0 +1,20 @@ +CWEBx for DEBIAN +---------------- + +This package contains Marc van Leeuwen's version of the CWEB system. + +The programs have been installed with the names cweavex and ctanglex +to distinguish them from the original Levy/Knuth version of CWEB. +This is important to note!! + +The manual is available in both TeX format (manual.tex) and DVI format +(manual.dvi). If you want a PostScript manual, run the following +command on the (unzipped) DVI file (presuming you have the tetex-bin +package installed): + + dvips -o manual.ps manual + +If you prefer less readable ASCII version, you can create it using the +non-free `dvi2tty' program: + + dvi2tty -w132 -e-40 manual.dvi > manual.txt --- cwebx-3.04.orig/debian/changelog +++ cwebx-3.04/debian/changelog @@ -0,0 +1,57 @@ +cwebx (3.04-9) unstable; urgency=low + + * Update dependencies for new TeXLive packages (Closes: #420904) + + -- Julian Gilbey Wed, 25 Apr 2007 14:14:20 +0100 + +cwebx (3.04-8) unstable; urgency=low + + * Update to new standards version 3.6.2 (Closes: #328794) + * Update to debhelper version 4 + + -- Julian Gilbey Tue, 20 Sep 2005 08:44:24 +0100 + +cwebx (3.04-7) unstable; urgency=low + + * Get debug/warning stuff right this time! + + -- Julian Gilbey Tue, 8 May 2001 10:25:40 +0100 + +cwebx (3.04-6) unstable; urgency=low + + * Support DEB_BUILD_OPTIONS=debug + * Standards version 3.5.4 + + -- Julian Gilbey Tue, 8 May 2001 09:25:58 +0100 + +cwebx (3.04-5) unstable; urgency=low + + * Removed install-stamp from debian/rules + * Standards version 3.1.1 (FHS, Build-Depends, etc.) + + -- Julian Gilbey Tue, 23 Nov 1999 12:34:03 +0000 + +cwebx (3.04-4) unstable; urgency=low + + * Moved tex input files from /usr/lib/texmf to /usr/share/texmf in line + with the change in tetex-*, moving towards FHS compliance + + -- Julian Gilbey Fri, 9 Apr 1999 12:46:54 +0100 + +cwebx (3.04-3) unstable; urgency=low + + * Removed CVS files from diff file! + + -- Julian Gilbey Thu, 25 Feb 1999 19:55:40 +0000 + +cwebx (3.04-2) unstable; urgency=low + + * Changed gcc flags to -O2 -g -Wall as described in Policy 4.1 + + -- Julian Gilbey Sun, 7 Feb 1999 21:34:23 +0000 + +cwebx (3.04-1) unstable; urgency=low + + * Initial Release. + + -- Julian Gilbey Wed, 27 Jan 1999 11:23:23 +0000 --- cwebx-3.04.orig/debian/compat +++ cwebx-3.04/debian/compat @@ -0,0 +1 @@ +5 --- cwebx-3.04.orig/debian/control +++ cwebx-3.04/debian/control @@ -0,0 +1,26 @@ +Source: cwebx +Section: devel +Priority: optional +Maintainer: Julian Gilbey +Standards-Version: 3.7.2 +Build-Depends: debhelper (>= 5.0.0), texlive-base + +Package: cwebx +Architecture: any +Depends: ${shlibs:Depends} +Recommends: gcc | c-compiler, texlive-base +Description: C/C++ literate programming system (Marc van Leeuwen's version) + This version is a complete rewrite of Levy & Knuth's version of CWEB. + It uses a slightly different syntax from the L&K version, but provides a + compatibility mode allowing L&K CWEB sources to be processed, producing + similar (though not necessarily identical) output. + . + CWEB allows you to write documents which can be used simultaneously as + C/C++ programs and as TeX documentation for them. + . + The philosophy behind CWEB is that programmers who want to provide the best + possible documentation for their programs need two things simultaneously: a + language like TeX for formatting, and a language like C for programming. + Neither type of language can provide the best documentation by itself. But + when both are appropriately combined, we obtain a system that is much more + useful than either language separately. --- cwebx-3.04.orig/debian/copyright +++ cwebx-3.04/debian/copyright @@ -0,0 +1,28 @@ +This package was debianized by Julian Gilbey on +Wed, 27 Jan 1999 11:02:46 +0000. + +It was downloaded from http://wallis.univ-poitiers.fr/~maavl/CWEBx/ + +Copyright from headers of source documents: + +% This file is part of CWEBx. +% This program by Marc van Leeuwen based on earlier versions by +% D. E. Knuth., Silvio Levy and Frank Jensen. +% It is distributed WITHOUT ANY WARRANTY, express or implied. +% CWEB (Revision: 2.0) % Don Knuth, July 1990 +% Version 3.x, Marc van Leeuwen, December 1993 +% CWEBx 2+1.0, Marc van Leeuwen, August 1994 +% CWEBx 3.0, Marc van Leeuwen, Januari 1995 +% CWEBx 3.02, Marc van Leeuwen, April 1996 + +% Copyright (C) 1987,1990 Silvio Levy and Donald E. Knuth +% Copyright 1994 Marc A. A. van Leeuwen + +% Permission is granted to make and distribute verbatim copies of this +% document provided that the copyright notice and this permission notice +% are preserved on all copies. + +% Permission is granted to copy and distribute modified versions of this +% document under the conditions for verbatim copying, provided that the +% entire resulting derived work is distributed under the terms of a +% permission notice identical to this one. --- cwebx-3.04.orig/debian/dirs +++ cwebx-3.04/debian/dirs @@ -0,0 +1,2 @@ +usr/bin +usr/share/texmf/tex/plain/litprog --- cwebx-3.04.orig/debian/docs +++ cwebx-3.04/debian/docs @@ -0,0 +1,3 @@ +manual.tex +manual.dvi +examples --- cwebx-3.04.orig/debian/postinst +++ cwebx-3.04/debian/postinst @@ -0,0 +1,11 @@ +#! /bin/bash + +set -e + +if [ -x /var/lib/texmf/web2c/mktexupd ]; then + /var/lib/texmf/web2c/mktexupd /usr/share/texmf/tex/plain/litprog cwebcmac.tex + /var/lib/texmf/web2c/mktexupd /usr/share/texmf/tex/plain/litprog cwebhmac.tex + /var/lib/texmf/web2c/mktexupd /usr/share/texmf/tex/plain/litprog cwebxmac.tex +fi + +#DEBHELPER# --- cwebx-3.04.orig/debian/rules +++ cwebx-3.04/debian/rules @@ -0,0 +1,61 @@ +#!/usr/bin/make -f +# debian/rules for cwebx package. Copyright with GPL version 2 or later +# by Julian Gilbey, 1998. +# +# Based on /usr/doc/debhelper/examples/rules: +# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +build: build-stamp + +build-stamp: + dh_testdir + touch *.c + $(MAKE) cweb manual + cp man1/cweb.1 man1/cwebx.1 + touch build-stamp + +clean: + dh_testdir + dh_testroot + rm -f build-stamp + $(MAKE) clean + rm -f man1/cwebx.1 + dh_clean + +install: build + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + $(MAKE) install + +# Build architecture-independent files here. +binary-indep: build install +# We have nothing to do by default. + +# Build architecture-dependent files here. +binary-arch: build install + dh_testdir + dh_testroot + dh_installdocs + dh_installman man1/ctanglex.1 man1/cweavex.1 man1/cwebx.1 + dh_installchangelogs + dh_strip + dh_compress + dh_fixperms + dh_installdeb + dh_shlibdeps + dh_gencontrol + dh_md5sums + dh_builddeb + +binary: binary-indep binary-arch + +.PHONY: build clean binary-indep binary-arch binary install + +# Local variables: +# mode: makefile +# End: