From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d4db,2c601866b37cbfd,start X-Google-Attributes: gid10d4db,public From: "Frank Swasey" Subject: REPOST: vgrind ported to Linux Date: 1995/05/11 Message-ID: <3ostik$htu@freya.yggdrasil.com> X-Deja-AN: 102459124 original-date: 5 May 1995 18:50:20 +0300 followup-to: comp.os.linux.development.apps content-type: text/plain; charset=ISO-8859-1 summary: Fancy postscript printing of C programs organization: IBM Microelectronics Division keywords: C postscript printing mime-version: 1.0 newsgroups: comp.os.linux.announce originator: wirzeniu@freya.yggdrasil.com >>From the vgrind manual page: Vgrind formats the program sources which are arguments in a nice style using troff. Comments are placed in italics, keywords in bold face, and the name of the current function is listed down the margin of each page as it is encountered. I have used the vgrind program in my work on IBM RS/6000 systems running AIX and like the output it gives. Therefore, when I needed to do some programming on my Linux system, I searched out the source for the vgrind program and got it working. I found the source on ftp.uu.net in /systems/unix/bsd-sources/usr.bin/vgrind. It, of course, was designed to be used with the BSD make program and installed in a BSD directory structure. Other than a complete replacement of the Makefile, there were only 26 lines of documentation and code out of the more than 2200 which needed to be modified to make vgrind operational on Linux. In addition to the patch, supplied below, to be applied to the sources from ftp.uu.net, two files have been uploaded to sunsite.unc.edu in the /pub/Linux/Incoming directory. Those files are the complete modified source (vgrindsrc.tgz) and an a.out binary distribution (vgrindbin.tgz) compiled using gcc 2.6.3 and libc.4.6.27. Here is the lsm entry for vgrindsrc.tgz: ========================================================================== Begin3 Title: vgrind source distribution Version: 1.0 Entered-date: April 8, 1995 Description: vgrind formats the program sources which are arguments in a nice style using troff. Comments are placed in italics, keywords in bold face, and the name of the current function is listed down the margin of each page as it is encountered. Keywords: PostScript, Print, Source Code Author: BSD Maintained-by: Frank_Swasey@vnet.ibm.com (Frank Swasey) Primary-site: sunsite.unc.edu /pub/Linux/system/Printing 17542 vgrindsrc.tgz Original-site: ftp.uu.net /systems/unix/bsd-sources/usr.bin/vgrind/ 364 Makefile.Z 1312 pathnames.h.Z 6560 regexp.c.Z 519 tmac.vgrind.Z 7969 vfontedpr.c.Z 3541 vgrind.1.Z 2293 vgrind.sh.Z 3470 vgrindefs.5.Z 4477 vgrindefs.c.Z 4009 vgrindefs.src.Z Platform: groff, PostScript printing capability Copying-policy: BSD End ======================================================================== The lsm entry for vgrindbin.tgz is identical to the one listed above with the exception of the size and name of the file in the Primary-site field: 16909 vgrindbin.tgz. --- Patch --- Before applying this patch, uncompress the files from ftp.uu.net and rename (or remove) the original Makefile to get it out of the way. diff -u -r1.1 pathnames.h --- 1.1 1995/03/12 22:08:38 +++ pathnames.h 1995/03/12 22:08:56 @@ -33,4 +33,4 @@ * @(#)pathnames.h 5.2 (Berkeley) 6/1/90 */ -#define _PATH_VGRINDEFS "/usr/share/misc/vgrindefs" +#define _PATH_VGRINDEFS "/usr/lib/groff/tmac/vgrindefs" diff -u -r1.1 vfontedpr.c --- 1.1 1995/03/12 22:09:44 +++ vfontedpr.c 1995/03/13 21:33:08 @@ -249,7 +249,7 @@ cp = strings; while (*cp) { while (*cp == ' ' || *cp =='\t') - *cp++ = NULL; + *cp++ = '\0'; if (*cp) *cpp++ = cp; while (*cp != ' ' && *cp != '\t' && *cp) @@ -291,7 +291,7 @@ _escaped = FALSE; blklevel = 0; for (psptr=0; psptr 0) then switch ($1:q) @@ -116,10 +116,10 @@ else if ("$head" != "") then $vf $options -h "$head" $files | \ - sh -c "vtroff -rx1 $voptions -i -mvgrind 2>> xindex" + sh -c "troff -rx1 $voptions -i -mvgrind 2>> xindex" else $vf $options $files | \ - sh -c "vtroff -rx1 $voptions -i -mvgrind 2>> xindex" + sh -c "troff -rx1 $voptions -i -mvgrind 2>> xindex" endif endif sort -df +0 -2 xindex >index @@ -133,9 +133,9 @@ endif else if ("$head" != "") then - $vf $options -h "$head" $files | vtroff -i $voptions -mvgrind + $vf $options -h "$head" $files | troff -i $voptions -mvgrind else - $vf $options $files | vtroff -i $voptions -mvgrind + $vf $options $files | troff -i $voptions -mvgrind endif endif endif diff -u -r1.1 vgrindefs.5 --- 1.1 1995/03/12 22:09:58 +++ vgrindefs.5 1995/03/12 22:14:49 @@ -144,8 +144,8 @@ and lower case are equivalent, then all the keywords should be specified in lower case. .Sh FILES -.Bl -tag -width /usr/share/misc/vgrindefs -compact -.It Pa /usr/share/misc/vgrindefs +.Bl -tag -width /usr/lib/groff/tmac/vgrindefs -compact +.It Pa /usr/lib/groff/tmac/vgrindefs File containing terminal descriptions. .El .Sh SEE ALSO diff -u -r1.1 vgrindefs.c --- 1.1 1995/03/12 22:10:09 +++ vgrindefs.c 1995/03/13 21:34:10 @@ -57,9 +57,9 @@ static char *tbuf; static char *filename; static int hopcount; /* detect infinite loops in termcap, init 0 */ -char *tskip(); +static char *tskip(); char *tgetstr(); -char *tdecode(); +static char *tdecode(); char *getenv(); /* diff -u /dev/null Makefile --- /dev/null Wed Dec 21 10:28:23 1994 +++ Makefile Mon Mar 13 16:56:35 1995 @@ -0,0 +1,57 @@ +# Makefile for vgrind Frank Swasey +# 32 Hickok Place +# Burlington, Vermont 05401-8515 +# USA +# Email: Frank_Swasey@vnet.ibm.com +# + +CC = gcc +CFLAGS = -O +PROG= vfontedpr +SRCS= regexp.c vfontedpr.c vgrindefs.c +DOCS= vgrind.1 vgrindefs.5 +OTHR= Makefile vgrind.sh vgrindefs.src tmac.vgrind pathnames.h +INSTS= /usr/bin/vgrind /usr/lib/groff/tmac/vgrindefs \ + /usr/lib/groff/tmac/tmac.vgrind /usr/lib/groff/tmac/vfontedpr \ + /usr/man/cat1/vgrind.1 /usr/man/cat5/vgrindefs.5 + +all: vfontedpr + +vfontedpr: regexp.o vfontedpr.o vgrindefs.o + +install: bininstall /usr/man/cat1/vgrind.1 /usr/man/cat5/vgrindefs.5 + touch install + +bininstall: vfontedpr vgrind.sh vgrindefs.src tmac.vgrind + install -c -o bin -g bin -m 555 vgrind.sh /usr/bin/vgrind + install -c -o bin -g bin -m 444 vgrindefs.src /usr/lib/groff/tmac/vgrindefs + install -c -o bin -g bin -m 444 tmac.vgrind /usr/lib/groff/tmac + install -c -o bin -g bin -m 555 vfontedpr /usr/lib/groff/tmac + touch bininstall + +/usr/man/cat1/vgrind.1: vgrind.1 + nroff -mandoc vgrind.1 >/usr/man/cat1/vgrind.1 + +/usr/man/cat5/vgrindefs.5: vgrindefs.5 + nroff -mandoc vgrindefs.5 >/usr/man/cat5/vgrindefs.5 + +uninstall: + rm -f /usr/bin/vgrind + rm -f /usr/lib/groff/tmac/vgrindefs + rm -f /usr/lib/groff/tmac/tmac.vgrind + rm -f /usr/lib/groff/tmac/vfontedpr + rm -f /usr/man/cat1/vgrind.1 + rm -f /usr/man/cat5/vgrindefs.5 + +clean: + rm -f *.o vfontedpr a.out *.bak core make.log + +srcdist: vgrindsrc.tgz + +vgrindsrc.tgz: $(OTHR) $(SRCS) $(DOCS) + tar cvzf vgrindsrc.tgz $(OTHR) $(SRCS) $(DOCS) + +bindist: vgrindbin.tgz + +vgrindbin.tgz: $(INSTS) + tar cvzf vgrindbin.tgz $(INSTS) -- e-mail: Frank_Swasey@vnet.ibm.com, fswasey@btv.ibm.com ,,, Tel: 802-769-4011 (tie: 446), Fax: 802-769-4253 (tie: 446) (o o) Speaking *from* but not *for* IBM -oOO--(_)--OOo- -- Send submissions for comp.os.linux.announce to: linux-announce@news.ornl.gov PLEASE remember Keywords: and a short description of the software.