This commit was manufactured by cvs2svn to create tag 'gsh_v1_1'.

This commit is contained in:
cvs2git 1997-11-18 05:31:01 +00:00
parent 1f1b3ada37
commit 8e0f91dcf3
1149 changed files with 0 additions and 173484 deletions

View File

@ -1,14 +0,0 @@
/*
* Too bad we don't have symlinks for GNO ...
* This file allows a program to use the *proper* name for this
* header file, while allowing the "real" header file to reside on
* a ProDOS volume. This is good for speed and disk integrity,
* and gives a work-around for those sites which don't use HFS.
*
* $Id: dli_var.h,v 1.1 1997/02/28 04:41:52 gdr Exp $
*/
#ifndef _NET_DLI_VAR_H_
#include <net/dli.var.h>
#endif

View File

@ -1,13 +0,0 @@
/*
* Too bad we don't have symlinks for GNO ...
* This file allows a program to use the *proper* name for this
* header file, while allowing the "real" header file to reside on
* a ProDOS volume. This is good for speed and disk integrity,
* and gives a work-around for those sites which don't use HFS.
*
* $Id: if_arp.h,v 1.1 1997/02/28 04:41:53 gdr Exp $
*/
#ifndef _NET_IF_ARP_H_
#include <net/if.arp.h>
#endif

View File

@ -1,13 +0,0 @@
/*
* Too bad we don't have symlinks for GNO ...
* This file allows a program to use the *proper* name for this
* header file, while allowing the "real" header file to reside on
* a ProDOS volume. This is good for speed and disk integrity,
* and gives a work-around for those sites which don't use HFS.
*
* $Id: raw_cb.h,v 1.1 1997/02/28 04:41:53 gdr Exp $
*/
#ifndef _NET_RAW_CB_H_
#include <net/raw.cb.h>
#endif

View File

@ -1,13 +0,0 @@
/*
* Too bad we don't have symlinks for GNO ...
* This file allows a program to use the *proper* name for this
* header file, while allowing the "real" header file to reside on
* a ProDOS volume. This is good for speed and disk integrity,
* and gives a work-around for those sites which don't use HFS.
*
* $Id: in_systm.h,v 1.1 1997/02/28 04:41:59 gdr Exp $
*/
#ifndef _NETINET_IN_SYSTM_H_
#include <netinet/in.systm.h>
#endif

View File

@ -1,13 +0,0 @@
/*
* Too bad we don't have symlinks for GNO ...
* This file allows a program to use the *proper* name for this
* header file, while allowing the "real" header file to reside on
* a ProDOS volume. This is good for speed and disk integrity,
* and gives a work-around for those sites which don't use HFS.
*
* $Id: ioctl_compat.h,v 1.1 1997/02/28 04:41:59 gdr Exp $
*/
#ifndef _SYS_IOCTL_COMPAT_H_
#include <sys/ioctl.compat.h>
#endif

View File

@ -1,76 +0,0 @@
#
# This file is intended for use with dmake. There are constructs in
# here that (as yet) make it unsuitable to be used on the GS.
#
# $Id: Makefile,v 1.4 1997/11/01 19:49:27 gdr Exp $
#
XFER = xfer
TMP = /tmp/gnobuild
UDL = /usr/local/bin/udl
NULIB = /usr/local/bin/nulib
XFER_LIST= \
$(XFER)/HFSinclude.shk \
$(XFER)/NOTES.shk \
$(XFER)/bin.shk \
$(XFER)/build.tools.shk \
$(XFER)/include.shk \
$(XFER)/lib.shk \
$(XFER)/orcacdefs.shk \
$(XFER)/root.shk \
$(XFER)/sbin.shk \
$(XFER)/usr.bin.shk \
$(XFER)/usr.orcabin.shk \
$(XFER)/usr.man.shk \
$(XFER)/usr.sbin.shk \
$(XFER)/verbatim.shk
NOT_YET= \
$(XFER)/libexec.shk \
$(XFER)/sys.shk \
$(XFER)/usr.sbin.shk
srcxfer: $(XFER_LIST)
ROOTFILES = Makefile binconst.mk binrules.mk paths.mk prog.mk
$(XFER)/root.shk: $(ROOTFILES)
@echo "making $@"; \
$(RM) -f $@; \
[ -d $(XFER) ] || mkdir -p $(XFER); \
if [ -d $(TMP) ]; then \
echo "$(TMP) exists. Aborted"; \
exit 1; \
fi; \
cwd=`pwd`; \
mkdir -p $(TMP); \
cp -r -p $< $(TMP); \
$(RM) -rf `find $(TMP) -name CVS -print `; \
$(UDL) -gR $(TMP); \
(cd $(TMP); $(NULIB) -cf $$cwd/$@ $< ); \
$(RM) -rf $(TMP)
# make sure the filename fits
$(XFER)/usr.orcabin.shk: $(XFER)/usr.orca.bin.shk
mv $< $@
# .PHONY: $(XFER_LIST)
$(XFER)/%.shk:
@echo "making $@"; \
$(RM) -f $@; \
[ -d $(XFER) ] || mkdir -p $(XFER); \
if [ -d $(TMP) ]; then \
echo "$(TMP) exists. Aborted"; \
exit 1; \
fi; \
mkdir -p $(TMP); \
cp -r -p $* $(TMP); \
$(RM) -rf `find $(TMP) -name CVS -print `; \
$(UDL) -gR $(TMP); \
(cd $(TMP); $(NULIB) -cf $*.shk $*); \
mv $(TMP)/$*.shk $(XFER); \
$(RM) -rf $(TMP)
# /bin/true $*;

View File

@ -1,23 +0,0 @@
$Id: INSTALL,v 1.1 1997/08/08 05:11:14 gdr Exp $
Installing the Binaries-Only Version
====================================
Make a copy of your disks.
Make a copy of the GNO distribution disks and keep the originals in
a safe place. Never modify the original disks; only modify copies.
Define your destination directories.
Using any text editor, edit the file /gno.disk1/installbin. In
that file you will find the shell variables VOL1, VOL2, VOL3
and VOL4. You should change the values of these variables
to volume or directory names that exist at your site.
While the distributed script used the same directory for
all of VOL1 (/), VOL2 (/usr), and VOL3 (/home), I recommend
placing them on different partitions if possible, especially
the first two. This is because, as you add more things to
GNO, the / and /usr partitions will (likely) eventually use
up most of a 32Meg ProDOS partition.

View File

@ -1,104 +0,0 @@
$Id: README.beta,v 1.1 1997/03/11 08:08:06 gdr Exp $
This is the README file for release beta 970304. It probably needs more
detail. Mail to gno-beta@myrias.com with questions, comments, bitches,
queries, complaints.
I suggest you don't mix these files up with those from other versions of
GNO, if you can help it. It will keep things cleaner for later.
Manifest:
orcacdefs This directory contains only the defaults.h file used
in Orca/C v2.1.x. If you already have a defaults.h
file, the contents of this one should be added to
the one you already have.
You will have to change the file type of this
file. Try 'chtyp -lcc *.h'.
include This is the majority of the new header files.
They may either be placed in 13/orcacdefs, or
they may be placed in another directory (such
as /usr/include). If the latter, ensure you
have Orca/C set up to search /usr/include (or
whatever) before searching 13/orcacdefs. This
may be done with the -L occ(1) flag or the
path pragma of Orca/C.
You will have to change the file type of these
files. Try 'chtyp -lcc *.h'.
HFSinclude These are files that belong in the same hierarchy
as those in the 'include' directory, but have
non-ProDOS file names. It is possible through the
use of the path pragma to have this directory on
an HFS volume and the include directory on a
ProDOS volume.
You will have to change the file type of these
files. Try 'chtyp -lcc *.h'.
usr.man Manual pages, mostly for libc and libutil. A
work in progress. ATTENTION: See the file
NOTES/notes.* for comments on nroff; these
pages will not currently display properly on the
IIgs.
Don't worry about .so link files for now; there
is a util coming that will create them from the
mkso.data file.
Remember: The newest man binary understands the
MANPATH environment variable, so you can use more
than just /usr/man to hold your man pages.
lib/libc.v203 These are versions of libc. One of these should
lib/libc.v210 be selected based on which version of ORCALib you
lib/libc.v211b2 are using. Sorry, the earliest version of libc
that I can build is for Orca/C v2.0.3. When Orcalib
is modified, it is likely that I will only be able
to build libc for v2.1.x.
The only one of these I have tested is for Orca/C
v2.1.1b2. The selected library should be placed
in your 13/ directory, which is presumably /lib.
Currently, the libraries are built for the small
memory model, and with no optimization.
lib/libutil.203 Again, pick one to match your compiler. The second
lib/libutil.210 one can be used for generic Orca/C v2.1.x. The
routines in this library are rarely used, so the
library should go somewhere other than your 13/
directory. I suggest /usr/lib.
NOTES/README.beta
This file.
NOTES/status This lists which routines have been completed and
their test status. If you test routines that
have not been marked with a 'T' as yet, please
let me know the results via the gno-beta mailing
list -- I would like to keep the list up-to-date.
NOTES/deviations
A list of deviations from various standards or
conventions.
NOTES/notes.* Miscellaneous notes, mainly intended for Derek or
NOTES/TO.DO myself. You may find something of interest.
NOTES/headers
NOTES/Contributers
If you are using a version of Orca/C earlier than v2.1.0, you should
ensure the macros
__appleiigs__
__GNO__
are defined for your programs. This can be done by the -D occ(1) flag
or using #define in your program.
If you are using Orca/C v2.1.0 or later, you do not have to explicitly
define the above two macros as they are in the enclosed defaults.h file.
You _do_, however have to edit the __ORCAC_VERSION macro in the defaults.h
file to match your version of Orcalib. Failure to do so may cause programs
using stdio to crash.

View File

@ -1,31 +0,0 @@
$Id: README.src,v 1.1 1997/03/11 08:08:06 gdr Exp $
Have a look in the NOTES directory, especially the files "status"
and "notes.*". There are notes in there on changed header files --
I have tried to minimize the impact on your work due to changed header
files, but there are a few to note. Here are two other comments
from the "notes.*" file that I would like to bring to your attention:
Currently there is a problem with the nroff package,
and many of the man pages will not look right on the
IIgs. I'm working on an update of nroff. Putting it under
Insight has shown a significant number of memory trashing
bugs (which are now gone).
I'm not done mkso yet (mkso is the program that creates
the .so links required for the various manual pages). I
still have to make it check for the legality of file names
on the current file system. I also plan to make it such
that one can place those .so links that require HFS on
another partition, and still have them find the sourced
files.
I've also included built versions of libc and libutil. IT IS CRITICAL
THAT THESE LIBRARIES ONLY BE USED WITH THE VERSION OF ORCALIB FOR WHICH
THEY WERE COMPILED, since struct FILE has changed. See the comments in
the NOTES/README.beta and orcacdefs/defaults.h files.
Also as a reminder, the gno-beta mailing list has been set up. To
join it, send email to <majordomo@myrias.com> with the following text
and nothing else in the body of the message:
subscribe gno-beta

View File

@ -1,148 +0,0 @@
*******
* soon
*
* $Id: TO.DO,v 1.5 1997/11/01 19:34:29 gdr Exp $
*
*******
Verify if cp or gshk is corrupting the "fudgeinstall" script.
Add implementations for Tilghman:
strftime(3)
Incorporate Tilghman's setttimeofday(2) routine.
Update funopen, fropen, fwopen, fsettext man pages:
If a user wants binary mode, he has to call fsetbinary
on the resulting file pointer; this info is not carried
over from the previous file pointer.
Create a src/gno/build.tools/dupfile script for duplicating binary
files at user install time. Current packages that need this:
compress
Complete mkso util
As a group:
Update utmp.5, libutil (logout, logwtmp), last(1), login(1), who(1),
w(1), init(8), _PATH_UTMP (<utmp.h> and FAQ), rwho(1), users(1)
Add to relevent util man pages:
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
Use __STACK_CHECK__ macro for stack checking code.
stdio:
- add %b modifier to fprintf implementation (ORCA/C compatibility)
stdlib/cvt.c:
- handle modes 0 and 1 correctly.
Use result of _setModeEmulation(3) in appropriate calls. These include
chmod -
fchmod -
creat - done
open - done
stat - unnecessary
fstat - unnecessary
lstat - unnecessary
clean up <gno/kerntool.h> -- some require errno args, some don't
check up on the type of nlink_t, used in stat(2)
Write a test that handles:
- negative process numbers
- process numbers exceeding INT_MAX and UINT_MAX
the easiest way to do this is to repeatedly exec a program that prints
it's process number. Keep doing so until either the number wraps or
the machine crashes.
libc/sys/exec.c:
buildCmd should single-quote strings containing whitespace.
If the string already has single quotes, then backspace them.
buildPath should only return files of type S16, EXEC, or EXE.
buildPath should use the mapPath facility.
These functions should operate closer to GS/OS when possible.
Also need to reduce stack requirements.
For the exec* functions, there should be a test for whether
or not the file is of type SRC and auxtype EXEC. If that
is the case, and if the first two characters of the file
are '#!', then the shell should be exec'd instead. (currently,
shell scripts cannot be exec'd)
NEED TO WRITE OR DUPLICATE MAN PAGES FOR
----------------------------------------
login libc(3)
login_tty
regexp libc(3)
termcap libc(3)
queue 3
tty 4
grp 5
passwd 5
termcap 5
ms 7
man 7
cron 8
runover 8 (obsolete?) No, needed for single user mode.
dialup 8
*******
* defer
*******
libc/sys/syscall.c:
for unlink, if file is open, then register a call to unlink
(non-recursive) the file via atexit(3)
[not practical?]
libc/gen/environ.c:
Review routines. Force them to use GSString routines, reduce
stack usage (depend on dynamic allocation for parm blocks).
libc/gen/err.c:
Use syslogd if not on a tty.
libc/gen/tty.c:
review these routines
do intro man pages:
1 done
2 review DEFINITIONS section
3 done
4 done
5 done
6 done
7 done
8 done
Add locale implementation to libc.
various man pages:
add note under COMPATIBILITY as to whether the routines
are thread-safe. If they write any globals or static
variables, they are not.
Verify that the setdebug(2) macros in gno/gno.h are correct.
Add implementations for execle; the final
envp can't appear in the prototype, but it can be found since it is
the last argument after the first NULL pointer.
man(1) implementation: create a database in the user's home directory
that contains a list of all man pages and their locations, based
on MANPATH. Keep a magic number the file to see if MANPATH has
changed. *maybe* check the date of the file against the
modification date of the respective directories and generate a
warning if the db is out-of-date.

View File

@ -1,148 +0,0 @@
*******
* soon
*
* $Id: TO.DO,v 1.5 1997/11/01 19:34:29 gdr Exp $
*
*******
Verify if cp or gshk is corrupting the "fudgeinstall" script.
Add implementations for Tilghman:
strftime(3)
Incorporate Tilghman's setttimeofday(2) routine.
Update funopen, fropen, fwopen, fsettext man pages:
If a user wants binary mode, he has to call fsetbinary
on the resulting file pointer; this info is not carried
over from the previous file pointer.
Create a src/gno/build.tools/dupfile script for duplicating binary
files at user install time. Current packages that need this:
compress
Complete mkso util
As a group:
Update utmp.5, libutil (logout, logwtmp), last(1), login(1), who(1),
w(1), init(8), _PATH_UTMP (<utmp.h> and FAQ), rwho(1), users(1)
Add to relevent util man pages:
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
Use __STACK_CHECK__ macro for stack checking code.
stdio:
- add %b modifier to fprintf implementation (ORCA/C compatibility)
stdlib/cvt.c:
- handle modes 0 and 1 correctly.
Use result of _setModeEmulation(3) in appropriate calls. These include
chmod -
fchmod -
creat - done
open - done
stat - unnecessary
fstat - unnecessary
lstat - unnecessary
clean up <gno/kerntool.h> -- some require errno args, some don't
check up on the type of nlink_t, used in stat(2)
Write a test that handles:
- negative process numbers
- process numbers exceeding INT_MAX and UINT_MAX
the easiest way to do this is to repeatedly exec a program that prints
it's process number. Keep doing so until either the number wraps or
the machine crashes.
libc/sys/exec.c:
buildCmd should single-quote strings containing whitespace.
If the string already has single quotes, then backspace them.
buildPath should only return files of type S16, EXEC, or EXE.
buildPath should use the mapPath facility.
These functions should operate closer to GS/OS when possible.
Also need to reduce stack requirements.
For the exec* functions, there should be a test for whether
or not the file is of type SRC and auxtype EXEC. If that
is the case, and if the first two characters of the file
are '#!', then the shell should be exec'd instead. (currently,
shell scripts cannot be exec'd)
NEED TO WRITE OR DUPLICATE MAN PAGES FOR
----------------------------------------
login libc(3)
login_tty
regexp libc(3)
termcap libc(3)
queue 3
tty 4
grp 5
passwd 5
termcap 5
ms 7
man 7
cron 8
runover 8 (obsolete?) No, needed for single user mode.
dialup 8
*******
* defer
*******
libc/sys/syscall.c:
for unlink, if file is open, then register a call to unlink
(non-recursive) the file via atexit(3)
[not practical?]
libc/gen/environ.c:
Review routines. Force them to use GSString routines, reduce
stack usage (depend on dynamic allocation for parm blocks).
libc/gen/err.c:
Use syslogd if not on a tty.
libc/gen/tty.c:
review these routines
do intro man pages:
1 done
2 review DEFINITIONS section
3 done
4 done
5 done
6 done
7 done
8 done
Add locale implementation to libc.
various man pages:
add note under COMPATIBILITY as to whether the routines
are thread-safe. If they write any globals or static
variables, they are not.
Verify that the setdebug(2) macros in gno/gno.h are correct.
Add implementations for execle; the final
envp can't appear in the prototype, but it can be found since it is
the last argument after the first NULL pointer.
man(1) implementation: create a database in the user's home directory
that contains a list of all man pages and their locations, based
on MANPATH. Keep a magic number the file to see if MANPATH has
changed. *maybe* check the date of the file against the
modification date of the respective directories and generate a
warning if the db is out-of-date.

View File

@ -1,76 +0,0 @@
$Id: deviations,v 1.1 1997/02/28 05:42:26 gdr Exp $
These are deviations from POSIX 1003.1:
======================================
Feature: full implementation
Header: (various)
Not all functions and system calls specified by POSIX 1003.1 are
implemented.
Feature: non-compliant limits/constants
Header: (various)
Value POSIX GNO Header File
-------------------------------------------------------------------
STDIN_FILENO 0 1 unistd.h
STDOUT_FILENO 1 2 unistd.h
STDERR_FILENO 2 3 unistd.h
_POSIX_LINK_MAX 8 1 limits.h
Feature: alarm(2)
Header: unistd.h
POSIX specifies that both the single argument and return type
should be unsigned int. GNO uses unsigned long for both.
Feature: fork(2)
Header: unistd.h
POSIX specifies an empty argument list, and both child and parent
process resume execution at the point where fork() returns but in
different address spaces. The GNO implementation takes a pointer
to a function at which the child process begins execution, and child
and parent share the address space.
Feature: getpgrp(2)
Header: unistd.h
POSIX specifies a pid_t return type. GNO implementation returns
an int.
These are deviations from the BSD implementations:
=================================================
Feature: POSIX compliance
Header: sys/unistd.h
BSD is POSIX2 compliant, GNO is not. (_POSIX2_VERSION is undefined)
Feature: vfork(2)
Header: unistd.h
See the notes on fork(2) in the section on POSIX deviations.
Feature: machine types
Header: <sys/types.h>, <sys/ansi.h>
BSD uses "long long" and "unsigned long long" for quad_t and u_quad_t,
respectively. GNO uses structures.
Type BSD GNO Header File
-------------------------------------------------------------------------------
quad_t long long (structure) sys/types.h
u_quad_t unsigned long long (structure) sys/types.h
pid_t long short sys/types.h
off_t quad_t long sys/types.h
dev_t unsigned long unsigned short sys/types.h
uid_t unsigned long unsigned short sys/types.h
gid_t unsigned long unsigned short sys/types.h
_BSD_PTRDIFF_T_ int long machine/ansi.h
_BSD_SIZE_T_ unsigned int unsigned long machine/ansi.h
_BSD_SSIZE_T_ int long machine/ansi.h
_BSD_OFF_T_ long long long machine/ansi.h
_BSD_PID_T_ long short machine/ansi.h
_BSD_WCHAR_T_ int long machine/ansi.h
_BSD_RUNE_T_ int long machine/ansi.h
Value BSD GNO Header File
-------------------------------------------------------------------------------
_BSD_CLK_TCK_ 128 60 machine/ansi.h
_BSD_CLOCKS_PER_SEC_ 128 60 machine/ansi.h
LINK_MAX 32767 1 sys/syslimits.h

View File

@ -1,95 +0,0 @@
$Id: headers,v 1.1 1997/02/28 05:42:26 gdr Exp $
A hash prefix indicates that it has passed the compile test. An "[Orca]"
indicates that the file is modified from an Orca/C header rather than
from either BSD or custom sources.
# curses.h changed hash type from u_int to u_long
# db.h various macros have changed.
# defaults.h add to user's copy, don't override it (Orca/C v2.1)
# dirent.h *** dirent structures have changed from gno v2.0.4
# err.h
# errno.h
# fcntl.h
# fnmatch.h *** upgraded to BSD 4.4 (incompatible downward)
# fts.h *** upgraded to BSD 4.4 (incompatible downward)
# glob.h
# gno/conf.h
# gno/gno.h
gno/kerntool.h INCOMPLETE CHANGES -- OBSOLETE?
# gno/kvm.h
# gno/proc.h
# gno/sim.h
# grp.h
# limits.h
# machine/ansi.h
# machine/endian.h
# machine/limits.h
# machine/param.h missing a lot of BSD stuff
# machine/signal.h includes stuff from gno/signal.h
# machine/types.h label_t changed from GNO v2.0.4
# netdb.h
# netinet/in.h
# netinet/in_systm.h
# netinet/ip.h
# netinet/tcp.h
# paths.h
protocols/talkd.h
# pwd.h
# regexp.h
# resolv.h
# rpc/types.h
# setjmp.h [Orca]
# sgtty.h
# signal.h
# stddef.h
# stdio.h [Orca] *** critical that __ORCAC_VERSION is correct
# stdlib.h
# string.h * check need for "const" in non-BSD, non-ORCA routines
# sys/cdefs.h
# sys/dirent.h *** dirent structures have changed from gno v2.0.4
# sys/errno.h
# sys/fcntl.h
# sys/filio.h
# sys/ioccom.h
# sys/ioctl.h
# sys/ioctl_compat.h
# sys/mount.h
# sys/param.h
# sys/ports.h GNO specific
# sys/select.h
# sys/signal.h
# sys/sockio.h
# sys/stat.h
# sys/syslimits.h
# sys/syslog.h
# sys/termios.h
# sys/time.h
# sys/times.h
# sys/tty.h
# sys/ttychars.h
# sys/ttycom.h
# sys/ttydefaults.h
# sys/ttydev.h
# sys/types.h quad_t defined but as struct
# sys/uio.h
# sys/unistd.h
# sys/wait.h
# syslog.h
# termcap.h
# termios.h
# time.h * last two fields of struct tm disabled for Orca compat
# ttyent.h
# types.h [Orca] Added GSString types
# unistd.h
# utime.h
# utmp.h very non-BSD
OBSOLETE:
getopt.h replaced by stdlib.h
sys/file.h This was really sys/fcntl.h.
sys/vfs.h Now sys/mount.h
types.h superceeded by one from Orca/C v2.1
tzfile.h no longer part of BSD

View File

@ -1,21 +0,0 @@
System calls new in v2.0.6
==========================
select $4303
InstallNetDriver $4403
socket $4503
bind $4603
connect $4703
listen $4703
accept $4903
recvfrom $4A03
sendto $4B03
recv $4C03
send $4D03
getpeername $4E03
getsockname $4F03
getsockopt $5003
setsockopt $5103
shutdown $5203
setreuid $5303
setregid $5403

View File

@ -1,313 +0,0 @@
7 Jan 97
$Id: notes.960227,v 1.2 1997/03/05 07:25:48 gdr Exp $
Header File Changes
===================
Where the Orca headers no longer suffice, effort has been made to make use
of the BSD 4.4 headers with minimal modifications.
Some BSD headers, due to the filenames used, cannot be placed on ProDOS
filesystems. There are a few problems with this (in my perceived order
of priority):
- having headers on HFS volumes slows down compilations
- the usual lack of disk optimization/fixing avail for HFS
- there are GNO users that don't use HFS volumes
OTOH, we don't want in general to break ported code which uses source like
#include <net/if_arp.h>
Therefore, I have renamed the original source files to use ProDOS naming
conventions. In this example, the new file is <net/if.arp.h>. There
is *also* a file called <net/if_arp.h> which can be installed on an
HFS volume, but this contains little more than an #include <net/if.arp.h>.
This way, the headers which require an HFS volume can be _optionally_
installed by the GNO user.
For the sake of compile time efficiency, I've been changing lines in
the GNO system header files like
#include <sys/types.h>
to
#ifndef _SYS_TYPES_H_
#include <sys/types.h>
#endif
This isn't complete, but it's getting there. I didn't touch any Orca/C
headers that used nested #includes but otherwise needed no modifications.
13/orcacdefs/defaults.h:
I'm trying to push through some "standard" arch and OS defines,
since they really help to be defined in many applications ports.
The contents of defaults.h should be copied into your
13/orcacdefs/defaults.h file (or copied to that directory if you
don't already have such a file).
The macros defined in that file are
__appleiigs__
__GNO__
__ORCAC_VERSION
_ANSI_SOURCE (if __KeepNamespacePure__ is defined)
__KeepNamespacePure__ (if _ANSI_SOURCE is defined)
Currently nothing depends on the _value_ of "__GNO__", just
that it is defined. The system header files which would have
bad side effects if __GNO__ is not defined will bitch if this
is the case. These header files are ones where it was desirable
to leave the BSD version in for reference.
By putting __ORCAC_VERSION in defaults.h, we know that
- it isn't defined for earlier Orca/C versions
- it can be incremented
Orca headers use __KeepNamespacePure__ and BSD headers use
_ANSI_SOURCE. We try to make them identical.
arpa/nameser.h:
The non-standard field 'pr' (primary server required) in
typedef struct {} HEADER has been removed, and it's storage
moved to the 'unused' field. The size of the structure and
the offsets of the remaining members haven't changed. This
was a BSD change, not mine.
The following macros have been added. See the header for
their meanings:
__BIND
HFIXEDSZ
INT32SZ
INT64SZ
INADDRSZ
arpa/telnet.h:
This file appears to have lots of changes, but I think
that, given a recompilation of the relevent sources, they
should be benign. If not, then the descriptions below
should give sufficient info to #ifdef out the problem parts.
There are new TELOPT_* macros, values 35-39, inclusive.
This affects NTELOPTS, TELOPT_LAST, TELOPT_OK, and the
'telopts' character array.
The following arrays are now terminated by a NULL pointer
telopts
telcmnds
slc_names
The following macros are also new:
TELQUAL_INFO
TELQUAL_REPLY
TELQUAL_NAME
LFLOW_* (4 of them)
MODE_SOFT_TAB
MODE_LIT_ECHO
MODE_MASK (changed due to two previous macros)
SLC_NAME_OK
SLC_NAME
fcntl.h:
used to contain #defines for L_SET, L_INCR, and L_XTND. These
were renamed by POSIX 1003.1 to SEEK_SET, SEEK_CUR, and SEEK_END,
respectively. If the old macros are desired, they can be obtained
by #including <unistd.h>.
machine/ansi.h:
wchar_t (and therefore rune_t) have been changed from
"unsigned short" to "int" to match the is*() definitions
in <ctype.h>. This shouldn't be a problem since there aren't
yet any library routines that use these types.
machine/endian.h
Note that under BSD 4.4, both BIG_ENDIAN and LITTLE_ENDIAN (and,
for that matter, PDP_ENDIAN) are defined. The way to test
endianness is not
#ifdef LITTLE_ENDIAN
but rather
#if (BYTE_ORDER == LITTLE_ENDIAN)
I doubt that the kernel uses this macro ...
netdb.h:
decl of inet_aton() removed; it should come from arpa/inet.h
decl of struct rpcent removed; it should come from rpc/rpc.h
net/*:
It appears that this directory is very much non-BSD. I haven't
touched it at all -- something in me says, "Danger, Will!".
After things settle down, it might be worth it to make it
closer to BSD, at least in the file names. However, I'm not
going to worry about it right now.
For your perusal (if required) I've included the directory
net.BSD which is the BSD 4.4 version of the net/* files.
This subdirectory is not intended to be part of the GNO
distribution. (The net.BSD directory is in the NOTES directory.)
netinet/in.h:
If the functions in_makeaddr() and in_lnaof() are used in the
kernel, could you prototype them and reenable them where they
appear in this file? If not, please delete them and the
enclosing #ifdef.
netinet/ip.h:
BSD 4.4 uses a different value for IPTOS_PREC_ROUTINE than was
in your original header. I've got both in (one #ifdef'd), but
could you delete the non-BSD one if it doesn't impact the
kernel or GS/TCP?
pwd.h:
struct passwd has changed in BSD 4.4. getpwent and related
routines have been updated, so any program that is using those
routines to access the /etc/passwd file will be fine. The
file itself has not changed.
resolv.h:
Name of "struct state" has changed to "__res_state" (I suspect
this was done to keep from polluting the namespace). The
"options" field has changed from long to u_long, and the
structure has been lengthened.
The new 'struct __res_state' has, however, been #ifdef'd out
and you have your old 'struct state'. Macro values haven't
changed. The functions you were using weren't prototyped, so
I had to assume the BSD prototypes are correct.
If you are willing to change to use 'struct __res_state', then
check out the #define of '__RES' near the top of <resolv.h>.
If you change then '__RES' should become an unconditional #define.
stdio.h:
As of Orca/C v2.1.1b2, the definition of FILE has changed.
The _pbk field has changed from
int _pbk;
to
int _pbk[2];
This is controlled via __ORCAC_VERSION defined in defaults.h
sys/ioccom.h:
This header file now specifies that the high 3 (vice 2) bits
of the uppper word are used to encode in/out status of the
parameter; is this compatible with the kernel? (Grep for
"IOCPARM_MASK" and look at the comments immediately prior to
it.)
### sys/ioctl.h:
I've included a "GNO-specific" section -- are these GNO-specific
macros actually used anywhere?
There are still some conflicts in this file with <sys/termios.h>,
however they're not new -- they were in the headers you sent me
as well. One of these is the TOSTOP and associated macros.
sys/socket.h:
It appears that the structures you used for "msghdr" and "sockaddr"
have been deemed out-of-date in 4.4BSD; they have been renamed
"omsghdr" and "osockaddr", respectively. I don't know how you
want to handle this; if necessary I guess one could use #ifdefs
and #define sockaddr as osockaddr, et al. I don't think the
new structs should be outright deleted from the header.
The field sequence, macro values, and so forth match your previous
implementation.
So that your routines are still getting the correct prototypes,
I've used the macros __SOCKADDR and __MSGHDR in the header file
prototypes; they're #defined right above the decls.
sys/termios.h:
The names of two of the fields in struct termios has changed:
ispeed --> c_ispeed
ospeed --> c_ospeed
See also the comments for <sys/ioctl.h>
sys/unistd.h:
The values of some of the _PC* macros have changed. I don't
think this should matter since the functions pathconf(3) and
fpathconf(3) haven't yet been implemented.
The following headers I don't believe are part of GNO, although they
were included with the headers you sent. Please correct me if I'm
wrong:
cons.h
console.h
debug.h
sprite.h
sys/m16.ioctl -- perhaps part of GNO, but not a header
The following Orca headers were modified, but I don't believe that the
mods are required for GNO users. (Are these fixes that should be
forwarded to Mike W?) [asked 12 Jan]
appleshare.h
appletalk.h <-- out of date as well
control.h
locator.h
misctool.h
The following headers appear to be not only non-GNO, but obsolete:
newshell.h
shell2.h
Library Changes:
===============
There were lots of additions.
libc/sys/trap.asm [formerly l2.asm]
execve renamed to _execve
getpgrp renamed to _getpgrp
kvm_getproc, kvm_nextproc, and kvm_setproc provided as alternate
entry points into kvmgetproc, kvmnextproc, and kvmsetproc
(respectively) since they were documented entry points in GNO v2.0.4
setpgid is provided as an alternate entry point to setpgrp.
The two are identical (under BSD), but the latter is considered
obsolete.
vfork added as alternate entry point to fork.
libc/sys/syscall.c
The mkdir implementation could easily accept a mode parameter
and thus become POSIX compliant. Should the mode be added?
Manual Page Considerations:
==========================
NOTE NOTE NOTE:
Currently there is a problem with the nroff package,
and many of the man pages will not look right on the
IIgs. I'm working on an update of nroff. Putting it under
Insight has shown a significant number of memory trashing
bugs (which are now gone).
undocumented(2):
This man page lists the undocumented kernel calls. I don't
know if all of these are supposed to _remain_ undocumented ...
kill(2):
Please verify that description of operation with negative process
numbers matches implementation. If there is no match, and
the implementation cannot or will not be changed, please
delete these paragraphs and change the STANDARDS section
to read "The kill function is not POSIX 1003.1 conformant."
semaphore(2):
I'm guessing at the behavior of scount; please verify it.
intro(2):
The "DEFINITIONS" section of this man page is as yet verbatim
from the BSD man page; I haven't had a chance to review it.
If you have any comments, speak up ...
Tools
=====
mkso:
I'm not done mkso yet (mkso is the program that creates
the .so links required for the various manual pages). I
still have to make it check for the legality of file names
on the current file system. I also plan to make it such
that one can place those .so links that require HFS on
another partition, and still have them find the sourced
files.

View File

@ -1,388 +0,0 @@
This file lists the status of the various files in the GNO base distribution.
Version: $Id: status.bin,v 1.6 1997/11/01 19:36:19 gdr Exp $
Person Working on Component ("Owner")
-------------------------------------
dave Dave Tribby
dt Derek Taubert
evan Evan Day
gdr Devin Reade
lb Leslie Barstow
matt Matt Ackeret
sonk Soenke Behrens
tl Tilghman Lesher
Column Key
----------
Program - Name of the program.
204 - 'Y' if it was part of the base v2.0.4 distribution.
Req - Is it required for v2.0.6?
Owner - Who is responsible for it.
Source - Has the source been located/written? "dir" means it's
a directory. "gen" means that it's generated by the
installation scripts.
Man - Is the documentation complete? This includes the man
page, describe entry, rVersion fork, and any
required auxillary documentation. The label
'P' means it's present, 'T' means it's been
tested (reviewed).
Compiled - Has it been cleanly recompiled with new headers/libs?
Tested - Has it been tested?
Archived - Has it been entered in the CVS repository? (gdr to coord)
Installed - Are 'release' and 'makeinstall' targets complete?
('R' and 'I', respectively)
(Pkg) or Archive Install In
Program [Note] 204 Req Owner Source Man Compile Test Target Target Archive
---------------------------------------------------------------------------------------------------------------
*/system Y Y - dir - - - - - -
*/system/Desk.Accs Y Y - dir - - - - - -
*/system/Desk.Accs/gnosnooper Y Y dt /gno.disk2/system.shk
*/system/Desk.Accs/gsi Y Y /gno.disk2/system.shk
*/system/Desk.Accs/suspda Y Y /gno.disk2/system.shk
*/system/Drivers Y Y - dir - - - - - -
*/system/Drivers/fileport Y Y dt prop /gno.disk2/system.shk
*/system/Drivers/fileport.data Y Y dt prop /gno.disk2/system.shk
*/system/Drivers/nullport Y Y dt prop /gno.disk2/system.shk
*/system/System.Setup Y Y - dir - - - - - -
*/system/System.Setup/sim Y Y dt prop /gno.disk2/system.shk
/ Y gdr dir - - - - Y /gno.disk1/installbin
/HFSinclude Y gdr dir - - - - Y /gno.disk1/installbin
/bin Y Y gdr dir - - - - Y /gno.disk1/installbin
/bin/aroff Y Y
/bin/binprint Y
/bin/cat Y Y dave Y T Y Y Y R
/bin/center Y
/bin/chmod Y lb
/bin/chtyp Y Y evan Y T Y Y Y R
/bin/cmp Y Y evan Y T Y Y Y R
/bin/compress Y Y evan
/bin/conv Y (should be replaced by /usr/bin/udl)
/bin/cp Y Y dt
/bin/csh
/bin/date Y Y tl
/bin/dd
/bin/df Y evan Y T Y Y Y R
/bin/domainname
/bin/du Y Y evan
/bin/echo Y dt
/bin/ed
/bin/egrep Y Y evan
/bin/expr
/bin/false Y gdr Y T Y Y Y R
/bin/fgrep Y Y evan
/bin/freeze Y Y
/bin/grep Y Y evan
/bin/gsh Y Y prop
/bin/head Y Y dave Y T Y Y Y R
/bin/hostname Y dt
/bin/info Y lb (rename to something else)
/bin/kill Y
/bin/less Y Y
/bin/ln N
/bin/ls Y Y
/bin/make Y O
/bin/makemake Y O
/bin/mkdir Y Y dt
/bin/more Y Y matt
/bin/mv Y dt
/bin/passwd Y Y
/bin/pax N
/bin/ps Y (replace functionality of /usr/bin/eps)
/bin/purge Y Y
/bin/pwd Y dave Y T Y Y Y R
/bin/rcp Y dt
/bin/rm Y dt
/bin/rmail
/bin/rmdir Y gdr Y T Y Y Y R
/bin/sh Y gdr
/bin/shutdown Y
/bin/sleep Y Y dave Y T Y Y Y R
/bin/split Y Y
/bin/strings Y Y lb
/bin/stty Y Y
/bin/su Y Y
/bin/sync Y
/bin/tail Y Y dave Y T Y Y Y R
/bin/tar Y Y tl
/bin/tee Y Y gdr Y T Y Y Y R
/bin/test Y gdr Y T Y Y Y R
/bin/time Y Y
/bin/touch Y Y dt
/bin/tr Y Y dave Y T Y Y Y R
/bin/true Y gdr Y T Y Y Y R
/bin/uncompress Y Y
/bin/uname Y
/bin/uniq Y Y
/bin/upper Y
/bin/vi Y Y
/bin/wc Y Y dave Y T Y Y Y R
/bin/yes Y dave Y T Y Y Y R
/dev Y Y gdr dir - - - - Y /gno.disk1/installbin
/dev/modem Y Y dt prop Y /gno.disk2/dev.shk
/dev/null Y dt prop Y /gno.disk2/dev.shk
/dev/printer Y Y dt prop Y /gno.disk2/dev.shk
/doc Y gdr dir - - - - Y /gno.disk1/installbin
/etc Y Y gdr dir - - - - Y /gno.disk1/installbin
/etc/cronlog (cron)
/etc/crontab (cron)
/etc/freeze.cnf (freeze)
/etc/gettytab Y Y Y /gno.disk2/etc.shk
/etc/group Y Y gdr Y - /gno.disk2/etc.shk
/etc/inittab (initd) Y Y Y /gno.disk2/etc.shk
/etc/motd Y Y gdr Y - - /gno.disk2/etc.shk
/etc/namespace Y Y gdr gen Y /gno.disk1/installbin
/etc/passwd Y Y gdr Y - /gno.disk2/etc.shk
/etc/rchost (mu)
/etc/syslog.conf (syslog)
/etc/termcap Y Y evan
/etc/tmtermrc (tmterm)
/etc/tty.config Y Y gdr Y - /gno.disk2/etc.shk
/etc/ttys Y Y Y -
/etc/utmp (mu)
/gshrc Y Y
/home/root Y gdr dir - - - -
/initrc (single-user) Y Y gdr Y - /gno.disk1/initrc
/installbin Y Y gdr - /gno.disk1/installbin
/kern Y Y dt prop
/lib Y Y gdr dir - - - - Y /gno.disk1/installbin
/lib/lbsd Y N -
/lib/lcrypt Y N (now in libc)
/lib/libc Y Y gdr Y
/lib/libgno Y N -
/lib/lsaneglue Y sonk Y T Y Y Y
/lib/lstring Y (replaced by libc?)
/lib/orcalib Y Y gdr Y T Y Y Y
/lib/sysfloat Y gdr Y T Y Y Y
/libexec/atrun
/libexec/fingerd
/libexec/ftpd Y dt
/libexec/rexecd
/libexec/rlogind
/libexec/rshd
/libexec/talkd Y dt
/libexec/telnetd
/libexec/uucpd
/sbin/dump Y dt
/sbin/dumpfs
/sbin/fsck
/sbin/init (initd) Y Y
/sbin/initd (initd) Y Y
/sbin/newfs
/sbin/ping
/sbin/renram5 Y gdr
/startinst Y
/usr Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/bin Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/bin/DAY Y
/usr/bin/GOTHIC Y
/usr/bin/SSCII Y
/usr/bin/See Y
/usr/bin/apply N
/usr/bin/apropos (man) Y gdr Y
/usr/bin/ar N
/usr/bin/at
/usr/bin/aw30 Y
/usr/bin/awk Y
/usr/bin/bang Y
/usr/bin/banner Y
/usr/bin/basename Y gdr
/usr/bin/biff
/usr/bin/bison Y N
/usr/bin/cal Y
/usr/bin/calendar
/usr/bin/catrez Y dave Y T Y Y Y R
/usr/bin/cclean Y
/usr/bin/cjpeg N (add on)
/usr/bin/cksum Y
/usr/bin/cmpl Y Y
/usr/bin/coff Y
/usr/bin/col
/usr/bin/column
/usr/bin/compile Y Y
/usr/bin/copycat Y Y tl
/usr/bin/cpp gdr Y Y
/usr/bin/ctags Y dt
/usr/bin/cut Y dave Y T Y Y Y R
/usr/bin/describe (describe) Y gdr Y T Y Y Y R
/usr/bin/dhrystone Y N
/usr/bin/diff Y gdr
/usr/bin/dirname Y gdr
/usr/bin/dmake Y gdr
/usr/bin/env Y gdr
/usr/bin/eps Y N (replace with updated /bin/ps)
/usr/bin/ffdir Y
/usr/bin/file
/usr/bin/find gdr
/usr/bin/finger
/usr/bin/flex Y N
/usr/bin/fmt Y gdr Y T Y Y Y R
/usr/bin/fold Y
/usr/bin/ftp Y dt
/usr/bin/getopt
/usr/bin/getvers Y Y
/usr/bin/gunzip Y
/usr/bin/gzip Y
/usr/bin/hear Y
/usr/bin/help Y Y gdr Y T - Y Y R
/usr/bin/hexdump
/usr/bin/install Y gdr Y T Y Y Y R
/usr/bin/join
/usr/bin/last Y dt
/usr/bin/launch Y Y tl
/usr/bin/link (ie: ld) Y Y
/usr/bin/locate gdr
/usr/bin/logger Y
/usr/bin/logname
/usr/bin/lpq (lpr) Y dt
/usr/bin/lpr (lpr) Y Y dt
/usr/bin/lprm (lpr) Y dt
/usr/bin/lseg Y Y dave Y T Y Y Y R
/usr/bin/mkdep
/usr/bin/makedmake gdr
/usr/bin/man Y Y gdr Y
/usr/bin/news Y N (waiting on NNTP/UUCP)
/usr/bin/nm
/usr/bin/nosh (formerly zsh) Y lb
/usr/bin/nroff Y Y gdr Y T Y Y Y R
/usr/bin/patch Y gdr
/usr/bin/pman Y
/usr/bin/pr
/usr/bin/printenv Y gdr
/usr/bin/printf
/usr/bin/qtime Y
/usr/bin/rb Y Y
/usr/bin/reset Y
/usr/bin/rlogin Y dt
/usr/bin/rot13 Y lb
/usr/bin/rsh Y dt
/usr/bin/rx Y Y
/usr/bin/rz Y Y
/usr/bin/sb Y
/usr/bin/script Y Y
/usr/bin/sed dave
/usr/bin/sendmail N (waiting on NNTP/UUCP)
/usr/bin/setvers Y Y
/usr/bin/shar
/usr/bin/size
/usr/bin/sort Y gdr Y (supercedes msort/dsort)
/usr/bin/sum Y Y
/usr/bin/sx Y Y
/usr/bin/sz Y Y
/usr/bin/talk Y dt
/usr/bin/telnet Y dt
/usr/bin/tftp
/usr/bin/tset
/usr/bin/tsort Y
/usr/bin/tty
/usr/bin/unshar Y Y
/usr/bin/unzip Y
/usr/bin/uptime Y Y
/usr/bin/uudecode
/usr/bin/uuencode
/usr/bin/wall Y dt
/usr/bin/whatis (man) Y gdr Y
/usr/bin/whereis Y gdr Y T Y Y Y R
/usr/bin/which
/usr/bin/who Y Y dt Y Y
/usr/bin/whois Y dt
/usr/bin/write Y lb
/usr/bin/xargs
/usr/bin/yankit Y Y
/usr/bin/zsh Y lb (renamed to nosh)
/usr/games Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/games/wump Y
/usr/include Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/lib Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/lib/libflex Y
/usr/lib/libcurses Y Y evan
/usr/lib/libregexp Y Y
/usr/lib/libtermcap Y Y evan
/usr/lib/libutil Y gdr Y
/usr/lib/tmac Y gdr dir - - - - Y /gno.disk1/installbin
/usr/lib/tmac/tmac.an (nroff) Y
/usr/lib/tmac/tmac.s (nroff) Y
/usr/orca/bin/occ Y sonk
/usr/orca/bin/rc Y sonk
/usr/orca/bin/udl Y sonk Y
/usr/man Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat1 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat2 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat3 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat4 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat5 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat6 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat7 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/cat8 Y Y gdr dir - - - - Y /gno.disk1/installbin
/usr/man/man1 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man1/intro.1 Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man2 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man2/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man3 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man3/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man4 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man4/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man5 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man5/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man6 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man6/intro.6 Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man7 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man7/* [A] Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/man/man8 Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/man/man8/intro.8 Y Y gdr - Y /gno.disk3/usr.man.shk
/usr/sbin Y Y gdr dir - - - - Y /gno.disk3/usr.man.shk
/usr/sbin/catman (man) Y gdr Y
/usr/sbin/cron Y Y
/usr/sbin/descc (describe) Y gdr Y T Y Y Y R
/usr/sbin/descu (describe) Y gdr Y T Y Y Y R
/usr/sbin/getty Y Y
/usr/sbin/inetd Y dt
/usr/sbin/login Y Y dt
/usr/sbin/lpc (lpr) Y dt
/usr/sbin/lpd (lpr) Y Y dt
/usr/sbin/lptest (lpr) Y dt
/usr/sbin/makewhatis (man) Y gdr Y
/usr/sbin/mctrl Y
/usr/sbin/mktmp
/usr/sbin/newuser (maybe replace with adduser?) (update to use /home vice /user, or maybe a conf file)
/usr/sbin/newuserv (maybe replace with adduser?) (update to use /home vice /user, or maybe a conf file)
/usr/sbin/nogetty Y
/usr/sbin/runover Y Y
/usr/sbin/uptimed Y
/usr/spool Y N - dir - - - - - /gno.disk1/installbin
/var/adm Y gdr dir - - - - Y /gno.disk1/installbin
/var/adm/utmp (initd)
/var/adm/wtmp (initd)
/var/run dir - - - -
/var/spool Y gdr dir - - - - Y /gno.disk1/installbin
/var/spool/uucppublic Y gdr dir - - - -
NOTES:
A) See the status.man for a complete list of
these files.
The following are add-on utils, that are not part of the base GNO
distribution:
/usr/local/bin/djpeg
/usr/local/bin/drwm
/usr/local/bin/jive
/usr/local/bin/valspeak
/usr/local/bin/ssplay
/usr/lang/bin/xlisp
The following are the files as the user sees them "shipped":
/gno.disk1/kern
/gno.disk1/gsh
/gno.disk1/installbin
/gno.disk1/mkso
/gno.disk1/dev/null
/gno.disk1/usr/bin/install
/gno.disk1/usr/bin/yankit
/gno.disk2/dev.shk
/gno.disk2/include.shk
/gno.disk3/usr.man.shk

View File

@ -1,607 +0,0 @@
$Id: status.lib,v 1.5 1997/11/03 03:15:58 gdr Exp $
Key for Code Status column:
R == reviewed
C == compiled
T == tested
The man page column info specifies in which chapter the manual page
resides. If it is blank, it is not yet written. "2U" indicates
undocumented system calls in undocumented.2. If these should be documented,
Derek, please write a man page for them or tell me what should be in there.
Letters in square brackets ("[]") following function names indicate
that you should read the respective note following this table.
function file code man header
status page
======================================================================
GNO-specific
------------
GIchange libc/gno/gsstring.c T 3 gno/gno.h
GIfree libc/gno/gsstring.c T 3 gno/gno.h
GIinit libc/gno/gsstring.c T 3 gno/gno.h
GOchange libc/gno/gsstring.c T 3 gno/gno.h
GOfree libc/gno/gsstring.c T 3 gno/gno.h
GOinit libc/gno/gsstring.c T 3 gno/gno.h
InstallNetDriver libc/sys/trap.asm C 2U gno/gno.h
LC_CopyFile libcontrib/copyfile.c T contrib.h
LC_CopyFileGS libcontrib/copyfile.c T contrib.h
LC_ExpandPath libcontrib/expandpath.c T contrib.h
LC_ExpandPathGS libcontrib/expandpath.c T contrib.h
LC_StringArrayAdd libcontrib/strarray.c T contrib.h
LC_StringArrayDelete libcontrib/strarray.c T contrib.h
LC_StringArrayClear libcontrib/strarray.c T contrib.h
LC_StringArrayCat libcontrib/strarray.c T contrib.h
LC_StringArrayNew libcontrib/strarray.c T contrib.h
LC_xmalloc libcontrib/xalloc.c T contrib.h
LC_xrealloc libcontrib/xalloc.c T contrib.h
LC_xstrdup libcontrib/xalloc.c T contrib.h
SetGNOQuitRec libc/sys/trap.asm C 2U gno/gno.h
WriteGString libc/gno/gnomisc.c C
__C2GS libc/gno/gsstring.c C 3 gno/gno.h
__C2GSMALLOC libc/gno/gsstring.c T 3 gno/gno.h
__GS2C libc/gno/gsstring.c C 3 gno/gno.h
__GS2CMALLOC libc/gno/gsstring.c C 3 gno/gno.h
__prognameGS libc/gno/gnomisc.c T 3 gno/gno.h
_beginStackCheck libc/gno/stack.asm T 3 gno/gno.h
_endStackCheck libc/gno/stack.asm T 3 gno/gno.h
_errnoText [var] libc/stdio/perror.c T na na
_getModeEmulation libc/sys/map.c T 3 gno/gno.h
_mapErr libc/gno/map.c T 3 gno/gno.h
_mapMode2GS libc/gno/map.c T 3 gno/gno.h
_mapMode2Unix libc/gno/map.c C 3 gno/gno.h
_mapPath libc/gno/map.c C 3 gno/gno.h
_mapPathGS libc/gno/map.c C 3 gno/gno.h
_setFdTranslation libc/sys/syscall.c C static na
_setModeEmulation libc/sys/map.c C 3 gno/gno.h
_setPathMapping libc/gno/map.c C 3 gno/gno.h
buildCmd libc/sys/exec.c C 3 gno/gno.h
buildEnv libc/sys/exec.c C 3 gno/gno.h
buildPath libc/sys/exec.c C 3 gno/gno.h
environInit libc/gen/environ.c T 3 stdlib.h
environPop libc/gen/environ.c T 3 stdlib.h
environPush libc/gen/environ.c T 3 stdlib.h
fsetbinary (macro) T 3 stdio.h
fsettext (macro) T 3 stdio.h
isRootPath libc/sys/exec.c C 3 gno/gno.h
kernStatus (inline) T 2 gno/gno.h
kernVersion (inline) T 2 gno/gno.h
needsgno libc/gno/gnomisc.c T 3 gno/gno.h
old_syslog libc/gen/oldlog.c C sys/syslog.h
rexit libc/sys/syscall.c C 3 stdlib.h
setdebug libc/sys/trap.asm T 2 gno/gno.h
setsystemvector libc/sys/trap.asm C 2U gno/gno.h
settpgrp libc/sys/trap.asm C 2 gno/gno.h
tcnewpgrp libc/sys/trap.asm C 2 gno/gno.h
tctpgrp libc/sys/trap.asm C 2 gno/gno.h
~GNO_COMMAND libc/gno/gnocmd.asm C 3 na
~GNO_FREEARG libc/gno/parsearg.asm C 3 na
~GNO_PARSEARG libc/gno/parsearg.asm C 3 na
BSD-ish
-------
__crypt_f libc/gen/crypta.asm C na na
__crypt_rotate libc/gen/crypta.asm C na na
__crypt_transpose libc/gen/crypta.asm C na na
__mb_cur_max [var] libc/locale/table.c C stdlib.h
__srget libc/stdio/rget.c C na stdio.h
__svfscanf libc/stdio/vfscanf C na stdio.h
__swbuf libc/stdio/wbuf.c C na stdio.h
_execve libc/sys/trap.asm C 2 unistd.h
_getlogin libc/gen/getlogin.c T na unistd.h
_getpgrp libc/sys/trap.asm C 2 unistd.h
_longjmp libc/gen/setjmp.asm C 3 setjmp.h
_setjmp libc/gen/setjmp.asm C 3 setjmp.h
accept libc/sys/trap.asm C 2 sys/socket.h
access libc/sys/syscall.c C 2 unistd.h
alarm libc/sys/trap.asm C 2 unistd.h
alarm10 libc/sys/trap.asm C 2 unistd.h
alphacasesort libc/gen/scandir.c T 3 dirent.h
alphasort libc/gen/scandir.c T 3 dirent.h
basename libc/gen/basename.c T 3 unistd.h
bcopy libc/gen/bmem.c C 3 string.h
bind libc/sys/trap.asm C 2 sys/socket.h
bzero libc/gen/bmem.c C 3 string.h
chdir libc/sys/syscall.c C 3 unistd.h
chmod libc/sys/syscall.c C 2 sys/stat.h
clearerr libc/stdio/clrerr.c C 3 stdio.h
close libc/sys/syscall.c C 2 unistd.h
closedir libc/gen/dirent.c T 3 dirent.h
closelog libc/gen/syslog.asm C 3 sys/syslog.h
connect libc/sys/trap.asm C 2 sys/socket.h
creat libc/sys/syscall.c T 2 sys/fcntl.h
crypt libc/gen/crypt.c C 3 unistd.h
ctermid libc/stdio/ stdio.h
dirfd (macro) T 3 dirent.h
dirname libc/gen/basename.c T 3 unistd.h
dup libc/sys/trap.asm C 2 unistd.h
dup2 libc/sys/trap.asm C 2 unistd.h
encrypt libc/gen/crypt.c C 3 unistd.h
endgrent libc/gen/getgrent.c T 3 grp.h
endpwent libc/gen/getpwent.c T 3 pwd.h
endttyent libc/gen/getttyent.c C 3 ttyent.h
err libc/gen/err.c T 3 err.h
errx libc/gen/err.c T 3 err.h
exec libc/sys/exec.c C 3 unistd.h
execl libc/sys/exec.c T 3 unistd.h
execle 3 unistd.h
execlp libc/sys/exec.c T 3 unistd.h
execv libc/sys/exec.c T 3 unistd.h
execve libc/sys/exec.c T 3 unistd.h
execvp libc/sys/exec.c T 3 unistd.h
fchdir libc/sys/syscall.c C 3 unistd.hf
fchmod libc/sys/syscall.c C 2 sys/stat.h
fclose libc/stdio/fclose.c T(1) 3 stdio.h
fcntl libc/sys/syscall.c T 2 sys/fcntl.h
fdopen libc/stdio/fdopen.c T 3 stdio.h
feof libc/stdio/feof.c C 3 stdio.h
ferror libc/stdio/ferror.c C 3 stdio.h
fflush libc/stdio/fflush.c C 3 stdio.h
fgetc libc/stdio/fgetc.c C 3 stdio.h
fgetln libc/stdio/fgetln.c C 3 stdio.h
fgetpos libc/stdio/fgetpos.c C 3 stdio.h
fgets libc/stdio/fgets.c C 3 stdio.h
fileno libc/stdio/fileno.c C 3 stdio.h
fnmatch libc/gen/fnmatch.c T 3 fnmatch.h
fopen libc/stdio/fopen.c C 3 stdio.h
fork libc/sys/trap.asm C 2 unistd.h
fork2 libc/sys/trap.asm C 2 unistd.h
forkpty [A] libutil/pty.c libutil.h
fprintf libc/stdio/fprintf.c C 3 stdio.h
fpurge libc/stdio/fpurge.c C 3 stdio.h
fputc libc/stdio/fputc.c C 3 stdio.h
fputs libc/stdio/fputs.c C 3 stdio.h
fread libc/stdio/fread.c T(1) 3 stdio.h
freopen libc/stdio/freopen.c C 3 stdio.h
fscanf libc/stdio/fscanf.c C 3 stdio.h
fseek libc/stdio/fseek.c C 3 stdio.h
fsetpos libc/stdio/fsetpos.c C 3 stdio.h
fstat libc/sys/trap.asm C 2 sys/stat.h
fstatfs libc/sys/syscall.c C 2 sys/mount.h
fsync libc/sys/syscall.c C 2 unistd.h
ftell libc/stdio/ftell.c C 3 stdio.h
ftruncate libc/sys/syscall.c C 2 unistd.h
fts_children libc/gen/fts.c R 3 fts.h
fts_close libc/gen/fts.c R 3 fts.h
fts_open libc/gen/fts.c R 3 fts.h
fts_read libc/gen/fts.c R 3 fts.h
fts_set libc/gen/fts.c R 3 fts.h
funopen libc/stdio/funopen.c T 3 stdio.h
fwrite libc/stdio/fvwrite.c T(1) 3 stdio.h
getc libc/stdio/getc.c C 3 stdio.h
getchar libc/stdio/getchar.c C 3 stdio.h
getcwd libc/gen/getcwd.c T 3 unistd.h
getdtablesize libc/sys/syscall.c C 2 unistd.h
getegid libc/sys/trap.asm C 2 unistd.h
getenv libc/gen/environ.c T 3 stdlib.h
geteuid libc/sys/trap.asm C 2 unistd.h
getgid libc/sys/trap.asm C 2 unistd.h
getgrent libc/gen/getgrent.c T 3 grp.h
getgrgid libc/gen/getgrent.c T 3 grp.h
getgrnam libc/gen/getgrent.c T 3 grp.h
gethostname libc/gen/hostname.c C 3 unistd.h
getlogin libc/gen/getlogin.c T 2 unistd.h
getopt libc/stdlib/getopt.c C 3 stdlib.h
getopt_restart libc/stdlib/getopt.c C 3 stdlib.h
getpass libc/gen/getpass.c C 3 unistd.h
getpeername libc/sys/trap.asm C 2 sys/socket.h
getpgrp libc/sys/syscall.c C 2 unistd.h
getpid libc/sys/trap.asm T 2 unistd.h
getppid libc/sys/trap.asm C 2 unistd.h
getpwent libc/gen/getpwent.c T 3 pwd.h
getpwnam libc/gen/getpwent.c T 3 pwd.h
getpwuid libc/gen/getpwent.c T 3 pwd.h
gets libc/stdio/gets.c C 3 stdio.h
getsockname libc/sys/trap.asm C 2 sys/socket.h
getsockopt 2 sys/socket.h
getsubopt libc/stdlib/getsubopt.c C 3 stdlib.h
gettimeofday libc/sys/syscall.c C 2 sys/time.h
getttyent libc/gen/getttyent.c C 3 ttyent.h
getttynam libc/gen/getttyent.c C 3 ttyent.h
getuid libc/sys/trap.asm C 2 unistd.h
getw libc/stdio/getw.c C 3 stdio.h
getwd libc/gen/getcwd.c T 3 unistd.h
group_from_gid libc/gen/pwcache.c C 3 na
gtty libc/gen/compat.c C 3 sgtty.h
index libc/string/str.c C 3 string.h
ioctl libc/sys/trap.asm C 2 sys/ioctl.h
isatty libc/gen/tty.c C 3 unistd.h
kill libc/sys/trap.asm C 2 signal.h
kvm_close libc/sys/trap.asm C 2U gno/gno.h
kvm_getproc libc/sys/trap.asm C 2U gno/gno.h
kvm_nextproc libc/sys/trap.asm C 2U gno/gno.h
kvm_open libc/sys/trap.asm C 2U gno/gno.h
kvm_setproc libc/sys/trap.asm C 2U gno/gno.h
kvmgetproc libc/sys/trap.asm C 2U gno/gno.h
kvmnextproc libc/sys/trap.asm C 2U gno/gno.h
kvmsetproc libc/sys/trap.asm C 2U gno/gno.h
listen libc/sys/trap.asm C 2 sys/socket.h
localeconv (locale.h)
login libutil/login.c C na libutil.h
login_tty libutil/logintty.c C na libutil.h
logout [B] libutil/logout.c na libutil.h
logwtmp [B, C] libutil/logwtmp.c na libutil.h
longjmp libc/gen/setjmp.asm C 3 setjmp.h
lseek libc/sys/syscall.c C 2 unistd.h
lstat libc/sys/trap.asm C 2 sys/stat.h
mkdir libc/sys/syscall.c C 2 sys/stat.h
mkstemp libc/stdio/mktemp.c C 3 unistd.h
mktemp libc/stdio/mktemp.c C 3 unistd.h
open libc/sys/syscall.c C 2 sys/fcntl.h
opendir libc/gen/dirent.c T 3 dirent.h
openlog libc/gen/syslog.asm C 3 sys/syslog.h
openpty [A] libutil/pty.c libutil.h
optarg [var] libc/stdlib/getopt.c C 3 stdlib.h
opterr [var] libc/stdlib/getopt.c C 3 stdlib.h
optind [var] libc/stdlib/getopt.c C 3 stdlib.h
optopt [var] libc/stdlib/getopt.c C 3 stdlib.h
optreset [var] libc/stdlib/getopt.c C 3 stdlib.h
pause libc/gen/sleep.c T 3 unistd.h
pbind libc/sys/trap.asm C 2 sys/ports.h
pclose libc/gen/popen.c C 3 stdio.h
pcreate libc/sys/trap.asm C 2 sys/ports.h
pdelete libc/sys/trap.asm C 2 sys/ports.h
perror libc/stdio/perror.c T 3 stdio.h
pgetcount libc/sys/trap.asm C 2 sys/ports.h
pgetport libc/sys/trap.asm C 2 sys/ports.h
pipe libc/sys/trap.asm C 2 unistd.h
popen libc/gen/popen.c C 3 stdio.h
preceive libc/sys/trap.asm C 2 sys/ports.h
preset libc/sys/trap.asm C 2 sys/ports.h
printf libc/stdio/printf.c C 3 stdio.h
procreceive libc/sys/trap.asm C 2 gno/gno.h
procrecvclr libc/sys/trap.asm C 2 gno/gno.h
procrecvtim libc/sys/trap.asm C 2 gno/gno.h
procsend libc/sys/trap.asm C 2 gno/gno.h
psend libc/sys/trap.asm C 2 sys/ports.h
psignal libc/gen/psignal.c R 3 signal.h
putc libc/stdio/putc.c C 3 stdio.h
putchar libc/stdio/putchar.c C 3 stdio.h
putenv libc/gen/environ.c T 3 stdlib.h
puts libc/stdio/puts.c C 3 stdio.h
putw libc/stdio/putw.c C 3 stdio.h
raise libc/sys/syscall.c C 3 signal.h
read libc/sys/syscall.c C 2 unistd.h
readdir libc/gen/dirent.c T 3 dirent.h
recv libc/sys/trap.asm C 2 sys/socket.h
recvfrom libc/sys/trap.asm C 2 sys/socket.h
recvmsg ( missing from kernel ) 2 sys/socket.h
remove libc/stdio/remove.c C 3 stdio.h
rename libc/sys/syscall.c T 2 stdio.h
rewind libc/stdio/rewind.c T(1) 3 stdio.h
rewinddir libc/gen/dirent.c T 3 dirent.h
rindex libc/string/str.c C 3 string.h
rmdir libc/sys/syscall.c T 2 unistd.h
scandir libc/gen/scandir.c T 3 dirent.h
scanf libc/stdio/scanf.c C 3 stdio.h
scount libc/sys/trap.asm C 2 gno/gno.h
screate libc/sys/trap.asm T 2 gno/gno.h
sdelete libc/sys/trap.asm C 2 gno/gno.h
seekdir libc/gen/dirent.c T 3 dirent.h
select libc/sys/trap.asm C 2 unistd.h
send libc/sys/trap.asm C 2 sys/socket.h
sendmsg ( missing from kernel ) 2 sys/socket.h
sendto libc/sys/trap.asm C 2 sys/socket.h
setbuf libc/stdio/setbuf.c C 3 stdio.h
setbuffer libc/stdio/setbuffer.c C 3 stdio.h
setegid libc/sys/trap.asm C 2 unistd.h
setenv libc/gen/environ.c T 3 stdlib.h
seteuid libc/sys/trap.asm C 2 unistd.h
setgid libc/sys/trap.asm C 2 unistd.h
setgrent libc/gen/getgrent.c T 3 grp.h
setgroupent libc/gen/getgrent.c T 3 grp.h
sethostname libc/gen/hostname.c C 3 unistd.h
setjmp libc/gen/setjmp.asm C 3 setjmp.h
setkey libc/gen/crypt.c C 3 unistd.h
setlinebuf libc/stdio/setbuffer.c C 3 stdio.h
setlocale (locale.h)
setlogin libc/gen/getlogin.c T 2 unistd.h
setlogmask libc/gen/syslog.asm C 3 sys/syslog.h
setpassent libc/gen/getpwent.c 3 pwd.h
setpgid libc/sys/trap.asm C 2 unistd.h
setpgrp libc/sys/trap.asm C 2 unistd.h
setproctitle [A] libutil/setproc.c libutil.h
setpwent libc/gen/getpwent.c T 3 pwd.h
setregid libc/sys/trap.asm C 2 unistd.h
setreuid libc/sys/trap.asm C 2 unistd.h
setrgid libc/sys/trap.asm C 2 unistd.h
setruid libc/sys/trap.asm C 2 unistd.h
setsockopt libc/sys/trap.asm C 2 sys/socket.h
settimeofday 2 sys/time.h
setttyent libc/gen/getttyent.c C 3 ttyent.h
setuid libc/sys/trap.asm C 2 unistd.h
setvbuf libc/stdio/setvbuf.c C 3 stdio.h
shutdown libc/sys/trap.asm C 2 sys/socket.h
sigblock libc/sys/trap.asm C 2 signal.h
siglongjmp 3 setjmp.h
sigmask (macro) C 2 sys/signal.h
signal libc/sys/trap.asm C 2 sys/signal.h
sigpause libc/sys/trap.asm C 2 signal.h
sigprocmask libc/sys/syscall.c signal.h
sigsetjmp 3 setjmp.h
sigsetmask libc/sys/trap.asm C 2 signal.h
sleep libc/gen/sleep.c T 3 unistd.h
snprintf libc/stdio/snprintf.c C 3 stdio.h
socket libc/sys/trap.asm C 2 sys/socket.h
sprintf libc/stdio/sprintf.c C 3 stdio.h
sscanf libc/stdio/sscanf.c C 3 stdio.h
ssignal libc/sys/trap.asm T 2 gno/gno.h
stat libc/sys/trap.asm C 2 sys/stat.h
statfs libc/sys/syscall.c C 2 sys/mount.h
strcasecmp libc/str/case.c T 3 string.h
strdup libc/string/str.c C 3 string.h
strerror libc/stdio/perror.c T 3 stdio.h
stricmp libc/str/case.c C 3 string.h
strincmp libc/str/case.c C 3 string.h
strncasecmp libc/str/case.c C 3 string.h
strsep libc/string/str.c C 3 string.h
stty libc/gen/compat.c C 3 sgtty.h
suboptarg [var] libc/stdlib/getsubopt.c C 3 stdlib.h
swait libc/sys/trap.asm T 2 gno/gno.h
sys_errlist [var] libc/stdio/perror.c T 3 stdio.h
sys_nerr [var] libc/stdio/perror.c T 3 stdio.h
sys_siglist [var] libc/gen/siglist.c R 3 signal.h
sys_signame [var] libc/gen/siglist.c R 3 signal.h
syslog libc/gen/syslog.asm C 3 sys/syslog.h
telldir libc/gen/dirent.c T 3 dirent.h
tempnam libc/stdio/tempnam.c C 3 stdio.h
times libc/sys/trap.asm C 2 sys/times.h
tmpfile libc/stdio/tmpfile.c T(1) 3 stdio.h
tmpnam libc/stdio/tmpnam.c C 3 stdio.h
truncate libc/sys/syscall.c C 2 unistd.h
ttyname libc/gen/tty.c C 3 unistd.h
ttyslot libc/gen/tty.c C 3 unistd.h
umask libc/sys/syscall.c C 2 sys/stat.h
ungetc libc/stdio/ungetc.c C 3 stdio.h
unlink libc/sys/syscall.c T 2 unistd.h
unsetenv libc/gen/environ.c T 3 stdlib.h
user_from_uid libc/gen/pwcache.c C 3 na
utime libc/gen/utime.c T 3 sys/time.h
utimes libc/gen/utime.c T 2 utime.h
verr libc/gen/err.c T 3 err.h
verrx libc/gen/err.c T 3 err.h
vfork libc/sys/trap.asm C 2 unistd.h
vfprintf libc/stdio/vfprintf.c C 3 stdio.h
vfscanf libc/stdio/vfscanf.c C 3 stdio.h
vprintf libc/stdio/vprintf.c C 3 stdio.h
vscanf libc/stdio/fscanf.c C 3 stdio.h
vsnprintf libc/stdio/vsnprintf.c C 3 stdio.h
vsprintf libc/stdio/vsprintf.c C 3 stdio.h
vsscanf libc/stdio/vsscanf.c C 3 stdio.h
vsyslog libc/gen/syslog.asm C 3 sys/syslog.h
vwarn libc/gen/err.c T 3 err.h
vwarnx libc/gen/err.c T 3 err.h
wait libc/sys/trap.asm C 2 sys/wait.h
wait3 ( missing from kernel ) 2 sys/wait.h
wait4 ( missing from kernel ) 2 sys/wait.h
waitpid libc/sys/syscall.c C 2 sys/wait.h
warn libc/gen/err.c T 3 err.h
warnx libc/gen/err.c T 3 err.h
write libc/sys/syscall.c C 2 unistd.h
zopen libc/stdio/ stdio.h
Notes:
[var] symbol is a variable, not a fuction
[A] function needs to be modified before use
[B] these sets of routines rely on a modified utmp/wtmp file
structure. Therefore a large list of routines and programs
have to be updated all at once (see the TO.DO file).
[C] logwtmp() is a stub at the moment. It can be called, but
will not modify the utmp/wtmp files.
Library Sources Currently Compiling:
-----------------------------------
- This list is exclusive of modified or standard ORCA libraries
- Where the filename appears with no other information, the
file is present but not yet part of the build.
DATA OPTIMIZE DEBUG MEMORY SEGMENT TESTING NAME
BANK MODEL COMPLETE
==============================================================
78 0 0 Y Y libc/gen/basename.c
78 0 0 Y N libc/gen/bmem.c
78 0 0 Y N libc/gen/compat.c
78 0 0 N N libc/gen/crypt.c
na na N N libc/gen/crypta.asm
78 0 0 Y Y libc/gen/dirent.c
8 0 0 Y Y libc/gen/err.c
78 0 0 Y Y libc/gen/fnmatch.c
78 0 0 Y Y libc/gen/fts.c
78 0 0 Y Y libc/gen/getcwd.c
78 0 0 Y Y libc/gen/getgrent.c
78 0 0 Y N libc/gen/getlogin.c
78 0 0 Y N libc/gen/getpass.c
78 0 0 Y Y libc/gen/getpwent.c
78 0 0 Y N libc/gen/getttyent.c
78 0 0 Y N libc/gen/hostname.c
78 0 0 Y N libc/gen/oldlog.c
78 0 0 Y N libc/gen/popen.c
78 0 0 Y N libc/gen/psignal.c
78 0 0 Y N libc/gen/pwcache.c
78 0 0 Y Y libc/gen/scandir.c
na na N N libc/gen/setjmp.asm
78 0 0 Y N libc/gen/siglist.c
78 0 0 Y Y libc/gen/sleep.c
na na Y N libc/gen/syslog.asm
78 0 0 Y N libc/gen/tty.c
78 0 0 Y Y libc/gen/utime.c
na na N N libc/gno/gnocmd.asm
78 0 0 (1) Y Y libc/gno/gnomisc.c
78 (79) 0 0 (1) Y Y libc/gno/gsstring.c
78 0 0 (1) Y N libc/gno/map.c
na na N N libc/gno/parsearg.asm
na na Y Y libc/gno/stack.asm
78 0 0 Y N libc/locale/table.c [stub]
78 0 0 Y N libc/stdio/clrerr.c
78 0 0 Y N libc/stdio/fclose.c
78 0 0 Y N libc/stdio/fdopen.c
78 0 0 Y N libc/stdio/feof.c
78 0 0 Y N libc/stdio/ferror.c
78 0 0 Y N libc/stdio/fflush.c
78 0 0 Y N libc/stdio/fgetc.c
78 0 0 Y N libc/stdio/fgetln.c
78 0 0 Y N libc/stdio/fgetpos.c
78 0 0 Y N libc/stdio/fgets.c
78 0 0 Y N libc/stdio/fileno.c
78 0 0 Y N libc/stdio/findfp.c
78 0 0 Y N libc/stdio/flags.c
78 0 0 Y N libc/stdio/fopen.c
78 0 0 Y N libc/stdio/fprintf.c
78 0 0 Y N libc/stdio/fpurge.c
78 0 0 Y N libc/stdio/fputc.c
78 0 0 Y N libc/stdio/fputs.c
78 0 0 Y N libc/stdio/fread.c
78 0 0 Y N libc/stdio/freopen.c
78 0 0 Y N libc/stdio/fscanf.c
78 0 0 Y N libc/stdio/fseek.c
78 0 0 Y N libc/stdio/fsetpos.c
78 0 0 Y N libc/stdio/ftell.c
78 0 0 Y N libc/stdio/funopen.c
78 0 0 Y N libc/stdio/fvwrite.c
78 0 0 Y N libc/stdio/fwalk.c
78 0 0 Y N libc/stdio/fwrite.c
78 0 0 Y N libc/stdio/getc.c
78 0 0 Y N libc/stdio/getchar.c
78 0 0 Y N libc/stdio/gets.c
78 0 0 Y N libc/stdio/getw.c
78 0 0 Y N libc/stdio/makebuf.c
78 0 0 Y N libc/stdio/mktemp.c
78 0 0 Y N libc/stdio/perror.c
78 0 0 Y N libc/stdio/printf.c
78 0 0 Y N libc/stdio/putc.c
78 0 0 Y N libc/stdio/putchar.c
78 0 0 Y N libc/stdio/puts.c
78 0 0 Y N libc/stdio/putw.c
78 0 0 Y N libc/stdio/refill.c
78 0 0 Y N libc/stdio/remove.c
78 0 0 Y N libc/stdio/rewind.c
78 0 0 Y N libc/stdio/rget.c
78 0 0 Y N libc/stdio/scanf.c
78 0 0 Y N libc/stdio/setbuf.c
78 0 0 Y N libc/stdio/setbuffer.c
78 0 0 Y N libc/stdio/setvbuf.c
78 0 0 Y N libc/stdio/snprintf.c
78 0 0 Y N libc/stdio/sprintf.c
78 0 0 Y N libc/stdio/sscanf.c
78 0 0 Y N libc/stdio/stdio.c
78 0 0 Y N libc/stdio/tempnam.c
78 0 0 Y N libc/stdio/tmpfile.c
78 0 0 Y N libc/stdio/tmpnam.c
78 0 0 Y N libc/stdio/ungetc.c
78 0 0 Y N libc/stdio/vfprintf.c
78 0 0 Y N libc/stdio/vfscanf.c
78 0 0 Y N libc/stdio/vprintf.c
78 0 0 Y N libc/stdio/vscanf.c
78 0 0 Y N libc/stdio/vsnprintf.c
78 0 0 Y N libc/stdio/vsprintf.c
78 0 0 Y N libc/stdio/vsscanf.c
78 0 0 Y N libc/stdio/wbuf.c
78 0 0 Y N libc/stdio/wsetup.c
78 0 0 Y N libc/stdlib/cvt.c
1 78 0 0 Y Y libc/stdlib/environ.c
na na Y Y libc/stdlib/fpspecnum.asm
78 0 0 Y N libc/stdlib/getopt.c
78 0 0 Y N libc/stdlib/getsubopt.c
libc/stdtime/asctime.c
libc/stdtime/difftime.c
libc/stdtime/localtime.c
libc/stdtime/strftime.c
78 0 0 Y N libc/string/case.c
78 0 0 Y N libc/string/str.c
78 0 0 Y Y libc/string/strerror.c
78 0 0 Y libc/sys/exec.c
78 0 0 Y libc/sys/syscall.c
na na Y N libc/sys/trap.asm
0 0 0 Y N libutil/login.c
0 0 0 Y N libutil/logintty.c
libutil/logout.c
0 0 0 Y N libutil/logwtmp.c
libutil/pty.c
libutil/setproc.c
NOTES: () tested at a previous level
These are unimplemented kernel traps.
kernel trap needed can be implemented comments
as a library call
===================================================================
acct no
adjtim low pri yes
brk no
chflags no
chroot no
fcntl yes not completely
fpathconf not now
getdirentries low pri yes
getdtablesize yes not completely
getfh no
getfsstat low pri yes
getgroups yes not completely
getitimer yes no
getlogin yes not completely
getpriority low pri no
getrlimit no no
getrusage low pri no
getsockopt yes no
gettimeofday low pri yes
ktrace not now
link no
madvise no
mincore no
mkfifo yes no
mknod no
mlock no
mmap no
mount not now a dynamic namespace facility?
mprotect no
msync no
munlock no
munmap no
nfssvc not now
pathconf not now
profil no
ptrace not now
readlink not now symlinks
revoke no
rtprio no
semctl low pri
semget low pri
semop low pri
setgroups yes not completely
setitimer yes no
setlogin yes not completely
setpriority low pri no
setrlimit no no
setsid low pri maybe
settimeofday low pri yes I've got code from Tilghman
shmat not now maybe shared mem
shmctl not now maybe shared mem
shmdt not now maybe shared mem
shmget not now maybe shared mem
sigaction low pri (?) maybe
sigalstack no
sigpending low pri no
sigreturn no
sigstack no
sigsuspend no
socketpair low pri
swapon no
symlink not now no symlinks
sync low pri not completely
syscall no
umask low pri unclear semantics

View File

@ -1,12 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
#
# Created by Dave Tribby, July 1997
#
# $Id: Makefile,v 1.2 1997/09/26 06:15:13 gdr Exp $
#
# Program name
PROG= cat
.INCLUDE : /src/gno/prog.mk

View File

@ -1,117 +0,0 @@
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)cat.1 8.3 (Berkeley) 5/2/95
.\" $Id: cat.1,v 1.2 1997/10/03 04:00:10 gdr Exp $
.\"
.TH CAT 1 "August 1997" "GNO" "Commands and Applications"
.SH NAME
.BR cat
\- concatenate and print files
.SH SYNOPSIS
.BR cat " [" -benstuv ]
.IR file \0...
.SH DESCRIPTION
The
.BR cat
utility reads files sequentially, writing them to the standard output.
The
.IR file
operands are processed in command line order.
A single dash represents the standard input.
.LP
.SS OPTIONS
.IP \fB-b\fR
Implies the
.B "-n"
option but doesn't number blank lines.
.IP \fB-e\fR
Implies the
.B "-v"
option, and displays a dollar sign (\fB$\fR)
at the end of each line
as well.
.IP \fB-n\fR
Number the output lines, starting at 1.
.IP \fB-s\fR
Squeeze multiple adjacent empty lines, causing the output to be
single spaced.
.IP \fB-t\fR
Implies the
.B -v
option, and displays tab characters as
.B ^I
as well.
.IP \fB-u\fR
The
.B -u
option guarantees that the output is unbuffered.
.IP \fB-v\fR
Displays non-printing characters so they are visible.
Control characters print as
.B ^X
for control-X; the delete
character (octal 0177) prints as
.B ^?
Non-ascii characters (with the high bit set) are printed as
.B M-
(for meta) followed by the character for the low 7 bits.
.RE
.LP
The
.BR cat
utility exits 0 on success, and >0 if an error occurs.
.SH WARNINGS
Because of the shell language mechanism used to perform output
redirection, the command
.IP
.B "cat file1 file2 > file1"
.PP
will cause the original data in file1 to be destroyed!
Instead use
.IP
.B "cat file2 >> file1"
.SH VERSION
This manual page documents
.BR cat
version 2.0.
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
.SH SEE ALSO
.BR head (1),
.BR more (1),
.BR pr (1),
.BR tail (1),
.BR vis (1)

View File

@ -1,323 +0,0 @@
/*
* Copyright (c) 1989, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Kevin Fall.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: cat.c,v 1.3 1997/10/03 03:59:41 gdr Exp $
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*/
#ifndef __GNO__
#ifndef lint
static char const copyright[] =
"@(#) Copyright (c) 1989, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char const sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
#endif /* not lint */
#endif
#include <sys/param.h>
#include <sys/stat.h>
#include <ctype.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#ifndef __GNO__
#include <locale.h>
#endif
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
int bflag, eflag, nflag, sflag, tflag, vflag;
int rval;
char *filename;
void cook_args __P((char *argv[]));
void cook_buf __P((FILE *));
void raw_args __P((char *argv[]));
void raw_cat __P((int));
/* Interface to check on how much stack space a C program uses. */
#if defined(__GNO__) && defined(__STACK_CHECK__)
#ifndef _GNO_GNO_H_
#include <gno/gno.h>
#endif
static void report_stack(void)
{
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
}
#endif
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc,
char *argv[])
#endif
{
extern int optind;
int ch;
#if defined(__GNO__) && defined(__STACK_CHECK__)
_beginStackCheck();
atexit(report_stack);
#endif
#ifndef __GNO__
setlocale(LC_CTYPE, "");
#endif
while ((ch = getopt(argc, argv, "benstuv")) != -1)
switch (ch) {
case 'b':
bflag = nflag = 1; /* -b implies -n */
break;
case 'e':
eflag = vflag = 1; /* -e implies -v */
break;
case 'n':
nflag = 1;
break;
case 's':
sflag = 1;
break;
case 't':
tflag = vflag = 1; /* -t implies -v */
break;
case 'u':
setbuf(stdout, (char *)NULL);
break;
case 'v':
vflag = 1;
break;
default:
(void)fprintf(stderr,
"usage: cat [-benstuv] [-] [file ...]\n");
exit(1);
}
#ifndef __ORCAC__
argv += optind;
#else
argv = argv + optind;
#endif
if (bflag || eflag || nflag || sflag || tflag || vflag)
cook_args(argv);
else
raw_args(argv);
if (fclose(stdout))
err(1, "stdout");
exit(rval);
}
void
#ifndef __STDC__
cook_args(argv)
char **argv;
#else
cook_args(char *argv[])
#endif
{
register FILE *fp;
fp = stdin;
filename = "stdin";
do {
if (*argv) {
if (!strcmp(*argv, "-"))
fp = stdin;
else if ((fp = fopen(*argv, "r")) == NULL) {
warn("%s", *argv);
rval = 1;
++argv;
continue;
}
filename = *argv++;
}
cook_buf(fp);
if (fp != stdin)
(void)fclose(fp);
} while (*argv);
}
void
#ifndef __STDC__
cook_buf(fp)
register FILE *fp;
#else
cook_buf(register FILE *fp)
#endif
{
register int ch, gobble, line, prev;
line = gobble = 0;
for (prev = '\n'; (ch = getc(fp)) != EOF; prev = ch) {
if (prev == '\n') {
if (ch == '\n') {
if (sflag) {
if (!gobble && putchar(ch) == EOF)
break;
gobble = 1;
continue;
}
if (nflag && !bflag) {
(void)fprintf(stdout, "%6d\t", ++line);
if (ferror(stdout))
break;
}
} else if (nflag) {
(void)fprintf(stdout, "%6d\t", ++line);
if (ferror(stdout))
break;
}
}
gobble = 0;
if (ch == '\n') {
if (eflag)
if (putchar('$') == EOF)
break;
} else if (ch == '\t') {
if (tflag) {
if (putchar('^') == EOF || putchar('I') == EOF)
break;
continue;
}
} else if (vflag) {
if (!isascii(ch) && !isprint(ch)) {
if (putchar('M') == EOF || putchar('-') == EOF)
break;
ch = toascii(ch);
}
if (iscntrl(ch)) {
if (putchar('^') == EOF ||
putchar(ch == '\177' ? '?' :
ch | 0100) == EOF)
break;
continue;
}
}
if (putchar(ch) == EOF)
break;
}
if (ferror(fp)) {
warn("%s", filename);
rval = 1;
clearerr(fp);
}
if (ferror(stdout))
err(1, "stdout");
}
void
#ifndef __STDC__
raw_args(argv)
char **argv;
#else
raw_args(char *argv[])
#endif
{
register int fd;
fd = fileno(stdin);
filename = "stdin";
do {
if (*argv) {
if (!strcmp(*argv, "-"))
fd = fileno(stdin);
#ifndef __GNO__
else if ((fd = open(*argv, O_RDONLY, 0)) < 0) {
#else /* GNO: 3rd parameter legal only when creating */
else if ((fd = open(*argv, O_RDONLY)) < 0) {
#endif
warn("%s", *argv);
rval = 1;
++argv;
continue;
}
filename = *argv++;
}
raw_cat(fd);
if (fd != fileno(stdin))
(void)close(fd);
} while (*argv);
}
void
#ifndef __STDC__
raw_cat(rfd)
register int rfd;
#else
raw_cat(register int rfd)
#endif
{
register int nr, nw, off, wfd;
static int bsize;
static char *buf;
struct stat sbuf;
wfd = fileno(stdout);
if (buf == NULL) {
if (fstat(wfd, &sbuf))
err(1, "%s", filename);
bsize = MAX(sbuf.st_blksize, 1024);
if ((buf = malloc((u_int)bsize)) == NULL)
err(1, NULL);
}
while ((nr = read(rfd, buf, bsize)) > 0)
for (off = 0; nr; nr -= nw, off += nw)
if ((nw = write(wfd, buf + off, nr)) < 0)
err(1, "stdout");
if (nr < 0) {
warn("%s", filename);
rval = 1;
}
}

View File

@ -1,9 +0,0 @@
Name: cat
Version: 2.0 (August 1997)
Shell: GNO
Author: Dave Tribby (from FreeBSD code)
Contact: tribby@cup.hp.com
Where: /bin
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
Concatenate and list files.

View File

@ -1,29 +0,0 @@
/*
* Resources for version and comment
*/
#define PROG "cat"
#define DESC "Concatenate and list files."
#include "Types.rez"
/*
* Version
*/
resource rVersion (1, purgeable3) {
{ 2, 0, 0, /* Version 2.0.0 */
release, /* development|alpha|beta|final|release */
0 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC " Released with GNO/ME."
};
/*
* Comment
*/
resource rComment (1, purgeable3) {
PROG " v2.0 (August 1997)\n"
"GNO utility: " DESC "\n"
"Ported from FreeBSD code by Dave Tribby."
};

View File

@ -1,150 +0,0 @@
# Tests for cat command; invoked by command file "fulltests"
# Written by Dave Tribby (August 1997)
# $Id: dotests,v 1.2 1997/10/03 03:58:54 gdr Exp $
# Location of the cat command to be tested
set testcmd="../cat"
# Record starting time
echo -n "Testing command $testcmd beginning at"
date
set src="file1.mixed"
set cmp="file1.mixed"
set dest="/tmp/$cmp"
echo "Copying a single text file ($src) using filename input"
$testcmd $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Copying a single text file ($src) using stdin"
$testcmd < $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="file1.bopt"
set dest="/tmp/${cmp}"
echo "Display a single text file ($src) with -b option"
$testcmd -b $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="file1.nopt"
set dest="/tmp/${cmp}"
echo "Display a single text file ($src) with -n option"
$testcmd -n $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="file1.topt"
set dest="/tmp/${cmp}"
echo "Display a single text file ($src) with -t option"
$testcmd -t $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="file1.eopt"
set dest="/tmp/${cmp}"
echo "Display a single text file ($src) with -e option"
$testcmd -e $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set src2=file1.nopt
set cmp="file1.combo"
set dest="/tmp/${cmp}"
echo "Combine two files ($src, $src2) with stdin in the middle"
set msg="===== stdin in between file1.mixed and $file1.nopt ====="
echo $msg | $testcmd $src - $src2 > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set src="file2.bin1"
set cmp="file2.bin1"
set dest="/tmp/$cmp"
echo "Copying a single binary file ($src) using filename input"
$testcmd $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Copying a single binary file ($src) using stdin"
$testcmd < $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="file2.vopt"
set dest="/tmp/${cmp}"
echo "Display a single binary file ($src) with -v option"
$testcmd -v $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="file2.topt"
set dest="/tmp/${cmp}"
echo "Display a single binary file ($src) with -t option"
$testcmd -t $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set src="$testcmd"
set cmp="$testcmd"
set dest="/tmp/cat"
echo "Copying a single binary file ($src) through a pipe"
$testcmd $src | $testcmd > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
echo "***** Error Messages *****"
set dest="/tmp/err.cond"
echo ""
echo "Expected error: illegal option"
$testcmd -x $src > $dest
echo " Error completion status = $status (expected: 1)"
echo ""
set src="badname"
echo "Expected error: $src: no such file or directory"
$testcmd $src > $dest
echo " Error completion status = $status (expected: 1)"

View File

@ -1,19 +0,0 @@
1 # Create the test environment for tr
2 # Compile and load flags passed to occ
3 # -v: verbose
4 # -I: add directory to header path
5 CFLAGS += -v -I /usr/include
6 LDFLAGS += -v
7 # Default target, "all," generates the files
8 all: file2.bin1 genbin
9 # Files depend upon program
10 file2.bin1: genbin
11 ./genbin
12 # Remove intermediate files
13 clean:
14 $(RM) -f *.o
15 $(RM) -f *.root

View File

@ -1,39 +0,0 @@
# Create the test environment for tr
# Compile and load flags passed to occ
# -v: verbose
# -I: add directory to header path
CFLAGS += -v -I /usr/include
LDFLAGS += -v
# Default target, "all," generates the files
all: file2.bin1 genbin
# Files depend upon program
file2.bin1: genbin
./genbin
# Remove intermediate files
clean:
$(RM) -f *.o
$(RM) -f *.root
===== stdin in between file1.mixed and .nopt =====
1 # Create the test environment for tr
2
3 # Compile and load flags passed to occ
4 # -v: verbose
5 # -I: add directory to header path
6 CFLAGS += -v -I /usr/include
7 LDFLAGS += -v
8
9 # Default target, "all," generates the files
10 all: file2.bin1 genbin
11
12 # Files depend upon program
13 file2.bin1: genbin
14 ./genbin
15
16 # Remove intermediate files
17 clean:
18 $(RM) -f *.o
19 $(RM) -f *.root

View File

@ -1,19 +0,0 @@
# Create the test environment for tr$
$
# Compile and load flags passed to occ$
# -v: verbose$
# -I: add directory to header path$
CFLAGS += -v -I /usr/include$
LDFLAGS += -v$
$
# Default target, "all," generates the files$
all: file2.bin1 genbin$
$
# Files depend upon program$
file2.bin1: genbin$
./genbin$
$
# Remove intermediate files$
clean:$
$(RM) -f *.o$
$(RM) -f *.root$

View File

@ -1,19 +0,0 @@
# Create the test environment for tr
# Compile and load flags passed to occ
# -v: verbose
# -I: add directory to header path
CFLAGS += -v -I /usr/include
LDFLAGS += -v
# Default target, "all," generates the files
all: file2.bin1 genbin
# Files depend upon program
file2.bin1: genbin
./genbin
# Remove intermediate files
clean:
$(RM) -f *.o
$(RM) -f *.root

View File

@ -1,19 +0,0 @@
1 # Create the test environment for tr
2
3 # Compile and load flags passed to occ
4 # -v: verbose
5 # -I: add directory to header path
6 CFLAGS += -v -I /usr/include
7 LDFLAGS += -v
8
9 # Default target, "all," generates the files
10 all: file2.bin1 genbin
11
12 # Files depend upon program
13 file2.bin1: genbin
14 ./genbin
15
16 # Remove intermediate files
17 clean:
18 $(RM) -f *.o
19 $(RM) -f *.root

View File

@ -1,19 +0,0 @@
# Create the test environment for tr
# Compile and load flags passed to occ
# -v: verbose
# -I: add directory to header path
CFLAGS^I+= -v -I /usr/include
LDFLAGS^I+= -v
# Default target, "all," generates the files
all: file2.bin1 genbin
# Files depend upon program
file2.bin1: genbin
^I./genbin
# Remove intermediate files
clean:
^I$(RM) -f *.o
^I$(RM) -f *.root

Binary file not shown.

View File

@ -1,3 +0,0 @@
^@^A^B^C^D^E^F^G^H^I
^K^L
^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_

View File

@ -1,3 +0,0 @@
^@^A^B^C^D^E^F^G^H
^K^L
^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^\^]^^^_

View File

@ -1,18 +0,0 @@
This is a text file
that contains multiple blank lines
to check out the "cat" command's ability
to remove extra lines (using the -r command).
===== END OF FILE =====

View File

@ -1,29 +0,0 @@
# gsh script to run tests and collect results
# Written by Dave Tribby * August 1997
# $Id: fulltests,v 1.3 1997/10/03 03:58:54 gdr Exp $
# Name of gsh script containing test cases
set command="dotests"
# Sometimes the file type is modified by editing; make it executable
chtyp -l exec $command
# Filenames for raw and modified results
set raw_file="/tmp/rawlist"
set result_file="test.list"
# Location of tr command that knows how to handle classes
set trcmd="/src/gno/usr.bin/tr/tr"
# --- Begin the tests ---
echo -n "Executing test script \"$command\" from directory "
pwd
# Create a new gsh invocation and record all I/O
echo "$command ; exit" | script $raw_file
# Cleanup control chars using either of the following...
echo "Done with tests. Removing control characters from results file"
$trcmd -c -ds '[:print:]\r' '\r' < $raw_file > $result_file
echo "Tests results have been saved as \"$result_file\""

View File

@ -1,32 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
#
# Created by Dave Tribby, August 1997
# Modified by Evan Day, September 1997
#
# $Id: Makefile,v 1.1 1997/10/03 05:06:50 gdr Exp $
# Program name
PROG= chtyp
# Source files
SRCS= chtyp.c ftypes.c
# If optimization wasn't set on the command line use 79, since
# chtyp has been tested to work at that level.
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE=79
.END
# Current implementation is using 960 bytes give or take
STACK = 1024
# Installation point
BINDIR = /bin
.INCLUDE : /src/gno/prog.mk
#
# Additional dependancies
#
chtyp.o:: ftypes.h
ftypes.o:: ftypes.h

View File

@ -1,72 +0,0 @@
.\"
.\" $Id: chtyp.1,v 1.1 1997/10/03 05:06:50 gdr Exp $
.\"
.TH CHTYP 1 "28 September 1997" GNO "Commands and Applications"
.SH NAME
.BR chtyp
\- change GS/OS file type information
.SH SYNOPSIS
.BR chtyp
[ [
.IR -t " " ftype
] [
.IR -a " " atype
] ] | [
.IR -l " " lang
]
.IR file ...
.SH DESCRIPTION
Set GS/OS file type information for the specified
.IR files
.LP
File types may be specified either as a number (decimal,
hexadecimal with a leading 0x, or octal with a leading 0)
or by a three letter abbreviation. Abbreviations are from
the official File Type Notes Index.
.LP
Auxilary types may only be specified as a number (decimal,
hexadecimal, or octal).
.LP
If a file type is specified with no aux type, or vice versa,
only the specified parameter is changed - the other is left
as is.
.LP
The language option sets the file type and aux type appropriate
for a source file of the specified language. See below for a
list of valid languages.
.SH OPTIONS
The following options are available:
.IP "\fB-t\fR \fIftype\fR"
Set the file type of the indicated files to the specified
.IR ftype "."
The file type may be specified as a number (in decimal, as a
hexadecimal number with a leading 0x, or as an octal number
with a leading 0) or by one of the official three letter
abbreviations listed in the File Type Notes Index. Types set
by abbreviation may not have their auxilary file types set
due to the large variety of assigned auxilary types for each
file type.
.IP "\fB-a\fR \fIatype\fR"
Set the auxilary file type of the indicated files to the
.IR atype
specified. The auxilary type may only be specified as a
number.
.IP "\fB-l\fR \fIlang\fR"
Set the file type and auxilary file type to that of a source
file of the selected
.IR lang "."
The
.IR -l
flag may not be used with the
.IR -t
or
.IR -a
flags.
.IP
Valid language types are: APWTXT, ASM, PASCAL, EXEC, CC, LINKER,
DESKTOP, REZ, TMLPASCAL, DISASM, SDEASM, SDECMD, PS.
.SH HISTORY
.BR chtyp
was originally written by Greg Thompson. Jawaid Bazyar rewrote it
later for GNO/ME, and it has since been rewritten from scratch for
GNO/ME v2.0.6 by Evan Day <day@engr.orst.edu>.

View File

@ -1,145 +0,0 @@
/*
* chtyp
*
* Sets the file/aux type for GS/OS files.
*
* $Id: chtyp.c,v 1.1 1997/10/03 05:06:50 gdr Exp $
*/
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <gsos.h>
#include "ftypes.h"
void usage(void);
void version(void);
#ifdef __STACK_CHECK__
#include <gno/gno.h>
static void cleanup(void)
{
(void) fprintf(stderr, "Stack Usage: %d.\n", _endStackCheck());
}
#endif
static GSString255 path;
int main(int argc, char **argv)
{
char *ftype = NULL;
char *atype = NULL;
char *lang = NULL;
char *left = NULL;
int filet = -1;
long auxt = -1;
int ch;
FileInfoRecGS finfo = {4, &path};
#ifdef __STACK_CHECK__
atexit(cleanup);
_beginStackCheck();
#endif
while((ch = getopt(argc, argv, "t:a:l:vV")) != -1)
switch(ch) {
case 't':
if(lang) {
(void) fprintf(stderr,
"chtyp: -t cannot be used with -l\n");
usage();
}
ftype = optarg;
break;
case 'a':
if(lang) {
(void) fprintf(stderr,
"chtyp: -a cannot be used with -l\n");
usage();
}
atype = optarg;
break;
case 'l':
if(ftype || atype) {
(void) fprintf(stderr,
"chtyp: -l cannot be used with %s%s\n",
ftype ? "-t" : "-a",
ftype && atype ? " or -a." : ".");
usage();
}
lang = optarg;
break;
case 'v':
case 'V':
version();
break;
default:
usage();
break;
}
argc -= optind;
argv = argv + optind;
if(argc == 0) {
(void) fprintf(stderr, "chtyp: no files specified\n");
usage();
}
if(lang) {
if(find_lang(lang, &filet, &auxt) == -1) {
(void) fprintf(stderr, "chtyp: unknown language argument \"%s\".\n",
lang);
usage();
}
}
if(ftype) {
filet = (int) strtol(ftype, &left, 0);
if(errno == ERANGE || *left)
if(find_type(ftype, &filet, &auxt) == -1) {
(void) fprintf(stderr,
"chtyp: invalid argument to -t option.\n");
usage();
}
}
if(atype) {
errno = 0; /* be sure to reset errno! */
auxt = strtol(atype, (char **) NULL, 0);
if(errno == ERANGE) {
(void) fprintf(stderr, "chtyp: invalid argument to -a option.\n");
usage();
}
}
ch = 0;
while(argc) {
strcpy(path.text, argv[ch]);
path.length = strlen(argv[ch++]);
GetFileInfoGS(&finfo);
if(filet != -1)
finfo.fileType = filet;
if(auxt != -1)
finfo.auxType = auxt;
SetFileInfoGS(&finfo);
argc--;
}
}
static void usage(void)
{
(void) fprintf(stderr,
"Usage: chtyp { [-t type] [-a auxtype] } | { [-l lang] } file ...\n");
exit(-1);
}
static void version(void)
{
(void) fprintf(stderr,
"V 2.0.0 Copyright 1997 by Evan Day, day@engr.orst.edu\n");
usage();
}

View File

@ -1,9 +0,0 @@
Name: df
Version: 2.0.0 (28 Sep 97)
Shell: GNO/ME
Author: Evan Day
Contact: day@engr.orst.edu
Where: /bin
FTP:
Set GS/OS file types.

View File

@ -1,34 +0,0 @@
/*
* $Id: chtyp.rez,v 1.2 1997/10/05 16:41:46 gdr Exp $
*/
#include "Types.Rez"
#include "proginfo.rez"
resource rVersion (0x1, purgeable3, nocrossbank) {
{ 2, 0, 0, /* version 2.0.0 */
release, /* development|alpha|beta|final|release */
0 /* non-final release number */
},
verUS, /* country code -- only some are avail */
"chtyp", /* name */
/* _Very_ brief descrition. Check "file info" */
/* shown in the Finder to see if it's too long */
/* Note that \n is used to separate lines here. */
"Change GS/OS file type information.\n"
"Requires GNO/ME Shell.\n"
"Evan Day <day@engr.orst.edu>"
};
resource rProgramInfo (0x1, purgeable3, nocrossbank) {
{ 6, 0, 1,
release,
0
},
80000, /* These are rough... the library isn't */
80000, /* final yet. */
1024,
progRequiresGNO+progAppleTalkOK+progAllowsCDAs,
piCompatible*ProgShellGSH+piSpecialFeatures*ProgShellGSH
};

View File

@ -1,171 +0,0 @@
/*
* ftypes.c
*
* data/routines to change an official Apple 3-letter filetype abbrevation
* into a full filetype/auxtype pair (or back, I suppose)
*
* also data/routines to change a language type (as specified in chtyp.1)
* into a filetype/auxtype pair.
*
* $Id: ftypes.c,v 1.1 1997/10/03 05:06:50 gdr Exp $
*/
#include <string.h>
static struct type_list {
char *name;
int file_type;
long aux_type;
} types[] = {
{ "non", 0x00, 0x0000 }, /* common abbrev for $00 */
{ "unk", 0x00, 0x0000 }, /* official abbrev for $00 */
{ "bad", 0x01, 0x0000 },
{ "pcd", 0x02, 0x0000 },
{ "ptx", 0x03, 0x0000 },
{ "txt", 0x04, 0x0000 },
{ "pda", 0x05, 0x0000 },
{ "bin", 0x06, 0x0000 },
{ "fnt", 0x07, 0x0000 },
{ "fot", 0x08, 0x0000 },
{ "ba3", 0x09, 0x0000 },
{ "da3", 0x0a, 0x0000 },
{ "wpf", 0x0b, 0x0000 },
{ "sos", 0x0c, 0x0000 },
{ "dir", 0x0f, 0x0000 },
{ "rpd", 0x10, 0x0000 },
{ "rpi", 0x11, 0x0000 },
{ "afd", 0x12, 0x0000 },
{ "afm", 0x13, 0x0000 },
{ "afr", 0x14, 0x0000 },
{ "scl", 0x15, 0x0000 },
{ "pfs", 0x16, 0x0000 },
{ "adb", 0x19, 0x0000 },
{ "awp", 0x1a, 0x0000 },
{ "asp", 0x1b, 0x0000 },
{ "tdm", 0x20, 0x0000 },
{ "8sc", 0x2a, 0x0000 },
{ "8ob", 0x2b, 0x0000 },
{ "8ic", 0x2c, 0x0000 },
{ "8ld", 0x2d, 0x0000 },
{ "p8c", 0x2e, 0x0000 },
{ "ptp", 0x2e, 0x8001 }, /* Point-to-point drivers */
{ "ftd", 0x42, 0x0000 },
{ "gwp", 0x50, 0x0000 },
{ "gss", 0x51, 0x0000 },
{ "gdb", 0x52, 0x0000 },
{ "drw", 0x53, 0x0000 },
{ "gdp", 0x54, 0x0000 },
{ "hmd", 0x55, 0x0000 },
{ "edu", 0x56, 0x0000 },
{ "stn", 0x57, 0x0000 },
{ "hlp", 0x58, 0x0000 },
{ "com", 0x59, 0x0000 },
{ "cfg", 0x5a, 0x0000 },
{ "anm", 0x5b, 0x0000 },
{ "mum", 0x5c, 0x0000 },
{ "ent", 0x5d, 0x0000 },
{ "dvu", 0x5e, 0x0000 },
{ "bio", 0x6b, 0x0000 },
{ "tdr", 0x6d, 0x0000 },
{ "pre", 0x6e, 0x0000 },
{ "hdv", 0x6f, 0x0000 },
{ "wp", 0xa0, 0x0000 },
{ "gsb", 0xab, 0x0000 },
{ "tdf", 0xac, 0x0000 },
{ "bdf", 0xad, 0x0000 },
{ "src", 0xb0, 0x0000 },
{ "obj", 0xb1, 0x0000 },
{ "lib", 0xb2, 0x0000 },
{ "s16", 0xb3, 0x0000 },
{ "rtl", 0xb4, 0x0000 },
{ "exe", 0xb5, 0x0000 },
{ "pif", 0xb6, 0x0000 },
{ "tif", 0xb7, 0x0000 },
{ "nda", 0xb8, 0x0000 },
{ "cda", 0xb9, 0x0000 },
{ "tol", 0xba, 0x0000 },
{ "dvr", 0xbb, 0x0000 },
{ "ldf", 0xbc, 0x0000 },
{ "fst", 0xbd, 0x0000 },
{ "doc", 0xbf, 0x0000 },
{ "pnt", 0xc0, 0x0000 },
{ "pic", 0xc1, 0x0000 },
{ "ani", 0xc2, 0x0000 },
{ "pal", 0xc3, 0x0000 },
{ "oog", 0xc5, 0x0000 },
{ "scr", 0xc6, 0x0000 },
{ "cdv", 0xc7, 0x0000 },
{ "fon", 0xc8, 0x0000 },
{ "fnd", 0xc9, 0x0000 },
{ "icn", 0xca, 0x0000 },
{ "mus", 0xd5, 0x0000 },
{ "ins", 0xd6, 0x0000 },
{ "mdi", 0xd7, 0x0000 },
{ "snd", 0xd8, 0x0000 },
{ "dbm", 0xdb, 0x0000 },
{ "lbr", 0xe0, 0x0000 },
{ "atk", 0xe2, 0x0000 },
{ "r16", 0xee, 0x0000 },
{ "pas", 0xef, 0x0000 },
{ "cmd", 0xf0, 0x0000 },
{ "os" , 0xf9, 0x0000 },
{ "int", 0xfa, 0x0000 },
{ "ivr", 0xfb, 0x0000 },
{ "bas", 0xfc, 0x0000 },
{ "var", 0xfd, 0x0000 },
{ "rel", 0xfe, 0x0000 },
{ "sys", 0xff, 0x0000 }
};
#define NUM_TYPES 98
static struct lang_list {
char *name;
int file_type;
long aux_type;
} langs[] = {
{ "apwtxt", 0xb0, 0x0001},
{ "asm", 0xb0, 0x0003},
{ "pascal", 0xb0, 0x0005},
{ "exec", 0xb0, 0x0006},
{ "cc", 0xb0, 0x0008},
{ "linker", 0xb0, 0x0009},
{ "apwc", 0xb0, 0x000a},
{ "desktop", 0xb0, 0x000c},
{ "rez", 0xb0, 0x0015},
{ "tmlpascal", 0xb0, 0x001e},
{ "disasm", 0xb0, 0x0115},
{ "sdeasm", 0xb0, 0x0503},
{ "sdecmd", 0xb0, 0x0506},
{ "ps", 0xb0, 0x0719},
};
#define NUM_LANGS 14
int find_type(char *type_str, int *f, long *a)
{
int i;
for(i = 0; i < NUM_TYPES; i++)
if(!stricmp(type_str, types[i].name)) {
*f = types[i].file_type;
*a = types[i].aux_type;
return(0);
}
return(-1);
}
int find_lang(char *lang_str, int *f, long *a)
{
int i;
for(i = 0; i < NUM_LANGS; i++)
if(!stricmp(lang_str, langs[i].name)) {
*f = langs[i].file_type;
*a = langs[i].aux_type;
return(0);
}
return(-1);
}

View File

@ -1,6 +0,0 @@
/*
* $Id: ftypes.h,v 1.1 1997/10/03 05:06:50 gdr Exp $
*/
extern int find_type(char *, int *, long *);
extern int find_lang(char *, int *, long *);

View File

@ -1,34 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
#
# Created by Dave Tribby, August 1997
# Modified by Evan Day, September 1997
#
# $Id: Makefile,v 1.2 1997/10/05 16:41:59 gdr Exp $
# Program name
PROG= cmp
# Source files
SRCS= cmp.c misc.c rcmp.c special.c
# If optimization wasn't set on the command line use 79, since
# cmp has been tested to work at that level.
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE=79
.END
# Current implementation is using ~1050 bytes give or take
STACK = 1280
# Installation point
BINDIR = /bin
.INCLUDE : /src/gno/prog.mk
#
# Additional dependancies
#
cmp.o:: extern.h
misc.o:: extern.h
rcmp.o:: extern.h
special.o:: extern.h

View File

@ -1,114 +0,0 @@
.\" Copyright (c) 1987, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)cmp.1 8.1 (Berkeley) 6/6/93
.\" $Id: cmp.1,v 1.1 1997/10/03 05:13:22 gdr Exp $
.\"
.TH CMP 1 "28 September 1997" GNO "Commands and Applications"
.SH NAME
.BR cmp
\- compare two files
.SH SYNOPSIS
.BR cmp " [" -l " | " -s "] ["
.BR -r
]
.IR file1
.IR file2
[
.IR skip1
[
.IR skip2
] ]
.SH DESCRIPTION
The
.BR cmp
utility compares two files of any type and writes the results
to the standard output.
By default,
.BR cmp
is silent if the files are the same; if they differ, the byte
and line number at which the first difference occurred is reported.
Also by default,
.BR cmp
also considers the resource forks of the files, and will make note
if only one of the files has a resource fork.
.PP
Bytes and lines are numbered beginning with one.
.PP
The following options are available:
.IP \fB-l\fR
Print the byte number (decimal) and the differing
byte values (octal) for each difference.
.IP \fB-s\fR
Print nothing for differing files; return exit
status only.
.IP \fB-r\fR
Ignore resource forks when comparing.
.PP
The optional arguments
.IR skip1
and
.IR skip2
are the byte offsets from the beginning of
.IR file1
and
.IR file2 ,
respectively, where the comparison will begin.
The offset is decimal by default, but may be expressed as an hexadecimal
or octal value by preceding it with a leading ``0x'' or ``0''.
.PP
The
.BR cmp
utility exits with one of the following values:
.IP \fB0\fR
The files are identical.
.IP \fB1\fR
The files are different; this includes the case
where one file is identical to the first part of
the other.
In the latter case, if the
.IR -s
option has not been specified,
.BR cmp
writes to standard output that EOF was reached in the shorter
file (before any differences were found).
.IP \fB>1\fR
An error occurred.
.SH SEE ALSO
.BR diff(1),
.BR diff3(1)
.SH HISTORY
The
.BR cmp
command for GNO/ME v2.0.6 is based on FreeBSD source code.

View File

@ -1,243 +0,0 @@
/*
* Copyright (c) 1987, 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* cmp for GNO/ME v2.0.6
*
* $Id: cmp.c,v 1.1 1997/10/03 05:13:22 gdr Exp $
*/
#ifndef __GNO__
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1987, 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#endif
#ifndef __GNO__
#ifndef lint
static char sccsid[] = "@(#)cmp.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <err.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "extern.h"
int lflag, sflag;
#ifdef __GNO__
int rflag;
#endif
static void usage __P((void));
#ifdef __STACK_CHECK__
#include <gno/gno.h>
static void cleanup(void)
{
(void) fprintf(stderr, "%d\n", _endStackCheck());
}
#endif
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc, char *argv[])
#endif
{
struct stat sb1, sb2;
off_t skip1, skip2;
int ch, fd1, fd2, special;
char *file1, *file2;
#ifdef __STACK_CHECK__
atexit(cleanup);
_beginStackCheck();
#endif
#ifdef __GNO__
while ((ch = getopt(argc, argv, "-lsr")) != -1)
#else
while ((ch = getopt(argc, argv, "-ls")) != -1)
#endif
switch (ch) {
case 'l': /* print all differences */
lflag = 1;
break;
case 's': /* silent run */
sflag = 1;
break;
#ifdef __GNO__
case 'r':
rflag = 1; /* ignore resource fork */
break;
#endif
case '-': /* stdin (must be after options) */
--optind;
goto endargs;
case '?':
default:
usage();
}
endargs:
#ifndef __ORCAC__
argv += optind;
#else
argv = argv + optind;
#endif
argc -= optind;
if (lflag && sflag)
errx(ERR_EXIT, "only one of -l and -s may be specified");
if (argc < 2 || argc > 4)
usage();
/* Backward compatibility -- handle "-" meaning stdin. */
special = 0;
if (strcmp(file1 = argv[0], "-") == 0) {
special = 1;
fd1 = 0;
file1 = "stdin";
}
#ifndef __GNO__
else if ((fd1 = open(file1, O_RDONLY, 0)) < 0) {
#else
/* open() for GNO/ME requires 3rd arg iff creating file */
else if ((fd1 = open(file1, O_RDONLY)) < 0) {
#endif
if (!sflag)
err(ERR_EXIT, "%s", file1);
else
exit(1);
}
if (strcmp(file2 = argv[1], "-") == 0) {
if (special)
errx(ERR_EXIT,
"standard input may only be specified once");
special = 1;
fd2 = 0;
file2 = "stdin";
}
#ifndef __GNO__
else if ((fd2 = open(file2, O_RDONLY, 0)) < 0) {
#else
else if ((fd2 = open(file2, O_RDONLY)) < 0) {
#endif
if (!sflag)
err(ERR_EXIT, "%s", file2);
else
exit(1);
}
skip1 = argc > 2 ? strtol(argv[2], NULL, 10) : 0;
skip2 = argc == 4 ? strtol(argv[3], NULL, 10) : 0;
#ifndef __GNO__
if (!special) {
if (fstat(fd1, &sb1)) {
if (!sflag)
err(ERR_EXIT, "%s", file1);
else
exit(1);
}
if (!S_ISREG(sb1.st_mode))
special = 1;
else {
if (fstat(fd2, &sb2)) {
if (!sflag)
err(ERR_EXIT, "%s", file2);
else
exit(1);
}
if (!S_ISREG(sb2.st_mode))
special = 1;
}
}
#else
special = 1; /* GNO doesn't have mmap.h, so treat every file as
a special file and process byte by byte */
#endif
if (special)
#ifdef __GNO__
{
#endif
c_special(fd1, file1, skip1, fd2, file2, skip2);
#ifdef __GNO__
close(fd1);
close(fd2);
}
if (rflag != 1) {
rflag = 2;
rcmp(&fd1, &fd2, file1, file2);
close(fd1);
close(fd2);
}
#else
else
c_regular(fd1, file1, skip1, sb1.st_size,
fd2, file2, skip2, sb2.st_size);
#endif
/* exit(0); */
}
static void
#ifndef __STDC__
usage()
#else
usage(void)
#endif
{
(void)fprintf(stderr,
#ifndef __GNO__
"usage: cmp [-l | -s] file1 file2 [skip1 [skip2]]\n");
#else
"usage: cmp [-l | -s] [-r] file1 file2 [skip1 [skip2]]\n");
#endif
exit(ERR_EXIT);
}

View File

@ -1,10 +0,0 @@
Name: cmp
Version: 2.0 (4 Aug 97)
Shell: GNO/ME
Author: Evan Day (from FreeBSD source)
Contact: day@engr.orst.edu
Where: /bin
FTP:
cmp compares and reports differences in the dataforks and resource forks
of two files.

View File

@ -1,33 +0,0 @@
/*
* $Id: cmp.rez,v 1.3 1997/10/30 02:28:49 gdr Exp $
*/
#include "Types.Rez"
#include "proginfo.rez"
resource rVersion (0x1, purgeable3, nocrossbank) {
{ 2, 0, 0, /* version */
release, /* development|alpha|beta|final|release */
0 /* non-final release number */
},
verUS, /* country code -- only some are avail */
"cmp", /* name */
/* _Very_ brief descrition. Check "file info" */
/* shown in the Finder to see if it's too long */
/* Note that \n is used to separate lines here. */
"Compares two files on disk.\n"
"Requires GNO/ME Shell.\n"
"Evan Day <day@engr.orst.edu>"
};
resource rProgramInfo (0x1, purgeable3, nocrossbank) {
{ 6, 0, 1,
release,
0
},
80000, /* Rough estimates - the library isn't */
80000, /* final yet. */
1280,
progRequiresGNO+progAppleTalkOK+progAllowsCDAs,
piCompatible*ProgShellGSH+piSpecialFeatures*ProgShellGSH
};

View File

@ -1,51 +0,0 @@
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)extern.h 8.3 (Berkeley) 4/2/94
*/
#define OK_EXIT 0
#define DIFF_EXIT 1
#define ERR_EXIT 2 /* error exit code */
void c_regular __P((int, char *, off_t, off_t, int, char *, off_t, off_t));
void c_special __P((int, char *, off_t, int, char *, off_t));
void diffmsg __P((char *, char *, off_t, off_t));
void eofmsg __P((char *));
#ifdef __GNO__
void rcmp __P((int *, int *, char *, char *));
#endif
extern int lflag, sflag;
#ifdef __GNO__
extern int rflag;
#endif

View File

@ -1,85 +0,0 @@
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* part of cmp for GNO/ME v2.0.6
*
* $Id: misc.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
*/
#ifndef __GNO__
#ifndef lint
static char sccsid[] = "@(#)misc.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include "extern.h"
void
#ifndef __STDC__
eofmsg(file)
char *file;
#else
eofmsg(char *file)
#endif
{
if (!sflag)
warnx("EOF on %s", file);
exit(DIFF_EXIT);
}
void
#ifndef __STDC__
diffmsg(file1, file2, byte, line)
char *file1, *file2;
off_t byte, line;
#else
diffmsg(char *file1, char *file2, off_t byte, off_t line)
#endif
{
if (!sflag)
#ifndef __ORCAC__
(void)printf("%s %s differ: char %qd, line %qd\n",
file1, file2, byte, line);
#else
(void)printf("[%s] %s differ: %s char %ld, line %ld\n",
(rflag==2) ? "resfork" : "datafork", file1, file2, byte, line);
#endif
exit(DIFF_EXIT);
}

View File

@ -1,52 +0,0 @@
/*
* rcmp.c
*
* Opens the resource forks of two files and sets the file descriptors to
* the open forks (if present).
*
* Catches files with no resource fork.
*
* Part of cmp for GNO/ME v2.0.6
*
* $Id: rcmp.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
*/
#include <gsos.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "extern.h"
static GSString255 path;
void rcmp(int *fd1, int *fd2, char *file1, char *file2)
{
OpenRecGS ropen = {4, 0, &path, readEnable, 1};
strcpy(path.text, file1);
path.length = strlen(file1);
OpenGS(&ropen);
*fd1 = ropen.refNum;
strcpy(path.text, file2);
path.length = strlen(file2);
OpenGS(&ropen);
*fd2 = ropen.refNum;
if(*fd1 == 0)
if(*fd2 == 0)
return;
else {
(void) printf("%s has a resource fork, %s does not.\n",
file2, file1);
return;
}
else if(*fd2 == 0) {
(void) printf("%s has a resource fork, %s does not.\n", file1,
file2);
return;
}
c_special(*fd1, file1, 0, *fd2, file2, 0);
}

View File

@ -1,156 +0,0 @@
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: regular.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
*/
#ifndef lint
static char sccsid[] = "@(#)regular.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#include <sys/param.h>
#ifndef __GNO__
#include <sys/mman.h>
#endif
#include <sys/stat.h>
#include <err.h>
#include <limits.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "extern.h"
#define ROUNDPAGE(i) ((i) & ~pagemask)
void
#ifndef __STDC__
c_regular(fd1, file1, skip1, len1, fd2, file2, skip2, len2)
int fd1, fd2;
char *file1, *file2;
off_t skip1, len1, skip2, len2;
#else
c_regular(int fd1, char *file1, off_t skip1, off_t len1, int fd2, char *file2,
off_t skip2, off_t len2)
#endif
{
#ifndef __GNO__
u_char ch, *p1, *p2;
#else
u_char ch, p1, p2;
#endif
off_t byte, length, line;
int dfound;
off_t pagemask, off1, off2;
if (sflag && len1 != len2)
exit(1);
if (skip1 > len1)
eofmsg(file1);
len1 -= skip1;
if (skip2 > len2)
eofmsg(file2);
len2 -= skip2;
pagemask = (off_t)getpagesize() - 1;
off1 = ROUNDPAGE(skip1);
off2 = ROUNDPAGE(skip2);
length = MIN(len1, len2);
#ifndef __ORCAC__
if (length > SIZE_T_MAX)
return (c_special(fd1, file1, skip1, fd2, file2, skip2));
#else
if (length > SIZE_T_MAX) {
c_special(fd1, file1, skip1, fd2, file2, skip2);
return;
}
#endif
#ifndef __GNO__
if ((p1 = (u_char *)mmap(NULL,
(size_t)length, PROT_READ, MAP_SHARED, fd1, off1)) == (u_char *)MAP_FAILED)
err(ERR_EXIT, "%s", file1);
madvise(p1, length, MADV_SEQUENTIAL);
if ((p2 = (u_char *)mmap(NULL,
(size_t)length, PROT_READ, MAP_SHARED, fd2, off2)) == (u_char *)MAP_FAILED)
err(ERR_EXIT, "%s", file2);
madvise(p2, length, MADV_SEQUENTIAL);
dfound = 0;
p1 += skip1 - off1;
p2 += skip2 - off2;
for (byte = line = 1; length--; ++p1, ++p2, ++byte) {
if ((ch = *p1) != *p2)
if (lflag) {
dfound = 1;
(void)printf("%6qd %3o %3o\n", byte, ch, *p2);
} else
diffmsg(file1, file2, byte, line);
/* NOTREACHED */
if (ch == '\n')
++line;
}
if (len1 != len2)
eofmsg (len1 > len2 ? file2 : file1);
if (dfound)
exit(DIFF_EXIT);
#else
dfound = 0;
lseek(fd1, skip1, SEEK_SET);
lseek(fd2, skip2, SEEK_SET);
for (byte = line = 1; length--; ++byte) {
read(fd1, (void *) &p1, 1);
read(fd2, (void *) &p2, 1);
if (p1 != p2)
if (lflag) {
dfound = 1;
(void)printf("%6qd %3o %3o\n", byte, ch, p2);
} else
diffmsg(file1, file2, byte, line);
/* NOTREACHED */
if (p1 == '\n')
++line;
}
if (len1 != len2)
eofmsg (len1 > len2 ? file2 : file1);
if (dfound)
exit(DIFF_EXIT);
#endif
}

View File

@ -1,116 +0,0 @@
/*-
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Part of cmp for GNO/ME v2.0.6
*
* $Id: special.c,v 1.1 1997/10/03 05:13:23 gdr Exp $
*/
#ifndef __GNO__
#ifndef lint
static char sccsid[] = "@(#)special.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <err.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "extern.h"
void
#ifndef __STDC__
c_special(fd1, file1, skip1, fd2, file2, skip2)
int fd1, fd2;
char *file1, *file2;
off_t skip1, skip2;
#else
c_special(int fd1, char *file1, off_t skip1, int fd2, char *file2, off_t skip2)
#endif
{
int ch1, ch2;
off_t byte, line;
FILE *fp1, *fp2;
int dfound;
if ((fp1 = fdopen(fd1, "r")) == NULL)
err(ERR_EXIT, "%s", file1);
if ((fp2 = fdopen(fd2, "r")) == NULL)
err(ERR_EXIT, "%s", file2);
dfound = 0;
while (skip1--)
if (getc(fp1) == EOF)
goto eof;
while (skip2--)
if (getc(fp2) == EOF)
goto eof;
for (byte = line = 1;; ++byte) {
ch1 = getc(fp1);
ch2 = getc(fp2);
if (ch1 == EOF || ch2 == EOF)
break;
if (ch1 != ch2) {
if (lflag) {
dfound = 1;
#ifndef __GNO__
(void)printf("%6qd %3o %3o\n", byte, ch1, ch2);
#else
(void)printf("%c%6ld %3o %3o\n", (rflag==2)? 'R' : 'D', byte, ch1, ch2);
#endif
} else
diffmsg(file1, file2, byte, line);
/* NOTREACHED */
}
if (ch1 == '\n')
++line;
}
eof: if (ferror(fp1))
err(ERR_EXIT, "%s", file1);
if (ferror(fp2))
err(ERR_EXIT, "%s", file2);
if (feof(fp1)) {
if (!feof(fp2))
eofmsg(file1);
} else
if (feof(fp2))
eofmsg(file2);
if (dfound)
exit(DIFF_EXIT);
}

View File

@ -1,32 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
#
# Created by Dave Tribby, August 1997
# Modified by Evan Day, September 1997
#
# $Id: Makefile,v 1.1 1997/10/03 05:42:18 gdr Exp $
# Program name
PROG= df
# Source files
SRCS= df.c gnodf.c
# If optimization wasn't set on the command line use 79, since
# df has been tested to work at that level.
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE=79
.END
# Current implementation is using 960 bytes give or take
STACK = 1024
# Installation point
BINDIR = /bin
.INCLUDE : /src/gno/prog.mk
#
# Additional dependancies
#
tr.o:: df.h
str.o:: df.h

View File

@ -1,104 +0,0 @@
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)df.1 8.3 (Berkeley) 5/8/95
.\"
.\" $Id: df.1,v 1.1 1997/10/03 05:42:18 gdr Exp $
.\"
.TH DF 1 "04 August 1997" GNO "Commands and Applications"
.SH NAME
.BR df
\- display free disk space and disk usage statistics
.SH SYNOPSIS
.BR df " [" -k "] [" -t
.IR "FST list"
]
.IR devnum
|
.IR vol
|
.IR file ...
.SH DESCRIPTION
displays statistics about the amount of free disk space on the
specified device number
.IR devnum
(.d##), on the specified volume
.IR vol
or on the volume of which
.IR file
is a part. More than one device number, volume, or file may be
listed, and types can be mixed in the argument list.
.LP
Values are displayed in 512-byte per block block counts.
If neither a file or a filesystem operand is specified,
statistics for all mounted filesystems are displayed.
Devices without valid media (e.g. a 3.5" disk drive with
no disk in the drive) are not included in the output.
.SH OPTIONS
The following options are available:
.IP \fB-k\fR
Use 1024-byte (1-Kbyte) blocks rather than the default. Note
that this overrides the
.BR BLOCKSIZE
specification from the environment.
.IP "\fB-t\fR \fIfst1,...,fstN\fR"
Only print out statistics for filesystems of the specified types.
More than one type may be specified in a comma separated list.
The list of filesystem types can be prefixed with
.IR no
to specify the filesystem types for which action should
not be taken.
.LP
For example, the
.BR df
command:
.nf
df -t nohfs,msdos
.fi
lists all filesystems except those of type
.IR HFS
and
.IR MS-DOS
.LP
Acceptable filesystem types are as follows:
.IP
prodos, dos33, dos32, pascal, mfs, hfs, lisa, cpm,
msdos, highsierra, iso9660, appleshare.
.SH ENVIRONMENT VARIABLES
.IP \fBBLOCKSIZE\fR
If the environment variable
.BR BLOCKSIZE
is set, the block counts will be displayed in units of that size block.
.SH HISTORY
.BR df
for GNO/ME was originally built-in to gsh(1). The implementation of
.BR df
is based on FreeBSD source code and distributed with GNO/ME v2.0.6

View File

@ -1,510 +0,0 @@
/*
* Copyright (c) 1980, 1990, 1993, 1994
* The Regents of the University of California. All rights reserved.
* (c) UNIX System Laboratories, Inc.
* All or some portions of this file are derived from material licensed
* to the University of California by American Telephone and Telegraph
* Co. or Unix System Laboratories, Inc. and are reproduced herein with
* the permission of UNIX System Laboratories, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: df.c,v 1.1 1997/10/03 05:42:18 gdr Exp $
*/
/*
* df for GNO/ME v2.0.6
* $ID$
*/
#ifndef __GNO__
#ifndef lint
static char const copyright[] =
"@(#) Copyright (c) 1980, 1990, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#endif
#ifndef __GNO__
#ifndef lint
static char const sccsid[] = "@(#)df.c 8.9 (Berkeley) 5/8/95";
#endif /* not lint */
#endif
#include <sys/param.h>
#include <sys/stat.h>
#ifndef __GNO__
#include <sys/mount.h>
#include <ufs/ufs/ufsmount.h>
#else
#include "df.h"
#endif
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifndef __GNO__
int checkvfsname __P((const char *, char **));
char **makevfslist __P((char *));
#else
void makevfslist __P((char *));
#endif
#ifndef __GNO__
long regetmntinfo __P((struct statfs **, long, char **));
int bread __P((off_t, void *, int));
char *getmntpt __P((char *));
#endif
void prtstat __P((struct statfs *, int));
#ifndef __GNO__
void ufs_df __P((char *, int));
#endif
void usage __P((void));
int iflag, nflag;
struct ufs_args mdev;
#ifdef __STACK_CHECK__
#include <gno/gno.h>
static void cleanup(void)
{
(void) fprintf(stderr, "Stack Usage: %d\n", _endStackCheck());
}
#endif
/*
The #ifdef's get quite messy, as there are certain filesystem things that
GNO/ME doesn't handle the same as UNIX. A lot of code is #ifdef'd out, but
left here with the thought that in the future some of it may be useful as
new libraries or FSTs are created.
The files gnodf.c contains a couple of UNIX library functions I've recreated
well enough to work for this applications, but I wouldn't even think of
adding to a library...
In particular, I muck with the statfs structure. DO NOT CALL statfs() or
fstatfs() with this structure. It may work and may cause a crash. This
structure is strictly for use with df(1) and the hacked functions in gnodf.c
which fill in fields with GS/OS calls, not kernel calls.
*/
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc, char *argv[])
#endif
{
struct stat stbuf;
struct statfs statfsbuf, *mntbuf;
long mntsize;
int ch, err, i, maxwidth, width;
#ifndef __GNO__
char *mntpt, **vfslist;
vfslist = NULL;
#else
char *mntpt;
#endif
#ifdef __STACK_CHECK__
atexit(cleanup);
_beginStackCheck();
#endif
#ifndef __GNO__
while ((ch = getopt(argc, argv, "iknt:")) != -1)
#else
while ((ch = getopt(argc, argv, "kt:")) != -1)
#endif
switch (ch) {
#ifndef __GNO__
case 'i':
iflag = 1;
break;
#endif
case 'k':
putenv("BLOCKSIZE=1k");
break;
#ifndef __GNO__
case 'n':
nflag = 1;
break;
#endif
case 't':
#ifndef __GNO__
if (vfslist != NULL)
#else
if (vfslist[14])
#endif
errx(1, "only one -t option may be specified.");
#ifndef __GNO__
vfslist = makevfslist(optarg);
#else
makevfslist(optarg);
#endif
break;
case '?':
default:
usage();
}
argc -= optind;
#ifndef __ORCAC__
argv += optind;
#else
argv = argv + optind;
#endif
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
maxwidth = 0;
for (i = 0; i < mntsize; i++) {
width = strlen(mntbuf[i].f_mntfromname);
if (width > maxwidth)
maxwidth = width;
}
if (!*argv) {
#ifndef __GNO__
mntsize = regetmntinfo(&mntbuf, mntsize, vfslist);
if (vfslist != NULL) {
maxwidth = 0;
for (i = 0; i < mntsize; i++) {
width = strlen(mntbuf[i].f_mntfromname);
if (width > maxwidth)
maxwidth = width;
}
}
#endif
for (i = 0; i < mntsize; i++)
prtstat(&mntbuf[i], maxwidth);
exit(0);
}
for (; *argv; argv++) {
if (stat(*argv, &stbuf) < 0) {
err = errno;
#ifndef __GNO__
if ((mntpt = getmntpt(*argv)) == 0) {
warn("%s", *argv);
continue;
}
#else
warn("%s", *argv);
continue;
#endif
#ifndef __GNO__
} else if ((stbuf.st_mode & S_IFMT) == S_IFCHR) {
ufs_df(*argv, maxwidth);
continue;
} else if ((stbuf.st_mode & S_IFMT) == S_IFBLK) {
if ((mntpt = getmntpt(*argv)) == 0) {
mntpt = mktemp(strdup("/tmp/df.XXXXXX"));
mdev.fspec = *argv;
if (mkdir(mntpt, DEFFILEMODE) != 0) {
warn("%s", mntpt);
continue;
}
if (mount("ufs", mntpt, MNT_RDONLY,
&mdev) != 0) {
ufs_df(*argv, maxwidth);
(void)rmdir(mntpt);
continue;
} else if (statfs(mntpt, &statfsbuf) == 0) {
statfsbuf.f_mntonname[0] = '\0';
prtstat(&statfsbuf, maxwidth);
} else
warn("%s", *argv);
(void)unmount(mntpt, 0);
(void)rmdir(mntpt);
continue;
}
#endif
} else
mntpt = *argv;
/*
* Statfs does not take a `wait' flag, so we cannot
* implement nflag here.
*/
#ifndef __GNO__
if (statfs(mntpt, &statfsbuf) < 0) {
warn("%s", mntpt);
continue;
}
#else
strcpy(statfsbuf.f_mntonname, mntpt);
if (nameinfo(&statfsbuf) < 0) {
warn("%s", statfsbuf.f_mntonname);
continue;
}
#endif
if (argc == 1)
maxwidth = strlen(statfsbuf.f_mntfromname) + 1;
prtstat(&statfsbuf, maxwidth);
}
return (0);
}
#ifndef __GNO__
char *
#ifndef __STDC__
getmntpt(name)
char *name;
#else
getmntpt(char *name)
#endif
{
long mntsize, i;
struct statfs *mntbuf;
mntsize = getmntinfo(&mntbuf, MNT_NOWAIT);
for (i = 0; i < mntsize; i++) {
if (!strcmp(mntbuf[i].f_mntfromname, name))
return (mntbuf[i].f_mntonname);
}
return (0);
}
#endif
#ifndef __GNO__
/*
* Make a pass over the filesystem info in ``mntbuf'' filtering out
* filesystem types not in vfslist and possibly re-stating to get
* current (not cached) info. Returns the new count of valid statfs bufs.
*/
long
#ifndef __STDC__
regetmntinfo(mntbufp, mntsize, vfslist)
struct statfs **mntbufp;
long mntsize;
char **vfslist;
#else
regetmntinfo(struct fsinfo **mntbufp, long mntsize, char **vfslist)
#endif
{
int i, j;
struct statfs *mntbuf;
if (vfslist == NULL)
return (nflag ? mntsize : getmntinfo(mntbufp, MNT_WAIT));
mntbuf = *mntbufp;
for (j = 0, i = 0; i < mntsize; i++) {
if (checkvfsname(mntbuf[i].f_fstypename, vfslist))
continue;
if (!nflag)
(void)statfs(mntbuf[i].f_mntonname,&mntbuf[j]);
else if (i != j)
mntbuf[j] = mntbuf[i];
j++;
}
return (j);
}
#endif
/*
* Convert statfs returned filesystem size into BLOCKSIZE units.
* Attempts to avoid overflow for large filesystems.
*/
#define fsbtoblk(num, fsbs, bs) \
(((fsbs) != 0 && (fsbs) < (bs)) ? \
(num) / ((bs) / (fsbs)) : (num) * ((fsbs) / (bs)))
/*
* Print out status about a filesystem.
*/
void
#ifndef __STDC__
prtstat(sfsp, maxwidth)
struct statfs *sfsp;
int maxwidth;
#else
prtstat(struct statfs *sfsp, int maxwidth)
#endif
{
static long blocksize;
static int headerlen, timesthrough;
static char *header;
long used, availblks, inodes;
if (maxwidth < 11)
maxwidth = 11;
if (++timesthrough == 1) {
header = getbsize(&headerlen, &blocksize);
#ifdef __GNO__
(void)printf("Dev# ");
#endif
(void)printf("%-*.*s %s Used Avail Capacity",
maxwidth, maxwidth, "Filesystem", header);
if (iflag)
(void)printf(" iused ifree %%iused");
#ifdef __GNO__
(void)printf("%12s", "FST");
#endif
(void)printf(" Mounted on\n");
}
#ifdef __GNO__
if(!vfslist[sfsp->f_type])
return;
(void)printf(".d%-2ld ", (sfsp->f_fsid).lo);
#endif
(void)printf("%-*.*s", maxwidth, maxwidth, sfsp->f_mntfromname);
used = sfsp->f_blocks - sfsp->f_bfree;
availblks = sfsp->f_bavail + used;
(void)printf(" %*ld %7ld %7ld", headerlen,
fsbtoblk(sfsp->f_blocks, sfsp->f_bsize, blocksize),
fsbtoblk(used, sfsp->f_bsize, blocksize),
fsbtoblk(sfsp->f_bavail, sfsp->f_bsize, blocksize));
(void)printf(" %5.0f%%",
availblks == 0 ? 100.0 : (double)used / (double)availblks * 100.0);
if (iflag) {
inodes = sfsp->f_files;
used = inodes - sfsp->f_ffree;
(void)printf(" %7ld %7ld %5.0f%% ", used, sfsp->f_ffree,
inodes == 0 ? 100.0 : (double)used / (double)inodes * 100.0);
} else
(void)printf(" ");
#ifdef __GNO__
(void)printf("%12s", fs_name[sfsp->f_type]);
#endif
(void)printf(" %s\n", sfsp->f_mntonname);
}
#ifndef __GNO__
/*
* This code constitutes the pre-system call Berkeley df code for extracting
* information from filesystem superblocks.
*/
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
#include <errno.h>
#include <fstab.h>
union {
struct fs iu_fs;
char dummy[SBSIZE];
} sb;
#define sblock sb.iu_fs
int rfd;
void
#ifndef __STDC__
ufs_df(file, maxwidth)
char *file;
int maxwidth;
#else
ufs_df(char *file, int maxwidth)
#endif
{
struct statfs statfsbuf;
struct statfs *sfsp;
char *mntpt;
static int synced;
if (synced++ == 0)
sync();
if ((rfd = open(file, O_RDONLY)) < 0) {
warn("%s", file);
return;
}
if (bread((off_t)SBOFF, &sblock, SBSIZE) == 0) {
(void)close(rfd);
return;
}
sfsp = &statfsbuf;
sfsp->f_type = 1;
strcpy(sfsp->f_fstypename, "ufs");
sfsp->f_flags = 0;
sfsp->f_bsize = sblock.fs_fsize;
sfsp->f_iosize = sblock.fs_bsize;
sfsp->f_blocks = sblock.fs_dsize;
sfsp->f_bfree = sblock.fs_cstotal.cs_nbfree * sblock.fs_frag +
sblock.fs_cstotal.cs_nffree;
sfsp->f_bavail = freespace(&sblock, sblock.fs_minfree);
sfsp->f_files = sblock.fs_ncg * sblock.fs_ipg;
sfsp->f_ffree = sblock.fs_cstotal.cs_nifree;
sfsp->f_fsid.val[0] = 0;
sfsp->f_fsid.val[1] = 0;
if ((mntpt = getmntpt(file)) == 0)
mntpt = "";
memmove(&sfsp->f_mntonname[0], mntpt, MNAMELEN);
memmove(&sfsp->f_mntfromname[0], file, MNAMELEN);
prtstat(sfsp, maxwidth);
(void)close(rfd);
}
int
#ifndef __STDC__
bread(off, buf, cnt)
off_t off;
void *buf;
int cnt;
#else
bread(off_t off, void *buf, int cnt)
#endif
{
int nr;
(void)lseek(rfd, off, SEEK_SET);
if ((nr = read(rfd, buf, cnt)) != cnt) {
/* Probably a dismounted disk if errno == EIO. */
if (errno != EIO)
(void)fprintf(stderr, "\ndf: %qd: %s\n",
off, strerror(nr > 0 ? EIO : errno));
return (0);
}
return (1);
}
#endif
void
#ifndef __STDC__
usage()
#else
usage(void)
#endif
{
(void)fprintf(stderr,
#ifndef __GNO__
"usage: df [-ikn] [-t type] [file | filesystem ...]\n");
#else
"usage: df [-k] [-t type] [devnum | volume | file ...]\n");
#endif
exit(1);
}

View File

@ -1,9 +0,0 @@
Name: df
Version: 1.0 (28 Sep 97)
Shell: GNO/ME
Author: Evan Day (from FreeBSD source)
Contact: day@engr.orst.edu
Where: /bin
FTP:
Displays free disk space and disk usage statistics for GS/OS block devices.

View File

@ -1,61 +0,0 @@
/*
* df.h
*
* Bastardized sys/mount.h with local constants and functions to provide
* functions not available in the gno libraries.
*
* $Id: df.h,v 1.1 1997/10/03 05:42:18 gdr Exp $
*/
#ifndef _SYS_TYPES_H_
#include <sys/types.h>
#endif
typedef quad_t fsid_t; /* formerly an equivalent struct */
struct statfs {
long f_type; /* FST type (see below) */
long f_bsize; /* fundamental file system block size */
long f_blocks; /* total blocks in file system */
long f_bfree; /* free blocks */
long f_bavail; /* free blocks available to non-superuser */
long f_files; /* total file nodes in file system */
long f_ffree; /* free file nodes in fs */
fsid_t f_fsid; /* file system id (GS/OS device number) */
long f_spare[7]; /* reserved */
char f_mntfromname[32]; /* device name */
char f_mntonname[32]; /* volume name */
};
#define MOUNT_PRODOS 0x0001 /* ProDOS or SOS */
#define MOUNT_DOS_33 0x0002 /* DOS 3.3 */
#define MOUNT_DOS_32 0x0003 /* DOS 3.1 or 3.2 */
#define MOUNT_PASCAL 0x0004 /* Apple II Pascal */
#define MOUNT_MFS 0x0005 /* Macintosh (MFS) */
#define MOUNT_HFS 0x0006 /* Macintosh (HFS) */
#define MOUNT_LISA 0x0007 /* Lisa */
#define MOUNT_CPM 0x0008 /* Apple CP/M */
#define MOUNT_MSDOS 0x000A /* MS/DOS */
#define MOUNT_HISHS 0x000B /* High Sierra */
#define MOUNT_CD9660 0x000C /* ISO 9660 (CD-ROM) */
#define MOUNT_APLSHAR 0x000D /* AppleShare */
#ifndef _SYS_CDEFS_H_
#include <sys/cdefs.h>
#endif
/* This constant is used in the one non-#ifdef'd getmntinfo() call */
#define MNT_NOWAIT 0
/* "Helper" functions to fill in the statfs structure where statfs() fails */
int nameinfo(struct statfs *);
void devinfo(struct statfs *);
long getmntinfo(struct statfs **, char);
char *getbsize(int *, long *);
/* Data structures */
extern char *fs_name[];
extern char vfslist[];

View File

@ -1,33 +0,0 @@
/*
* $Id: df.rez,v 1.3 1997/10/05 16:42:03 gdr Exp $
*/
#include "Types.Rez"
#include "proginfo.rez"
resource rVersion (0x1, purgeable3, nocrossbank) {
{ 1, 0, 0, /* version 1.0.0 */
release, /* development|alpha|beta|final|release */
0 /* non-final release number */
},
verUS, /* country code -- only some are avail */
"df", /* name */
/* _Very_ brief descrition. Check "file info" */
/* shown in the Finder to see if it's too long */
/* Note that \n is used to separate lines here. */
"Display free disk space.\n"
"Requires GNO/ME Shell.\n"
"Evan Day <day@engr.orst.edu>"
};
resource rProgramInfo (0x1, purgeable3, nocrossbank) {
{ 6, 0, 1,
release,
0
},
80000, /* Overestimate, but the library */
80000, /* isn't final yet. */
1024,
progRequiresGNO+progAppleTalkOK+progAllowsCDAs,
piCompatible*ProgShellGSH+piSpecialFeatures*ProgShellGSH
};

View File

@ -1,268 +0,0 @@
/*
* gnodf.c
*
* Provide missing library functions to make df(1) work right
* $ID$
*/
#include <gsos.h>
#include <stdlib.h>
#include <string.h>
#include "df.h"
/* Array of FST names */
char *fs_name[] = {
"",
"ProDOS",
"DOS 3.3",
"DOS 3.2",
"Pascal",
"MFS",
"HFS",
"LISA",
"CP/M",
"",
"MS-DOS",
"High Sierra",
"ISO 9660",
"AppleShare"
};
/* vfsname is an array of fsts accepted by the -t flag */
static char *vfsname[15] = {
"",
"prodos",
"dos33",
"dos32",
"pascal",
"mfs",
"hfs",
"lisa",
"cpm",
"",
"msdos",
"highsierra",
"iso9660",
"appleshare"
};
/* Each member of the vfslist array reflects if the FST is included in the
* output (as affected by the -t flag).
* 1 = display
* 0 = don't display
*/
char vfslist[15] = {0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0};
/* getbsize()
*
* in: pointer to int, pointer to long
* out: pointer to char
*
* getbsize() returns a string indicative of the current value of the
* BLOCKSIZE environment variable. If BLOCKSIZE is 1k or 1024, " kbytes"
* is returned. Otherwise, " blocks" is returned. If BLOCKSIZE is NULL,
* a standard 512 byte blocksize is returned. len is the strlen of the
* returned string, always 7 in this case.
*
* BLOCKSIZE may be a plain number, in which case the number represents the
* number of bytes in a block. It may also be #k, where # represents the
* number of kilobytes in a block.
*/
char *getbsize(int *len, long *blocksize)
{
char *size;
char *p;
size = getenv("BLOCKSIZE");
if(size == NULL)
*blocksize = 512;
else {
*blocksize = strtol(size, &p, 0);
if(*p == 'k')
*blocksize *= 1024;
}
*len = 7;
if(*blocksize != 1024)
return(" blocks");
else
return(" kbytes");
}
/* makevfslist()
*
* in: string containing a comma separated list of FSTs.
* (see manpage for the exact list of recognized strings)
*
* global: char vfslist[14]
*
* vfslist is a character array. Each entry determines if the FST number
* is to be displayed in the df list or not.
*
* makevfslist() parses the input string for valid FST names. If the name
* is specified, the FST is either included or excluded from the list.
* If the string starts with "no", all FSTs are included except those present
* in the string. Otherwise, only the FSTs specified are included.
*/
void makevfslist(char *list)
{
int def, include, i;
char *p, *str;
def = 0;
include = 1;
p = list;
if(*list == 'n') {
p += 2;
include = 0;
def = 1;
}
for(i = 1; i < 14; i++)
vfslist[i] = def;
str = strtok(p, ",");
do {
for(i=1; i < 14; i++) {
if(!strcmp(str, vfsname[i])) {
vfslist[i] = include;
break;
}
}
} while((str = strtok(NULL, NULL)) != NULL);
/* Mark that makevfslist() has been run */
vfslist[14] = 0xFF;
}
/* nameinfo()
*
* in: customize statfs structure pointer
*
* out: 0 = success, -1 = failure
*
* nameinfo() check the f_mntonname field of the statfs structure and calls
* the GetDevNumber and DInfo GS/OS calls to fill in the f_mntfromname field
* and the f_type field of the statfs structure.
*/
static ResultBuf32 devName = {35};
static DInfoRecGS dInfo = {3, 0, &devName};
int nameinfo(struct statfs *sbuf)
{
GSString255 dName = {strlen(sbuf->f_mntonname)};
DevNumRecGS dNum = {2, (GSString32 *) &dName};
strcpy(&dName.text[0], sbuf->f_mntonname);
GetDevNumberGS(&dNum);
if(_toolErr)
return(-1);
dInfo.devNum = dNum.devNum;
DInfoGS(&dInfo);
if(_toolErr)
return(-1);
devName.bufString.text[devName.bufString.length] = '\0';
strcpy(sbuf->f_mntfromname, devName.bufString.text);
(sbuf->f_fsid).lo = (long) dNum.devNum;
devinfo(sbuf);
return(0);
}
/* devinfo()
*
* in: customized statfs structure pointer
*
* devinfo() takes the f_mntfromname field of the statfs structure and fills
* in the fields used by df with the results of the GSOS Volume call.
* Devices with no valid media (i.e. a 3.5" drive with no disk) are filled
* with blank values and excluded from the resulting output.
*/
static ResultBuf255 vRes = {259};
void devinfo(struct statfs *sbuf)
{
GSString32 dname = {strlen(sbuf->f_mntfromname)};
VolumeRecGS vInfo = {6, &dname, &vRes};
strcpy(dname.text, sbuf->f_mntfromname);
VolumeGS(&vInfo);
if(_toolErr) {
strcpy(sbuf->f_mntonname, "");
sbuf->f_bsize = 0;
sbuf->f_blocks = 0;
sbuf->f_bfree = sbuf->f_bavail = 0;
sbuf->f_type = 0;
} else {
vRes.bufString.text[vRes.bufString.length] = '\0';
strcpy(sbuf->f_mntonname, vRes.bufString.text);
sbuf->f_bsize = vInfo.blockSize;
sbuf->f_blocks = vInfo.totalBlocks;
sbuf->f_bfree = sbuf->f_bavail = vInfo.freeBlocks;
sbuf->f_type = vInfo.fileSysID;
}
}
/* getmntinfo()
*
* in: struct statfs **, char
*
* out: number of block devices currently online.
*
* getmntinfo() first finds out how many devices are online and how many of
* them are block devices by repeated calls to DInfo. Then it dynamically
* creates and array of statfs structures and for each block devices fills in
* an entry in the array, returning the total number of block devices present.
*/
long getmntinfo(struct statfs **mntlist, char flags)
{
int n, b, i, j;
/* First find out how many devices exist, and how many are block
devices */
b = n = 0;
while(1) {
dInfo.devNum = n+1;
DInfoGS(&dInfo);
if(_toolErr)
break;
if(dInfo.characteristics & 0x80)
b++;
n++;
}
/* Prepare the mntlist array */
if((*mntlist = (struct statfs *) malloc(sizeof(struct statfs)*b)) == NULL)
return(0L);
/* Copy the device names of each block device to the array */
for(j=0,i=1;i<=n;i++) {
dInfo.devNum = i;
DInfoGS(&dInfo);
if(dInfo.characteristics & 0x80) {
devName.bufString.text[devName.bufString.length] = '\0';
strcpy((*mntlist)[j].f_mntfromname, devName.bufString.text);
(*mntlist)[j].f_fsid.lo = (long) dInfo.devNum;
devinfo(&(*mntlist)[j++]);
}
}
return((long) b);
}

View File

@ -1,11 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
#
# Created by Dave Tribby, July 1997
#
# $Id: Makefile,v 1.2 1997/09/26 06:19:35 gdr Exp $
# Program name
PROG = head
.INCLUDE: /src/gno/prog.mk

View File

@ -1,90 +0,0 @@
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)head.1 2.0 (GNO) 8/1/97
.\" $Id: head.1,v 1.3 1997/10/03 03:57:52 gdr Exp $
.\"
.TH HEAD 1 "August 1997" "GNO" "Commands and Applications"
.SH NAME
.BR head
\- display first lines of a file
.SH SYNOPSIS
.BR head
.RB [ -n
.IR count " |"
.BI "-c " bytes
.RI "] " file ...
.SS Obsolescent:
.BR head " ["
.BI - count
.RI "] [" file ...]
.SH DESCRIPTION
This filter displays the first
.I count
lines or
.I bytes
of each of the specified
.IR file s,
or of the standard input if no
.IR file s
are specified.
If
.I count
is omitted it defaults to 10.
.LP
If more than a single
.I file
is specified, each
.I file
is preceded by a header consisting of the string
.B "==> XXX <=="
where
.B XXX
is the name of the file.
.LP
The
.BR head
utility exits 0 on success, and >0 if an error occurs.
.SH OPTIONS
.RS
.IP \fB-n \fIlines\fR
Print the indicated number of lines.
.IP \fB-c \fIbytes\fR
Print the indicated number of characters.
.SH VERSION
This manual page documents
.BR head
version 2.0.
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
.SH SEE ALSO
.BR tail (1)

View File

@ -1,260 +0,0 @@
/*
* Copyright (c) 1980, 1987, 1992, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*
* $Id: head.c,v 1.3 1997/10/03 03:58:18 gdr Exp $
*/
#ifndef __GNO__
#ifndef lint
static const char copyright[] =
"@(#) Copyright (c) 1980, 1987, 1992, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
#if 0
static char sccsid[] = "@(#)head.c 8.2 (Berkeley) 5/4/95";
#endif
static const char rcsid[] =
"$Id: head.c,v 1.3 1997/10/03 03:58:18 gdr Exp $";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <ctype.h>
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
/*
* head - give the first few lines of a stream or of each of a set of files
*
* Bill Joy UCB August 24, 1977
*/
void head __P((FILE *, int));
void head_bytes __P((FILE *, int));
void obsolete __P((char *[]));
void usage __P((void));
int eval;
/* Interface to check on how much stack space a C program uses. */
#if defined(__GNO__) && defined(__STACK_CHECK__)
#ifndef _GNO_GNO_H_
#include <gno/gno.h>
#endif
static void report_stack(void)
{
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
}
#endif
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc, char *argv[])
#endif
{
register int ch;
FILE *fp;
int first, linecnt = -1, bytecnt = -1;
char *ep;
#if defined(__GNO__) && defined(__STACK_CHECK__)
_beginStackCheck();
atexit(report_stack);
#endif
obsolete(argv);
while ((ch = getopt(argc, argv, "n:c:")) != -1)
switch(ch) {
case 'c':
bytecnt = strtol(optarg, &ep, 10);
if (*ep || bytecnt <= 0)
errx(1, "illegal byte count -- %s", optarg);
break;
case 'n':
linecnt = strtol(optarg, &ep, 10);
if (*ep || linecnt <= 0)
errx(1, "illegal line count -- %s", optarg);
break;
case '?':
default:
usage();
}
argc -= optind;
#ifndef __ORCAC__
argv += optind;
#else
/* ORCA/C 2.1 compiler cannot handle += on pointer */
argv = argv + optind;
#endif
if (linecnt != -1 && bytecnt != -1)
errx(1, "can't combine line and byte counts");
if (linecnt == -1 )
linecnt = 10;
if (*argv) {
for (first = 1; *argv; ++argv) {
if ((fp = fopen(*argv, "r")) == NULL) {
warn("%s", *argv);
eval = 1;
continue;
}
if (argc > 1) {
(void)printf("%s==> %s <==\n",
first ? "" : "\n", *argv);
first = 0;
}
if (bytecnt == -1)
head(fp, linecnt);
else
head_bytes(fp, bytecnt);
(void)fclose(fp);
}
}
else if (bytecnt == -1)
head(stdin, linecnt);
else
head_bytes(stdin, bytecnt);
exit(eval);
}
void
#ifndef __STDC__
head(fp, cnt)
FILE *fp;
register int cnt;
#else
head(FILE *fp, register int cnt)
#endif
{
register int ch;
while (cnt && (ch = getc(fp)) != EOF) {
if (putchar(ch) == EOF)
err(1, "stdout");
if (ch == '\n')
cnt--;
}
}
void
#ifndef __STDC__
head_bytes(fp, cnt)
FILE *fp;
register int cnt;
#else
head_bytes(FILE *fp, register int cnt)
#endif
{
#ifndef __GNO__
char buf[4096];
#else
/* Cannot handle 4096 bytes on stack. Since head_bytes is */
/* non-recursive, make it a static array. DMT */
static char buf[4096];
#endif
register int readlen;
while (cnt) {
if (cnt < sizeof(buf))
readlen = cnt;
else
readlen = sizeof(buf);
readlen = fread(buf, sizeof(char), readlen, fp);
if (readlen == EOF)
break;
if (fwrite(buf, sizeof(char), readlen, stdout) != readlen)
err(1, "stdout");
cnt -= readlen;
}
}
void
#ifndef __STDC__
obsolete(argv)
char *argv[];
#else
obsolete(char *argv[])
#endif
{
char *ap;
while ((ap = *++argv)) {
/* Return if "--" or not "-[0-9]*". */
if (ap[0] != '-' || ap[1] == '-' || !isdigit(ap[1]))
return;
if ((ap = malloc(strlen(*argv) + 2)) == NULL)
err(1, NULL);
ap[0] = '-';
ap[1] = 'n';
(void)strcpy(ap + 2, *argv + 1);
*argv = ap;
}
}
void
#ifndef __STDC__
usage()
#else
usage(void)
#endif
{
#ifndef __GNO__
(void)fprintf(stderr, "usage: head [-n lines] [-c bytes] [file ...]\n");
#else
/* Show -n and -c as exclusive, and add obsolescent format (DMT) */
(void)fprintf(stderr, "usage: head [-n lines | -c bytes] [file ...]\n");
(void)fprintf(stderr, " head [-count] [file ...]\n");
#endif
exit(1);
}

View File

@ -1,9 +0,0 @@
Name: head
Version: 2.0 (August 1997)
Shell: GNO
Author: Dave Tribby (from FreeBSD code)
Contact: tribby@cup.hp.com
Where: /bin
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
Print the first part of a file.

View File

@ -1,29 +0,0 @@
/*
* Resources for version and comment
*/
#define PROG "head"
#define DESC "Print the first part of a file."
#include "Types.rez"
/*
* Version
*/
resource rVersion (1, purgeable3) {
{ 2, 0, 0, /* Version 2.0.0 */
release, /* development|alpha|beta|final|release */
0 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC " Released with GNO/ME."
};
/*
* Comment
*/
resource rComment (1, purgeable3) {
PROG " v2.0 (August 1997)\n"
"GNO utility: " DESC "\n"
"Ported from FreeBSD code by Dave Tribby."
};

View File

@ -1,96 +0,0 @@
# Tests for head command; invoked by command file "fulltests"
# Written by Dave Tribby (August 1997)
# $Id: dotests,v 1.2 1997/10/03 03:56:35 gdr Exp $
# Location of the head command to be tested
set testcmd="../head"
# Record starting time
echo -n "Testing command $testcmd beginning at"
date
set src="file500.txt"
set cmp="f500.10l"
set dest="/tmp/$cmp"
echo "Listing first ten lines (default) of $src"
$testcmd $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Listing first ten lines (default) of $src using stdin"
$testcmd < $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}B"
echo "Listing first ten lines (explicit) of $src"
$testcmd -n 10 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}C"
echo "Listing first ten lines (obsolescent) of $src"
$testcmd -10 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="f500.90c"
set dest="/tmp/$cmp"
echo "Listing first 90 chars of $src"
$testcmd -c 90 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="multi.out"
set dest="/tmp/$cmp"
echo "Listing first 3 lines of f*.*"
$testcmd -n 3 f*.* > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
echo "***** Error Messages *****"
set dest="/tmp/err.cond"
echo ""
echo "Expected error: illegal option"
$testcmd -x $src > $dest
echo " Error completion status = $status (expected: 1)"
echo ""
echo "Expected error: illegal byte count"
$testcmd -c 12x $src > $dest
echo " Error completion status = $status (expected: 1)"
echo ""
echo "Expected error: can't combine line and byte counts"
$testcmd -n 12 -c 12 $src > $dest
echo " Error completion status = $status (expected: 1)"
echo ""
set src="badname"
echo "Expected error: $src: no such file or directory"
$testcmd $src > $dest
echo " Error completion status = $status (expected: 1)"

View File

@ -1,10 +0,0 @@
This is line number 1
This is line number 2
This is line number 3
This is line number 4
This is line number 5
This is line number 6
This is line number 7
This is line number 8
This is line number 9
This is line number 10

View File

@ -1,4 +0,0 @@
This is line number 1
This is line number 2
This is line number 3
This is line nu

View File

@ -1,500 +0,0 @@
This is line number 1
This is line number 2
This is line number 3
This is line number 4
This is line number 5
This is line number 6
This is line number 7
This is line number 8
This is line number 9
This is line number 10
This is line number 11
This is line number 12
This is line number 13
This is line number 14
This is line number 15
This is line number 16
This is line number 17
This is line number 18
This is line number 19
This is line number 20
This is line number 21
This is line number 22
This is line number 23
This is line number 24
This is line number 25
This is line number 26
This is line number 27
This is line number 28
This is line number 29
This is line number 30
This is line number 31
This is line number 32
This is line number 33
This is line number 34
This is line number 35
This is line number 36
This is line number 37
This is line number 38
This is line number 39
This is line number 40
This is line number 41
This is line number 42
This is line number 43
This is line number 44
This is line number 45
This is line number 46
This is line number 47
This is line number 48
This is line number 49
This is line number 50
This is line number 51
This is line number 52
This is line number 53
This is line number 54
This is line number 55
This is line number 56
This is line number 57
This is line number 58
This is line number 59
This is line number 60
This is line number 61
This is line number 62
This is line number 63
This is line number 64
This is line number 65
This is line number 66
This is line number 67
This is line number 68
This is line number 69
This is line number 70
This is line number 71
This is line number 72
This is line number 73
This is line number 74
This is line number 75
This is line number 76
This is line number 77
This is line number 78
This is line number 79
This is line number 80
This is line number 81
This is line number 82
This is line number 83
This is line number 84
This is line number 85
This is line number 86
This is line number 87
This is line number 88
This is line number 89
This is line number 90
This is line number 91
This is line number 92
This is line number 93
This is line number 94
This is line number 95
This is line number 96
This is line number 97
This is line number 98
This is line number 99
This is line number 100
This is line number 101
This is line number 102
This is line number 103
This is line number 104
This is line number 105
This is line number 106
This is line number 107
This is line number 108
This is line number 109
This is line number 110
This is line number 111
This is line number 112
This is line number 113
This is line number 114
This is line number 115
This is line number 116
This is line number 117
This is line number 118
This is line number 119
This is line number 120
This is line number 121
This is line number 122
This is line number 123
This is line number 124
This is line number 125
This is line number 126
This is line number 127
This is line number 128
This is line number 129
This is line number 130
This is line number 131
This is line number 132
This is line number 133
This is line number 134
This is line number 135
This is line number 136
This is line number 137
This is line number 138
This is line number 139
This is line number 140
This is line number 141
This is line number 142
This is line number 143
This is line number 144
This is line number 145
This is line number 146
This is line number 147
This is line number 148
This is line number 149
This is line number 150
This is line number 151
This is line number 152
This is line number 153
This is line number 154
This is line number 155
This is line number 156
This is line number 157
This is line number 158
This is line number 159
This is line number 160
This is line number 161
This is line number 162
This is line number 163
This is line number 164
This is line number 165
This is line number 166
This is line number 167
This is line number 168
This is line number 169
This is line number 170
This is line number 171
This is line number 172
This is line number 173
This is line number 174
This is line number 175
This is line number 176
This is line number 177
This is line number 178
This is line number 179
This is line number 180
This is line number 181
This is line number 182
This is line number 183
This is line number 184
This is line number 185
This is line number 186
This is line number 187
This is line number 188
This is line number 189
This is line number 190
This is line number 191
This is line number 192
This is line number 193
This is line number 194
This is line number 195
This is line number 196
This is line number 197
This is line number 198
This is line number 199
This is line number 200
This is line number 201
This is line number 202
This is line number 203
This is line number 204
This is line number 205
This is line number 206
This is line number 207
This is line number 208
This is line number 209
This is line number 210
This is line number 211
This is line number 212
This is line number 213
This is line number 214
This is line number 215
This is line number 216
This is line number 217
This is line number 218
This is line number 219
This is line number 220
This is line number 221
This is line number 222
This is line number 223
This is line number 224
This is line number 225
This is line number 226
This is line number 227
This is line number 228
This is line number 229
This is line number 230
This is line number 231
This is line number 232
This is line number 233
This is line number 234
This is line number 235
This is line number 236
This is line number 237
This is line number 238
This is line number 239
This is line number 240
This is line number 241
This is line number 242
This is line number 243
This is line number 244
This is line number 245
This is line number 246
This is line number 247
This is line number 248
This is line number 249
This is line number 250
This is line number 251
This is line number 252
This is line number 253
This is line number 254
This is line number 255
This is line number 256
This is line number 257
This is line number 258
This is line number 259
This is line number 260
This is line number 261
This is line number 262
This is line number 263
This is line number 264
This is line number 265
This is line number 266
This is line number 267
This is line number 268
This is line number 269
This is line number 270
This is line number 271
This is line number 272
This is line number 273
This is line number 274
This is line number 275
This is line number 276
This is line number 277
This is line number 278
This is line number 279
This is line number 280
This is line number 281
This is line number 282
This is line number 283
This is line number 284
This is line number 285
This is line number 286
This is line number 287
This is line number 288
This is line number 289
This is line number 290
This is line number 291
This is line number 292
This is line number 293
This is line number 294
This is line number 295
This is line number 296
This is line number 297
This is line number 298
This is line number 299
This is line number 300
This is line number 301
This is line number 302
This is line number 303
This is line number 304
This is line number 305
This is line number 306
This is line number 307
This is line number 308
This is line number 309
This is line number 310
This is line number 311
This is line number 312
This is line number 313
This is line number 314
This is line number 315
This is line number 316
This is line number 317
This is line number 318
This is line number 319
This is line number 320
This is line number 321
This is line number 322
This is line number 323
This is line number 324
This is line number 325
This is line number 326
This is line number 327
This is line number 328
This is line number 329
This is line number 330
This is line number 331
This is line number 332
This is line number 333
This is line number 334
This is line number 335
This is line number 336
This is line number 337
This is line number 338
This is line number 339
This is line number 340
This is line number 341
This is line number 342
This is line number 343
This is line number 344
This is line number 345
This is line number 346
This is line number 347
This is line number 348
This is line number 349
This is line number 350
This is line number 351
This is line number 352
This is line number 353
This is line number 354
This is line number 355
This is line number 356
This is line number 357
This is line number 358
This is line number 359
This is line number 360
This is line number 361
This is line number 362
This is line number 363
This is line number 364
This is line number 365
This is line number 366
This is line number 367
This is line number 368
This is line number 369
This is line number 370
This is line number 371
This is line number 372
This is line number 373
This is line number 374
This is line number 375
This is line number 376
This is line number 377
This is line number 378
This is line number 379
This is line number 380
This is line number 381
This is line number 382
This is line number 383
This is line number 384
This is line number 385
This is line number 386
This is line number 387
This is line number 388
This is line number 389
This is line number 390
This is line number 391
This is line number 392
This is line number 393
This is line number 394
This is line number 395
This is line number 396
This is line number 397
This is line number 398
This is line number 399
This is line number 400
This is line number 401
This is line number 402
This is line number 403
This is line number 404
This is line number 405
This is line number 406
This is line number 407
This is line number 408
This is line number 409
This is line number 410
This is line number 411
This is line number 412
This is line number 413
This is line number 414
This is line number 415
This is line number 416
This is line number 417
This is line number 418
This is line number 419
This is line number 420
This is line number 421
This is line number 422
This is line number 423
This is line number 424
This is line number 425
This is line number 426
This is line number 427
This is line number 428
This is line number 429
This is line number 430
This is line number 431
This is line number 432
This is line number 433
This is line number 434
This is line number 435
This is line number 436
This is line number 437
This is line number 438
This is line number 439
This is line number 440
This is line number 441
This is line number 442
This is line number 443
This is line number 444
This is line number 445
This is line number 446
This is line number 447
This is line number 448
This is line number 449
This is line number 450
This is line number 451
This is line number 452
This is line number 453
This is line number 454
This is line number 455
This is line number 456
This is line number 457
This is line number 458
This is line number 459
This is line number 460
This is line number 461
This is line number 462
This is line number 463
This is line number 464
This is line number 465
This is line number 466
This is line number 467
This is line number 468
This is line number 469
This is line number 470
This is line number 471
This is line number 472
This is line number 473
This is line number 474
This is line number 475
This is line number 476
This is line number 477
This is line number 478
This is line number 479
This is line number 480
This is line number 481
This is line number 482
This is line number 483
This is line number 484
This is line number 485
This is line number 486
This is line number 487
This is line number 488
This is line number 489
This is line number 490
This is line number 491
This is line number 492
This is line number 493
This is line number 494
This is line number 495
This is line number 496
This is line number 497
This is line number 498
This is line number 499
This is line number 500

View File

@ -1,29 +0,0 @@
# gsh script to run tests and collect results
# Written by Dave Tribby * August 1997
# $Id: fulltests,v 1.3 1997/10/03 03:56:35 gdr Exp $
# Name of gsh script containing test cases
set command="dotests"
# Sometimes the file type is modified by editing; make it executable
chtyp -l exec $command
# Filenames for raw and modified results
set raw_file="/tmp/rawlist"
set result_file="test.list"
# Location of tr command that knows how to handle classes
set trcmd="/src/gno/usr.bin/tr/tr"
# --- Begin the tests ---
echo -n "Executing test script \"$command\" from directory "
pwd
# Create a new gsh invocation and record all I/O
echo "$command ; exit" | script $raw_file
# Cleanup control chars using either of the following...
echo "Done with tests. Removing control characters from results file"
$trcmd -c -ds '[:print:]\r' '\r' < $raw_file > $result_file
echo "Tests results have been saved as \"$result_file\""

View File

@ -1,14 +0,0 @@
==> f500.10l <==
This is line number 1
This is line number 2
This is line number 3
==> f500.90c <==
This is line number 1
This is line number 2
This is line number 3
==> file500.txt <==
This is line number 1
This is line number 2
This is line number 3

View File

@ -1,19 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
# $Id: Makefile,v 1.1 1997/10/03 04:02:33 gdr Exp $
#
# Created by Dave Tribby, September 1997
# Program name
PROG= pwd
# Default stack size and optimization (can be overridden by cmd line)
# These values have been tested and certified as working
.IF $(STACK) == $(NULL)
STACK = 1024
.END
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE = -1
.END
.INCLUDE : /src/gno/prog.mk

View File

@ -1,71 +0,0 @@
.\" Copyright (c) 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)pwd.1 8.2 (Berkeley) 4/28/95
.\" $Id: pwd.1,v 1.1 1997/10/03 04:02:33 gdr Exp $
.\"
.TH PWD 1 "September 1997" "GNO" "Commands and Applications"
.SH NAME
.BR pwd
\- return working directory name
.SH SYNOPSIS
.BR pwd
.SH DESCRIPTION
.BR pwd
writes the absolute pathname of the current working directory to
the standard output.
.LP
The pwd utility exits 0 on success, and >0 if an error occurs.
.SH VERSION
This manual page documents
.BR pwd
version 1.0.
.SH HISTORY
Prior to GNO 2.0.6,
.BR pwd
was released only as a built-in command to
.IR gsh (1).
.SH STANDARDS
The
.BR pwd
command is expected to be
POSIX.2
compatible.
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
.SH SEE ALSO
.BR cd (1),
.BR gsh (1),
.BR getcwd (3)

View File

@ -1,137 +0,0 @@
/*
* Copyright (c) 1991, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: pwd.c,v 1.1 1997/10/03 04:02:33 gdr Exp $
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, September 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*/
#ifndef __GNO__
#ifndef lint
static char const copyright[] =
"@(#) Copyright (c) 1991, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char const sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
#endif /* not lint */
#endif
#include <err.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void usage __P((void));
/* Interface to check on how much stack space a C program uses. */
#if defined(__GNO__) && defined(__STACK_CHECK__)
#ifndef _GNO_GNO_H_
#include <gno/gno.h>
#endif
static void report_stack(void)
{
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
}
#endif
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc, char *argv[])
#endif
{
int ch;
char *p;
#if defined(__GNO__) && defined(__STACK_CHECK__)
_beginStackCheck();
atexit(report_stack);
#endif
/*
* Flags for pwd are a bit strange. The POSIX 1003.2B/D9 document
* has an optional -P flag for physical, which is what this program
* will produce by default. The logical flag, -L, should fail, as
* there's no way to display a logical path after forking. We don't
* document either flag, only adding -P for future portability.
*/
while ((ch = getopt(argc, argv, "P")) != -1)
switch (ch) {
case 'P':
break;
case '?':
default:
usage();
}
argc -= optind;
#ifndef __ORCAC__
argv += optind;
#else
/* ORCA/C 2.1 compiler cannot handle += on pointer */
argv = argv + optind;
#endif
if (argc != 0)
usage();
if ((p = getcwd(NULL, 0)) == NULL)
err(1, NULL);
(void)printf("%s\n", p);
exit(0);
}
void
#ifndef __STDC__
usage()
#else
usage(void)
#endif
{
(void)fprintf(stderr, "usage: pwd\n");
exit(1);
}

View File

@ -1,10 +0,0 @@
Name: pwd
Version: 1.0 (September 1997)
Shell: GNO
Author: Dave Tribby (from FreeBSD code)
Contact: tribby@cup.hp.com
Where: /bin
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
Print working directory name

View File

@ -1,30 +0,0 @@
/*
* Resources for version and comment
* $Id: pwd.rez,v 1.1 1997/10/03 04:02:33 gdr Exp $
*/
#define PROG "pwd"
#define DESC "Print working directory name"
#include "Types.rez"
/*
* Version
*/
resource rVersion (1, purgeable3) {
{ 1, 0, 0, /* Version 1.0.0 */
release, /* development|alpha|beta|final|release */
0 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC " Released with GNO/ME."
};
/*
* Comment
*/
resource rComment (1, purgeable3) {
PROG " v1.0 (September 1997)\n"
"GNO utility: " DESC "\n"
"Ported from FreeBSD code by Dave Tribby."
};

View File

@ -1,60 +0,0 @@
# Tests for pwd command; invoked by command file "fulltests"
# Written by Dave Tribby (September 1997)
# $Id: dotests,v 1.1 1997/10/03 04:02:40 gdr Exp $
# Location of the pwd command to be tested
set cmdir=":src:gno:bin:pwd"
set testcmd="$cmdir:pwd"
# Echoing to a file leaves a blank at the end of the line;
# clean this up with the tr command
set cleancmd=":src:gno:usr.bin:tr:tr -d ' '"
# Record starting time
echo -n "Testing command $testcmd beginning at"
date
set cmp=":tmp:pwd.gsh"
set dest=":tmp:pwd.new"
echo "Command directory ($cmdir)"
cd $cmdir
echo "$cmdir" | $cleancmd > $cmp
$testcmd > $dest
echo " Completion status = $status"
echo "Checking results against gsh built-in (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dir=":tmp"
echo "Temporary directory ($dir)"
cd $dir
echo "$dir" | $cleancmd > $cmp
$testcmd > $dest
echo " Completion status = $status"
echo "Checking results against gsh built-in (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dir=":usr:include"
echo "Header directory ($dir)"
cd $dir
echo "$dir" | $cleancmd > $cmp
$testcmd > $dest
echo " Completion status = $status"
echo "Checking results against gsh built-in (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
echo "***** Error Messages *****"
set dest=":tmp:err.cond"
echo ""
echo "Expected error: illegal option"
$testcmd -x > $dest
echo " Error completion status = $status (expected: 1)"

View File

@ -1,29 +0,0 @@
# gsh script to run tests and collect results
# Written by Dave Tribby * August 1997
# $Id: fulltests,v 1.1 1997/10/03 04:02:40 gdr Exp $
# Name of gsh script containing test cases
set command="dotests"
# Sometimes the file type is modified by editing; make it executable
chtyp -l exec $command
# Filenames for raw and modified results
set raw_file="/tmp/rawlist"
set result_file="test.list"
# Location of tr command that knows how to handle classes
set trcmd="/src/gno/usr.bin/tr/tr"
# --- Begin the tests ---
echo -n "Executing test script \"$command\" from directory "
pwd
# Create a new gsh invocation and record all I/O
echo "$command ; exit" | script $raw_file
# Cleanup control chars using either of the following...
echo "Done with tests. Removing control characters from results file"
$trcmd -c -ds '[:print:]\r' '\r' < $raw_file > $result_file
echo "Tests results have been saved as \"$result_file\""

View File

@ -1,12 +0,0 @@
#
# $Id: Makefile,v 1.1 1997/10/30 02:33:48 gdr Exp $
#
PROG = rmdir
# Add -D__STACK_CHECK__ to CFLAGS to get stack usage information
CFLAGS += -I/src/gno/lib/libcontrib
LDFLAGS += -l/src/gno/lib/libcontrib/libcontrib
STACK = 768
.INCLUDE: /src/gno/prog.mk

View File

@ -1,52 +0,0 @@
.\"
.\" Devin Reade, 1994
.\"
.\" $Id: rmdir.1,v 1.2 1997/10/30 02:33:49 gdr Exp $
.\"
.TH RMDIR 1 "17 October 1997" GNO "Commands and Applications"
.SH NAME
rmdir \- remove (delete) a directory
.SH SYNOPSIS
.BR rmdir
[
.BR -p
]
.IR dir " ..."
.SH DESCRIPTION
.BR rmdir
will delete all the listed directories.
.BR rmdir
will print an error and skip the file if
.I dir
is not a directory, is non-empty, or if the user does not
have permission to delete it.
.LP
If the
.BR -p
flag is given, then
.BR rmdir
will attempt to recursively delete all empty directories in the pathname
.IR dir ,
not including the volume name (if given).
.SH BUGS
It is possible to delete the current directory of
.B rmdir
or another process.
.SH VERSION
This manual page documents
.BR rmdir
version 1.1.
.SH STANDARDS
The
.BR rmdir
utility corresponds to POSIX 1003.2.
.SH AUTHOR
Devin Reade, <gdr@myrias.ab.ca>
.LP
This program contains material from the ORCA/C run\-time libraries,
Copyright 1987\-1997 Byte Works Inc. Used with permission.
.SH "SEE ALSO"
.BR cp (1),
.BR rm (1),
.BR rmdir (1),
.BR rmdir (2).

View File

@ -1,136 +0,0 @@
/*
* rmdir - remove directory
*
* ChangeLog:
* v1.1 - incorporated into GNO base distribution
* - added -p flag for POSIX conformance
* - moved rmdir(2) implementation to libc
* v1.0 - initial revision
*
* Version 1.1 by Devin Reade <gdr@myrias.ab.ca>
*/
#include <types.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <err.h>
#include <gno/gno.h>
#include "contrib.h"
#ifdef __STACK_CHECK__
static void
printStack (void) {
fprintf(stderr, "stack usage: %d bytes\n", _endStackCheck());
}
#endif
static void
usage (void) {
fprintf(stderr, "usage: rmdir [-p] directory ...\n");
exit(1);
}
const char *nodup = "couldn't duplicate %s";
int
main(int argc, char **argv) {
int c, result, pflag;
char delim, *path, *root, *p, *q;
#ifdef __STACK_CHECK__
_beginStackCheck();
atexit(printStack);
#endif
pflag = 0;
while ((c = getopt (argc, argv, "p")) != EOF) {
switch (c) {
case 'p':
pflag = 1;
break;
default:
usage();
}
}
if ((argc - optind) == 0) {
usage();
}
result = 0;
/* loop over all filenames */
for (; optind<argc; optind++) {
path = argv[optind];
if (pflag == 0) {
/*
* Just do the last directory component, and
* skip the mess below
*/
if (rmdir(path)!=0) {
warn("%s skipped", path);
result++;
}
} else {
/* get the full pathname */
if ((path = LC_ExpandPath (path)) == NULL) {
warn("couldn't expand %s", argv[optind]);
continue;
}
if ((q = strdup(path)) == NULL) {
err(1, nodup, path);
}
path = q;
/* what is the volume component? */
q = (*path == ':') ? path+1 : path;
q = strchr(q, ':');
if (q != NULL) {
*q = '\0';
}
if (*path == ':') {
if ((root = strdup(path)) == NULL) {
err(1, nodup, path);
}
} else {
root = NULL;
}
if (q != NULL) {
*q = ':';
}
for(;;) {
if (*path == '\0') {
/* deleted all the directories */
break;
}
if ((root != NULL) && !strcmp(root, path)) {
/* don't try to delete the volume */
break;
}
if (rmdir(path)!=0) {
warn("%s skipped", path);
result++;
break;
}
p = path + strlen(path) - 1;
while (p >= path) {
if (*p == ':') {
*p = '\0';
break;
} else {
*p-- = '\0';
}
}
}
}
}
return result;
}

View File

@ -1,8 +0,0 @@
Name: rmdir
Version: 1.0 (28 Nov 94)
Author: Devin Reade.
Contact: <gdr@myrias.ab.ca>
Where: /bin
FTP: cco.caltech.edu, grind.isca.uiowa.edu
Remove empty directories.

View File

@ -1,18 +0,0 @@
/*
* $Id: rmdir.rez,v 1.1 1997/10/30 02:33:49 gdr Exp $
*/
#include "Types.Rez"
resource rVersion (0x1, purgeable3, nocrossbank) {
{ 1, 1, 0, /* version 1.1.0 */
release, /* development|alpha|beta|final|release */
0 /* non-final release number */
},
verUS,
"rmdir",
"remove (empty) directory\n"
"Devin Reade <gdr@eddore.myrias.com>\n"
"Canada"
};

View File

@ -1,19 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
# $Id: Makefile,v 1.1 1997/10/03 04:02:40 gdr Exp $
#
# Created by Dave Tribby, September 1997
# Program name
PROG= sleep
# Default stack size and optimization (can be overridden by cmd line)
# These values have been tested and certified as working
.IF $(STACK) == $(NULL)
STACK = 768
.END
.IF $(OPTIMIZE) == $(NULL)
OPTIMIZE = -1
.END
.INCLUDE : /src/gno/prog.mk

View File

@ -1,99 +0,0 @@
.\" Copyright (c) 1990, 1993, 1994
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)sleep.1 8.3 (Berkeley) 4/18/94
.\" $Id: sleep.1,v 1.2 1997/10/30 02:34:54 gdr Exp $
.\"
.TH SLEEP 1 "September 1997" "" "Commands and Applications"
.SH NAME
.BR sleep
\- suspend execution for an interval of time
.SH SYNOPSIS
.BR sleep
.BR seconds
.SH DESCRIPTION
The
.BR sleep
command
suspends execution for a minimum of
.BR seconds .
.BR sleep
is used to schedule the execution of other commands (see
.B EXAMPLES
below).
.LP
If the
.BR sleep
command
receives a SIGALRM signal, it terminates normally with a zero exit status,
for any other signal it takes the standard action.
.LP
The
.BR sleep
utility exits with one of the following values:
.IP \fB0\fR
On successful completion, or if the signal
.BR SIGALRM
was received.
.IP \fB\&>\&0\fR
An error occurred.
.SH EXAMPLES
To schedule the execution of a command for
some
number of seconds later:
.LP
.B "sleep 1800; command_file"
.LP
This incantation would wait a half hour before
running the script command_file. (See the
.BR at (1)
utility.)
.SH VERSION
This manual page documents
.BR sleep
version 2.0.
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
.SH SEE ALSO
.BR at (1),
.BR setitimer (2),
.BR alarm (3),
.BR sleep (3)
.SH STANDARDS
The
.BR sleep
command is expected to be
POSIX.2
compatible.

View File

@ -1,125 +0,0 @@
/*
* Copyright (c) 1988, 1993, 1994
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: sleep.c,v 1.1 1997/10/03 04:02:41 gdr Exp $
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, September 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*/
#ifndef __GNO__
#ifndef lint
static char const copyright[] =
"@(#) Copyright (c) 1988, 1993, 1994\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char const sccsid[] = "@(#)sleep.c 8.3 (Berkeley) 4/2/94";
#endif /* not lint */
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
void usage __P((void));
/* Interface to check on how much stack space a C program uses. */
#if defined(__GNO__) && defined(__STACK_CHECK__)
#ifndef _GNO_GNO_H_
#include <gno/gno.h>
#endif
static void report_stack(void)
{
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
}
#endif
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc, char *argv[])
#endif
{
int ch, secs;
#if defined(__GNO__) && defined(__STACK_CHECK__)
_beginStackCheck();
atexit(report_stack);
#endif
while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
case '?':
default:
usage();
}
argc -= optind;
#ifndef __ORCAC__
argv += optind;
#else
/* ORCA/C 2.1 compiler cannot handle += on pointer */
argv = argv + optind;
#endif
if (argc != 1)
usage();
if ((secs = atoi(*argv)) > 0)
(void)sleep(secs);
exit(0);
}
void
#ifndef __STDC__
usage()
#else
usage(void)
#endif
{
(void)fprintf(stderr, "usage: sleep seconds\n");
exit(1);
}

View File

@ -1,10 +0,0 @@
Name: sleep
Version: 2.0 (September 1997)
Shell: GNO
Author: Dave Tribby (from FreeBSD code)
Contact: tribby@cup.hp.com
Where: /bin
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
Suspend execution for an interval of time.

View File

@ -1,30 +0,0 @@
/*
* Resources for version and comment
* $Id: sleep.rez,v 1.1 1997/10/03 04:02:41 gdr Exp $
*/
#define PROG "sleep"
#define DESC "Suspend execution for an interval of time."
#include "Types.rez"
/*
* Version
*/
resource rVersion (1, purgeable3) {
{ 2, 0, 0, /* Version 2.0.0 */
release, /* development|alpha|beta|final|release */
0 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC " Released with GNO/ME."
};
/*
* Comment
*/
resource rComment (1, purgeable3) {
PROG " v2.0 (September 1997)\n"
"GNO utility: " DESC "\n"
"Ported from FreeBSD code by Dave Tribby."
};

View File

@ -1,43 +0,0 @@
# Tests for sleep command; invoked by command file "fulltests"
# Written by Dave Tribby (September 1997)
# $Id: dotests,v 1.1 1997/10/03 04:02:41 gdr Exp $
# Location of the pwd command to be tested
set testcmd="../sleep"
# Record starting time
echo -n "Testing command $testcmd beginning at"
date
set time=2
echo "Sleep $time seconds"
date
$testcmd $time
set teststatus=$status
date
echo " Completion status = $teststatus"
echo ""
set time=10
echo "Sleep $time seconds"
date
$testcmd $time
set teststatus=$status
date
echo " Completion status = $teststatus"
echo ""
echo "***** Error Messages *****"
set dest="/tmp/err.cond"
echo ""
echo "Expected error: illegal option"
$testcmd -x
echo " Error completion status = $status (expected: 1)"
echo ""
echo "Expected error: usage string only"
$testcmd
echo " Error completion status = $status (expected: 1)"

View File

@ -1,29 +0,0 @@
# gsh script to run tests and collect results
# Written by Dave Tribby * August 1997
# $Id: fulltests,v 1.1 1997/10/03 04:02:41 gdr Exp $
# Name of gsh script containing test cases
set command="dotests"
# Sometimes the file type is modified by editing; make it executable
chtyp -l exec $command
# Filenames for raw and modified results
set raw_file="/tmp/rawlist"
set result_file="test.list"
# Location of tr command that knows how to handle classes
set trcmd="/src/gno/usr.bin/tr/tr"
# --- Begin the tests ---
echo -n "Executing test script \"$command\" from directory "
pwd
# Create a new gsh invocation and record all I/O
echo "$command ; exit" | script $raw_file
# Cleanup control chars using either of the following...
echo "Done with tests. Removing control characters from results file"
$trcmd -c -ds '[:print:]\r' '\r' < $raw_file > $result_file
echo "Tests results have been saved as \"$result_file\""

View File

@ -1,17 +0,0 @@
#
# This makefile is intended for use with dmake(1) on Apple IIGS
# $Id: Makefile,v 1.3 1997/10/03 03:52:54 gdr Exp $
#
# Created by Dave Tribby, July 1997
# Program name
PROG= tail
# Source files
SRCS= tail.c forward.c misc.c read.c
.INCLUDE : /src/gno/prog.mk
tail.o:: extern.h
forward.o:: extern.h
misc.o:: extern.h
read.o:: extern.h

View File

@ -1,54 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)extern.h 8.1 (Berkeley) 6/6/93
*
* $Id: extern.h,v 1.2 1997/09/26 06:23:30 gdr Exp $
*/
#define WR(p, size) \
if (write(STDOUT_FILENO, p, size) != size) \
oerr();
enum STYLE { NOTSET = 0, FBYTES, FLINES, RBYTES, RLINES, REVERSE };
void forward __P((FILE *, enum STYLE, long, struct stat *));
void reverse __P((FILE *, enum STYLE, long, struct stat *));
int bytes __P((FILE *, off_t));
int lines __P((FILE *, off_t));
void ierr __P((void));
void oerr __P((void));
extern int fflag, rflag, rval;
extern char *fname;

View File

@ -1,333 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Edward Sze-Tyan Wang.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*
* $Id: forward.c,v 1.2 1997/09/26 06:23:29 gdr Exp $
*/
#ifndef __GNO__ /* Don't need what strings for GNO */
#ifndef lint
static char sccsid[] = "@(#)forward.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <sys/time.h>
#ifndef __GNO__
#include <sys/mman.h>
#endif
#include <limits.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "extern.h"
static void rlines __P((FILE *, long, struct stat *));
/*
* forward -- display the file, from an offset, forward.
*
* There are eight separate cases for this -- regular and non-regular
* files, by bytes or lines and from the beginning or end of the file.
*
* FBYTES byte offset from the beginning of the file
* REG seek
* NOREG read, counting bytes
*
* FLINES line offset from the beginning of the file
* REG read, counting lines
* NOREG read, counting lines
*
* RBYTES byte offset from the end of the file
* REG seek
* NOREG cyclically read characters into a wrap-around buffer
*
* RLINES
* REG mmap the file and step back until reach the correct offset.
* NOREG cyclically read lines into a wrap-around array of buffers
*/
void
#ifndef __STDC__
forward(fp, style, off, sbp)
FILE *fp;
enum STYLE style;
long off;
struct stat *sbp;
#else
forward(FILE *fp,
enum STYLE style,
long off,
struct stat *sbp)
#endif
{
register int ch;
struct timeval second;
switch(style) {
case FBYTES:
if (off == 0)
break;
if (S_ISREG(sbp->st_mode)) {
if (sbp->st_size < off)
off = sbp->st_size;
if (fseek(fp, off, SEEK_SET) == -1) {
ierr();
return;
}
} else while (off--)
if ((ch = getc(fp)) == EOF) {
if (ferror(fp)) {
ierr();
return;
}
break;
}
break;
case FLINES:
if (off == 0)
break;
for (;;) {
if ((ch = getc(fp)) == EOF) {
if (ferror(fp)) {
ierr();
return;
}
break;
}
if (ch == '\n' && !--off)
break;
}
break;
case RBYTES:
if (S_ISREG(sbp->st_mode)) {
if (sbp->st_size >= off &&
fseek(fp, -off, SEEK_END) == -1) {
ierr();
return;
}
} else if (off == 0) {
while (getc(fp) != EOF);
if (ferror(fp)) {
ierr();
return;
}
} else
if (bytes(fp, off))
return;
break;
case RLINES:
if (S_ISREG(sbp->st_mode))
if (!off) {
if (fseek(fp, 0L, SEEK_END) == -1) {
ierr();
return;
}
} else
rlines(fp, off, sbp);
else if (off == 0) {
while (getc(fp) != EOF);
if (ferror(fp)) {
ierr();
return;
}
} else
if (lines(fp, off))
return;
break;
}
/*
* We pause for one second after displaying any data that has
* accumulated since we read the file.
*/
for (;;) {
while ((ch = getc(fp)) != EOF)
if (putchar(ch) == EOF)
oerr();
if (ferror(fp)) {
ierr();
return;
}
(void)fflush(stdout);
if (!fflag)
break;
/* Sleep(3) is eight system calls. Do it fast. */
second.tv_sec = 1;
second.tv_usec = 0;
if (select(0, NULL, NULL, NULL, &second) == -1)
if (errno != EINTR)
err(1, "select");
clearerr(fp);
}
}
/* Need a separate version of rlines for GNO (see below) */
/* because the mmap routines are not available. DMT */
#ifndef __GNO__
/*
* rlines -- display the last offset lines of the file.
*/
static void
#ifndef __STDC__
rlines(fp, off, sbp)
FILE *fp;
long off;
struct stat *sbp;
#else
rlines(FILE *fp,
long off,
struct stat *sbp)
#endif
{
register off_t size;
register char *p;
char *start;
if (!(size = sbp->st_size))
return;
if (size > SIZE_T_MAX) {
errno = EFBIG;
ierr();
return;
}
if ((start = mmap(NULL, (size_t)size,
PROT_READ, MAP_SHARED, fileno(fp), (off_t)0)) == MAP_FAILED) {
ierr();
return;
}
/* Last char is special, ignore whether newline or not. */
for (p = start + size - 1; --size;)
if (*--p == '\n' && !--off) {
++p;
break;
}
/* Set the file pointer to reflect the length displayed. */
size = sbp->st_size - size;
WR(p, size);
if (fseek(fp, (long)sbp->st_size, SEEK_SET) == -1) {
ierr();
return;
}
if (munmap(start, (size_t)sbp->st_size)) {
ierr();
return;
}
}
#else
/*
* rlines -- display the last offset lines of the file.
* This GNO version doesn't use mmap calls. (DMT)
*/
static void
rlines(FILE *fp,
long off,
struct stat *sbp)
{
off_t size, bytes_read, bytes_remaining;
size_t readlen;
#define BUFSIZE 4096
static char buf[BUFSIZE];
int offset;
if (!(size = sbp->st_size))
return;
/* Last char is special, ignore whether newline or not. */
bytes_remaining = size - 1;
bytes_read = 1;
while (bytes_remaining && off) {
if (bytes_remaining < BUFSIZE) {
/* Need to read from beginning of file */
readlen = bytes_remaining;
rewind(fp);
}
else {
/* Setup to read one buffer's worth of data */
readlen = BUFSIZE;
fseek(fp, -(bytes_read+BUFSIZE), SEEK_END);
}
if ((readlen = fread(buf, sizeof(char), readlen, fp)) == 0) {
ierr();
return;
}
bytes_read += readlen;
bytes_remaining -= readlen;
/* Set pointer to end of the data that was just read */
offset = readlen;
while (offset) {
if (buf[--offset] == '\n' && ! --off) {
++offset;
break;
}
}
}
if (off)
/* Requested number of lines not found. Go to beginning. */
rewind(fp);
else {
/* Set the file pointer to reflect the length displayed. */
if (fseek(fp, size-bytes_read+offset, SEEK_SET) == -1) {
ierr();
return;
}
}
}
#endif

View File

@ -1,83 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Edward Sze-Tyan Wang.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*
* $Id: misc.c,v 1.2 1997/09/26 06:23:29 gdr Exp $
*/
#ifndef __GNO__ /* Don't need what strings for GNO */
#ifndef lint
static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "extern.h"
void
#ifndef __STDC__
ierr()
#else
ierr(void)
#endif
{
warn("%s", fname);
rval = 1;
}
void
#ifndef __STDC__
oerr()
#else
oerr(void)
#endif
{
err(1, "stdout");
}

View File

@ -1,215 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Edward Sze-Tyan Wang.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* $Id: read.c,v 1.2 1997/09/26 06:23:30 gdr Exp $
*/
#ifndef __GNO__ /* Don't need what strings for GNO */
#ifndef lint
static char sccsid[] = "@(#)read.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "extern.h"
/*
* bytes -- read bytes to an offset from the end and display.
*
* This is the function that reads to a byte offset from the end of the input,
* storing the data in a wrap-around buffer which is then displayed. If the
* rflag is set, the data is displayed in lines in reverse order, and this
* routine has the usual nastiness of trying to find the newlines. Otherwise,
* it is displayed from the character closest to the beginning of the input to
* the end.
*/
int
#ifndef __STDC__
bytes(fp, off)
register FILE *fp;
off_t off;
#else
bytes(register FILE *fp,
off_t off)
#endif
{
register int ch, len, tlen;
register char *ep, *p, *t;
int wrap;
char *sp;
if ((sp = p = malloc(off)) == NULL)
err(1, "malloc");
for (wrap = 0, ep = p + off; (ch = getc(fp)) != EOF;) {
*p = ch;
if (++p == ep) {
wrap = 1;
p = sp;
}
}
if (ferror(fp)) {
ierr();
return 1;
}
if (rflag) {
for (t = p - 1, len = 0; t >= sp; --t, ++len)
if (*t == '\n' && len) {
WR(t + 1, len);
len = 0;
}
if (wrap) {
tlen = len;
for (t = ep - 1, len = 0; t >= p; --t, ++len)
if (*t == '\n') {
if (len) {
WR(t + 1, len);
len = 0;
}
if (tlen) {
WR(sp, tlen);
tlen = 0;
}
}
if (len)
WR(t + 1, len);
if (tlen)
WR(sp, tlen);
}
} else {
if (wrap && (len = ep - p))
WR(p, len);
if (len = p - sp)
WR(sp, len);
}
return 0;
}
/*
* lines -- read lines to an offset from the end and display.
*
* This is the function that reads to a line offset from the end of the input,
* storing the data in an array of buffers which is then displayed. If the
* rflag is set, the data is displayed in lines in reverse order, and this
* routine has the usual nastiness of trying to find the newlines. Otherwise,
* it is displayed from the line closest to the beginning of the input to
* the end.
*/
int
#ifndef __STDC__
lines(fp, off)
register FILE *fp;
off_t off;
#else
lines(register FILE *fp,
off_t off)
#endif
{
struct {
u_int blen;
u_int len;
char *l;
} *lines;
register int ch;
register char *p;
int blen, cnt, recno, wrap;
char *sp;
if ((lines = malloc(off * sizeof(*lines))) == NULL)
err(1, "malloc");
bzero(lines, off * sizeof(*lines));
sp = NULL;
blen = cnt = recno = wrap = 0;
while ((ch = getc(fp)) != EOF) {
if (++cnt > blen) {
if ((sp = realloc(sp, blen += 1024)) == NULL)
err(1, "realloc");
p = sp + cnt - 1;
}
*p++ = ch;
if (ch == '\n') {
if (lines[recno].blen < cnt) {
lines[recno].blen = cnt + 256;
if ((lines[recno].l = realloc(lines[recno].l,
lines[recno].blen)) == NULL)
err(1, "realloc");
}
bcopy(sp, lines[recno].l, lines[recno].len = cnt);
cnt = 0;
p = sp;
if (++recno == off) {
wrap = 1;
recno = 0;
}
}
}
if (ferror(fp)) {
ierr();
return 1;
}
if (cnt) {
lines[recno].l = sp;
lines[recno].len = cnt;
if (++recno == off) {
wrap = 1;
recno = 0;
}
}
if (rflag) {
for (cnt = recno - 1; cnt >= 0; --cnt)
WR(lines[cnt].l, lines[cnt].len);
if (wrap)
for (cnt = off - 1; cnt >= recno; --cnt)
WR(lines[cnt].l, lines[cnt].len);
} else {
if (wrap)
for (cnt = recno; cnt < off; ++cnt)
WR(lines[cnt].l, lines[cnt].len);
for (cnt = 0; cnt < recno; ++cnt)
WR(lines[cnt].l, lines[cnt].len);
}
return 0;
}

View File

@ -1,317 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Edward Sze-Tyan Wang.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*
* $Id: reverse.c,v 1.2 1997/09/26 06:23:30 gdr Exp $
*/
/* =====> NOTE <=====
* Because the -r option has not been implemented for GNO (due to the
* lack of mman.h routines), this source file IS NOT USED by GNO's tail.
* It is being included with the distribution only for reference, and
* in case someone wishes to implement the -r option some day.
*/
#ifndef __GNO__ /* Don't need what strings for GNO */
#ifndef lint
static char sccsid[] = "@(#)reverse.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#endif
#include <sys/param.h>
#include <sys/stat.h>
#ifndef __GNO__
#include <sys/mman.h>
#endif
#include <limits.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "extern.h"
static void r_buf __P((FILE *));
static void r_reg __P((FILE *, enum STYLE, long, struct stat *));
/*
* reverse -- display input in reverse order by line.
*
* There are six separate cases for this -- regular and non-regular
* files by bytes, lines or the whole file.
*
* BYTES display N bytes
* REG mmap the file and display the lines
* NOREG cyclically read characters into a wrap-around buffer
*
* LINES display N lines
* REG mmap the file and display the lines
* NOREG cyclically read lines into a wrap-around array of buffers
*
* FILE display the entire file
* REG mmap the file and display the lines
* NOREG cyclically read input into a linked list of buffers
*/
void
#ifndef __STDC__
reverse(fp, style, off, sbp)
FILE *fp;
enum STYLE style;
long off;
struct stat *sbp;
#else
reverse(FILE *fp,
enum STYLE style,
long off,
struct stat *sbp)
#endif
{
if (style != REVERSE && off == 0)
return;
if (S_ISREG(sbp->st_mode))
#ifdef __GNO__
{
printf("Sorry, this option has not been implemented.\n");
return;
}
#else
r_reg(fp, style, off, sbp);
#endif
else
switch(style) {
case FBYTES:
case RBYTES:
bytes(fp, off);
break;
case FLINES:
case RLINES:
lines(fp, off);
break;
case REVERSE:
r_buf(fp);
break;
}
}
/*
* r_reg -- display a regular file in reverse order by line.
*/
static void
#ifndef __STDC__
r_reg(fp, style, off, sbp)
FILE *fp;
register enum STYLE style;
long off;
struct stat *sbp;
#else
r_reg(FILE *fp,
register enum STYLE style,
long off,
struct stat *sbp)
#endif
{
register off_t size;
register int llen;
register char *p;
char *start;
if (!(size = sbp->st_size))
return;
#ifndef __GNO__
if (size > SIZE_T_MAX) {
errno = EFBIG;
ierr();
return;
}
if ((start = mmap(NULL, (size_t)size,
PROT_READ, MAP_SHARED, fileno(fp), (off_t)0)) == MAP_FAILED) {
ierr();
return;
}
#endif
p = start + size - 1;
if (style == RBYTES && off < size)
size = off;
/* Last char is special, ignore whether newline or not. */
for (llen = 1; --size; ++llen)
if (*--p == '\n') {
WR(p + 1, llen);
llen = 0;
if (style == RLINES && !--off) {
++p;
break;
}
}
if (llen)
WR(p, llen);
#ifndef __GNO__
if (munmap(start, (size_t)sbp->st_size))
ierr();
#endif
}
typedef struct bf {
struct bf *next;
struct bf *prev;
int len;
char *l;
} BF;
/*
* r_buf -- display a non-regular file in reverse order by line.
*
* This is the function that saves the entire input, storing the data in a
* doubly linked list of buffers and then displays them in reverse order.
* It has the usual nastiness of trying to find the newlines, as there's no
* guarantee that a newline occurs anywhere in the file, let alone in any
* particular buffer. If we run out of memory, input is discarded (and the
* user warned).
*/
static void
#ifndef __STDC__
r_buf(fp)
FILE *fp;
#else
r_buf(FILE *fp)
#endif
{
register BF *mark, *tl, *tr;
register int ch, len, llen;
register char *p;
off_t enomem;
#define BSZ (128 * 1024)
for (mark = NULL, enomem = 0;;) {
/*
* Allocate a new block and link it into place in a doubly
* linked list. If out of memory, toss the LRU block and
* keep going.
*/
if (enomem || (tl = malloc(sizeof(BF))) == NULL ||
(tl->l = malloc(BSZ)) == NULL) {
if (!mark)
err(1, "malloc");
tl = enomem ? tl->next : mark;
enomem += tl->len;
} else if (mark) {
tl->next = mark;
tl->prev = mark->prev;
mark->prev->next = tl;
mark->prev = tl;
} else
mark->next = mark->prev = (mark = tl);
/* Fill the block with input data. */
for (p = tl->l, len = 0;
len < BSZ && (ch = getc(fp)) != EOF; ++len)
*p++ = ch;
if (ferror(fp)) {
ierr();
return;
}
/*
* If no input data for this block and we tossed some data,
* recover it.
*/
if (!len) {
if (enomem)
enomem -= tl->len;
tl = tl->prev;
break;
}
tl->len = len;
if (ch == EOF)
break;
}
if (enomem) {
warnx("warning: %ld bytes discarded\n", enomem);
rval = 1;
}
/*
* Step through the blocks in the reverse order read. The last char
* is special, ignore whether newline or not.
*/
for (mark = tl;;) {
for (p = tl->l + (len = tl->len) - 1, llen = 0; len--;
--p, ++llen)
if (*p == '\n') {
if (llen) {
WR(p + 1, llen);
llen = 0;
}
if (tl == mark)
continue;
for (tr = tl->next; tr->len; tr = tr->next) {
WR(tr->l, tr->len);
tr->len = 0;
if (tr == mark)
break;
}
}
tl->len = llen;
if ((tl = tl->prev) == mark)
break;
}
tl = tl->next;
if (tl->len) {
WR(tl->l, tl->len);
tl->len = 0;
}
while ((tl = tl->next)->len) {
WR(tl->l, tl->len);
tl->len = 0;
}
}

View File

@ -1,149 +0,0 @@
.\" Copyright (c) 1980, 1990, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" the Institute of Electrical and Electronics Engineers, Inc.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by the University of
.\" California, Berkeley and its contributors.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)tail.1 2.0 (GNO) 8/1/97
.\" $Id: tail.1,v 1.2 1997/10/03 03:53:43 gdr Exp $
.\"
.TH TAIL 1 "August 1997" "GNO" "Commands and Applications"
.SH NAME
.BR tail
\- display the last part of a file
.SH SYNOPSIS
.BR tail
.RB [ -f ]
.RB [ -b
.IR number " |"
.B -c
.IR number " |"
.B -n
.IR number ]
.RI [ file ...]
.SS Obsolescent:
.BR tail "
.RB [ -f ]
.RB [ + | -\fInumber [ l
.RB "| " b " | " c ]]
.RI [ file ...]
.SH DESCRIPTION
The
.BR tail
utility displays the contents of
.BR file
or, by default, its standard input, to the standard output.
.LP
The display begins at a byte, line or 512-byte block location in the
input.
Numbers having a leading plus (``+'') sign are relative to the beginning
of the input, for example,
.B "-c +2"
starts the display at the second
byte of the input.
Numbers having a leading minus (``-'') sign or no explicit sign are
relative to the end of the input, for example,
.B "-n 2"
displays the last two lines of the input.
The default starting location is
.BR "-n 10" ,
or the last 10 lines of the input.
.LP
.SH OPTIONS
The options are as follows:
.RS
.IP \fB-b\fR \fInumber\fR
The location is
.IR number
512-byte blocks.
.IP \fB-c\fR \fInumber\fR
The location is
.IR number
bytes.
.IP \fB-f\fR
The
.B -f
option causes
.BR tail
not to stop when end of file is reached, but rather to wait for additional
data to be appended to the input.
The
.B -f
option is ignored if the standard input is a pipe, but not if it is a FIFO.
.IP \fB-n\fR \fInumber\fR
The location is
.IR number
lines.
.RE
.LP
If more than a single file is specified, each file is preceded by a
header consisting of the string
.B "==> XXX <=="
where
.B XXX
is the name of the file.
.LP
The
.BR tail
utility exits 0 on success, and >0 if an error occurs.
.SH VERSION
This manual page documents
.BR tail
version 2.0.
.SH ATTRIBUTIONS
This command was ported from FreeBSD source code
for distribution with GNO/ME 2.0.6.
.SH SEE ALSO
.BR cat (1),
.BR head (1),
.BR sed (1)
.SH STANDARDS
The
.BR tail
utility is expected to be a superset of the POSIX.2
specification.
In particular, the
.BR -b
option is an extension to that standard.
.LP
The historic (obsolescent) command line syntax of
.BR tail
is supported by this implementation.
.SH HISTORY
The BSD
.B -r
option, which causes the input to be displayed in reverse order, by line,
has not been implemented for the GNO version of
.BR tail .
.PP
Version 1.1 (18-Jan-93) of
.BR tail ,
shipped with GNO 2.0, was written by Sameer Parekh (zane@ddsw1.MCS.COM).

View File

@ -1,381 +0,0 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Edward Sze-Tyan Wang.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*/
/*
* Modified for GNO (Apple IIGS) by Dave Tribby, July 1997
*
* Constructs unacceptable to compiler are replaced using #ifndef __ORCAC__
*
* Changes not related to compiler are replaced using #ifndef __GNO__
* (e.g., did not implement -r option)
*
* Added prototyped headers, surrounded by #ifndef __STDC__
*
* $Id: tail.c,v 1.3 1997/10/03 03:55:11 gdr Exp $
*/
#ifndef __GNO__ /* Don't need what strings for GNO */
#ifndef lint
static char copyright[] =
"@(#) Copyright (c) 1991, 1993\n\
The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
static char sccsid[] = "@(#)tail.c 8.1 (Berkeley) 6/6/93";
#endif /* not lint */
#endif __GNO__
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>
#include <unistd.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <err.h>
#include "extern.h"
int fflag, rflag, rval;
char *fname;
static void obsolete __P((char **));
static void usage __P((void));
/* Interface to check on how much stack space a C program uses. */
#if defined(__GNO__) && defined(__STACK_CHECK__)
#ifndef _GNO_GNO_H_
#include <gno/gno.h>
#endif
static void report_stack(void)
{
fprintf(stderr,"\n ==> %d stack bytes used <== \n", _endStackCheck());
}
#endif
int
#ifndef __STDC__
main(argc, argv)
int argc;
char *argv[];
#else
main(int argc,
char *argv[])
#endif
{
struct stat sb;
FILE *fp;
long off;
enum STYLE style;
int ch, first;
char *p;
#if defined(__GNO__) && defined(__STACK_CHECK__)
_beginStackCheck();
atexit(report_stack);
#endif
/*
* Tail's options are weird. First, -n10 is the same as -n-10, not
* -n+10. Second, the number options are 1 based and not offsets,
* so -n+1 is the first line, and -c-1 is the last byte. Third, the
* number options for the -r option specify the number of things that
* get displayed, not the starting point in the file. The one major
* incompatibility in this version as compared to historical versions
* is that the 'r' option couldn't be modified by the -lbc options,
* i.e. it was always done in lines. This version treats -rc as a
* number of characters in reverse order. Finally, the default for
* -r is the entire file, not 10 lines.
*/
/* NOTE: for GNO the -r (reverse print) option has been removed */
#define ARG(units, forward, backward) { \
if (style) \
usage(); \
off = strtol(optarg, &p, 10) * (units); \
if (*p) \
errx(1, "illegal offset -- %s", optarg); \
switch(optarg[0]) { \
case '+': \
if (off) \
off -= (units); \
style = (forward); \
break; \
case '-': \
off = -off; \
/* FALLTHROUGH */ \
default: \
style = (backward); \
break; \
} \
}
obsolete(argv);
style = NOTSET;
#ifndef __GNO__ /* -r option not used in GNO */
while ((ch = getopt(argc, argv, "b:c:fn:r")) != -1)
#else
while ((ch = getopt(argc, argv, "b:c:fn:")) != -1)
#endif
switch(ch) {
case 'b':
ARG(512, FBYTES, RBYTES);
break;
case 'c':
ARG(1, FBYTES, RBYTES);
break;
case 'f':
fflag = 1;
break;
case 'n':
ARG(1, FLINES, RLINES);
break;
#ifndef __GNO__
case 'r':
rflag = 1;
break;
#endif
case '?':
default:
usage();
}
argc -= optind;
#ifndef __ORCAC__
argv += optind;
#else
argv = argv + optind;
#endif
if (fflag && argc > 1)
errx(1, "-f option only appropriate for a single file");
#ifndef __GNO__
/*
* If displaying in reverse, don't permit follow option, and convert
* style values.
*/
if (rflag) {
if (fflag)
usage();
if (style == FBYTES)
style = RBYTES;
else if (style == FLINES)
style = RLINES;
}
#endif
/*
* If style not specified, the default is the whole file for -r, and
* the last 10 lines if not -r.
*/
if (style == NOTSET)
#ifndef __GNO__
if (rflag) {
off = 0;
style = REVERSE;
} else {
#else
{
#endif
off = 10;
style = RLINES;
}
if (*argv)
for (first = 1; fname = *argv++;) {
if ((fp = fopen(fname, "r")) == NULL ||
fstat(fileno(fp), &sb)) {
ierr();
continue;
}
if (argc > 1) {
(void)printf("%s==> %s <==\n",
first ? "" : "\n", fname);
first = 0;
(void)fflush(stdout);
}
#ifndef __GNO__
if (rflag)
reverse(fp, style, off, &sb);
else
#endif
forward(fp, style, off, &sb);
(void)fclose(fp);
}
else {
fname = "stdin";
if (fstat(fileno(stdin), &sb)) {
ierr();
exit(1);
}
/*
* Determine if input is a pipe. 4.4BSD will set the SOCKET
* bit in the st_mode field for pipes. Fix this then.
*/
if (lseek(fileno(stdin), (off_t)0, SEEK_CUR) == -1 &&
errno == ESPIPE) {
errno = 0;
fflag = 0; /* POSIX.2 requires this. */
}
#ifndef __GNO__
if (rflag)
reverse(stdin, style, off, &sb);
else
#endif
forward(stdin, style, off, &sb);
}
exit(rval);
}
/*
* Convert the obsolete argument form into something that getopt can handle.
* This means that anything of the form [+-][0-9][0-9]*[lbc][fr] that isn't
* the option argument for a -b, -c or -n option gets converted.
*/
static void
#ifndef __STDC__
obsolete(argv)
char *argv[];
#else
obsolete(char **argv)
#endif
{
register char *ap, *p, *t;
int len;
char *start;
while (ap = *++argv) {
/* Return if "--" or not an option of any form. */
if (ap[0] != '-') {
if (ap[0] != '+')
return;
} else if (ap[1] == '-')
return;
switch(*++ap) {
/* Old-style option. */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
/* Malloc space for dash, new option and argument. */
len = strlen(*argv);
if ((start = p = malloc(len + 3)) == NULL)
err(1, "malloc");
*p++ = '-';
/*
* Go to the end of the option argument. Save off any
* trailing options (-3lf) and translate any trailing
* output style characters.
*/
t = *argv + len - 1;
#ifndef __GNO__
if (*t == 'f' || *t == 'r') {
#else
if (*t == 'f') {
#endif
*p++ = *t;
*t-- = '\0';
}
switch(*t) {
case 'b':
*p++ = 'b';
*t = '\0';
break;
case 'c':
*p++ = 'c';
*t = '\0';
break;
case 'l':
*t = '\0';
/* FALLTHROUGH */
case '0': case '1': case '2': case '3': case '4':
case '5': case '6': case '7': case '8': case '9':
*p++ = 'n';
break;
default:
errx(1, "illegal option -- %s", *argv);
}
*p++ = *argv[0];
(void)strcpy(p, ap);
*argv = start;
continue;
/*
* Options w/ arguments, skip the argument and continue
* with the next option.
*/
case 'b':
case 'c':
case 'n':
if (!ap[1])
++argv;
/* FALLTHROUGH */
/* Options w/o arguments, continue with the next option. */
case 'f':
#ifndef __GNO__
case 'r':
#endif
continue;
/* Illegal option, return and let getopt handle it. */
default:
return;
}
}
}
static void
#ifndef __STDC__
usage()
#else
usage(void)
#endif
{
#ifndef __GNO__
(void)fprintf(stderr,
"usage: tail [-f | -r] [-b # | -c # | -n #] [file ...]\n");
#else /* GNO doesn't implement -r; shows obsolescent form */
(void)fprintf(stderr,
"usage: tail [-f] [-b # | -c # | -n #] [file ...]\n");
(void)fprintf(stderr,
" tail [-f] [+|-#[b|c|l]] [file ...]\n");
#endif
exit(1);
}

View File

@ -1,9 +0,0 @@
Name: tail
Version: 2.0 (August 1997)
Shell: GNO
Author: Dave Tribby (from FreeBSD code)
Contact: tribby@cup.hp.com
Where: /bin/tail
FTP: ground.isca.uiowa.edu apple2.caltech.edu trenco.myrias.com
Print the last part of a file.

View File

@ -1,31 +0,0 @@
/*
* Resources for version and comment
*
* $Id: tail.rez,v 1.2 1997/09/26 06:23:30 gdr Exp $
*/
#define PROG "tail"
#define DESC "Print the last part of a file."
#include "Types.rez"
/*
* Version
*/
resource rVersion (1, purgeable3) {
{ 2, 0, 0, /* Version 2.0.0 */
release, /* development|alpha|beta|final|release */
0 }, /* non-final release number */
verUS, /* Country */
PROG, /* Program name */
DESC " Released with GNO/ME."
};
/*
* Comment
*/
resource rComment (1, purgeable3) {
PROG " v2.0 (August 1997)\n"
"GNO utility: " DESC "\n"
"Ported from FreeBSD code by Dave Tribby."
};

View File

@ -1,200 +0,0 @@
# Tests for tail command; invoked by command file "fulltests"
# Written by Dave Tribby (August 1997)
# $Id: dotests,v 1.2 1997/10/03 03:52:25 gdr Exp $
# Location of the tail command to be tested
set testcmd="../tail"
# Record starting time
echo -n "Testing command $testcmd beginning at"
date
set src="file500.txt"
set cmp="f500.10l"
set dest="/tmp/$cmp"
echo "Listing last ten lines (default) of $src"
$testcmd $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Listing last ten lines (default) of $src using stdin"
$testcmd < $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}B"
echo "Listing last ten lines (explicit) of $src"
$testcmd -n 10 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}C"
echo "Listing last ten lines (obsolescent) of $src"
$testcmd -10 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="f500.90c"
set dest="/tmp/$cmp"
echo "Listing last 90 chars of $src"
$testcmd -c 90 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}B"
echo "Listing last 90 chars (obsolescent) of $src"
$testcmd -90c $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="f500.1b"
set dest="/tmp/$cmp"
echo "Listing last block of $src"
$testcmd -b 1 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Listing last block (obsolescent) of $src"
$testcmd -1b $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="f500.p400l"
set dest="/tmp/$cmp"
echo "Listing $src beginning at line 400"
$testcmd -n +400 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Listing $src beginning at line 400 (obsolescent)"
$testcmd +400 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}B"
echo "Listing $src beginning at line 400 (obsolescent/explicit)"
$testcmd +400l $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="f500.p12040c"
set dest="/tmp/$cmp"
echo "Listing $src beginning at char 12040"
$testcmd -c +12040 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set dest="/tmp/${cmp}A"
echo "Listing $src beginning at char 12040 (obsolescent)"
$testcmd +12040c $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="$src"
set dest="/tmp/${cmp}N"
echo "Listing all of $src using -n option"
$testcmd -n +1 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="$src"
set dest="/tmp/${cmp}B"
echo "Listing all of $src using -b option"
$testcmd -b +1 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="$src"
set dest="/tmp/${cmp}C"
echo "Listing all of $src using -c option"
$testcmd -c +1 $src > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
set cmp="multi.out"
set dest="/tmp/$cmp"
echo "Listing last 3 lines of f*.*"
$testcmd -n 3 f*.* > $dest
echo " Completion status = $status"
echo "Checking results against control file $cmp (no differences expected)"
cmp $cmp $dest
echo " Completion status = $status"
echo ""
echo "***** Error Messages *****"
set dest="/tmp/err.cond"
echo ""
echo "Expected error: illegal option"
$testcmd -x $src > $dest
echo " Error completion status = $status (expected: 1)"
echo ""
echo "Expected error: illegal offset"
$testcmd -n 12x $src > $dest
echo " Error completion status = $status (expected: 1)"
echo ""
set src="badname"
echo "Expected error: $src: no such file or directory"
$testcmd $src > $dest
echo " Error completion status = $status (expected: 1)"

View File

@ -1,10 +0,0 @@
This is line number 491
This is line number 492
This is line number 493
This is line number 494
This is line number 495
This is line number 496
This is line number 497
This is line number 498
This is line number 499
This is line number 500

Some files were not shown because too many files have changed in this diff Show More