Incorporated into the GNO base distribution.

Changed the initialization for the getopt(3) package to work with
     BSD-based systems (like GNO v2.0.6) as well as with GNU-based
     systems.
  Use proper capitalization for "UNIX" and "ORCA".
This commit is contained in:
gdr 1997-12-19 07:48:16 +00:00
parent 7276456260
commit c1f439e0a7
7 changed files with 78 additions and 66 deletions

View File

@ -1,16 +1,16 @@
============================================================================= =============================================================================
udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF), udl - Convert EOL formats freely between MS-DOS (CR/LF), UNIX/Amiga (LF),
and Apple (CR). and Apple (CR).
(c) 1993-1996 Soenke Behrens, Devin Reade (c) 1993-1997 Soenke Behrens, Devin Reade
Version 1.1.5 Version 1.1.6
$Id: HISTORY,v 1.3 1997/08/02 21:09:12 gdr Exp $ $Id: HISTORY,v 1.4 1997/12/19 07:48:15 gdr Exp $
============================================================================= =============================================================================
Udl converts text files between CR, LF and CR/LF (Apple, Unix and MS-DOS). Udl converts text files between CR, LF and CR/LF (Apple, UNIX and MS-DOS).
It is a very fast utility that ensures that the integrity of the file It is a very fast utility that ensures that the integrity of the file
cannot be compromised during the translation. It is also much easier cannot be compromised during the translation. It is also much easier
to use than tr(1). to use than tr(1).
@ -38,17 +38,17 @@ v1.1.1
prefixed with the name it was invoked with. prefixed with the name it was invoked with.
v1.1.2 v1.1.2
Sped up Apple <-> Unix conversion further (factor 1.5). Sped up Apple <-> UNIX conversion further (factor 1.5).
v1.1.2 (Unix) v1.1.2 (UNIX)
(December 1993) (December 1993)
Modified source to produce a Unix version Modified source to produce a UNIX version
v1.1.3 v1.1.3
(Updated by Devin Reade, November 1994) (Updated by Devin Reade, November 1994)
Added ability to recurse through directories (-R flag). Added ability to recurse through directories (-R flag).
Changed behavior to ignore binary files rather than exiting. Changed behavior to ignore binary files rather than exiting.
Merged Unix and Apple IIgs versions. Merged UNIX and Apple IIgs versions.
No message is printed out when a binary file (or, in the IIgs No message is printed out when a binary file (or, in the IIgs
implementation, a non-TXT or non-SRC file) is encountered implementation, a non-TXT or non-SRC file) is encountered
unless the -v option is specified. unless the -v option is specified.
@ -66,18 +66,26 @@ v1.1.4
Modified Makefile.gs to properly write the new executable over Modified Makefile.gs to properly write the new executable over
the old resource fork for udl. The resource fork originates with the old resource fork for udl. The resource fork originates with
the file udl.r. the file udl.r.
Added suggested defines to the README for various Unix platforms. Added suggested defines to the README for various UNIX platforms.
Man page changes, including grammar and the deletion of a bug that Man page changes, including grammar and the deletion of a bug that
no longer exists. no longer exists.
Fixed bug where invoking 'udl -u directory' would attempt to Fixed bug where invoking 'udl -u directory' would attempt to
deref a NULL pointer, causing either memory tromping (IIgs) or deref a NULL pointer, causing either memory tromping (IIgs) or
a core dump (Unix). a core dump (UNIX).
Tested under SunOS 4.x, SunOS 5.x (Solaris), and AIX. Tested under SunOS 4.x, SunOS 5.x (Solaris), and AIX.
v1.1.5 v1.1.5
(Soenke Behrens, Devin Reade, January 1996) (Soenke Behrens, Devin Reade, January 1996)
Changed source slightly to compile under djgpp (MS-DOS) and Linux, Changed source slightly to compile under djgpp (MS-DOS) and Linux,
linted source linted source
Unix makefile changed by Devin Reade to automatically detect OS UNIX makefile changed by Devin Reade to automatically detect OS
type type
Apple IIgs source now opens files with "r+b" instead of "rwb" Apple IIgs source now opens files with "r+b" instead of "rwb"
v1.1.6
(Devin Reade, December 1997)
Incorporated into the GNO base distribution.
Changed the initialization for the getopt(3) package to work with
BSD-based systems (like GNO v2.0.6) as well as with GNU-based
systems.
Use proper capitalization for "UNIX" and "ORCA".

View File

@ -5,18 +5,16 @@
# #
# Devin Reade, October 1997. # Devin Reade, October 1997.
# #
# $Id: Makefile,v 1.1 1997/12/08 16:07:19 gdr Exp $ # $Id: Makefile,v 1.2 1997/12/19 07:48:15 gdr Exp $
# #
PROG = udl PROG = udl
SRCS = udlgs.c udluse.c common.c globals.c SRCS = udlgs.c udluse.c common.c globals.c
MAIN = udlgs MAIN = udlgs
# OPTIMIZE= 0
# DEBUG =
# See the README for these macros. # See the README for these macros.
CFLAGS += -DHAS_ATEXIT -DOVERFLOW_CHECK # -D__STACK_CHECK__ CFLAGS += -DHAS_ATEXIT -DOVERFLOW_CHECK # -D__STACK_CHECK__
STACK = 4096 STACK = 2048
BINDIR = /usr/bin BINDIR = /usr/bin
.INCLUDE: /src/gno/prog.mk .INCLUDE: /src/gno/prog.mk

View File

@ -1,16 +1,16 @@
============================================================================= =============================================================================
udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF), udl - Convert EOL formats freely between MS-DOS (CR/LF), UNIX/Amiga (LF),
and Apple (CR). and Apple (CR).
(c) 1993-1996 Soenke Behrens, Devin Reade (c) 1993-1997 Soenke Behrens, Devin Reade
Version 1.1.5: $Id: README,v 1.11 1997/12/08 16:07:19 gdr Exp $ Version 1.1.6: $Id: README,v 1.12 1997/12/19 07:48:15 gdr Exp $
============================================================================= =============================================================================
Udl converts text files between the various end-of-line conventions, i.e. Udl converts text files between the various end-of-line conventions, i.e.
CR, LF, and CR/LF, used by the Apple IIgs, MS-DOS, Amiga, and Unix. CR, LF, and CR/LF, used by the Apple IIgs, MS-DOS, Amiga, and UNIX.
After conversion, the original file is replaced with the converted file. After conversion, the original file is replaced with the converted file.
Udl is known to run with ORCA/Shell 2.x, GNO/ME 2.x, and Unix. Udl is known to run with ORCA/Shell 2.x, GNO/ME 2.x, and UNIX.
Not only is udl faster and simpler than tr(1), but it saves a step in Not only is udl faster and simpler than tr(1), but it saves a step in
the conversion process by automatically replacing the original file the conversion process by automatically replacing the original file
@ -33,9 +33,10 @@ so the risk is no greater.
Compiling: Compiling:
========= =========
Three makefiles are included: Four makefiles are included:
Makefile.gs For use on the Apple IIgs running GNO Makefile For use on the Apple IIgs running GNO (GNO Base Build)
Makefile.unx For use with Unix systems Makefile.gs For use on the Apple IIgs running GNO (Stand-alone)
Makefile.unx For use with UNIX systems
Makefile.msd For use with MS-DOS systems (djgpp) Makefile.msd For use with MS-DOS systems (djgpp)
Although udl on the IIgs can be run from either GNO or ORCA shells, Although udl on the IIgs can be run from either GNO or ORCA shells,
@ -46,8 +47,10 @@ The IIgs distribution should contain a binary of udl, including a
resource fork. Therefore, you should be able to skip straight to the resource fork. Therefore, you should be able to skip straight to the
section on installation. For those who must know, however, building the section on installation. For those who must know, however, building the
binaries under GNO should just be a matter of typing 'dmake -f Makefile.gs'. binaries under GNO should just be a matter of typing 'dmake -f Makefile.gs'.
(You cannot use the "Makefile" -- without the suffix -- unless you are
building udl as part of the entire base GNO distribution.)
If you are compiling on Unix operating systems that have been previously If you are compiling on UNIX operating systems that have been previously
tested, you should be able to just type 'make -f Makefile.unx'. This tested, you should be able to just type 'make -f Makefile.unx'. This
will select the appropriate DEFINES for your system. For an explanation will select the appropriate DEFINES for your system. For an explanation
the various DEFINES, see the section below on "DEFINES Definitions". the various DEFINES, see the section below on "DEFINES Definitions".
@ -85,14 +88,14 @@ If you have describe(1) installed, you can update the udl(1) entry
with the file "udl.desc". See the descu(8) and descc(8) man pages with the file "udl.desc". See the descu(8) and descc(8) man pages
for details. for details.
Apple IIgs with Orca/Shell Apple IIgs with ORCA/Shell
^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^
Copy the following files to their respective destinations: Copy the following files to their respective destinations:
udl to 17 udl to 17
help/udl to 17/help help/udl to 17/help
Unix systems UNIX systems
^^^^^^^^^^^^ ^^^^^^^^^^^^
Type 'make -f Makefile.unx install'. By default the binary will Type 'make -f Makefile.unx install'. By default the binary will
go into /usr/local/bin and the man page into /usr/local/man/man1. go into /usr/local/bin and the man page into /usr/local/man/man1.
@ -141,10 +144,12 @@ The following are the DEFINES values for tested operating systems:
APPLE IIGS: (use "dmake -f Makefile.gs") APPLE IIGS: (use "dmake -f Makefile.gs")
^^^^^^^^^^ ^^^^^^^^^^
ORCA/Shell and GNO/ME: (tested with occ) ORCA/Shell and GNO/ME v2.0.6: (tested with occ)
-DGNO -D_POSIX_C_SOURCE -D_POSIX_SOURCE -DHAS_ATEXIT -DHAS_ATEXIT -DOVERFLOW_CHECK
-DOVERFLOW_CHECK The v2.0.6 libraries are POSIX compliant, but some functions
don't get prototyped if _POSIX_C_SOURCE and _POSIX_SOURCE are
defined. This probably indicates that udl is not "strictly
conforming".
MS-DOS: (use "make -f Makefile.msd") MS-DOS: (use "make -f Makefile.msd")
^^^^^^ ^^^^^^
@ -176,17 +181,18 @@ Files
The following files are present in the udl package: The following files are present in the udl package:
README This file README This file
HISTORY Revision history HISTORY Revision history
Makefile.gs make(1) script for GNO Makefile dmake(1) script for GNO (base build)
Makefile.unx make(1) script for Unix Makefile.gs dmake(1) script for GNO
Makefile.unx make(1) script for UNIX
Makefile.msd make(1) script for MS-DOS Makefile.msd make(1) script for MS-DOS
common.c Routines common to GNO and Unix versions common.c Routines common to GNO and UNIX versions
common.h Header file for common.c common.h Header file for common.c
globals.c Global variable definitions globals.c Global variable definitions
udl.1 Man page for udl command udl.1 Man page for udl command
udl.desc short description of udl, FTP info udl.desc short description of udl, FTP info
udlgs.c Apple IIgs specific routines udlgs.c Apple IIgs specific routines
udl.rez Apple IIgs REZ source for resource fork udl.rez Apple IIgs REZ source for resource fork
udlunix.c Unix specific routines udlunix.c UNIX specific routines
udluse.c Strings for invocation information udluse.c Strings for invocation information
===== =====
@ -211,7 +217,7 @@ This package may be redistributed so long as no fee is charged, the
authors' names remain, and all modifications are clearly marked as authors' names remain, and all modifications are clearly marked as
such and the unmodified source is included. such and the unmodified source is included.
This program contains material from the Orca/C Run-Time Libraries, This program contains material from the ORCA/C Run-Time Libraries,
Copyright 1987-1995 by Byte Works, Inc. Used with permission. Copyright 1987-1995 by Byte Works, Inc. Used with permission.
The GS executable of udl contains code CopyLeft by the FSF (Free Software The GS executable of udl contains code CopyLeft by the FSF (Free Software
@ -221,14 +227,14 @@ Foundation). Source and binaries to GNU getopt are available on request.
Authors Authors
======= =======
Original code by Soenke Behrens <sbehrens@contech.demon.co.uk> Original code by Soenke Behrens <sbehrens@bigfoot.com>
with modifications and version-merging by Devin Reade <gdr@myrias.ab.ca>. with modifications and version-merging by Devin Reade <gdr@myrias.com>.
Soenke Behrens Soenke Behrens
sbehrens@contech.demon.co.uk sbehrens@bigfoot.com
Devin Reade Devin Reade
gdr@myrias.ab.ca gdr@myrias.com
January 1996 December 1997
Version 1.1.5 Version 1.1.6

View File

@ -1,8 +1,8 @@
.\" Copyright (c) 1993-1997 Soenke Behrens, Devin Reade .\" Copyright (c) 1993-1997 Soenke Behrens, Devin Reade
.\" .\"
.\" $Id: udl.1,v 1.12 1997/12/08 16:07:19 gdr Exp $ .\" $Id: udl.1,v 1.13 1997/12/19 07:48:15 gdr Exp $
.\" .\"
.TH UDL 1 "31 January 1996" GNO "Commands and Applications" .TH UDL 1 "11 December 1997" GNO "Commands and Applications"
.SH NAME .SH NAME
udl - convert text files between different architectures udl - convert text files between different architectures
.SH SYNOPSIS .SH SYNOPSIS
@ -26,7 +26,7 @@ will skip any file that is not of type TXT or SRC.
No notice is given of this unless the No notice is given of this unless the
.B -v .B -v
flag is used. flag is used.
Since Unix file systems do not have file types Since UNIX file systems do not have file types
.BR udl .BR udl
is limited in the types of checks which it can carry out, is limited in the types of checks which it can carry out,
so the user must take care that so the user must take care that
@ -46,20 +46,20 @@ creates a temporary file in the same directory as the original file.
The temporary file is close to or exactly the same size as the original The temporary file is close to or exactly the same size as the original
file. file.
.PP .PP
When running under Byteworks' ORCA shell, the Orca shell wildcards When running under Byteworks' ORCA shell, the ORCA shell wildcards
.BR = .BR =
and and
.BR ? .BR ?
are properly expanded in file names. are properly expanded in file names.
.SH OPTIONS .SH OPTIONS
.IP \fB\-u\fP .IP \fB\-u\fP
Convert to use LF as EOL (Unix/Amiga). Convert to use LF as EOL (UNIX/Amiga).
.IP \fB\-m\fP .IP \fB\-m\fP
Convert to use CR/LF as EOL (MS-DOS). Convert to use CR/LF as EOL (MS-DOS).
.IP \fB\-g\fP .IP \fB\-g\fP
Convert to use CR as EOL (Apple). Convert to use CR as EOL (Apple).
.IP \fB\-p\fP .IP \fB\-p\fP
Be pedantic, only affects Unix<->Apple conversions, see below. Be pedantic, only affects UNIX<->Apple conversions, see below.
.IP \fB\-R\fP .IP \fB\-R\fP
Recurse through subdirectories. Recurse through subdirectories.
.IP \fB\-v\fP .IP \fB\-v\fP
@ -75,10 +75,10 @@ switch,
.B udl .B udl
is pedantic while doing the conversion. This means: The input file may is pedantic while doing the conversion. This means: The input file may
contain bytes with a value of zero (0), and the input file may contain contain bytes with a value of zero (0), and the input file may contain
different EOL characters (ie: MS-DOS and Unix style might be mixed in different EOL characters (ie: MS-DOS and UNIX style might be mixed in
one file). For conversions to or from MS-DOS one file). For conversions to or from MS-DOS
.B udl .B udl
is always pedantic, so this only affects conversions from Unix to Apple is always pedantic, so this only affects conversions from UNIX to Apple
or vice versa. Being pedantic slows udl down by a factor of 1.5. or vice versa. Being pedantic slows udl down by a factor of 1.5.
.SH LIMITATIONS .SH LIMITATIONS
When running under GNO on the Apple IIgs, there is a limit to the nesting When running under GNO on the Apple IIgs, there is a limit to the nesting
@ -92,9 +92,9 @@ the stack actually overflows.
.SH BUGS .SH BUGS
Bug reports should be directed to one of the two addresses below. Bug reports should be directed to one of the two addresses below.
.SH AUTHOR .SH AUTHOR
Soenke Behrens <sbehrens@contech.demon.co.uk> with contributions by Soenke Behrens <sbehrens@bigfoot.com> with contributions by
Devin Reade <gdr@myrias.ab.ca>. Devin Reade <gdr@myrias.com>.
.SH VERSION .SH VERSION
This manual page documents This manual page documents
.B udl .B udl
version 1.1.5. version 1.1.6.

View File

@ -1,10 +1,10 @@
Name: udl Name: udl
Version: 1.1.5 Version: 1.1.6
Shell: GNO/ME, ORCA/Shell Shell: GNO/ME, ORCA/Shell
Author: Soenke Behrens, Devin Reade Author: Soenke Behrens, Devin Reade
Contact: sbehrens@contech.demon.co.uk, gdr@myrias.ab.ca Contact: sbehrens@bigfoot.com, gdr@myrias.com
Where: /usr/local/bin Where: /usr/bin
FTP: apple2.caltech.edu, grind.isca.uiowa.edu FTP: apple2.caltech.edu, ground.isca.uiowa.edu, trenco.myrias.com
Converts text between the CR, LF and CR/LF forms. Also available for Unix Converts text between the CR, LF and CR/LF forms. Also available for UNIX
machines, reasonably fast yet secure. machines, reasonably fast yet robust.

View File

@ -1,24 +1,24 @@
/* /*
* $Id: udl.rez,v 1.3 1996/02/11 20:05:49 gdr Exp $ * $Id: udl.rez,v 1.4 1997/12/19 07:48:15 gdr Exp $
*/ */
#include "Types.Rez" #include "Types.Rez"
resource rVersion (0x1, purgeable1, nocrossbank) { resource rVersion (0x1, purgeable1, nocrossbank) {
{ 1, 1, 5, /* version 1.1.5 */ { 1, 1, 6, /* version */
release, /* development|alpha|beta|final|release */ release, /* development|alpha|beta|final|release */
0 /* non-final release number */ 0 /* non-final release number */
}, },
verBritain, verBritain,
"udl", "udl",
"Copyright 1993-1996,\n" "Copyright 1993-1997,\n"
"S" $"9A" "nke Behrens, Devin Reade" "S" $"9A" "nke Behrens, Devin Reade"
}; };
resource rComment (0x1) { resource rComment (0x1) {
"Text File Conversion Program\n" "Text File Conversion Program\n"
"Converts files between CR, CR/LF, and LF.\n" "Converts files between CR, CR/LF, and LF.\n"
"(Apple, MS-DOS, and Unix)" "(Apple, MS-DOS, and UNIX)"
}; };
resource rComment (0x2) { resource rComment (0x2) {

View File

@ -4,7 +4,7 @@
* *
* Apple IIgs specific routines. * Apple IIgs specific routines.
* *
* $Id: udlgs.c,v 1.11 1997/12/08 16:07:19 gdr Exp $ * $Id: udlgs.c,v 1.12 1997/12/19 07:48:16 gdr Exp $
* *
* Copyright (c) 1993-1995 Soenke Behrens, Devin Reade * Copyright (c) 1993-1995 Soenke Behrens, Devin Reade
*/ */
@ -55,7 +55,7 @@ printStack (void) {
} }
#endif #endif
int main(int argc,char *argv[]) { int main(int argc, char **argv) {
FILE *infile, *outfile; FILE *infile, *outfile;
int Tunix = FALSE; int Tunix = FALSE;
int Messy = FALSE; int Messy = FALSE;
@ -111,7 +111,7 @@ int main(int argc,char *argv[]) {
/* Get and process arguments */ /* Get and process arguments */
optind = 0; optind = 1; /* set these to ensure that the program is restartable */
opterr = 1; opterr = 1;
while ((c = getopt (argc, argv, "pvugmRVh")) != EOF) { while ((c = getopt (argc, argv, "pvugmRVh")) != EOF) {
switch (c) { switch (c) {