home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume35 / prpp / part01 < prev    next >
Encoding:
Text File  |  1993-02-21  |  15.4 KB  |  707 lines

  1. Newsgroups: comp.sources.misc
  2. From: mgleason@cse.unl.edu (Mike Gleason)
  3. Subject: v35i086:  prpp - Prototype Pre-processor, Part01/01
  4. Message-ID: <1993Feb22.043032.15909@sparky.imd.sterling.com>
  5. X-Md4-Signature: a6bc91cf051e2e7826928e5e6b1d2b42
  6. Date: Mon, 22 Feb 1993 04:30:32 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: mgleason@cse.unl.edu (Mike Gleason)
  10. Posting-number: Volume 35, Issue 86
  11. Archive-name: prpp/part01
  12. Environment: UNIX
  13.  
  14. prpp - Prototype Pre-preprocessor
  15.  
  16. "Well-written" C source code uses function prototypes, so the header that
  17. declares the prototype should be #included.  On my system at least, the manual
  18. pages often do not tell you what header to include, so I whipped up this program
  19. to help work around this problem.  Prpp reads C headers and only spits out the
  20. function prototypes from the header.  Then you can run the program on all your
  21. headers, and have all the prototypes from all the headers in a single file,
  22. so you can grep through them.  The program only works on header (.h) files --
  23. don't run it on source (.c) files.
  24.  
  25. After using the enclosed script to generate the file, you can use the other
  26. enclosed script "prlook" to find prototypes.  For example, here's what I get
  27. when I "prlook perror":
  28.  
  29. <X11/Xlibos.h> 165:  void perror();
  30. <errno.h> 47:  void perror(const char *);
  31. <stdio.h> 176:  void perror(const char *);
  32. <rpc/clnt.h> 310:  void clnt_perror(CLIENT *, const char *);
  33. <rpc/clnt.h> 311:  char *clnt_sperror(CLIENT *, const char *);
  34.  
  35. Comments welcome,
  36. Mike Gleason
  37.  
  38. #! /bin/sh
  39. # This is a shell archive.  Remove anything before this line, then unpack
  40. # it by saving it into a file and typing "sh file".  To overwrite existing
  41. # files, type "sh file -c".  You can also feed this as standard input via
  42. # unshar, or by typing "sh <file", e.g..  If this archive is complete, you
  43. # will see the following message at the end:
  44. #        "End of shell archive."
  45. # Contents:  prpp.c prpp.readme Makefile prlook makeprlist
  46. # Wrapped by mgleason@cse on Mon Feb  8 17:09:04 1993
  47. PATH=/bin:/usr/bin:/usr/ucb ; export PATH
  48. if test -f 'prpp.c' -a "${1}" != "-c" ; then 
  49.   echo shar: Will not clobber existing file \"'prpp.c'\"
  50. else
  51. echo shar: Extracting \"'prpp.c'\" \(8937 characters\)
  52. sed "s/^X//" >'prpp.c' <<'END_OF_FILE'
  53. X/*
  54. X * Prototype Pre-Processor, by Mike Gleason, NCEMRSoft.
  55. X * Version 1.0 / February 8, 1993.
  56. X */
  57. X
  58. X#define VERSION "1.0"
  59. X
  60. X#include <stdio.h>
  61. X#include <string.h>
  62. X#include <ctype.h>
  63. X#include <stdlib.h>
  64. X
  65. X/* Definitions. */
  66. X#define CPP_LINE                '#'
  67. X#define SEMICOLON                ';'
  68. X#define LEFTBRACKET                '{'
  69. X#define RIGHTBRACKET            '}'
  70. X#define LEFTPAREN                '('
  71. X#define RIGHTPAREN                ')'
  72. X#define SLASH                    '/'
  73. X#define BACKSLASH                '\\'
  74. X#define ASTERISK                '*'
  75. X#define COMMA                    ','
  76. X#define CIDENTCHAR(c)            (isalnum(c) || ((c) == '_'))
  77. X#define CIDENTCHAR1(c)            (isalpha(c) || ((c) == '_'))
  78. X#define NEXTC                    (cbp->chr)
  79. X#define SKIPCHAR                cbp->chr = getc(fp); cbp = (cbp->next)
  80. X#define EQ(a,b)                    (strcmp((a), (b)) == 0)
  81. X#define Strncpy(a,b)            strncpy((a), (b), sizeof(a) - 1)
  82. X#define Strncat(a,b)            strncat((a), (b), sizeof(a) - 1)
  83. X#define wt_unknown                0
  84. X#define wt_extern                1
  85. X#define wt_static                2
  86. X#define wt_volatile                3
  87. X#define wt_const                4
  88. X#define wt_unsigned                5
  89. X#define wt_signed                6
  90. X#define wt_enum                    7
  91. X#define wt_union                8
  92. X#define wt_struct                9
  93. X#define wt_typedef                10
  94. X#ifndef HEADERDIR
  95. X#    define HEADERDIR            "/usr/include"
  96. X#endif
  97. X
  98. X/* Types. */
  99. Xstruct ch {
  100. X    int chr;
  101. X    struct ch *next;
  102. X};
  103. X
  104. X/* Globals. */
  105. XFILE                        *fp;
  106. Xchar                        word[128];
  107. X
  108. X/* For now, pgrepoutput isn't very helpful.  I was going to support this
  109. X * weird format which prints the function name first so you could alphabetize
  110. X * the list (for fast searches), but fgrep is plenty fast for me.
  111. X */
  112. X
  113. Xint                            pgrepoutput = 0;
  114. Xint                            is_sue;
  115. Xint                            is_ptr;
  116. Xint                            is_volatile;
  117. Xint                            is_signed;
  118. Xint                            curline;
  119. Xint                            curchar;
  120. Xint                            startline;
  121. Xchar                        typename[64];
  122. Xchar                        funcname[64];
  123. Xchar                        funcargs[256];
  124. Xchar                        filename[256];
  125. X
  126. X/* Keep a 4-byte look ahead buffer. */
  127. Xstruct ch cbuf[4] = {
  128. X    { EOF, &cbuf[1] },
  129. X    { EOF, &cbuf[2] },
  130. X    { EOF, &cbuf[3] },
  131. X    { EOF, &cbuf[0] }
  132. X}, *cbp;
  133. X
  134. X
  135. X
  136. X
  137. Xstatic void InitGetc(void)
  138. X{
  139. X    int i;
  140. X    
  141. X    cbp = cbuf;
  142. X    curline = 1;
  143. X    curchar = 0;
  144. X    for (i=0; i<4; i++)
  145. X        cbuf[i].chr = getc(fp);
  146. X}    /* InitGetc */
  147. X
  148. X
  149. X
  150. X
  151. Xstatic int Getc(void)
  152. X{
  153. X    int c;
  154. X    c = cbp->chr;
  155. X    if (c == '\n') {
  156. X        curchar = 0;
  157. X        curline++;
  158. X    } else
  159. X        curchar++;
  160. X    SKIPCHAR;
  161. X    return c;
  162. X}    /* Getc */
  163. X
  164. X
  165. X
  166. X
  167. Xstatic int Skipline(void)
  168. X{
  169. X    int c;
  170. X
  171. X    while(1) {
  172. X        c = Getc();
  173. X        if (c == EOF) return (EOF);
  174. X        if (c == BACKSLASH)
  175. X            (void) Getc();
  176. X        if (c == '\n') return ('\n');
  177. X    }
  178. X}    /* Skipline */
  179. X
  180. X
  181. X
  182. X
  183. Xstatic int Wordcmp(void)
  184. X{
  185. X    char *cp = word;
  186. X    int wt = wt_unknown;
  187. X
  188. X    switch(*cp++) {
  189. X        case 'e':    /* extern? */
  190. X            if (EQ(cp, "xtern"))
  191. X                wt = wt_extern;
  192. X            else if (EQ(cp, "num"))
  193. X                wt = wt_enum;
  194. X            break;
  195. X        case 't':
  196. X            if (EQ(cp, "ypedef"))
  197. X                wt = wt_typedef;
  198. X            break;
  199. X        case 'v':
  200. X            if (EQ(cp, "olatile"))
  201. X                wt = wt_volatile;
  202. X            break;
  203. X        case 'u':
  204. X            if (EQ(cp, "nsigned"))
  205. X                wt = wt_unsigned;
  206. X            else if (EQ(cp, "nion"))
  207. X                wt = wt_union;
  208. X            break;
  209. X        case 's':
  210. X            if (*cp++ == 't') {
  211. X                if (EQ(cp, "ruct"))
  212. X                    wt = wt_struct;
  213. X                else if (EQ(cp, "atic"))
  214. X                    wt = wt_static;
  215. X            } else if (EQ(cp, "igned"))
  216. X                wt = wt_signed;
  217. X            break;
  218. X    }
  219. X    return wt;
  220. X}    /* Wordcmp */
  221. X
  222. X
  223. X
  224. X
  225. Xstatic int SkipUntilSemi(void)
  226. X{
  227. X    int brackets = 0, c;
  228. X
  229. X    while (1) {
  230. X        c = Getc();
  231. X        if (c == EOF)
  232. X            break;
  233. X        else if (c == SEMICOLON && brackets <= 0)
  234. X            break;
  235. X        else if (c == LEFTBRACKET)
  236. X            brackets++;
  237. X        else if (c == RIGHTBRACKET)
  238. X            --brackets;
  239. X    }
  240. X    return c;
  241. X}    /* SkipUntilSemi */
  242. X
  243. X
  244. X
  245. Xstatic int SkipBrackets(void)
  246. X{
  247. X    int brackets = 1, c;
  248. X
  249. X    while (brackets > 0) {
  250. X        c = Getc();
  251. X        if (c == EOF)
  252. X            break;
  253. X        else if (c == LEFTBRACKET)
  254. X            brackets++;
  255. X        else if (c == RIGHTBRACKET)
  256. X            --brackets;
  257. X    }
  258. X    return c;
  259. X}    /* SkipUntilSemi */
  260. X
  261. X
  262. X
  263. X
  264. Xstatic void PutProto(void)
  265. X{
  266. X    char *sue_str, *vol_str, *signed_str;
  267. X    char *ptr_str = "***********";
  268. X
  269. X    if (is_sue == wt_struct)
  270. X        sue_str = "struct ";
  271. X    else if (is_sue == wt_union)
  272. X        sue_str = "union ";
  273. X    else if (is_sue == wt_enum)
  274. X        sue_str = "enum ";
  275. X    else sue_str = "";
  276. X
  277. X    if (is_volatile)
  278. X        vol_str = "volatile ";
  279. X    else vol_str = "";
  280. X
  281. X    if (is_ptr > 0)
  282. X        ptr_str[is_ptr] = 0;
  283. X    else ptr_str = "";
  284. X
  285. X    if (is_signed == wt_unsigned)
  286. X        signed_str = "unsigned ";
  287. X    else if (is_signed == wt_signed)
  288. X        signed_str = "signed ";
  289. X    else signed_str = "";
  290. X    
  291. X    if (pgrepoutput > 0) {
  292. X        (void) printf("%s [%s%s%s%s %s]%s;%s %d\n",
  293. X            funcname,
  294. X            vol_str,
  295. X            signed_str,
  296. X            sue_str,
  297. X            typename,
  298. X            ptr_str,
  299. X            funcargs,
  300. X            filename,
  301. X            startline
  302. X        );
  303. X    } else {
  304. X        if (!EQ("-", filename))
  305. X            (void) printf("%s %d:  ",
  306. X                filename,
  307. X                startline
  308. X            );
  309. X        (void) printf("%s%s%s%s %s%s%s;\n",
  310. X            vol_str,
  311. X            signed_str,
  312. X            sue_str,
  313. X            typename,
  314. X            ptr_str,
  315. X            funcname,
  316. X            funcargs
  317. X        );
  318. X    }
  319. X
  320. X    if (is_ptr > 0)
  321. X        ptr_str[is_ptr] = ASTERISK;
  322. X}    /* PutProto */
  323. X
  324. X
  325. X
  326. X
  327. Xstatic void NewType(void)
  328. X{
  329. X    is_sue = 0;
  330. X    is_volatile = 0;
  331. X    is_signed = 0;
  332. X    is_ptr = 0;
  333. X    typename[0] = funcname[0] = funcargs[0] = 0;
  334. X    startline = -1;
  335. X}    /* NewType */
  336. X
  337. X
  338. X
  339. X
  340. Xstatic int ParenCollect(char *dst, size_t siz)
  341. X{
  342. X    char *wordp = dst;
  343. X    int parens = 1, c;
  344. X    size_t len;
  345. X
  346. X    siz -= 2;        /* leave room for last ) and null. */
  347. X    *wordp++ = LEFTPAREN;
  348. X    len = 1;
  349. X
  350. X    while (1) {
  351. X        c = Getc();
  352. X        if (c == EOF)
  353. X            break;
  354. X        if (c == LEFTPAREN)
  355. X            parens++;
  356. X        else if (c == RIGHTPAREN) {
  357. X            if (--parens == 0) {
  358. X                *wordp++ = c;
  359. X                break;
  360. X            }
  361. X        }
  362. X        if (isspace(c)) {
  363. X            /* Don't bother with consecutive whitespace. */
  364. X            if (!isspace(wordp[-1]) && len < siz) {
  365. X                *wordp++ = ' ';
  366. X                ++len;
  367. X            }
  368. X        } else if (len < siz) {
  369. X            *wordp++ = c;
  370. X            ++len;
  371. X        }
  372. X    }
  373. X    *wordp = 0;
  374. X    return c;
  375. X}    /* ParenCollect */
  376. X
  377. X
  378. X
  379. X
  380. Xstatic void Parse(void)
  381. X{
  382. X    int                c = '\n', c2;
  383. X    int                inword = 0;
  384. X    char            *wordp;
  385. X    int                wt;
  386. X
  387. X    InitGetc();
  388. X    NewType();
  389. X
  390. X    while(1) {
  391. X        if (inword) {
  392. X            if (CIDENTCHAR(c)) {
  393. X                *wordp++ = c;
  394. X            } else {
  395. X                /* End token. */
  396. X                *wordp = 0;
  397. X                inword = 0;
  398. X                switch (wt = Wordcmp()) {
  399. X                    case wt_typedef:
  400. X                        (void) SkipUntilSemi();
  401. X                        break;
  402. X                    case wt_struct:
  403. X                    case wt_enum:
  404. X                    case wt_union:
  405. X                        is_sue = wt;
  406. X                        break;
  407. X                    case wt_volatile:
  408. X                        is_volatile = wt_volatile;
  409. X                        break;
  410. X                    case wt_unsigned:
  411. X                    case wt_signed:
  412. X                        is_signed = wt;
  413. X                        break;
  414. X                    case wt_static:
  415. X                    case wt_extern:
  416. X                        break;
  417. X                    case wt_unknown:
  418. X                        if (typename[0] == 0) {
  419. X                            (void) Strncpy(typename, word);
  420. X                        } else {
  421. X                            if (startline == -1)
  422. X                                startline = curline;
  423. X                            (void) Strncpy(funcname, word);
  424. X                        }
  425. X                }
  426. X            }
  427. X        } else {
  428. X            if (CIDENTCHAR1(c)) {
  429. X                wordp = word;
  430. X                inword = 1;
  431. X                *wordp++ = c;
  432. X            }
  433. X        }
  434. X
  435. X        if (c == '\n') {
  436. X            while (NEXTC == CPP_LINE) {
  437. X                 if (Skipline() == EOF)
  438. X                    goto done;
  439. X            }
  440. X        } else if (c == SLASH) {
  441. X            /* C++ style comment. */
  442. X            if (((c2 = NEXTC) == SLASH)) {
  443. X                if (Skipline() == EOF)
  444. X                    goto done;
  445. X            } else if (c2 == ASTERISK) {
  446. X                /* C comment block. */
  447. X                SKIPCHAR;
  448. X                while (1) {
  449. X                    if ((c = Getc()) == EOF) goto done;
  450. X                    if (c == ASTERISK && NEXTC == SLASH) {
  451. X                        /* End of comment. */
  452. X                        SKIPCHAR;
  453. X                        break;
  454. X                    }
  455. X                }    /* end getting comment block. */
  456. X            }        /* end if the char was '*' */
  457. X        } else if (c == SEMICOLON) {
  458. X            if (funcargs[0])
  459. X                PutProto();
  460. X            NewType();
  461. X        } else if (c == COMMA) {
  462. X            if (funcargs[0])
  463. X                PutProto();
  464. X            funcname[0] = funcargs[0] = 0;
  465. X            is_ptr = 0;
  466. X            startline = -1;
  467. X        } else if (c == LEFTBRACKET) {
  468. X            if (is_sue && (SkipBrackets() == EOF))
  469. X                goto done;
  470. X            else if (EQ(typename, "C"))        /* No 'extern "C" {' lines, please. */
  471. X                typename[0] = 0;
  472. X        } else if (c == LEFTPAREN) {
  473. X            if (is_signed && typename[0] && funcname[0] == 0) {
  474. X                (void) Strncpy(funcname, typename);
  475. X                (void) Strncpy(typename, "int");
  476. X                startline = curline;
  477. X            }
  478. X            if (funcname[0]) {
  479. X                /* We have an argument list. */
  480. X                if (ParenCollect(funcargs, sizeof(funcargs)) == EOF)
  481. X                    goto done;
  482. X            } else {
  483. X                /* Typename, could be something like: (void (*)(int)) */
  484. X                if (ParenCollect(typename, sizeof(typename)) == EOF)
  485. X                    goto done;
  486. X            }
  487. X        } else if (c == ASTERISK) {
  488. X            if (typename[0])
  489. X                is_ptr++;
  490. X        }
  491. X
  492. X        c = Getc();
  493. X        if (c == EOF) break;
  494. X    }
  495. Xdone:
  496. X    return;
  497. X}    /* parse */
  498. X
  499. X
  500. X
  501. Xvoid main(int argc, char **argv)
  502. X{
  503. X    int i, c, files;
  504. X
  505. X    for (i=1, files=0; i<argc; i++) {
  506. X        if (argv[i][0] == '-') {
  507. X            c = argv[i][1];
  508. X            if (c == 'g')
  509. X                pgrepoutput++;
  510. X            else if (c == 'c')
  511. X                --pgrepoutput;
  512. X            else {
  513. X                (void) fprintf(stderr, "\
  514. X%s version %s by Mike Gleason, NCEMRSoft.\n\
  515. XFunction: Parses C header files and prints the function prototypes from them.\n\
  516. XUsage: %s [-g | -c] headers...\n", argv[0], VERSION, argv[0]);
  517. X                exit(1);
  518. X            }
  519. X        } else {
  520. X            if ((fp = fopen(argv[i], "r")) == NULL)
  521. X                perror(argv[i]);
  522. X            else {
  523. X                files++;
  524. X                if (strncmp(argv[i], HEADERDIR, sizeof(HEADERDIR) - 1) == 0) {
  525. X                    filename[0] = '<';
  526. X                    (void) strncpy(filename + 1, argv[i] + sizeof(HEADERDIR), sizeof(filename) - 2);
  527. X                    (void) Strncat(filename, ">");
  528. X                } else
  529. X                    (void) Strncpy(filename, argv[i]);
  530. X                Parse();
  531. X                (void) fclose(fp);
  532. X            }
  533. X        }
  534. X    }
  535. X    if (files == 0) {
  536. X        fp = stdin;
  537. X        (void) Strncpy(filename, "-");
  538. X        Parse();
  539. X    }
  540. X}    /* main */
  541. X
  542. X/* prpp.c */
  543. END_OF_FILE
  544. if test 8937 -ne `wc -c <'prpp.c'`; then
  545.     echo shar: \"'prpp.c'\" unpacked with wrong size!
  546. fi
  547. # end of 'prpp.c'
  548. fi
  549. if test -f 'prpp.readme' -a "${1}" != "-c" ; then 
  550.   echo shar: Will not clobber existing file \"'prpp.readme'\"
  551. else
  552. echo shar: Extracting \"'prpp.readme'\" \(1073 characters\)
  553. sed "s/^X//" >'prpp.readme' <<'END_OF_FILE'
  554. Xprpp - Prototype Pre-preprocessor
  555. X
  556. X"Well-written" C source code uses function prototypes, so the header that
  557. Xdeclares the prototype should be #included.  On my system at least, the manual
  558. Xpages often do not tell you what header to include, so I whipped up this program
  559. Xto help work around this problem.  Prpp reads C headers and only spits out the
  560. Xfunction prototypes from the header.  Then you can run the program on all your
  561. Xheaders, and have all the prototypes from all the headers in a single file,
  562. Xso you can grep through them.  The program only works on header (.h) files --
  563. Xdon't run it on source (.c) files.
  564. X
  565. XAfter using the enclosed script to generate the file, you can use the other
  566. Xenclosed script "prlook" to find prototypes.  For example, here's what I get
  567. Xwhen I "prlook perror":
  568. X
  569. X<X11/Xlibos.h> 165:  void perror();
  570. X<errno.h> 47:  void perror(const char *);
  571. X<stdio.h> 176:  void perror(const char *);
  572. X<rpc/clnt.h> 310:  void clnt_perror(CLIENT *, const char *);
  573. X<rpc/clnt.h> 311:  char *clnt_sperror(CLIENT *, const char *);
  574. X
  575. XComments welcome,
  576. XMike Gleason
  577. X
  578. END_OF_FILE
  579. if test 1073 -ne `wc -c <'prpp.readme'`; then
  580.     echo shar: \"'prpp.readme'\" unpacked with wrong size!
  581. fi
  582. # end of 'prpp.readme'
  583. fi
  584. if test -f 'Makefile' -a "${1}" != "-c" ; then 
  585.   echo shar: Will not clobber existing file \"'Makefile'\"
  586. else
  587. echo shar: Extracting \"'Makefile'\" \(974 characters\)
  588. sed "s/^X//" >'Makefile' <<'END_OF_FILE'
  589. X# PrPP Makefile
  590. X
  591. XPROG=prpp
  592. X
  593. X# Your favorite C Compiler, and flags.
  594. XCC=cc
  595. XCFLAGS=-O
  596. XLFLAGS=-s
  597. X#CFLAGS=-g
  598. X#LFLAGS=
  599. X
  600. X# Any -D definitions:
  601. XDEFS=
  602. X
  603. X# File permissions for chmod:
  604. XMODE=755
  605. X
  606. XREADME=$(PROG).readme
  607. XPACKAGE=$(PROG).c $(README) Makefile prlook makeprlist
  608. X
  609. Xall: it
  610. X    chmod $(MODE) $(PROG)
  611. X    @ls -l $(PROG)
  612. X    @echo 'Done.'
  613. X
  614. Xit: $(PROG).c
  615. X    $(CC) $(CFLAGS) $(PROG).c -o $(PROG) $(LFLAGS)
  616. X
  617. Xshar:
  618. X    shar $(PACKAGE) | cat $(README) - > $(PROG).shar
  619. X
  620. Xtar:
  621. X    tar cvf - $(PACKAGE) | compress -f > $(PROG).tar.Z
  622. X
  623. Xclean:
  624. X    rm -f core *.u
  625. X
  626. Xclobber: clean
  627. X    rm -i $(PACKAGE)
  628. X
  629. X# I use these during development:
  630. Xlint:
  631. X    lint $(PROG).c > $(PROG).lint
  632. X
  633. Xuntab:
  634. X    mv $(PROG).c $(PROG).bak
  635. X    newform -i-4 < $(PROG).bak > $(PROG)
  636. X
  637. Xdebug:
  638. X    $(CC) -g $(DEFS) $(PROG).c -o $(PROG)
  639. X    chmod $(MODE) $(PROG)
  640. X    @ls -l $(PROG)
  641. X
  642. Xmips:
  643. X    cc $(MIPS_OPT) -s $(DEFS) $(PROG).c -o $(PROG)
  644. X    @rm -f *.[ou]
  645. X    chmod $(MODE) $(PROG)
  646. X    @ls -l $(PROG)
  647. X    cp $(PROG) ~/bin
  648. X    rehash
  649. X
  650. Xrz:
  651. X    rm -f $(PROG).c $(PROG)
  652. X    rz -e
  653. X    make
  654. X
  655. X# eof
  656. END_OF_FILE
  657. if test 974 -ne `wc -c <'Makefile'`; then
  658.     echo shar: \"'Makefile'\" unpacked with wrong size!
  659. fi
  660. # end of 'Makefile'
  661. fi
  662. if test -f 'prlook' -a "${1}" != "-c" ; then 
  663.   echo shar: Will not clobber existing file \"'prlook'\"
  664. else
  665. echo shar: Extracting \"'prlook'\" \(69 characters\)
  666. sed "s/^X//" >'prlook' <<'END_OF_FILE'
  667. X#!/bin/sh
  668. Xzcat /user/students/ugrad/mgleason/src/protos.Z | fgrep $@
  669. END_OF_FILE
  670. if test 69 -ne `wc -c <'prlook'`; then
  671.     echo shar: \"'prlook'\" unpacked with wrong size!
  672. fi
  673. chmod +x 'prlook'
  674. # end of 'prlook'
  675. fi
  676. if test -f 'makeprlist' -a "${1}" != "-c" ; then 
  677.   echo shar: Will not clobber existing file \"'makeprlist'\"
  678. else
  679. echo shar: Extracting \"'makeprlist'\" \(157 characters\)
  680. sed "s/^X//" >'makeprlist' <<'END_OF_FILE'
  681. X#!/bin/sh
  682. X
  683. XHDIR=/usr/include
  684. XPRFILE="./protos"
  685. X
  686. Xif [ $# = 1 ] 
  687. Xthen
  688. X    PRFILE=$1
  689. Xfi
  690. X
  691. Xfind $HDIR -exec prpp {} > $PRFILE \;
  692. Xcompress -v $PRFILE
  693. Xls -l $PRFILE.Z
  694. END_OF_FILE
  695. if test 157 -ne `wc -c <'makeprlist'`; then
  696.     echo shar: \"'makeprlist'\" unpacked with wrong size!
  697. fi
  698. chmod +x 'makeprlist'
  699. # end of 'makeprlist'
  700. fi
  701. echo shar: End of shell archive.
  702. exit 0
  703. --
  704. --mg                                                      mgleason@cse.unl.edu
  705.  
  706. exit 0 # Just in case...
  707.