home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.sources.misc
- From: byron@archone.tamu.edu (Byron Rakitzis)
- Subject: v30i030: rc - A Plan 9 shell reimplementation, v1.4, Part07/07
- Message-ID: <1992May30.031745.5684@sparky.imd.sterling.com>
- X-Md4-Signature: 87c27fcff7734084ebc5a1e95923a4aa
- Date: Sat, 30 May 1992 03:17:45 GMT
- Approved: kent@sparky.imd.sterling.com
-
- Submitted-by: byron@archone.tamu.edu (Byron Rakitzis)
- Posting-number: Volume 30, Issue 30
- Archive-name: rc/part07
- Environment: UNIX
- Supersedes: rc: Volume 23, Issue 61-66
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then feed it
- # into a shell via "sh file" or similar. To overwrite existing files,
- # type "sh file -c".
- # The tool that generated this appeared in the comp.sources.unix newsgroup;
- # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
- # Contents: addon.h cpp history/Makefile
- # Wrapped by kent@sparky on Fri May 29 20:55:25 1992
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- echo If this archive is complete, you will see the following message:
- echo ' "shar: End of archive 7 (of 7)."'
- if test -f 'addon.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'addon.h'\"
- else
- echo shar: Extracting \"'addon.h'\" \(847 characters\)
- sed "s/^X//" >'addon.h' <<'END_OF_FILE'
- X/*
- X This file is the interface to the rest of rc for any locally
- X defined addon builtins. By default there are none.
- X The interface consists of the following macro.
- X
- X ADDONS A comma-separated list of pairs of function pointers
- X and string literals.
- X
- X The addon functions must also have proper prototypes in this file.
- X The builtins all have the form:
- X
- X void b_NAME(char **av);
- X
- X Builtins report their exit status using set(TRUE) or set(FALSE).
- X
- X Example:
- X
- X #define ADDONS { b_test, "test" },
- X extern void b_test(char **av);
- X*/
- X
- X#define ADDONS /* no addons by default */
- X
- X#ifdef DWS
- X
- X/*
- X This is what DaviD Sanderson (dws@cs.wisc.edu) uses.
- X*/
- X
- X#undef ADDONS
- X#define ADDONS { b_access, "access" },\
- X { b_test, "test" },\
- X { b_test, "[" },
- X
- Xextern void b_access(char **av);
- Xextern void b_test(char **av);
- X
- X#endif
- END_OF_FILE
- if test 847 -ne `wc -c <'addon.h'`; then
- echo shar: \"'addon.h'\" unpacked with wrong size!
- fi
- # end of 'addon.h'
- fi
- if test -f 'cpp' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'cpp'\"
- else
- echo shar: Extracting \"'cpp'\" \(1035 characters\)
- sed "s/^X//" >'cpp' <<'END_OF_FILE'
- X#!/bin/sh
- X
- X# @(#) cpp.sh 1.3 92/01/15 21:53:22
- X
- X# Unprototypeing preprocessor for pre-ANSI C compilers. On some systems,
- X# this script can be as simple as:
- X#
- X# /lib/cpp "$@" | unproto
- X#
- X# However, some cc(1) drivers specify output file names on the
- X# preprocessor command line, so this shell script must be prepared to
- X# intercept them. Depending on the driver program, the cpp options may
- X# even go before or after the file name argument(s). The script below
- X# tries to tackle all these cases.
- X#
- X# You may want to add -Ipath_to_stdarg.h_file, -Dvoid=, -Dvolatile=,
- X# and even -D__STDC__.
- X
- X## (This is what I used while testing with the SunOS C compiler.
- X## Also, I added "-Qpath ." to CFLAGS so that cpp would be
- X## run out of the current directory. --- Byron)
- Xcpp_args="-I/u/byron/lib/sun4 -Dconst= -Dvolatile="
- X
- Xwhile :
- Xdo
- X case $1 in
- X "") break;;
- X -*) cpp_args="$cpp_args $1";;
- X *) cpp_args="$cpp_args $1"
- X case $2 in
- X ""|-*) ;;
- X *) exec 1> $2 || exit 1; shift;;
- X esac;;
- X esac
- X shift
- Xdone
- X
- X/lib/cpp $cpp_args | unproto
- END_OF_FILE
- if test 1035 -ne `wc -c <'cpp'`; then
- echo shar: \"'cpp'\" unpacked with wrong size!
- fi
- # end of 'cpp'
- fi
- if test -f 'history/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'history/Makefile'\"
- else
- echo shar: Extracting \"'history/Makefile'\" \(197 characters\)
- sed "s/^X//" >'history/Makefile' <<'END_OF_FILE'
- XCC=gcc -g -O
- X
- Xhistory: history.c
- X $(CC) -o history history.c
- X @echo 'Now install "history" as -, --, -p and --p in your bin directory'
- X @echo '(for example, by making them links to the same file)'
- END_OF_FILE
- if test 197 -ne `wc -c <'history/Makefile'`; then
- echo shar: \"'history/Makefile'\" unpacked with wrong size!
- fi
- # end of 'history/Makefile'
- fi
- echo shar: End of archive 7 \(of 7\).
- cp /dev/null ark7isdone
- MISSING=""
- for I in 1 2 3 4 5 6 7 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 7 archives.
- rm -f ark[1-9]isdone
- else
- echo You still must unpack the following archives:
- echo " " ${MISSING}
- fi
- exit 0
- exit 0 # Just in case...
-