home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume30 / rc / part07 < prev    next >
Encoding:
Text File  |  1992-05-29  |  4.6 KB  |  158 lines

  1. Newsgroups: comp.sources.misc
  2. From: byron@archone.tamu.edu (Byron Rakitzis)
  3. Subject:  v30i030:  rc - A Plan 9 shell reimplementation, v1.4, Part07/07
  4. Message-ID: <1992May30.031745.5684@sparky.imd.sterling.com>
  5. X-Md4-Signature: 87c27fcff7734084ebc5a1e95923a4aa
  6. Date: Sat, 30 May 1992 03:17:45 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: byron@archone.tamu.edu (Byron Rakitzis)
  10. Posting-number: Volume 30, Issue 30
  11. Archive-name: rc/part07
  12. Environment: UNIX
  13. Supersedes: rc: Volume 23, Issue 61-66
  14.  
  15. #! /bin/sh
  16. # This is a shell archive.  Remove anything before this line, then feed it
  17. # into a shell via "sh file" or similar.  To overwrite existing files,
  18. # type "sh file -c".
  19. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  20. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  21. # Contents:  addon.h cpp history/Makefile
  22. # Wrapped by kent@sparky on Fri May 29 20:55:25 1992
  23. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  24. echo If this archive is complete, you will see the following message:
  25. echo '          "shar: End of archive 7 (of 7)."'
  26. if test -f 'addon.h' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'addon.h'\"
  28. else
  29.   echo shar: Extracting \"'addon.h'\" \(847 characters\)
  30.   sed "s/^X//" >'addon.h' <<'END_OF_FILE'
  31. X/*
  32. X   This file is the interface to the rest of rc for any locally
  33. X   defined addon builtins.  By default there are none.
  34. X   The interface consists of the following macro.
  35. X  
  36. X   ADDONS    A comma-separated list of pairs of function pointers
  37. X        and string literals.
  38. X  
  39. X   The addon functions must also have proper prototypes in this file.
  40. X   The builtins all have the form:
  41. X  
  42. X    void b_NAME(char **av);
  43. X  
  44. X   Builtins report their exit status using set(TRUE) or set(FALSE).
  45. X  
  46. X   Example:
  47. X  
  48. X    #define ADDONS    { b_test, "test" },
  49. X    extern void b_test(char **av);
  50. X*/
  51. X
  52. X#define ADDONS        /* no addons by default */
  53. X
  54. X#ifdef    DWS
  55. X
  56. X/*
  57. X   This is what DaviD Sanderson (dws@cs.wisc.edu) uses.
  58. X*/
  59. X
  60. X#undef    ADDONS
  61. X#define ADDONS    { b_access,    "access" },\
  62. X        { b_test,     "test" },\
  63. X        { b_test,    "[" },
  64. X
  65. Xextern void b_access(char **av);
  66. Xextern void b_test(char **av);
  67. X
  68. X#endif
  69. END_OF_FILE
  70.   if test 847 -ne `wc -c <'addon.h'`; then
  71.     echo shar: \"'addon.h'\" unpacked with wrong size!
  72.   fi
  73.   # end of 'addon.h'
  74. fi
  75. if test -f 'cpp' -a "${1}" != "-c" ; then 
  76.   echo shar: Will not clobber existing file \"'cpp'\"
  77. else
  78.   echo shar: Extracting \"'cpp'\" \(1035 characters\)
  79.   sed "s/^X//" >'cpp' <<'END_OF_FILE'
  80. X#!/bin/sh
  81. X
  82. X# @(#) cpp.sh 1.3 92/01/15 21:53:22
  83. X
  84. X# Unprototypeing preprocessor for pre-ANSI C compilers.  On some systems,
  85. X# this script can be as simple as:
  86. X#
  87. X#    /lib/cpp "$@" | unproto
  88. X#
  89. X# However, some cc(1) drivers specify output file names on the
  90. X# preprocessor command line, so this shell script must be prepared to
  91. X# intercept them.  Depending on the driver program, the cpp options may
  92. X# even go before or after the file name argument(s). The script below
  93. X# tries to tackle all these cases.
  94. X#
  95. X# You may want to add -Ipath_to_stdarg.h_file, -Dvoid=, -Dvolatile=, 
  96. X# and even -D__STDC__.
  97. X
  98. X## (This is what I used while testing with the SunOS C compiler.
  99. X## Also, I added "-Qpath ." to CFLAGS so that cpp would be
  100. X## run out of the current directory. --- Byron)
  101. Xcpp_args="-I/u/byron/lib/sun4 -Dconst= -Dvolatile="
  102. X
  103. Xwhile :
  104. Xdo
  105. X    case $1 in
  106. X    "")    break;;
  107. X    -*)    cpp_args="$cpp_args $1";;
  108. X     *)    cpp_args="$cpp_args $1"
  109. X        case $2 in
  110. X        ""|-*)    ;;
  111. X            *)    exec 1> $2 || exit 1; shift;;
  112. X        esac;;
  113. X    esac
  114. X    shift
  115. Xdone
  116. X
  117. X/lib/cpp $cpp_args | unproto
  118. END_OF_FILE
  119.   if test 1035 -ne `wc -c <'cpp'`; then
  120.     echo shar: \"'cpp'\" unpacked with wrong size!
  121.   fi
  122.   # end of 'cpp'
  123. fi
  124. if test -f 'history/Makefile' -a "${1}" != "-c" ; then 
  125.   echo shar: Will not clobber existing file \"'history/Makefile'\"
  126. else
  127.   echo shar: Extracting \"'history/Makefile'\" \(197 characters\)
  128.   sed "s/^X//" >'history/Makefile' <<'END_OF_FILE'
  129. XCC=gcc -g -O
  130. X
  131. Xhistory: history.c
  132. X    $(CC) -o history history.c
  133. X    @echo 'Now install "history" as -, --, -p and --p in your bin directory'
  134. X    @echo '(for example, by making them links to the same file)'
  135. END_OF_FILE
  136.   if test 197 -ne `wc -c <'history/Makefile'`; then
  137.     echo shar: \"'history/Makefile'\" unpacked with wrong size!
  138.   fi
  139.   # end of 'history/Makefile'
  140. fi
  141. echo shar: End of archive 7 \(of 7\).
  142. cp /dev/null ark7isdone
  143. MISSING=""
  144. for I in 1 2 3 4 5 6 7 ; do
  145.     if test ! -f ark${I}isdone ; then
  146.     MISSING="${MISSING} ${I}"
  147.     fi
  148. done
  149. if test "${MISSING}" = "" ; then
  150.     echo You have unpacked all 7 archives.
  151.     rm -f ark[1-9]isdone
  152. else
  153.     echo You still must unpack the following archives:
  154.     echo "        " ${MISSING}
  155. fi
  156. exit 0
  157. exit 0 # Just in case...
  158.