mirror of
https://github.com/GnoConsortium/gno.git
synced 2024-06-08 20:29:44 +00:00
The comments on the previous checkin were a bit premature. The enclosed
files are the released version 1.13, minus the files "udl" and "udl.r".
This commit is contained in:
parent
9366028046
commit
a3c069777c
|
@ -3,7 +3,7 @@
|
|||
# Copyright (c) 1993-1994 Soenke Behrens
|
||||
# For use with dmake
|
||||
#
|
||||
# $Id: Makefile.gs,v 1.1 1994/12/13 18:08:13 gdr Exp $
|
||||
# $Id: Makefile.gs,v 1.3 1995/02/08 05:15:20 gdr Exp $
|
||||
#
|
||||
# Define the following as necessary:
|
||||
#
|
||||
|
@ -20,20 +20,25 @@
|
|||
# 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.
|
||||
|
||||
DEFINES = -DGNO -D_POSIX_C_SOURCE -D_POSIX_SOURCE -DHAS_ATEXIT -DCHECK_STACK
|
||||
CFLAGS = $(DEFINES) -G25 -w -v
|
||||
LDFLAGS = -v -l/usr/lib/stack -l/usr/lib/gnulib
|
||||
DEFINES = -DGNO -D_POSIX_C_SOURCE -D_POSIX_SOURCE -DHAS_ATEXIT \
|
||||
-DOVERFLOW_CHECK
|
||||
CFLAGS = $(DEFINES) -O -w -v -s2048
|
||||
LDFLAGS = -v -l/usr/lib/gnulib -s2048
|
||||
|
||||
#
|
||||
# You should not have to modify anything beyond this point
|
||||
#
|
||||
|
||||
udl: udl.o udluse.o udl.r common.o
|
||||
# cp udl.r udl
|
||||
$(CC) $(LDFLAGS) -o udl udl.o udluse.o common.o
|
||||
copyfork udl.r udl
|
||||
|
||||
udl.o: udl.gs.c common.h
|
||||
$(CC) -c $(CFLAGS) -o udl.o udl.gs.c
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
# Makefile for udl
|
||||
# (c) 1993-1994 Soenke Behrens
|
||||
#
|
||||
# $Id: Makefile.unx,v 1.1 1994/12/13 18:08:16 gdr Exp $
|
||||
# $Id: Makefile.unx,v 1.3 1995/02/08 05:15:22 gdr Exp $
|
||||
#
|
||||
# Define the following as necessary:
|
||||
#
|
||||
|
|
|
@ -4,7 +4,7 @@ udl - Convert EOL formats freely between MS-DOS (CR/LF), Unix/Amiga (LF),
|
|||
|
||||
(c) 1993-1994 Soenke Behrens
|
||||
|
||||
Version 1.13: $Id: README,v 1.1 1994/12/13 18:08:18 gdr Exp $
|
||||
Version 1.13: $Id: README,v 1.2 1995/02/08 05:05:36 gdr Exp $
|
||||
=============================================================================
|
||||
|
||||
Udl converts text files between CR, LF and CR/LF (Apple, Unix and MS-DOS).
|
||||
|
@ -46,6 +46,9 @@ v1.13
|
|||
Added ability to recurse through directories (-R flag).
|
||||
Changed behavior to ignore binary files rather than exiting.
|
||||
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.
|
||||
|
||||
=========
|
||||
Compiling:
|
||||
|
@ -66,6 +69,13 @@ Also, udl.c assumes that getopt() is declared in <unistd.h> and that
|
|||
the function strdup() exists in <string.h>. You might want to change
|
||||
these includes if that's not the case.
|
||||
|
||||
==========
|
||||
Legalities:
|
||||
==========
|
||||
|
||||
This program contains material from the Orca/C Run-Time Libraries,
|
||||
copyright 1987-1994 by Byte Works, Inc. Used with permission.
|
||||
|
||||
=============================================================================
|
||||
Enjoy,
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Routines common to both the Unix and Apple IIgs versions.
|
||||
*
|
||||
* $Id: common.c,v 1.1 1994/12/13 18:08:20 gdr Exp $
|
||||
* $Id: common.c,v 1.2 1995/02/08 05:05:38 gdr Exp $
|
||||
*
|
||||
* Copyright (c) 1993-1994 Soenke Behrens
|
||||
*/
|
||||
|
@ -717,8 +717,19 @@ void build_file_list(char *file, short recurse) {
|
|||
DIR *dir;
|
||||
struct dirent *entry;
|
||||
|
||||
/* check for stack overflow */
|
||||
recursionDepth++;
|
||||
#ifdef OVERFLOW_CHECK
|
||||
if ((recursionDepth * BYTES_PER_DEPTH + BASESIZE) > STACKSIZE) {
|
||||
fprintf(stderr,"%s: Exceeded permitted nesting depth (%d levels)\n"
|
||||
"Aborted.\n",program_name,recursionDepth);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (stat(file,&tstat)!=0) {
|
||||
fprintf(stderr,"%s: Couldn't stat %s. File skipped\n",program_name,file);
|
||||
--recursionDepth;
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -790,6 +801,7 @@ void build_file_list(char *file, short recurse) {
|
|||
add_to_pathList(currentDirectory, file);
|
||||
}
|
||||
|
||||
--recursionDepth;
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Header file for routines common to both the Unix and Apple IIgs versions.
|
||||
*
|
||||
* $Id: common.h,v 1.1 1994/12/13 18:08:23 gdr Exp $
|
||||
* $Id: common.h,v 1.2 1995/02/08 05:05:40 gdr Exp $
|
||||
*
|
||||
* Copyright (c) 1993-1994 Soenke Behrens
|
||||
*/
|
||||
|
@ -24,6 +24,9 @@
|
|||
#define BUFFERSIZE 0x2000
|
||||
#define PATHLIST_QUANTUM 20
|
||||
#define UDL_VERSION "Version 1.13"
|
||||
#define STACKSIZE 2048
|
||||
#define BYTES_PER_DEPTH 40
|
||||
#define BASESIZE 700
|
||||
|
||||
#ifndef FALSE
|
||||
# define FALSE 0
|
||||
|
|
9
usr.orca.bin/udl/describe.udl
Normal file
9
usr.orca.bin/udl/describe.udl
Normal file
|
@ -0,0 +1,9 @@
|
|||
Name: udl
|
||||
Version: 1.13
|
||||
Author: Soenke Behrens
|
||||
Contact: soenke.behrens@conner.com
|
||||
Where: /usr/local/bin
|
||||
FTP: cco.caltech.edu, grind.isca.uiowa.edu
|
||||
|
||||
Converts text between the CR, LF and CR/LF forms. Also available for
|
||||
Unix machines, reasonably fast yet secure.
|
|
@ -1,6 +1,6 @@
|
|||
.\" Copyright (c) 1993-1994 Soenke Behrens
|
||||
.\" $Id: udl.1,v 1.1 1994/12/13 18:08:26 gdr Exp $
|
||||
.TH UDL 1 "22 November 1994" "Version 1.13" "Commands and Applications"
|
||||
.\" $Id: udl.1,v 1.2 1995/02/08 05:05:42 gdr Exp $
|
||||
.TH UDL 1 "Commands and Applications" "22 November 1994" "Version 1.13"
|
||||
.SH NAME
|
||||
udl - convert text files between different architectures
|
||||
.SH SYNOPSIS
|
||||
|
@ -16,10 +16,25 @@ udl - convert text files between different architectures
|
|||
.SH DESCRIPTION
|
||||
.B udl
|
||||
converts files between different computer systems by changing the EOL
|
||||
(End-Of-Line) character. It does
|
||||
.I not
|
||||
do a plausability check, so the user has to make sure udl is not invoked
|
||||
on object files or the like.
|
||||
(End-Of-Line) character.
|
||||
.PP
|
||||
On the Apple IIgs,
|
||||
.B udl
|
||||
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
|
||||
.BR udl
|
||||
is limited in the types of checks which it can carry out,
|
||||
so the user must take care that
|
||||
it is not invoked on object files or the like. On both platforms, if
|
||||
.I file
|
||||
appears to be a binary file (that is, no EOL is
|
||||
found in the first part of the file), the file will be skipped.
|
||||
Again, no notice is given of this unless the
|
||||
.B -v
|
||||
flag is used.
|
||||
.PP
|
||||
.B udl
|
||||
creates a temporary file the size of the file it is currently working on
|
||||
|
@ -55,14 +70,6 @@ one file). For conversions to or from MS-DOS,
|
|||
.B udl
|
||||
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.
|
||||
.PP
|
||||
If
|
||||
.B udl
|
||||
is given a file that seems to be a binary file \(that is, no EOL is
|
||||
found in the first part of the file\), the file will be skipped. No
|
||||
notice is given of this unless the
|
||||
.B -v
|
||||
flag is used.
|
||||
.SH BUGS
|
||||
When compiling on some Solaris installations, files within subdirectories
|
||||
do not get their names properly resolved.
|
||||
|
@ -71,6 +78,15 @@ This seems to be due to bad definitions in
|
|||
If you have access to SunOS 4.x,
|
||||
.BR udl
|
||||
can be compiled there and used under Solaris.
|
||||
.PP
|
||||
When running under Gno on the Apple IIgs, there is a limit to the nesting
|
||||
depth when recusing on subdirectories. This is because the routine that
|
||||
is responsible for this behavior is itself recursive. The default 2k
|
||||
stack size will allow about 33 levels of nested directories, so this limit
|
||||
should not normally be a problem. If the limit is exceeded,
|
||||
.BR udl
|
||||
will exit with an error message before any files are changed, and before
|
||||
the stack actually overflows.
|
||||
.LP
|
||||
If you find any other bugs, please send a report to the address given below.
|
||||
.SH AUTHOR
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Apple IIgs specific routines.
|
||||
*
|
||||
* $Id: udlgs.c,v 1.1 1994/12/13 18:08:29 gdr Exp $
|
||||
* $Id: udlgs.c,v 1.2 1995/02/08 05:05:46 gdr Exp $
|
||||
*
|
||||
* Copyright (c) 1993-1994 Soenke Behrens
|
||||
*/
|
||||
|
@ -18,6 +18,7 @@
|
|||
#include "common.h"
|
||||
|
||||
#define QUITFLAG 0x4000 /* udl is restartable */
|
||||
#define DIRECTORY 0x0F
|
||||
|
||||
/*
|
||||
* Globals
|
||||
|
@ -65,6 +66,7 @@ int main(int argc,char *argv[]) {
|
|||
pathSlots = 0;
|
||||
pathList = NULL;
|
||||
*currentDirectory = '\0';
|
||||
recursionDepth=0;
|
||||
|
||||
#ifdef CHECK_STACK
|
||||
begin_stack_check();
|
||||
|
@ -177,7 +179,11 @@ int main(int argc,char *argv[]) {
|
|||
rsp.bufSize = 259;
|
||||
NextWild.pathName = &rsp;
|
||||
InitWild.wFile = &gsp;
|
||||
InitWild.flags = 0x8000 | 0x2000 | 0x1000;
|
||||
if (R_flag) {
|
||||
InitWild.flags = 0x2000 | 0x1000;
|
||||
} else {
|
||||
InitWild.flags = 0;
|
||||
}
|
||||
|
||||
/* loop through all command line args */
|
||||
for (; optind < argc; optind++) {
|
||||
|
@ -244,8 +250,6 @@ int main(int argc,char *argv[]) {
|
|||
current_file = *p;
|
||||
|
||||
if (CheckGSOSType (current_file) == FALSE) {
|
||||
fprintf(stderr,"%s: %s is not of type TXT or "
|
||||
"SRC ... skipping\n",program_name,current_file);
|
||||
p++;
|
||||
continue;
|
||||
}
|
||||
|
@ -335,9 +339,12 @@ int CheckGSOSType(char *name) {
|
|||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
if ((fir.fileType != TXT) && (fir.fileType != SRC))
|
||||
if ((fir.fileType != TXT) && (fir.fileType != SRC)) {
|
||||
if (verbose && (fir.fileType != DIRECTORY))
|
||||
fprintf(stderr,"%s: %s is not of type TXT or "
|
||||
"SRC ... skipping\n",program_name,current_file);
|
||||
return (FALSE);
|
||||
else {
|
||||
} else {
|
||||
theType = fir.fileType;
|
||||
theAuxType = fir.auxType;
|
||||
return (TRUE);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Unix specific routines.
|
||||
*
|
||||
* $Id: udlunix.c,v 1.1 1994/12/13 18:08:32 gdr Exp $
|
||||
* $Id: udlunix.c,v 1.2 1995/02/08 05:05:48 gdr Exp $
|
||||
*
|
||||
* Copyright (c) 1993-1994 Soenke Behrens
|
||||
*/
|
||||
|
@ -33,6 +33,7 @@ int main(int argc,char *argv[]) {
|
|||
pathSlots = 0;
|
||||
pathList = NULL;
|
||||
*currentDirectory = '\0';
|
||||
recursionDepth=0;
|
||||
|
||||
/* In case of exit(), free the mem I allocated */
|
||||
#ifdef HAS_ATEXIT
|
||||
|
@ -202,5 +203,3 @@ int main(int argc,char *argv[]) {
|
|||
|
||||
return (EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
*
|
||||
* Usage strings.
|
||||
*
|
||||
* $Id: udluse.c,v 1.1 1994/12/13 18:08:34 gdr Exp $
|
||||
* $Id: udluse.c,v 1.2 1995/02/08 05:05:49 gdr Exp $
|
||||
*
|
||||
* Copyright (c) 1993-1994 Soenke Behrens
|
||||
*/
|
||||
|
@ -23,7 +23,6 @@ char use1 [] =
|
|||
"written when it is done.\n";
|
||||
|
||||
char use2 [] =
|
||||
"files may contain ORCA/Shell style wildcards.\n\n";
|
||||
"\nFiles may contain ORCA/Shell style wildcards.\n";
|
||||
|
||||
/* End Of File */
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user