============================================================================= udl - Convert EOL formats freely between MS-DOS (CR/LF), UNIX/Amiga (LF), and Apple (CR). (c) 1993-1997 Soenke Behrens, Devin Reade Version 1.1.6: $Id: README,v 1.13 1999/07/03 14:45:43 gdr-ftp 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. 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. 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 after the conversion completes. Thus: udl file replaces the longer sequence of tr '\012' '\015' < file > file.temp mv file.temp file Because it replaces the original file, udl makes every effort to ensure that the conversion process cannot corrupt the original. The translation process uses a temporary file and replaces the original only after the translation has completed. In case of a machine crash or power-down, the original file remains intact, unless the machine dies at precisely the instant the update occurs. This problem exists for a manual file replacement, as in: mv file.temp file so the risk is no greater. ========= Compiling: ========= 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, it cannot be built with the standard ORCA installation due to a lack of additional libraries. 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 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". Note that compilation of udl _requires_ an ANSI C compiler. If you are compiling to a new system, add in another set of defines and let us know about them. Note that udlunix.c and udlgs.c assume that getopt() is declared in and that the function strdup() exists in . You might have to change these includes if that's not the case. Ensure you use cpp conditional compilations to match your platform (and to avoid breaking the code for other platforms). ============ Installation ============ Apple IIgs with GNO v2.0.6 (Source Distribution) ^^^^^^^^^^^^^^^^^^^^^^^^^^ Type 'dmake install' to install to a live system. Type 'dmake release' when building a binary release. Apple IIgs with GNO v2.0.4 ^^^^^^^^^^^^^^^^^^^^^^^^^^ Type 'dmake install -f Makefile.gs'. By default this copies the binary into "/usr/local/bin" and the man page into "/usr/local/man/man1". (You _are_ using version 3.x of 'man', are you not? *blatant plug*) If you don't like these locations, either modify the BINDIR and MANDIR macros in the makefile or install the files by hand. 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 ^^^^^^^^^^^^^^^^^^^^^^^^^^ Copy the following files to their respective destinations: udl to 17 help/udl to 17/help 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. This assumes root access. If this does not match your plans and/or access permissions, either copy the files by hand or change the BINDIR, MANDIR, and OWNER_GROUP macros in the makefile. =================== DEFINES Definitions =================== If you have problems compiling or are porting udl to a new operating system, define the following macros in the makefile as necessary. They should be used as the value of $(DEFINES_$(OS)) where $(OS) is your operating system as returned by `uname -sr | tr ' ' '_'`. HAS_ATEXIT if your system has atexit() _POSIX_C_SOURCE and _POSIX_SOURCE if your compiler, libraries, and headers are POSIX-1.1988 compliant READDIR_RETURNS_DOT if your direct readdir() function will return entries for "." and "..". SunOS 4.x and 5.x (Solaris) are known to do this. BROKEN_REALLOC if your realloc() doesn't behave like malloc() when passed a NULL pointer as the first argument. BROKEN_DIRENT_STRUCT if you find that the first two letters of filenames obtained during directory recursion (as shown when the "-v" flag is used) seem to be missing. Some installations of Solaris are known to do this. GNO if you are compiling on the IIgs. This will allow for both ':' and '/' as pathname separators. OVERFLOW_CHECK Udl uses one recursive subroutine. Define this if you want to check for stack overflows for this routine (independent of any compiler flags). Strongly recommended. CHECK_STACK if you want stack usage to be displayed (IIgs only). You will also have to specify -l/usr/lib/stack in LDFLAGS. The following are the DEFINES values for tested operating systems: APPLE IIGS: (use "dmake -f Makefile.gs") ^^^^^^^^^^ 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") ^^^^^^ DJGPP: (tested with djgpp v2beta) -DREADDIR_RETURNS_DOT -DHAS_ATEXIT TESTED UNIX OS's: (use "make -f Makefile.unx") ^^^^^^^^^^^^^^^^ SunOS 4.x: (tested with gcc) -DREADDIR_RETURNS_DOT -DBROKEN_REALLOC -D_POSIX_C_SOURCE -D_POSIX_SOURCE SunOS 5.x (Solaris): (tested with SUNWspro cc) -DREADDIR_RETURNS_DOT -DBROKEN_DIRENT_STRUCT -D_POSIX_C_SOURCE -D_POSIX_SOURCE AIX 3.2: (tested with xlc) -DBROKEN_REALLOC -D_POSIX_C_SOURCE -D_POSIX_SOURCE Linux 1.2.3: (tested with gcc) -DREADDIR_RETURNS_DOT -D_POSIX_C_SOURCE -D_POSIX_SOURCE -DHAS_ATEXIT ===== Files ===== The following files are present in the udl package: README This file HISTORY Revision history 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.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 udluse.c Strings for invocation information ===== Notes ===== If the machine crashes before udl has replaced the original file with the converted file, the temporary file needs to be manually deleted. The temporary file resides in the same directory as the source file and has a name of the form: UDLTMPXX where XX is replaced by AA, AB and so on. ========= Copyright ========= COPYRIGHT 1993-1996 by Soenke Behrens and Devin Reade ALL RIGHTS RESERVED 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, Copyright 1987-1995 by Byte Works, Inc. Used with permission. The GS executable of udl contains code CopyLeft by the FSF (Free Software Foundation). Source and binaries to GNU getopt are available on request. ======= Authors ======= Original code by Soenke Behrens with modifications and version-merging by Devin Reade . Soenke Behrens sbehrens@bigfoot.com Devin Reade gdr@gno.org December 1997 Version 1.1.6