flip-1.20/0000777000175000017500000000000011042756230007373 500000000000000flip-1.20/FILES0000644000175000017500000000127207705635226010112 00000000000000 chars name description 3710 flip.1 (**ix) manual for formatting with "nroff -man" 1731 makefile.nix (**ix) make file 4455 flip.man (generic) formatted manual 1522 install.doc (generic) installation instructions 13273 flip.c (generic) flip C source 7556 flip.h (generic) flip C source 2801 getopt.c (generic) getopt function C source 605 makefile.tcc (ms-dos/turbo c) make file 56 flip.prj (ms-dos/turbo c) project file 140 turboc.cfg (ms-dos/turbo c) configuration file 10224 turboc.c (ms-dos/turbo c) C source flip-1.20/INSTALL.DOC0000644000175000017500000000303207705635226010756 00000000000000 Installing Flip 1.00 Installation instructions are provided for System V Release 2, 4.3BSD, Ultrix, Microport System V/AT, and MS-DOS/Turbo C. To install under other similar environments look carefully in flip.h and make changes as needed. MS-DOS/TURBO C The files supplied are suitable for compilation with Borland's Turbo C 2.0 for MS-DOS. A makefile "makefile.tcc" is supplied. Use the command line compiler "tcc.exe". You will need a good make program, such as NDMAKE. Edit "turboc.cfg" so it correctly reflects the include directories on your system. Then type "make -f makefile.tcc". You can also use the intergrated environment "tc.exe". Convert "turboc.cfg" to "tcconfig.tc" using Borland's "tcconfig.exe" program. Invoke tc.exe and load the configuration file "tcconfig.tc". A project file "flip.prj" is supplied. Compile as usual. SYSTEM V RELEASE 2, 4.3BSD, OR MICROPORT SYSTEM V/AT Rename the provided file "makefile.nix" to "makefile". Depending on the system, type: make sys_v for System V Release 2 make bsd for 4.3BSD make uport for Microport System V/AT (large model) make ultrix for Ultrix, includes bug fix, not tested It may work to do "make sys_v" for Microport System V/AT, but I'm not sure, as I haven't yet restored my small model libraries which vanished from my disk one day without warning. Under any flavor of **IX you can link "flip" to "toix" and "toms". flip-1.20/MAKEFILE.TCC0000644000175000017500000000116607705635226011037 00000000000000# ::[[ @(#) makefile.tcc 1.1 89/07/02 00:19:54 ]]:: # Makefile for flip for MS-DOS and Turbo C 2.0. The supplied turboc.cfg # configuration file must be in the current directory; edit it to make # sure the include directories are correct. CC = tcc CFLAGS = -c -DTURBOC -DLINT -DNDEBUG CFMORE = LD = tcc LDFLAGS = -eFLIP LDMORE = OBJS = flip.obj getopt.obj turboc.obj flip.exe: $(OBJS) $(LD) $(LDFLAGS) $(LDMORE) $(OBJS) flip.obj: flip.c flip.h $(CC) $(CFLAGS) $(CFMORE) $*.c getopt.obj: getopt.c flip.h $(CC) $(CFLAGS) $(CFMORE) $*.c turboc.obj: turboc.c flip.h $(CC) $(CFLAGS) $(CFMORE) $*.c flip-1.20/test-flip0000644000175000017500000000475011042663615011153 00000000000000#!/bin/bash # quit at first sign of trouble set -e WORKING="testfile expected tperm eperm" # preferably test executable in current directory, else in $PATH if [ -x ./flip ]; then FLIP=./flip; else FLIP=`which flip`; fi echo "testing $FLIP" echo -n "checking conversion from **IX to MSDOS... " echo $'ww\nww\rww\r\nww' >testfile echo $'ww\r\nww\rww\r\nww\r' >expected $FLIP -m testfile if diff -q testfile expected; then echo pass; else echo FAIL; echo "expected result:"; dump expected; echo "actual result:"; dump testfile; exit 1; fi echo -n "checking conversion from MSDOS to **IX... " echo $'ww\nww\rww\czww\r\nww' >testfile echo $'ww\nww\rww\czww\nww' >expected $FLIP -u testfile if diff -q testfile expected; then echo pass; else echo FAIL; echo "expected result:"; dump expected; echo "actual result:"; dump testfile; exit 1; fi echo -n "checking removal of trailing control Z... " echo $'wwww\cz' |head -c 5 >testfile echo $'wwww\cz' |head -c 4 >expected $FLIP -u testfile if diff -q testfile expected; then echo pass; else echo FAIL; echo "expected result:"; dump expected; echo "actual result:"; dump testfile; exit 1; fi echo -n "checking that permissions are preserved... " echo $'ww\nww\rww\xee\r\nww' >testfile; chmod 642 testfile; ls -l testfile|head -c 10 >eperm $FLIP -u testfile 2>/dev/null || true ls -l testfile|head -c 10 >tperm if diff -q eperm tperm; then echo pass; else echo FAIL; echo "expected permissions: `cat eperm`";echo "actual permissions: `cat tperm`"; exit 1; fi echo -n "checking that timestamps are preserved... " echo $'ww\nww\rww\xee\r\nww' >testfile; touch --date 2001-09-11 testfile echo $'ww\nww\rww\czww\nww' >expected; touch --date 2001-09-11 expected $FLIP -u testfile 2>/dev/null || true if [ ! testfile -nt expected ] && [ ! testfile -ot expected ]; then echo pass; else echo FAIL; ls -l --full-time testfile expected exit 1; fi echo -n "checking that binary files are ignored... " echo $'ww\nww\rww\xee\r\nww' >testfile echo $'ww\nww\rww\xee\r\nww' >expected $FLIP -u testfile 2>/dev/null || true if diff -q testfile expected; then echo pass; else echo FAIL; echo "expected result:"; dump expected; echo "actual result:"; dump testfile; exit 1; fi echo -n "checking file truncation at control Z... " echo $'wwww\cz\r\nww\rww\nww' >testfile echo $'wwww' | head -c 4 >expected $FLIP -u -z testfile if diff -q testfile expected; then echo pass; else echo FAIL; echo "expected result:"; dump expected; echo "actual result:"; dump testfile; exit 1; fi rm -rf $WORKING flip-1.20/MESSAGE0000644000175000017500000000207407705635226010335 00000000000000Path: bsu-cs!iuvax!cica!ctrsol!ginosko!uunet!allbery From: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) Newsgroups: comp.sources.misc Subject: v07i068: flip 1.0: a newline conversion program Message-ID: <59948@uunet.UU.NET> Date: 9 Jul 89 00:36:02 GMT Sender: allbery@uunet.UU.NET Reply-To: dhesi@bsu-cs.bsu.edu (Rahul Dhesi) Lines: 1808 Approved: allbery@uunet.UU.NET (Brandon S. Allbery - comp.sources.misc) Posting-number: Volume 7, Issue 68 Submitted-by: dhesi@bsu-cs.bsu.edu (Rahul Dhesi) Archive-name: flip This program converts text file between MS-DOS and **IX format. It works under System V, 4.3BSD, Ultrix, and MS-DOS/Turbo C. It detects binary files in a nearly foolproof way and leaves them alone unless you override this. It will also leave files alone that are already in the right format. User interrupts are handled gracefully and no garbage or corrupted files left behind. An MS-DOS binary will eventually appear in comp.binaries.ibm.pc. Rahul Dhesi UUCP: ...!{iuvax,pur-ee}!bsu-cs!dhesi flip-1.20/Makefile0000644000175000017500000000511111042756177010757 00000000000000# Makefile for flip for **IX. ::[[ @(#) makefile.nix 1.4 89/07/04 12:00:02 ]]:: # The contents of this makefile are hereby released to the public domain. # -- Rahul Dhesi 1989/06/19 PACKAGE = flip VERSION = 1.20 distdir = $(PACKAGE)-$(VERSION) srcdir = . TAR = tar GZIP_ENV = --best DISTFILES=FILES INSTALL.DOC MAKEFILE.TCC test-flip \ MESSAGE Makefile TURBOC.C TURBOC.CFG flip.1 flip.c flip.h getopt.c ChangeLog # Before use make sure this file is called "makefile". (Rename it if # necessary.) Then invoke as follows: # To build on a modern Unix system with a standard C compiler: # make "CFLAGS= -DBSD -DIX -DSTDINCLUDE" flip # Otherwise: # "make sys_v" makes executable flip for System V Release 2 # "make bsd" makes executable flip for 4.3BSD # "make install" moves flip into BINDIR, copies flip.1 into MANDIR # "make clean" deletes object and executable files # Where to install executable and manual files on "make install". The trailing # "/." forces an error message if the destination directory doesn't exist. BINDIR = /usr/local/bin/. MANDIR = /usr/man/man1/. # CC is compiler, LD is loader (may be same as compiler), CFLAGS are flags # for compiler, LDFLAGS are flags for loader, CFMORE are additional # (relatively unchanging) flags for compiler CC = cc CFLAGS = CFMORE = -c -DNDEBUG -O -DVERSION=\"$(VERSION)\" LD = cc LDFLAGS = -o flip # If your system does not supply getopt as a library function, # add getopt.o to the RHS list on the next line and uncomment the # two nonblank lines after that. OBJS = flip.o #getopt.o: getopt.c flip.h # $(CC) $(CFLAGS) $(CFMORE) $*.c nothing: @echo \ 'Please type "make sys_v", "make bsd", "make uport", or "make ultrix"' sys_v: make "CFLAGS=-DSYS_V -DIX" flip uport: make "CFLAGS=-DSYS_V -Ml -DIX" "LDFLAGS=-Ml -o flip" flip bsd: make "CFLAGS=-DBSD -DIX" flip ultrix: make "CFLAGS=-DBSD -DULTRIX_BUG" flip flip: $(OBJS) $(LD) $(LDFLAGS) $(OBJS) flip.o: flip.c flip.h $(CC) $(CFLAGS) $(CFMORE) $*.c clean: rm -f *.o core flip install: mv flip $(BINDIR) cp flip.1 $(MANDIR) check: bash test-flip dist: $(DISTFILES) -rm -rf $(distdir) mkdir $(distdir) -chmod 777 $(distdir) @for file in $(DISTFILES); do \ d=$(srcdir); \ if test -d $$d/$$file; then \ cp -pr $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done -chmod -R a+r $(distdir) GZIP=$(GZIP_ENV) $(TAR) -chozf $(distdir).tar.gz $(distdir) -rm -rf $(distdir) flip-1.20/TURBOC.C0000644000175000017500000002446507705635226010440 00000000000000/* ::[[ @(#) turboc.c 1.6 89/07/02 00:19:31 ]]:: */ #ifndef LINT static char sccsid[]="::[[ @(#) turboc.c 1.6 89/07/02 00:19:31 ]]::"; #endif /* Copyright 1989 Rahul Dhesi, All rights reserved. This file is used only for MS-DOS & Turbo C. */ /* Checksum: 3933529970 (check or update this with "brik") */ /* nextfile() is a general wildcard expansion function that may be used with other programs. Usage instructions are below. It does not simply expand wildcards in an entire argument list. Instead, it is called in a loop as described below, and returns one matching filename each time it is called. These functions are for the SMALL MEMORY MODEL ONLY. */ extern unsigned _stklen = 10000; #include "assert.h" #include "flip.h" #define FMAX 2 /* Number of different filename patterns */ #define PATHSIZE 200 /* Size of MS-DOS pathname */ #define NULL 0 #ifdef ANSIPROTO char *strtcpy (char *, char *); int strlen (char *); char *strcpy (char *, char *); #endif /* Structure definitions for MS-DOS software interrupt intdos() */ struct WORD_REGISTERS { unsigned int ax, bx, cx, dx, si, di, carry, flags; }; /* byte registers */ struct BYTE_REGISTERS { unsigned char al, ah, bl, bh, cl, ch, dl, dh; }; union REGS { struct WORD_REGISTERS x; struct BYTE_REGISTERS h; }; int intdos (union REGS *, union REGS *); /* format of disk transfer address after MS-DOS calls FindFirst and FindNext */ struct dta_t { char junk[22]; int time; int date; long size; char fname[13]; char just_in_case[4]; /* in case MS-DOS writes too much */ }; void setdta (struct dta_t *); void fcbpath (struct dta_t *, char *, char *); /*******************/ /* nextfile() returns the name of the next source file matching a filespec. INPUT what: A flag specifying what to do. If "what" is 0, nextfile() initializes itself. If "what" is 1, nextfile() returns the next matching filename. filespec: The filespec, usually containing wildcard characters, that specifies which files are needed. If "what" is 0, filespec must be the filespec for which matching filenames are needed. If "what" is 1, nextfile() does not use "filespec" and "filespec" should be NULL to avoid an assertion error during debugging. fileset: nextfile() can keep track of more than one set of filespecs. The fileset specifies which filespec is being matched and therefore which set of files is being considered. "fileset" can be in the range 0:FMAX. Initialization of one fileset does not affect the other filesets. OUTPUT IF what == 0 THEN return value is NULL ELSE IF what == 1 THEN IF a matching filename is found THEN return value is pointer to matching filename including supplied path ELSE IF at least one file matched previously but no more match THEN return value is NULL ELSE IF supplied filespec never matched any filename THEN IF this is the first call with what == 1 THEN return value is pointer to original filespec ELSE return value is NULL END IF END IF END IF END IF NOTE Initialization done when "what"=0 is not dependent on the correctness of the supplied filespec but simply initializes internal variables and makes a local copy of the supplied filespec. If the supplied filespec was illegal, the only effect is that the first time that nextfile() is called with "what"=1, it will return the original filespec instead of a matching filename. That the filespec was illegal will become obvious when the caller attempts to open the returned filename for input/output and the open attempt fails. USAGE HINTS nextfile() can be used in the following manner: char *filespec; -- will point to filespec char *this_file; -- will point to matching filename filespec = parse_command_line(); -- may contain wildcards FILE *stream; nextfile (0, filespec, 0); -- initialize fileset 0 while ((this_file = nextfile(1, (char *) NULL, 0)) != NULL) { stream = fopen (this_file, "whatever"); if (stream == NULL) printf ("could not open %s\n", this_file); else perform_operations (stream); } */ char *nextfile (what, filespec, fileset) int what; /* whether to initialize or match */ register char *filespec; /* filespec to match if initializing */ register int fileset; /* which set of files */ { static struct dta_t new_dta [FMAX+1]; /* our own private dta */ static int first_time [FMAX+1]; static char pathholder [FMAX+1][PATHSIZE]; /* holds a pathname to return */ static char saved_fspec [FMAX+1][PATHSIZE];/* our own copy of filespec */ union REGS regs; assert(fileset >= 0 && fileset <= FMAX); if (what == 0) { assert(filespec != NULL); strcpy (saved_fspec[fileset], filespec); /* save the filespec */ first_time[fileset] = 1; return ((char *) NULL); } setdta (&new_dta[fileset]); /* set new dta -- our very own */ assert(what == 1); assert(filespec == NULL); assert(first_time[fileset] == 0 || first_time[fileset] == 1); if (first_time[fileset]) { /* first time -- initialize etc. */ /* find first matching file */ regs.h.ah = 0x4e; /* FindFirst MS-DOS call */ regs.x.dx = (unsigned int) saved_fspec[fileset]; /* filespec to match */ regs.x.cx = 0; /* search attributes */ intdos (®s, ®s); } else { /* find next matching file */ regs.h.ah = 0x4f; /* FindNext MS-DOS call */ intdos (®s, ®s); } if (regs.x.carry != 0) { /* if error status */ if (first_time[fileset]) { /* if file never matched then */ first_time[fileset] = 0; return (saved_fspec[fileset]);/* return original filespec */ } else { /* else */ first_time[fileset] = 0; /* */ return ((char *) NULL); /* return (NULL) for no more */ } } else { /* a file matched */ first_time[fileset] = 0; /* add path info */ fcbpath (&new_dta[fileset], saved_fspec[fileset], pathholder[fileset]); return (pathholder[fileset]); /* matching path */ } } /* nextfile */ /*******************/ /* This function sets the dta to a new dta */ void setdta (dta) struct dta_t *dta; { union REGS regs; regs.h.ah = 0x1a; /* SetDTA Call */ regs.x.dx = (unsigned int) dta; /* new DTA address */ intdos (®s, ®s); } /*******************/ /* fcbpath() accepts a pointer to the Disk Transfer Area, a character pointer to a pathname that may contain wildcards, and a character pointer to a buffer. It copies into the buffer the path prefix from the pathname and the filename prefix from the DTA so that it forms a complete path. */ void fcbpath (dta, old_path, new_path) struct dta_t *dta; char *old_path; register char *new_path; { register int i; int length, start_pos; strcpy(new_path, old_path); /* copy the whole thing first */ length = strlen(new_path); i = length - 1; /* i points to end of path */ while (i >= 0 && new_path[i] != '/' && new_path[i] != '\\' && new_path[i] != ':') i--; /* either we found a "/", "\", or ":", or we reached the beginning of the name. In any case, i points to the last character of the path part. */ start_pos = i + 1; for (i = 0; i < 13; i++) new_path[start_pos+i] = dta->fname[i]; new_path[start_pos+13] = '\0'; } /* -- END OF nextfile() and related functions -- */ /* For Turbo C, we implement MVFILE as a file copy to avoid wildcard expansion finding the same file again after a direct rename. To avoid leaving a partially-written destination file, we trap ^C, and if it occurs, delete the dest file and quickly do just a simple rename to it. */ #define BLOCKSIZ 16384 #include #include #include #include void handler (int); /* ^C handler */ char *xsrc, *xdest; /* global for handler() */ void (*oldsignal) (int); /* global for handler() */ int infd, outfd; /* global for handler() */ int brk_flag; /* ms-dos break flag status */ int getcbrk (void); int setcbrk (int); int MVFILE (src, dest) char *src; char *dest; { int retval; char buf[BLOCKSIZ]; retval = -1; /* default error return */ xsrc = src; xdest = dest; /* make visible to handler */ oldsignal = signal (SIGINT, handler); outfd = open (dest, O_CREAT|O_TRUNC|O_BINARY, S_IREAD|S_IWRITE); if (outfd == -1) goto erret; infd = open (src, O_RDONLY|O_BINARY); if (infd == -1) { close (outfd); goto erret; } while ((retval = read (infd, buf, BLOCKSIZ)) > 0) { if (write (outfd, buf, retval) != retval) { retval = -1; goto done; } } done: /* retval is zero on normal exit from loop, else nonzero */ close (infd); close (outfd); if (retval == 0) { signal (SIGINT, oldsignal); /* avoid race condition */ unlink (src); return (retval); } erret: /* if error during read/write, do rename to avoid loss of dest file */ unlink (dest); retval = rename (src, dest); signal (SIGINT, oldsignal); return (retval); } void handler (int sig) { signal (sig, SIG_IGN); close (infd); close (outfd); unlink (xdest); rename (xsrc, xdest); signal (sig, oldsignal); raise (sig); /* original handler gets signal now */ } #include void brktst() { kbhit(); } /* test for user interrupt */ void spec_init() { brk_flag = getcbrk(); setcbrk (0); } void spec_exit() { setcbrk (brk_flag); } flip-1.20/TURBOC.CFG0000644000175000017500000000024107705635226010637 00000000000000-wamp -wcln -wuse -wrvl -wsig -wamb -wstv -wpro -wnod -wucp -A -O -Z -k- -d -I\turboc\include -L\turboc\lib -eFLIP -DTURBOC -DLINT -DNDEBUG flip-1.20/flip.10000644000175000017500000001157607705635226010351 00000000000000.\" Hey Emacs! This file is -*- nroff -*- source. .\" .\" This manpage is copyright (C) 1989 Rahul Dhesi .\" .\" Permission is granted to make and distribute verbatim copies of this .\" manual provided the copyright notice and this permission notice are .\" preserved on all copies. .\" .\" Permission is granted to copy and distribute modified versions of this .\" manual 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 .\" .\" Since the Linux kernel and libraries are constantly changing, this .\" manual page may be incorrect or out-of-date. The author(s) assume no .\" responsibility for errors or omissions, or for damages resulting from .\" the use of the information contained herein. The author(s) may not .\" have taken the same level of care in the production of this manual, .\" which is licensed free of charge, as they might when working .\" professionally. .\" .\" Formatted or processed versions of this manual, if unaccompanied by .\" the source, must acknowledge the copyright and authors of this work. .TH FLIP 1 "July 20, 2002" "Linux 2.0" "Linux Programmer's Manual" .SH NAME flip, toms, toix \- do newline conversions between **IX and MS-DOS .SH SYNOPSIS .B flip -h .br .B flip \fR[\fP -umvtsbz\fR]\fP \fIfile\fP ... .br .B flip \fR[\fP -umvtsbz\fR]\fP - .br .B toix \fR[\fP -vtsbz\fR]\fP \fIfile\fP ... .br .B toms \fR[\fP -vtsbz\fR]\fP \fIfile\fP ... .SH DESCRIPTION \fBflip\fP is a file interchange program that converts text file formats between **ix and MS-DOS. It converts lines ending with carriage-return (CR) and linefeed (LF) to lines ending with just linefeed, or vice versa. If the special argument "-" is given, input is read from stdin and written to stdout. \fBflip\fP has the following features: .sp .RS \fBflip\fP will normally refuse to convert binary files. You can override this. When asked to convert a file to the same format that it already has, \fBflip\fP causes no change to the file. Thus to convert all files to **IX format you can type .sp .nf .\" flip -u *.* (under MS-DOS) flip -u * .\" (under **IX) .fi .sp and all files will end up right, regardless of whether they were in MS-DOS or in **IX format to begin with. This also works in the opposite direction. If a file contains isolated CR characters for underlining or overprinting, \fBflip\fP does not change them. \fBflip\fP preserves file timestamps. You can override this. \fBflip\fP preserves file permissions. \fBflip\fP is written in C and will compile and run under MS-DOS/Turbo C, 4.3BSD, and System V. \fBflip\fP accepts wildcards and multiple filenames on the command line. If a user interrupt aborts \fBflip\fP, it does not leave behind any garbage files or cause corruption of the files being converted. When converting from MS-DOS to **IX format, \fBflip\fP removes any trailing control Z (the last character in the file), but leaves embedded control Z characters unchanged. This minimizes the possibility of accidentally converting a binary file that contains a control Z near the beginning. You can override this and ask \fBflip\fP to recognize the first control Z found as end-of-file. \fBflip\fP can be asked to strip the high (parity) bit as it converts a file. .RE .sp \fBflip\fP is normally invoked as: .nf flip -umhvtb file ... .fi One of -u, -m, or -h is required. Switches may be given separately or combined together after a dash. For example, the three command lines given below are equivalent: .nf flip -uvt *.c flip -u -v -t *.c flip -u -vt *.c .fi On systems that allow a program to know its own name, \fBflip\fP may be renamed (or linked) to a file called toix .\" (or toix.exe under MS-DOS) for conversion to **IX format, or to a file called toms .\" (or toms.exe under MS-DOS) for conversion to MS-DOS format. When invoked with the name toix or toms, \fBflip\fP will act as if it were invoked with the -u or -m option respectively. .\" .\" .SH RETURN VALUE .\" On success, \fB@name@\fP returns ... .\" On error, it returns \-1, and \fIerrno\fP is set appropriately. .SH OPTIONS .IP -u Convert to **IX format (CR LF => LF, lone CR or LF unchanged, trailing control Z removed, embedded control Z unchanged). .IP -m Convert to MS-DOS format (lone LF => CR LF, lone CR unchanged). .IP -h Give a help message. .IP -v Be verbose, print filenames as they are processed. .IP -t Touch files (don't preserve timestamps). .IP -s Strip high bit. .IP -b Convert binary files too (else binary files are left unchanged). .IP -z Truncate file at first control Z encountered. .SH AUTHOR Rahul Dhesi . .SH SEE ALSO .BR unix2dos (1), .BR dos2unix (1). flip-1.20/flip.c0000644000175000017500000003577411042646665010437 00000000000000/* ::[[ @(#) flip.c 1.18 89/07/04 16:07:16 ]]:: */ #ifndef LINT static char sccsid[]="::[[ @(#) flip.c 1.20 2008-07-26 ]]::"; #endif /* Copyright 1989 Rahul Dhesi, All rights reserved. Checksum: 1217582374 (check or update with "brik") */ /* Does newline conversions between **IX and MS-DOS conventions. Uses a state machine, so repeated conversions on the same file will do no harm. Assumes the US ASCII character set in some places (search for 'ASCII'). */ /* change contents of flip.h as needed */ #include "flip.h" enum choices { MSTOIX, IXTOMS, NEITHER }; /* conversion choices */ enum state { NONE, SAWCR, SAWLF, SAWCRLF, SAWCTRLZ }; void usage PARMS ((void)); void give_help PARMS ((void)); void flip_exit PARMS ((int)); int getopt PARMS ((int argc, char **argv, char *options)); void doarg PARMS ((char *, enum choices)); int dofile PARMS ((char *, enum choices)); char *nextfile PARMS ((int, char *, int)); int ixtoms PARMS ((FILE *, FILE *)); int mstoix PARMS ((FILE *, FILE *)); void error PARMS ((char *, char *)); void setup_sigs PARMS ((void)); void cleanup PARMS ((int)); int mkstemp PARMS ((char *)); #ifdef STDINCLUDE # include # include #else void *malloc PARMS ((int)); void exit PARMS ((int)); char *strcpy PARMS ((char *, char *)); #endif #ifdef IX #include #include /* stat and chmod */ #include #endif #ifdef NDEBUG # define assert(c) #else # ifdef STDINCLUDE # include # else # define assert(c) if(!(c)) \ fprintf(stderr,"assert error %s:%d\n",__FILE__,__LINE__) # endif /* STDINCLUDE */ #endif /* NDEBUG */ #ifdef USE_TABLE char *bintab; #endif #ifdef USE_SIG int got_sig; /* will indicate if signal received */ #endif char *myname = NULL; int exitstat = 0; /* exit status */ int verbose = 0; /* set by -v option */ int touch = 0; /* set by -t option */ int strip = 0; /* set by -s option */ int bintoo = 0; /* set by -b option */ int ztrunc = 0; /* set by -z option */ int use_stdio = 0; /* set by "-" filename */ int main (argc, argv) int argc; char **argv; { int option; extern int optind; int i; enum choices which = NEITHER; #ifdef USE_TABLE #define TABSIZ 256 char table[TABSIZ]; #endif #ifdef PICKNAME register char *p; /* temp pointer for finding our name */ register char *arg0 = *argv; #endif /* PICKNAME */ SPEC_INIT /* optional initialization */ #ifdef USE_SIG setup_sigs(); #endif #ifdef PICKNAME # define STRCMP(a,op,b) (strcmp(a,b) op 0) p = arg0 + strlen(arg0); if (p != arg0) { /* if program name is defined */ while (p != arg0 && *p != '/' && *p != '\\') p--; assert ((p - arg0) <= strlen (arg0)); if (p != arg0) p++; /* p now points to trailing name component, or nothing */ myname = p; while (*p != '\0' && *p != '.') { /* ASCII convert to lowercase */ if (*p >= 'A' && *p <= 'Z') { *p = (*p - 'A' + 'a'); } p++; } if (p != myname && *p == '.') *p = '\0'; /* remove trailing .exe or .com under MS-DOS etc. */ if (STRCMP(myname,==,"toix")) which = MSTOIX; else if (STRCMP(myname,==,"toms")) which = IXTOMS; } else myname = "flip"; #else myname = "flip"; #endif /* PICKNAME */ argv[0] = myname; /* for use by getopt */ #ifdef USE_TABLE /* table to find out which characters are binary */ for (i = 0; i < TABSIZ; i++) { if ( (i < 7) || (i > 13 && i < 26) || (i > 126)) /*ASCII binary chars*/ table[i] = 1; else table[i] = 0; } bintab = table; #endif /* USE_TABLE */ if (argc < 2) { usage(); flip_exit (1); } while ((option = getopt (argc, argv, "umhvtsbz")) != EOF) { switch (option) { case 'u': which = MSTOIX; break; case 'm': which = IXTOMS; break; case 'h': give_help(); flip_exit (0); case 'v': verbose = 1; break; case 't': touch = 1; break; case 's': strip = 1; break; case 'b': bintoo = 1; break; case 'z': ztrunc = 1; break; default: usage(); flip_exit (1); } } switch (which) { case MSTOIX: /* printf ("converting to **ix format\n"); */ break; case IXTOMS: /* printf ("converting to msdos format\n"); */ break; default: fprintf (stderr, "%s: error: -u or -m is required\n", myname); flip_exit (1); break; } if (argc <= optind) { fprintf (stderr, "%s: error: filenames are needed\n", myname); flip_exit (1); } for (i = optind; i < argc; i++) doarg (argv[i], which); return (exitstat); } /* Does conversion for one argument, calling dofile with wildcards expanded. Updates exitstat in case of error. */ void doarg (arg, which) char *arg; enum choices which; { #ifdef WILDCARD char *this_file; nextfile (0, arg, 0); while ((this_file = nextfile(1, (char *) NULL, 0)) != NULL) { exitstat |= dofile (this_file, which); } #else exitstat |= dofile (arg, which); #endif /* WILDCARD */ } #ifdef USE_SIG # include #endif FILE *outfile; /* make it visible to both dofile and cleanup */ /* Here we have filename and an option. We call a different routine for each type of conversion. This way more types of conversions can be easily added in the future. */ int dofile (fname, which) char *fname; enum choices which; { FILE *infile; char tfname[PATHSIZE]; SGFTIME timestamp; /* save file timestamp here, restore later */ int errstat = 0; char *p; /* temp file ptr */ #ifdef IX struct stat ifilestat, ofilestat; #endif #ifdef USE_SIG if (got_sig) flip_exit (INT_EXIT); #endif if(STRCMP(fname,==,"-")) use_stdio = 1; if(!use_stdio) { /* if writable, open for reading */ if ((infile = fopen (fname, R_PL_B)) != NULL) { fclose (infile); infile = fopen (fname, RB); #ifdef IX if (stat (fname, &ifilestat)) { /* can't get the file's permissions */ char *buf = malloc(strlen(fname)+strlen(myname)+3); if (buf) { sprintf(buf, "%s: %s", myname, fname); perror(buf); } ifilestat.st_mode = 0644; ifilestat.st_uid = geteuid(); ifilestat.st_gid = getegid(); } #endif } } else { infile = stdin; } if (infile == NULL) { error (fname, ": can't open"); return (1); } if(use_stdio) { outfile = stdout; } else { /* to make temp file in same dir as original, we make p point to the filename component of fname, put '\0' there, and strcat the temp name to it */ strcpy (tfname, fname); p = tfname + strlen(tfname); while (p != tfname && *p != '/' && *p != '\\') p--; if (p != tfname) p++; *p = '\0'; #define TEMPLATE "XXXXXX" #ifdef IX strcat (tfname, TEMPLATE); { int fd = mkstemp(tfname); if (fd == -1 || (outfile = fdopen(fd, WB)) == NULL) { fclose (infile); error (fname, ": skipped, could not open temporary file"); return (1); } } #else { char template[7]; strcpy (template, TEMPLATE); strcat (tfname, mktemp (template)); } outfile = fopen (tfname, WB); if (outfile == NULL) { fclose (infile); error (fname, ": skipped, could not open temporary file"); return (1); } #endif } if (!touch) GETFT (infile, fname, timestamp); /* save current timestamp */ assert (which == IXTOMS || which == MSTOIX); #ifdef BIGBUF setvbuf (infile, (char *) NULL, _IOFBF, BIGBUF); setvbuf (outfile, (char *) NULL, _IOFBF, BIGBUF); #endif /* BIGBUF */ switch (which) { case IXTOMS: errstat = ixtoms (infile, outfile); break; case MSTOIX: errstat = mstoix (infile, outfile); break; case NEITHER: ; } fclose (infile); switch (errstat) { case ERRBINF: fclose (outfile); DELFILE (tfname); fprintf (stderr, "%s: binary file, not converted\n", fname); return (1); /* break; */ /* unreachable code */ #ifdef USE_SIG case ERRSIG: fclose (outfile); DELFILE (tfname); flip_exit (INT_EXIT); break; #endif default: ; } assert (errstat == 0); if (!ferror(outfile) && fflush(outfile) != EOF && fclose(outfile) != EOF) { int moved; #ifdef IX if (stat (tfname, &ofilestat)) { /* can't get the file's permissions */ char *buf = malloc(strlen(tfname)+strlen(myname)+3); if (buf) { sprintf(buf, "%s: %s", myname, tfname); perror(buf); } } if (ifilestat.st_gid != ofilestat.st_gid || ifilestat.st_uid != ofilestat.st_uid) if (chown(tfname, ifilestat.st_uid, ifilestat.st_gid)) { /* can't set the file's ownership */ char *buf = malloc(strlen(tfname)+strlen(myname)+3); if (buf) { sprintf(buf, "%s: %s", myname, tfname); perror(buf); } } if (ifilestat.st_mode != ofilestat.st_mode) if (chmod(tfname, ifilestat.st_mode)) { /* can't set the file's permissions */ char *buf = malloc(strlen(tfname)+strlen(myname)+3); if (buf) { sprintf(buf, "%s: %s", myname, tfname); perror(buf); } } #endif /* IX */ // DELFILE (fname); if (!use_stdio) { moved = MVFILE (tfname, fname); if (moved == 0) { FILE *fptr; if (!touch && (fptr = fopen (fname, RB)) != NULL) { SETFT (fptr, fname, timestamp); fclose (fptr); } if (verbose) { printf ("%s\n", fname); fflush (stdout); } return (0); } else { error (fname, ": not converted, could not rename temp file"); DELFILE (tfname); return (1); } } } else { fclose (outfile); /* outfile was not closed, so close it here */ return (1); } return (1); /* silences gcc warning */ } /* convert from ms-dos to **ix format */ int mstoix (infile, outfile) FILE *infile; /* input file */ FILE *outfile; /* output file */ { int c; enum state state = NONE; /* lone LF => unchanged, lone CR => unchanged, CR LF => LF, ^Z at end means EOF; ^Z elsewhere => unchanged */ while (1) { /* break out on EOF only */ while ((c = getc (infile)) != EOF) { #ifdef USE_SIG if (got_sig) return (ERRSIG); #endif if (!bintoo && BINCHAR(c)) return (ERRBINF); if (strip) STRIP(c); switch (c) { case LF: CHECK_BREAK putc (c, outfile); if (state == SAWCR) state = NONE; break; case CR: state = SAWCR; break; case CTRLZ: if (state == SAWCR) putc (CR, outfile); state = SAWCTRLZ; goto saweof; default: if (state == SAWCR) { state = NONE; putc (CR, outfile); } putc (c, outfile); break; } } saweof: /* exit outer loop only on EOF or ^Z as last char */ if ( (ztrunc && (state == SAWCTRLZ)) || (c = getc (infile)) == EOF ) break; else ungetc (c, infile); if (state == SAWCTRLZ) putc (CTRLZ, outfile); } return (0); } /* convert from **ix to ms-dos format */ int ixtoms (infile, outfile) FILE *infile; /* input file */ FILE *outfile; /* output file */ { int c; enum state state = NONE; /* LF => CR LF, but leave CR LF alone */ while ((c = getc (infile)) != EOF) { #ifdef USE_SIG if (got_sig) return (ERRSIG); #endif if (!bintoo && BINCHAR(c)) return (ERRBINF); if (strip) STRIP(c); switch (c) { case LF: CHECK_BREAK if (state == SAWCR) state = NONE; else putc (CR, outfile); putc (LF, outfile); break; case CR: state = SAWCR; putc (c, outfile); break; case CTRLZ: if (ztrunc) return (0); /* FALL THROUGH */ default: state = NONE; putc (c, outfile); break; } } return (0); } /* set up signal handler for selected signals */ #ifdef USE_SIG void setup_sigs () { # ifdef SIGPIPE if (signal (SIGPIPE, SIG_IGN) != SIG_IGN) signal (SIGPIPE, cleanup); # endif # ifdef SIGHUP if (signal (SIGHUP, SIG_IGN) != SIG_IGN) signal (SIGHUP, cleanup); # endif # ifdef SIGQUIT if (signal (SIGQUIT, SIG_IGN) != SIG_IGN) signal (SIGQUIT, cleanup); # endif # ifdef SIGINT if (signal (SIGINT, SIG_IGN) != SIG_IGN) signal (SIGINT, cleanup); # endif # ifdef SIGTERM if (signal (SIGTERM, SIG_IGN) != SIG_IGN) signal (SIGTERM, cleanup); # endif } /* set flag on signal */ void cleanup(sig) int sig; { signal (sig, SIG_IGN); /* needed for flaky System V Release 2 */ got_sig = 1; signal (sig, cleanup); /* ditto */ } #endif /* USE_SIG */ #define ERRSIZE 200 /* prints error message via perror */ void error (msg1, msg2) char *msg1, *msg2; { char buf[ERRSIZE]; strcpy (buf, myname); strcat (buf, ": "); strcat (buf, msg1); strcat (buf, msg2); perror (buf); fflush (stderr); } /* gives brief usage message */ void usage() { fprintf (stderr, "usage: %s [-u | -m] [other options] file ... (or \"%s -h\" for more help)\n", myname, myname); } /* gives help screen */ void give_help() { printf ("\ File interchange program flip version " VERSION ". Copyright 1989 Rahul Dhesi,\n\ All rights reserved. Both noncommercial and commercial copying, use, and\n\ creation of derivative works are permitted in accordance with the\n\ requirements of the GNU license. This program does newline conversions.\n"); printf ("\n\ Usage: flip -umhvtsbz file ...\n\ \n\ One of -u, -m, or -h is required; others are optional. See user manual.\n"); printf ("\n\ -u convert to **IX format (CR LF => LF, lone CR or LF unchanged,\n\ trailing control Z removed, embedded control Z unchanged)\n\ -m convert to MS-DOS format (lone LF => CR LF, lone CR unchanged)\n\ -h give this help message\n\ -v be verbose, print filenames as they are processed\n\ -t touch files (don't preserve timestamps)\n\ -s strip high bit\n\ -b convert binary files too (else binary files are left unchanged)\n\ -z truncate file at first control Z encountered\n\ "); #ifdef PICKNAME printf ("\n\ May be invoked as \"toix\" (same as \"flip -u\") or \"toms\" (same as \"flip -m\").\n\ "); #endif return; } /* normal exits go through here -- atexit would be nice but not portable */ void flip_exit(stat) int stat; { SPEC_EXIT exit (stat); } /* special code for **IX -- not in use because can't properly handle SIGINT while /bin/mv is executing */ #ifdef NIX # ifndef MVFILE int MVFILE (src, dest) char *dest; char *src; { char cmd[2 * PATHSIZE]; sprintf (cmd, "/bin/mv %s %s", src, dest); return (system(cmd)); } # endif /* MVFILE */ #endif /* NIX */ flip-1.20/flip.h0000644000175000017500000001724311042651204010414 00000000000000/* ::[[ @(#) flip.h 1.16 89/07/04 17:00:46 ]]:: */ /* Copyright 1989 Rahul Dhesi, All rights reserved. Checksum: 2652839101 (check or update with "brik") ANSI-compatibility strategy: 1. If ANSIPROTO is defined, function prototypes are used, ANSI-style. If it is not defined, regular function declarations (without a parameter list) are used. This is achieved with the use of the PARMS macro. 2. If STDINCLUDE is defined, ANSI-conformant header files are included. Otherwise functions that would be declared in such header files are declared individually. */ #ifndef OK_NL /* Define ANSIPROTO and/or STDINCLUDE here if needed */ #ifdef TURBOC # define ANSIPROTO # define STDINCLUDE #endif /* TURBOC */ #include #ifndef PARMS # ifdef ANSIPROTO # define PARMS(x) x # else # define PARMS(x) () # endif #endif /************************************************************/ /*** change following definitions as needed for your system */ /************************************************************/ /* BIGBUF If defined, setvbuf() will be used to set input and output buffers to BIGBUF characters BINCHAR This must be a macro accepting a single character argument and returning nonzero if and only if that character is a binary character. By default, BINCHAR is defined to look up a table, and the table is compiled in by defining USE_TABLE. CHECK_BREAK If your operating system requires programs to check for user interrupts at intervals, define CHECK_BREAK to be a function or macro that checks for a user interrupt. Flip will call this at intervals. If not needed, define CHECK_BREAK to be null. DELFILE Must be a function or macro that will accept one filenames and delete that file, returning zero on success, nonzero on failure. GETFT Must be a macro with usage GETFT(file,name,var) that will take an open file, a filename, and a variable name, and put in that variable the timestamp of the file. INT_EXIT If USE_SIG is defined, INT_EXIT must be defined to be the exit code returned by flip when its execution is aborted by a user interrupt. MVFILE Must be a function or macro that will take two filenames and rename the first file to the second file, returning zero on success, nonzero on failure. NIX If this symbol is defined, some things common to most implementations of **IX get defined and need not be individually defined. PATHSIZE size of buffer(s) to use to hold pathname(s) PICKNAME Do "#define PICKNAME" if you want the program to know its name and respond to it. If PICKNAME is not defined, the program will assume that it is called "flip". SETFT Must be a function or macro with usage SETFT(file,name,var) that will take an open file, a filename, and a variable name, and set the timestamp of the file from the variable. SIG_T If USE_SIG is defined, then SIG_T must be defined (or typedef'd) to be the data type returned by (*signal). Usually int or void. SPEC_EXIT Like SPEC_INIT, but is called just before flip exits. SPEC_INIT This is invoked to initialize flip. Should be defined to be either a function call (with trailing semicolon) or null string. SGFTIME This must be a typedef for a data type suitable to store file times. USE_TABLE If this is defined, flip code will use a table look-up to decide which characters should be considered binary. See also BINCHAR. ULTRIX_BUG At least one version of Ultrix chokes on a trailing "b" in the mode string for fopen(). If ULTRIX_BUG is defined no trailing "b" will be used. USE_SIG If this is defined, then signal() will be used so flip may trap user interrupts and delete temporary files. If USE_SIG is defined, then SIG_T and INT_EXIT must also be defined (below). WILDCARD If this is defined, the function nextfile() will be called to expand wildcards. If WILDCARD is not defined, no wildcard expansion will be done and nextfile() is not needed. For a description of nextfile() see turboc.c. */ #ifdef FILENAME_MAX #define PATHSIZE FILENAME_MAX #endif /* FILENAME_MAX */ #ifdef TURBOC #ifndef PATHSIZE # define PATHSIZE 200 #endif /* PATHSIZE */ # define PICKNAME # define BIGBUF 16384 # define DELFILE remove extern int MVFILE PARMS ((char *src, char *dest)); /* Turbo C */ # define USE_SIG # define SIG_T void /* return type from (*signal) */ # define INT_EXIT 127 /* status when a signal causes exit */ # define CHECK_BREAK brktst(); void brktst PARMS ((void)); # define SPEC_INIT spec_init(); # define SPEC_EXIT spec_exit(); void spec_init PARMS ((void)); void spec_exit PARMS ((void)); # define WILDCARD /* date and time */ # include typedef struct ftime SGFTIME; # define GETFT(f,name,var) getftime(fileno(f), &var) # define SETFT(f,name,var) setftime(fileno(f), &var) #endif /* TURBOC */ #ifdef SYS_V # define NIX /* see below */ #ifndef PATHSIZE # define PATHSIZE 200 #endif /* PATHSIZE */ # define BIGBUF 16384 # define MVFILE(src,dest) (!(!link(src,dest)&&!unlink(src))) # define SIG_T int #endif /* SYS_V */ #ifdef BSD # define NIX /* see below */ #ifndef PATHSIZE # define PATHSIZE 1027 #endif /* PATHSIZE */ # undef BIGBUF # define MVFILE rename # define SIG_T int #endif /* BSD */ #ifdef VMS #ifndef PATHSIZE # define PATHSIZE 1024 #endif /* PATHSIZE */ # define PICKNAME # define BIGBUF 16384 # define DELFILE delete # define MVFILE rename # define USE_SIG # define SIG_T int # define INT_EXIT 127 # define SPEC_INIT # define SPEC_EXIT #endif /* VMS */ /************************************************************/ /*** remaining definitions should not need to be changed ****/ /************************************************************/ /* define ASCII character values for linefeed, carriage return, control Z */ #define LF 10 #define CR 13 #define CTRLZ 26 /* error codes */ #define ERRBINF 1 /* binary file */ #define ERRSIG 2 /* interrupted by signal */ /* how to strip high bit */ #define STRIP(c) c &= 0x7f /**** BINCHAR(c) returns nonzero if c is a binary char ****/ #ifndef BINCHAR # define USE_TABLE /* use internal table -- see flip.c */ # define BINCHAR(c) bintab[c] #endif /**** mode strings for fopen() -- to work around Ultrix problem ****/ /**** (Thanks to Taso N. Devetzis for reporting this) ****/ #ifdef ULTRIX_BUG # define WB "w" # define RB "r" # define R_PL_B "r+" #else # define WB "wb" /* write binary */ # define RB "rb" /* read binary */ # define R_PL_B "r+b" /* read + update binary */ #endif /* ULTRIX_BUG */ /* things common to most **IX systems */ #ifdef NIX # define SPEC_INIT # define SPEC_EXIT # define CHECK_BREAK # define PICKNAME # define DELFILE unlink # define USE_SIG # define INT_EXIT 127 # include /* for file time */ # include /* for file time */ # include /* for utime() */ typedef struct stat SGFTIME; # define GETFT(file,name,var) fstat(fileno(file),&var) # define SETFT(file,name,var) do { struct utimbuf x; x.actime = var.st_atime; \ x.modtime = var.st_mtime; utime (name, &x); \ } while (0) #endif /* NIX */ #endif /* OK_NL */ flip-1.20/getopt.c0000644000175000017500000000552307705635226010776 00000000000000/* ::[[ @(#) getopt.c 1.5 89/07/02 00:18:19 ]]:: */ #ifndef LINT static char sccsid[]="::[[ @(#) getopt.c 1.5 89/07/02 00:18:19 ]]::"; #endif /* Checksum: 505161377 (check or update this with "brik") */ /* * Here's something you've all been waiting for: the AT&T public domain * source for getopt(3). It is the code which was given out at the 1985 * UNIFORUM conference in Dallas. I obtained it by electronic mail * directly from AT&T. The people there assure me that it is indeed * in the public domain. * * There is no manual page. That is because the one they gave out at * UNIFORUM was slightly different from the current System V Release 2 * manual page. The difference apparently involved a note about the * famous rules 5 and 6, recommending using white space between an option * and its first argument, and not grouping options that have arguments. * Getopt itself is currently lenient about both of these things White * space is allowed, but not mandatory, and the last option in a group can * have an argument. That particular version of the man page evidently * has no official existence, and my source at AT&T did not send a copy. * The current SVR2 man page reflects the actual behavor of this getopt. * However, I am not about to post a copy of anything licensed by AT&T. */ /* Minor modifications by Rahul Dhesi 1989/03/06 */ #include "flip.h" #ifdef STDINCLUDE # include #else extern int strcmp PARMS ((char *, char *)); extern char *strchr PARMS ((char *, char)); #endif /* Avoid possible compiler warning if we simply redefine NULL or EOF */ #define XNULL 0 #define XEOF (-1) #define ERR(szz,czz) if(opterr){fprintf(stderr,"%s%s%c\n",argv[0],szz,czz);} int opterr = 1; int optind = 1; int optopt; char *optarg; int getopt(argc, argv, opts) int argc; char **argv, *opts; { static int sp = 1; register int c; register char *cp; if(sp == 1) if(optind >= argc || argv[optind][0] != '-' || argv[optind][1] == '\0') return(XEOF); else if(strcmp(argv[optind], "--") == XNULL) { optind++; return(XEOF); } optopt = c = argv[optind][sp]; if(c == ':' || (cp=strchr(opts, c)) == XNULL) { ERR(": illegal option -- ", c); if(argv[optind][++sp] == '\0') { optind++; sp = 1; } return('?'); } if(*++cp == ':') { if(argv[optind][sp+1] != '\0') optarg = &argv[optind++][sp+1]; else if(++optind >= argc) { ERR(": option requires an argument -- ", c); sp = 1; return('?'); } else optarg = argv[optind++]; sp = 1; } else { if(argv[optind][++sp] == '\0') { sp = 1; optind++; } optarg = XNULL; } return(c); } flip-1.20/ChangeLog0000644000175000017500000000226711042756201011066 000000000000002008-07-26 James R. Van Zandt * Makefile (check): new target "check". Include test-flip in distribution file. Add comments giving command to build on a modern Unix system with a standard C compiler. * test-flip: new shell script to test flip * flip.h (SETFT): #include utime.h. call utime with a struct utimbuf rather than an array. * flip.c: bring sccsid up to date. (dofile): handle case NEITHER. Transfer old file permissions and ownership to new file. Add return value to silence gcc warning. (mstoix): add parens to silence gcc warning 2008-07-25 James R. Van Zandt * flip.h (PATHSIZE): set PATHSIZE from FILENAME_MAX (in stdio.h) if possible. * Makefile: version 1.20 2001-07-15 James R. Van Zandt * flip.c: preserve file permissions. Accept input from stdin, write to stdout (thanks to "Dwayne C. Litzenberger" ) * flip.1: document the above. 2001-07-13 James R. Van Zandt * Makefile (DISTFILES): add "dist" target. * flip.c: help message inherits version number from Makefile * flip.c: use mkstemp instead of mktemp to reduce security risk. * version 1.19