mirror of https://github.com/GnoConsortium/gno.git
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:
parent
7276456260
commit
c1f439e0a7
|
@ -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).
|
||||
|
||||
(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
|
||||
cannot be compromised during the translation. It is also much easier
|
||||
to use than tr(1).
|
||||
|
@ -38,17 +38,17 @@ v1.1.1
|
|||
prefixed with the name it was invoked with.
|
||||
|
||||
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)
|
||||
Modified source to produce a Unix version
|
||||
Modified source to produce a UNIX version
|
||||
|
||||
v1.1.3
|
||||
(Updated by Devin Reade, November 1994)
|
||||
Added ability to recurse through directories (-R flag).
|
||||
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
|
||||
implementation, a non-TXT or non-SRC file) is encountered
|
||||
unless the -v option is specified.
|
||||
|
@ -66,18 +66,26 @@ v1.1.4
|
|||
Modified Makefile.gs to properly write the new executable over
|
||||
the old resource fork for udl. The resource fork originates with
|
||||
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
|
||||
no longer exists.
|
||||
Fixed bug where invoking 'udl -u directory' would attempt to
|
||||
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.
|
||||
|
||||
v1.1.5
|
||||
(Soenke Behrens, Devin Reade, January 1996)
|
||||
Changed source slightly to compile under djgpp (MS-DOS) and Linux,
|
||||
linted source
|
||||
Unix makefile changed by Devin Reade to automatically detect OS
|
||||
UNIX makefile changed by Devin Reade to automatically detect OS
|
||||
type
|
||||
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".
|
||||
|
|
|
@ -5,18 +5,16 @@
|
|||
#
|
||||
# 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
|
||||
SRCS = udlgs.c udluse.c common.c globals.c
|
||||
MAIN = udlgs
|
||||
# OPTIMIZE= 0
|
||||
# DEBUG =
|
||||
|
||||
# See the README for these macros.
|
||||
CFLAGS += -DHAS_ATEXIT -DOVERFLOW_CHECK # -D__STACK_CHECK__
|
||||
STACK = 4096
|
||||
STACK = 2048
|
||||
BINDIR = /usr/bin
|
||||
|
||||
.INCLUDE: /src/gno/prog.mk
|
||||
|
|
|
@ -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).
|
||||
|
||||
(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.
|
||||
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.
|
||||
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
|
||||
the conversion process by automatically replacing the original file
|
||||
|
@ -33,9 +33,10 @@ so the risk is no greater.
|
|||
Compiling:
|
||||
=========
|
||||
|
||||
Three makefiles are included:
|
||||
Makefile.gs For use on the Apple IIgs running GNO
|
||||
Makefile.unx For use with Unix systems
|
||||
Four makefiles are included:
|
||||
Makefile For use on the Apple IIgs running GNO (GNO Base Build)
|
||||
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)
|
||||
|
||||
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
|
||||
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'.
|
||||
(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
|
||||
will select the appropriate DEFINES for your system. For an explanation
|
||||
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
|
||||
for details.
|
||||
|
||||
Apple IIgs with Orca/Shell
|
||||
Apple IIgs with ORCA/Shell
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
Copy the following files to their respective destinations:
|
||||
|
||||
udl to 17
|
||||
help/udl to 17/help
|
||||
|
||||
Unix systems
|
||||
UNIX systems
|
||||
^^^^^^^^^^^^
|
||||
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.
|
||||
|
@ -141,10 +144,12 @@ The following are the DEFINES values for tested operating systems:
|
|||
APPLE IIGS: (use "dmake -f Makefile.gs")
|
||||
^^^^^^^^^^
|
||||
|
||||
ORCA/Shell and GNO/ME: (tested with occ)
|
||||
-DGNO -D_POSIX_C_SOURCE -D_POSIX_SOURCE -DHAS_ATEXIT
|
||||
-DOVERFLOW_CHECK
|
||||
|
||||
ORCA/Shell and GNO/ME v2.0.6: (tested with occ)
|
||||
-DHAS_ATEXIT -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")
|
||||
^^^^^^
|
||||
|
@ -176,17 +181,18 @@ Files
|
|||
The following files are present in the udl package:
|
||||
README This file
|
||||
HISTORY Revision history
|
||||
Makefile.gs make(1) script for GNO
|
||||
Makefile.unx make(1) script for Unix
|
||||
Makefile dmake(1) script for GNO (base build)
|
||||
Makefile.gs dmake(1) script for GNO
|
||||
Makefile.unx make(1) script for UNIX
|
||||
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
|
||||
globals.c Global variable definitions
|
||||
udl.1 Man page for udl command
|
||||
udl.desc short description of udl, FTP info
|
||||
udlgs.c Apple IIgs specific routines
|
||||
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
|
||||
|
||||
=====
|
||||
|
@ -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
|
||||
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.
|
||||
|
||||
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
|
||||
=======
|
||||
|
||||
Original code by Soenke Behrens <sbehrens@contech.demon.co.uk>
|
||||
with modifications and version-merging by Devin Reade <gdr@myrias.ab.ca>.
|
||||
Original code by Soenke Behrens <sbehrens@bigfoot.com>
|
||||
with modifications and version-merging by Devin Reade <gdr@myrias.com>.
|
||||
|
||||
Soenke Behrens
|
||||
sbehrens@contech.demon.co.uk
|
||||
sbehrens@bigfoot.com
|
||||
|
||||
Devin Reade
|
||||
gdr@myrias.ab.ca
|
||||
gdr@myrias.com
|
||||
|
||||
January 1996
|
||||
Version 1.1.5
|
||||
December 1997
|
||||
Version 1.1.6
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
.\" 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
|
||||
udl - convert text files between different architectures
|
||||
.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
|
||||
.B -v
|
||||
flag is used.
|
||||
Since Unix file systems do not have file types
|
||||
Since UNIX file systems do not have file types
|
||||
.BR udl
|
||||
is limited in the types of checks which it can carry out,
|
||||
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
|
||||
file.
|
||||
.PP
|
||||
When running under Byteworks' ORCA shell, the Orca shell wildcards
|
||||
When running under Byteworks' ORCA shell, the ORCA shell wildcards
|
||||
.BR =
|
||||
and
|
||||
.BR ?
|
||||
are properly expanded in file names.
|
||||
.SH OPTIONS
|
||||
.IP \fB\-u\fP
|
||||
Convert to use LF as EOL (Unix/Amiga).
|
||||
Convert to use LF as EOL (UNIX/Amiga).
|
||||
.IP \fB\-m\fP
|
||||
Convert to use CR/LF as EOL (MS-DOS).
|
||||
.IP \fB\-g\fP
|
||||
Convert to use CR as EOL (Apple).
|
||||
.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
|
||||
Recurse through subdirectories.
|
||||
.IP \fB\-v\fP
|
||||
|
@ -75,10 +75,10 @@ switch,
|
|||
.B udl
|
||||
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
|
||||
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
|
||||
.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.
|
||||
.SH LIMITATIONS
|
||||
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
|
||||
Bug reports should be directed to one of the two addresses below.
|
||||
.SH AUTHOR
|
||||
Soenke Behrens <sbehrens@contech.demon.co.uk> with contributions by
|
||||
Devin Reade <gdr@myrias.ab.ca>.
|
||||
Soenke Behrens <sbehrens@bigfoot.com> with contributions by
|
||||
Devin Reade <gdr@myrias.com>.
|
||||
.SH VERSION
|
||||
This manual page documents
|
||||
.B udl
|
||||
version 1.1.5.
|
||||
version 1.1.6.
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
Name: udl
|
||||
Version: 1.1.5
|
||||
Version: 1.1.6
|
||||
Shell: GNO/ME, ORCA/Shell
|
||||
Author: Soenke Behrens, Devin Reade
|
||||
Contact: sbehrens@contech.demon.co.uk, gdr@myrias.ab.ca
|
||||
Where: /usr/local/bin
|
||||
FTP: apple2.caltech.edu, grind.isca.uiowa.edu
|
||||
Contact: sbehrens@bigfoot.com, gdr@myrias.com
|
||||
Where: /usr/bin
|
||||
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
|
||||
machines, reasonably fast yet secure.
|
||||
Converts text between the CR, LF and CR/LF forms. Also available for UNIX
|
||||
machines, reasonably fast yet robust.
|
||||
|
|
|
@ -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"
|
||||
|
||||
resource rVersion (0x1, purgeable1, nocrossbank) {
|
||||
{ 1, 1, 5, /* version 1.1.5 */
|
||||
{ 1, 1, 6, /* version */
|
||||
release, /* development|alpha|beta|final|release */
|
||||
0 /* non-final release number */
|
||||
},
|
||||
verBritain,
|
||||
"udl",
|
||||
"Copyright 1993-1996,\n"
|
||||
"Copyright 1993-1997,\n"
|
||||
"S" $"9A" "nke Behrens, Devin Reade"
|
||||
};
|
||||
|
||||
resource rComment (0x1) {
|
||||
"Text File Conversion Program\n"
|
||||
"Converts files between CR, CR/LF, and LF.\n"
|
||||
"(Apple, MS-DOS, and Unix)"
|
||||
"(Apple, MS-DOS, and UNIX)"
|
||||
};
|
||||
|
||||
resource rComment (0x2) {
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* 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
|
||||
*/
|
||||
|
@ -55,7 +55,7 @@ printStack (void) {
|
|||
}
|
||||
#endif
|
||||
|
||||
int main(int argc,char *argv[]) {
|
||||
int main(int argc, char **argv) {
|
||||
FILE *infile, *outfile;
|
||||
int Tunix = FALSE;
|
||||
int Messy = FALSE;
|
||||
|
@ -111,7 +111,7 @@ int main(int argc,char *argv[]) {
|
|||
|
||||
/* Get and process arguments */
|
||||
|
||||
optind = 0;
|
||||
optind = 1; /* set these to ensure that the program is restartable */
|
||||
opterr = 1;
|
||||
while ((c = getopt (argc, argv, "pvugmRVh")) != EOF) {
|
||||
switch (c) {
|
||||
|
|
Loading…
Reference in New Issue