home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1994 March / Source_Code_CD-ROM_Walnut_Creek_March_1994.iso / compsrcs / misc / volume30 / indent / part04 < prev    next >
Encoding:
Text File  |  1992-07-05  |  37.9 KB  |  1,442 lines

  1. Newsgroups: comp.sources.misc
  2. From: jrs@panix.com (Jon Saxton)
  3. Subject:  v30i098:  indent - C/C++ indent for UNIX, OS/2 and MSDOS, Part04/04
  4. Message-ID: <1992Jul5.190413.26935@sparky.imd.sterling.com>
  5. X-Md4-Signature: b029669a6e1260b2cf8c0849ad264dc1
  6. Date: Sun, 5 Jul 1992 19:04:13 GMT
  7. Approved: kent@sparky.imd.sterling.com
  8.  
  9. Submitted-by: jrs@panix.com (Jon Saxton)
  10. Posting-number: Volume 30, Issue 98
  11. Archive-name: indent/part04
  12. Environment: UNIX, OS/2, MSDOS
  13.  
  14. #! /bin/sh
  15. # This is a shell archive.  Remove anything before this line, then feed it
  16. # into a shell via "sh file" or similar.  To overwrite existing files,
  17. # type "sh file -c".
  18. # The tool that generated this appeared in the comp.sources.unix newsgroup;
  19. # send mail to comp-sources-unix@uunet.uu.net if you want that tool.
  20. # Contents:  Makefile.1x Makefile.20 Makefile.bsd args.c indent.1
  21. #   indent.pro proto.h typedefs.os2
  22. # Wrapped by kent@sparky on Tue Jun 30 00:01:42 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 4 (of 4)."'
  26. if test -f 'Makefile.1x' -a "${1}" != "-c" ; then 
  27.   echo shar: Will not clobber existing file \"'Makefile.1x'\"
  28. else
  29.   echo shar: Extracting \"'Makefile.1x'\" \(1430 characters\)
  30.   sed "s/^X//" >'Makefile.1x' <<'END_OF_FILE'
  31. X# Copyright (c) 1987 Regents of the University of California.
  32. X# All rights reserved.
  33. X#
  34. X# Redistribution and use in source and binary forms are permitted
  35. X# provided that the above copyright notice and this paragraph are
  36. X# duplicated in all such forms and that any documentation,
  37. X# advertising materials, and other materials related to such
  38. X# distribution and use acknowledge that the software was developed
  39. X# by the University of California, Berkeley.  The name of the
  40. X# University may not be used to endorse or promote products derived
  41. X# from this software without specific prior written permission.
  42. X# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  43. X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  44. X# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  45. X#
  46. X#    @(#)Makefile    5.9 (Berkeley) 88/09/15
  47. X#
  48. X#
  49. X# Makefile for OS/2 1.x by Jon Saxton, February 1992
  50. X
  51. X
  52. XCFLAGS=    -FPi -G2 -W3 -Zp
  53. XCC=    cl -c
  54. XLN=    cl -Lp
  55. XSRCS=    indent.c io.c lexi.c parse.c comment.c args.c
  56. XH=    codes.h globals.h proto.h
  57. XOBJS=    indent.obj io.obj lexi.obj parse.obj comment.obj args.obj
  58. X
  59. X.c.obj:
  60. X    $(CC) $(CFLAGS) $*.c
  61. X
  62. Xall: indent.exe
  63. X
  64. Xindent.exe: $(OBJS)
  65. X    $(LN) $(OBJS) indent.def
  66. X#    $(LN) $(OBJS), $@, nul,,indent.def
  67. X    bind $@ /names DOSQFSATTACH
  68. X
  69. Xindent.obj:    indent.c $H
  70. X
  71. Xio.obj:        io.c globals.h proto.h
  72. X
  73. Xlexi.obj:    lexi.c $H
  74. X
  75. Xparse.obj:    parse.c $H
  76. X
  77. Xcomment.obj:    comment.c globals.h proto.h
  78. X
  79. Xargs.obj:    args.c globals.h proto.h
  80. END_OF_FILE
  81.   if test 1430 -ne `wc -c <'Makefile.1x'`; then
  82.     echo shar: \"'Makefile.1x'\" unpacked with wrong size!
  83.   fi
  84.   # end of 'Makefile.1x'
  85. fi
  86. if test -f 'Makefile.20' -a "${1}" != "-c" ; then 
  87.   echo shar: Will not clobber existing file \"'Makefile.20'\"
  88. else
  89.   echo shar: Extracting \"'Makefile.20'\" \(1402 characters\)
  90.   sed "s/^X//" >'Makefile.20' <<'END_OF_FILE'
  91. X# Copyright (c) 1987 Regents of the University of California.
  92. X# All rights reserved.
  93. X#
  94. X# Redistribution and use in source and binary forms are permitted
  95. X# provided that the above copyright notice and this paragraph are
  96. X# duplicated in all such forms and that any documentation,
  97. X# advertising materials, and other materials related to such
  98. X# distribution and use acknowledge that the software was developed
  99. X# by the University of California, Berkeley.  The name of the
  100. X# University may not be used to endorse or promote products derived
  101. X# from this software without specific prior written permission.
  102. X# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  103. X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  104. X# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  105. X#
  106. X#    @(#)Makefile    5.9 (Berkeley) 88/09/15
  107. X#
  108. X#
  109. X# Makefile for OS/2 2.0 by Jon Saxton, February 1992
  110. X# Amended for C Set/2 by Jon Saxton, April 1992
  111. X
  112. XCFLAGS=    -c -G3 -W3 -Sm -Q -O
  113. XCC=    icc
  114. XSRCS=    indent.c io.c lexi.c parse.c comment.c args.c
  115. XH=    codes.h globals.h proto.h
  116. XOBJS=    indent.obj io.obj lexi.obj parse.obj comment.obj args.obj
  117. X
  118. X.c.obj:
  119. X    $(CC) $(CFLAGS) $*.c
  120. X
  121. Xall: indent.exe
  122. X
  123. Xindent.exe: $(OBJS)
  124. X    $(CC) $(OBJS) indent.def
  125. X
  126. Xindent.obj:    indent.c $H
  127. X
  128. Xio.obj:        io.c globals.h proto.h
  129. X
  130. Xlexi.obj:    lexi.c $H
  131. X
  132. Xparse.obj:    parse.c $H
  133. X
  134. Xcomment.obj:    comment.c globals.h proto.h
  135. X
  136. Xargs.obj:    args.c globals.h proto.h
  137. END_OF_FILE
  138.   if test 1402 -ne `wc -c <'Makefile.20'`; then
  139.     echo shar: \"'Makefile.20'\" unpacked with wrong size!
  140.   fi
  141.   # end of 'Makefile.20'
  142. fi
  143. if test -f 'Makefile.bsd' -a "${1}" != "-c" ; then 
  144.   echo shar: Will not clobber existing file \"'Makefile.bsd'\"
  145. else
  146.   echo shar: Extracting \"'Makefile.bsd'\" \(1429 characters\)
  147.   sed "s/^X//" >'Makefile.bsd' <<'END_OF_FILE'
  148. X# Copyright (c) 1987 Regents of the University of California.
  149. X# All rights reserved.
  150. X#
  151. X# Redistribution and use in source and binary forms are permitted
  152. X# provided that the above copyright notice and this paragraph are
  153. X# duplicated in all such forms and that any documentation,
  154. X# advertising materials, and other materials related to such
  155. X# distribution and use acknowledge that the software was developed
  156. X# by the University of California, Berkeley.  The name of the
  157. X# University may not be used to endorse or promote products derived
  158. X# from this software without specific prior written permission.
  159. X# THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  160. X# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  161. X# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  162. X#
  163. X#    @(#)Makefile    5.9 (Berkeley) 88/09/15
  164. X#
  165. XCFLAGS=    -O -DBSD #-DMAXPATHLEN=256
  166. XLIBC=    /lib/libc.a
  167. XSRCS=    indent.c io.c lexi.c parse.c comment.c args.c
  168. XOBJS=    indent.o io.o lexi.o parse.o comment.o args.o
  169. XMAN=    indent.0
  170. X
  171. Xall: indent
  172. X
  173. Xindent: ${OBJS} ${LIBC}
  174. X    ${CC} -o $@ ${CFLAGS} ${OBJS}
  175. X
  176. Xclean:
  177. X    rm -f ${OBJS} core indent
  178. X
  179. Xcleandir: clean
  180. X    rm -f ${MAN} tags .depend
  181. X
  182. Xdepend: ${SRCS}
  183. X    mkdep ${CFLAGS} ${SRCS}
  184. X
  185. Xinstall: ${MAN}
  186. X    install -s -o bin -g bin -m 755 indent ${DESTDIR}/usr/ucb/indent
  187. X    install -c -o bin -g bin -m 444 indent.0 ${DESTDIR}/usr/man/cat1/indent.0
  188. X
  189. Xlint: ${SRCS}
  190. X    lint ${CFLAGS} ${SRCS}
  191. X
  192. Xtags: ${SRCS}
  193. X    ctags ${SRCS}
  194. END_OF_FILE
  195.   if test 1429 -ne `wc -c <'Makefile.bsd'`; then
  196.     echo shar: \"'Makefile.bsd'\" unpacked with wrong size!
  197.   fi
  198.   # end of 'Makefile.bsd'
  199. fi
  200. if test -f 'args.c' -a "${1}" != "-c" ; then 
  201.   echo shar: Will not clobber existing file \"'args.c'\"
  202. else
  203.   echo shar: Extracting \"'args.c'\" \(11649 characters\)
  204.   sed "s/^X//" >'args.c' <<'END_OF_FILE'
  205. X/*
  206. X * Copyright (c) 1985 Sun Microsystems, Inc.
  207. X * Copyright (c) 1980 The Regents of the University of California.
  208. X * Copyright (c) 1976 Board of Trustees of the University of Illinois.
  209. X * All rights reserved.
  210. X *
  211. X * Redistribution and use in source and binary forms are permitted
  212. X * provided that the above copyright notice and this paragraph are
  213. X * duplicated in all such forms and that any documentation,
  214. X * advertising materials, and other materials related to such
  215. X * distribution and use acknowledge that the software was developed
  216. X * by the University of California, Berkeley, the University of Illinois,
  217. X * Urbana, and Sun Microsystems, Inc.  The name of either University
  218. X * or Sun Microsystems may not be used to endorse or promote products
  219. X * derived from this software without specific prior written permission.
  220. X * THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  221. X * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  222. X * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  223. X */
  224. X
  225. X#ifndef lint
  226. X# ifndef OS2
  227. X    static char sccsid[] = "@(#)args.c    6.0 (Berkeley) 92/06/15";
  228. X# endif
  229. X#endif                          /* not lint */
  230. X
  231. X/*
  232. X * Argument scanning and profile reading code.  Default parameters are set
  233. X * here as well.
  234. X */
  235. X
  236. X#include "globals.h"
  237. X#include <sys/types.h>
  238. X#include <ctype.h>
  239. X
  240. X#ifdef OS2
  241. X#include <stdlib.h>
  242. X#include <string.h>
  243. X#include <malloc.h>
  244. X#define INCL_NOPM
  245. X#define INCL_NOPMAPI
  246. X#define INCL_BASE
  247. X#define INCL_DOSFILEMGR
  248. X#include <os2.h>
  249. X#define MAXPATHLEN CCHMAXPATH
  250. X#define index(a,b) strchr(a,b)
  251. X#else
  252. Xchar *getenv(), *index();
  253. X
  254. X#endif
  255. X
  256. X#ifdef ANSIC
  257. Xstatic void scan_profile(FILE *);
  258. Xstatic FILE *fopenenv(char *, char *, char *);
  259. X
  260. X#else
  261. Xstatic FILE *fopenenv();
  262. X
  263. X#endif
  264. X
  265. X/* profile types */
  266. X#define    PRO_SPECIAL    1           /* special case */
  267. X#define    PRO_BOOL    2             /* boolean */
  268. X#define    PRO_INT        3             /* integer */
  269. X#define PRO_FONT    4             /* troff font */
  270. X
  271. X/* profile specials for booleans */
  272. X#define    ON        1                 /* turn it on */
  273. X#define    OFF        0                 /* turn it off */
  274. X
  275. X/* profile specials for specials */
  276. X#define    IGN        1                 /* ignore it */
  277. X#define    CLI        2                 /* case label indent (float) */
  278. X#define    STDIN        3               /* use stdin */
  279. X#define    KEY        4                 /* type (keyword) */
  280. X#define    CCI        5                 /* case code indent (float) */
  281. X
  282. X/*
  283. X * N.B.: because of the way the table here is scanned, options whose names are
  284. X * substrings of other options must occur later; that is, with -lp vs -l, -lp
  285. X * must be first.  Also, while (most) booleans occur more than once, the last
  286. X * default value is the one actually assigned.
  287. X */
  288. Xstruct pro
  289. X{
  290. X    char *p_name;               /* name, eg -bl, -cli */
  291. X    int p_type;                 /* type (int, bool, special) */
  292. X    int p_default;              /* the default value (if int) */
  293. X    int p_special;              /* depends on type */
  294. X    int *p_obj;                 /* the associated variable */
  295. X}   pro[] =
  296. X
  297. X{
  298. X
  299. X    "T", PRO_SPECIAL, 0, KEY, 0,
  300. X    "bacc", PRO_BOOL, false, ON, &blanklines_around_conditional_compilation,
  301. X    "badp", PRO_BOOL, false, ON, &blanklines_after_declarations_at_proctop,
  302. X    "bad", PRO_BOOL, false, ON, &blanklines_after_declarations,
  303. X    "bap", PRO_BOOL, false, ON, &blanklines_after_procs,
  304. X    "bbb", PRO_BOOL, false, ON, &blanklines_before_blockcomments,
  305. X    "bc", PRO_BOOL, true, OFF, &ps.leave_comma,
  306. X    "bl", PRO_BOOL, false, OFF, &btype_2,
  307. X    "brr", PRO_BOOL, false, ON, &btype_3,
  308. X    "br", PRO_BOOL, true, ON, &btype_2,
  309. X    "bs", PRO_BOOL, false, ON, &Bill_Shannon,
  310. X    "cdb", PRO_BOOL, true, ON, &comment_delimiter_on_blankline,
  311. X    "cd", PRO_INT, 0, 0, &ps.decl_com_ind,
  312. X    "ce", PRO_BOOL, true, ON, &cuddle_else,
  313. X    "ci", PRO_INT, 0, 0, &continuation_indent,
  314. X    "cli", PRO_SPECIAL, 0, CLI, 0,
  315. X    "cci", PRO_SPECIAL, 0, CCI, 0,
  316. X    "c", PRO_INT, 33, 0, &ps.com_ind,
  317. X    "di", PRO_INT, 16, 0, &ps.decl_indent,
  318. X    "dj", PRO_BOOL, false, ON, &ps.ljust_decl,
  319. X    "d", PRO_INT, 0, 0, &ps.unindent_displace,
  320. X    "eei", PRO_BOOL, false, ON, &extra_expression_indent,
  321. X    "ei", PRO_BOOL, true, ON, &ps.else_if,
  322. X    "fbc", PRO_FONT, 0, 0, (int *) &blkcomf,
  323. X    "fbx", PRO_FONT, 0, 0, (int *) &boxcomf,
  324. X    "fb", PRO_FONT, 0, 0, (int *) &bodyf,
  325. X    "fc1", PRO_BOOL, true, ON, &format_col1_comments,
  326. X    "fc", PRO_FONT, 0, 0, (int *) &scomf,
  327. X    "fk", PRO_FONT, 0, 0, (int *) &keywordf,
  328. X    "fs", PRO_FONT, 0, 0, (int *) &stringf,
  329. X    "ip", PRO_BOOL, true, ON, &ps.indent_parameters,
  330. X    "i", PRO_INT, 8, 0, &ps.ind_size,
  331. X    "lc", PRO_INT, 0, 0, &block_comment_max_col,
  332. X    "lp", PRO_BOOL, true, ON, &lineup_to_parens,
  333. X    "l", PRO_INT, 78, 0, &max_col,
  334. X    "nbacc", PRO_BOOL, false, OFF, &blanklines_around_conditional_compilation,
  335. X    "nbadp", PRO_BOOL, false, OFF, &blanklines_after_declarations_at_proctop,
  336. X    "nbad", PRO_BOOL, false, OFF, &blanklines_after_declarations,
  337. X    "nbap", PRO_BOOL, false, OFF, &blanklines_after_procs,
  338. X    "nbbb", PRO_BOOL, false, OFF, &blanklines_before_blockcomments,
  339. X    "nbc", PRO_BOOL, true, ON, &ps.leave_comma,
  340. X    "nbs", PRO_BOOL, false, OFF, &Bill_Shannon,
  341. X    "ncdb", PRO_BOOL, true, OFF, &comment_delimiter_on_blankline,
  342. X    "nce", PRO_BOOL, true, OFF, &cuddle_else,
  343. X    "ndj", PRO_BOOL, false, OFF, &ps.ljust_decl,
  344. X    "neei", PRO_BOOL, false, OFF, &extra_expression_indent,
  345. X    "nei", PRO_BOOL, true, OFF, &ps.else_if,
  346. X    "nfc1", PRO_BOOL, true, OFF, &format_col1_comments,
  347. X    "nip", PRO_BOOL, true, OFF, &ps.indent_parameters,
  348. X    "nlp", PRO_BOOL, true, OFF, &lineup_to_parens,
  349. X    "npcs", PRO_BOOL, false, OFF, &proc_calls_space,
  350. X    "npro", PRO_SPECIAL, 0, IGN, 0,
  351. X    "nprs", PRO_BOOL, false, OFF, &parens_space,
  352. X    "npsl", PRO_BOOL, true, OFF, &procnames_start_line,
  353. X    "nps", PRO_BOOL, false, OFF, &pointer_as_binop,
  354. X    "nsc", PRO_BOOL, true, OFF, &star_comment_cont,
  355. X    "nsob", PRO_BOOL, false, OFF, &swallow_optional_blanklines,
  356. X    "nv", PRO_BOOL, false, OFF, &verbose,
  357. X    "pcs", PRO_BOOL, false, ON, &proc_calls_space,
  358. X    "prs", PRO_BOOL, false, ON, &parens_space,
  359. X    "psl", PRO_BOOL, true, ON, &procnames_start_line,
  360. X    "ps", PRO_BOOL, false, ON, &pointer_as_binop,
  361. X    "sc", PRO_BOOL, true, ON, &star_comment_cont,
  362. X    "sob", PRO_BOOL, false, ON, &swallow_optional_blanklines,
  363. X    "st", PRO_SPECIAL, 0, STDIN, 0,
  364. X    "tabs", PRO_INT, 8, 0, &tabsize,
  365. X    "troff", PRO_BOOL, false, ON, &troff,
  366. X    "v", PRO_BOOL, false, ON, &verbose,
  367. X    "+", PRO_BOOL, false, ON, &cplus,
  368. X    /* whew! */
  369. X    0, 0, 0, 0, 0
  370. X};
  371. X
  372. X/*
  373. X * set_profile reads $HOME/.indent.pro and ./.indent.pro and handles arguments
  374. X * given in these files.
  375. X */
  376. X#ifdef ANSIC
  377. Xvoid set_profile(void)
  378. X#else
  379. Xset_profile()
  380. X#endif
  381. X{
  382. X    FILE *f;
  383. X
  384. X#ifdef OS2
  385. X# ifdef __32BIT__
  386. X#  define MODE_PROTECTED 1
  387. X# endif
  388. X    char MachineMode = MODE_PROTECTED;
  389. X    static char prof[] = "indent.pro";
  390. X
  391. X#else
  392. X    static char prof[] = ".indent.pro";
  393. X
  394. X#endif
  395. X
  396. X    f = fopenenv(prof, "r", "HOME");
  397. X
  398. X#ifdef OS2
  399. X# ifndef __32BIT__                  /* Must be MSDOS or OS/2 1.x code */
  400. X    DosGetMachineMode(&MachineMode);
  401. X# endif
  402. X    if (MachineMode == MODE_PROTECTED)
  403. X        if (f == NULL)
  404. X            f = fopenenv(prof, "r", "DPATH");
  405. X#endif
  406. X    if (f == NULL)
  407. X        f = fopenenv(prof, "r", "PATH");
  408. X
  409. X    if (f != NULL)
  410. X    {
  411. X        scan_profile(f);
  412. X        (void) fclose(f);
  413. X    }
  414. X
  415. X    if ((f = fopen(prof, "r")) != NULL)
  416. X    {
  417. X        scan_profile(f);
  418. X        (void) fclose(f);
  419. X    }
  420. X}
  421. X
  422. X#ifdef ANSIC
  423. Xstatic void scan_profile(FILE *f)
  424. X#else
  425. Xscan_profile(f)
  426. X    FILE *f;
  427. X
  428. X#endif
  429. X{
  430. X    register int i;
  431. X    register char *p;
  432. X    char buf[BUFSIZ];
  433. X
  434. X    while (1)
  435. X    {
  436. X        for (p = buf; (i = getc(f)) != EOF && (*p = (char) i) > ' '; ++p);
  437. X        if (p != buf)
  438. X        {
  439. X            *p++ = 0;
  440. X            if (verbose)
  441. X                printf("profile: %s\n", buf);
  442. X            set_option(buf);
  443. X        }
  444. X        else if (i == EOF)
  445. X            return;
  446. X    }
  447. X}
  448. X
  449. Xstatic char *param_start;
  450. X
  451. X#ifdef ANSIC
  452. Xstatic int eqin(register char *s1, register char *s2)
  453. X#else
  454. Xeqin(s1, s2)
  455. X    register char *s1;
  456. X    register char *s2;
  457. X
  458. X#endif
  459. X{
  460. X    while (*s1)
  461. X    {
  462. X        if (*s1++ != *s2++)
  463. X            return (false);
  464. X    }
  465. X    param_start = s2;
  466. X    return (true);
  467. X}
  468. X
  469. X/*
  470. X * Set the defaults.
  471. X */
  472. X#ifdef ANSIC
  473. Xvoid set_defaults(void)
  474. X#else
  475. Xset_defaults()
  476. X#endif
  477. X{
  478. X    register struct pro *p;
  479. X
  480. X    /*
  481. X       Because ps.case_indent and ps.case_code_indent are floats, we can't
  482. X       initialize them from the table:
  483. X    */
  484. X    ps.case_indent = (float) 0; /* -cli0.0 */
  485. X    ps.case_code_indent = (float) 1;  /* -cci1.0 */
  486. X    for (p = pro; p->p_name != NULL; p++)
  487. X        if (p->p_type != PRO_SPECIAL && p->p_type != PRO_FONT)
  488. X            *p->p_obj = p->p_default;
  489. X}
  490. X
  491. X#ifdef ANSIC
  492. Xvoid set_option(register char *arg)
  493. X#else
  494. Xset_option(arg)
  495. X    register char *arg;
  496. X
  497. X#endif
  498. X{
  499. X    register struct pro *p;
  500. X
  501. X#ifndef ANSIC
  502. X    extern double atof();
  503. X
  504. X#endif
  505. X    arg++;                      /* ignore leading "-" */
  506. X    for (p = pro; p->p_name; p++)
  507. X        if (*p->p_name == *arg && eqin(p->p_name, arg))
  508. X            goto found;
  509. X    fprintf(stderr, "indent: unknown parameter \"%s\"\n", arg - 1);
  510. X    exit(1);
  511. Xfound:
  512. X    switch (p->p_type)
  513. X    {
  514. X
  515. X    case PRO_SPECIAL:
  516. X        switch (p->p_special)
  517. X        {
  518. X
  519. X        case IGN:
  520. X            break;
  521. X
  522. X        case CLI:
  523. X            if (*param_start == 0)
  524. X                goto need_param;
  525. X            ps.case_indent = (float) atof(param_start);
  526. X            break;
  527. X
  528. X        case CCI:
  529. X            if (*param_start == 0)
  530. X                goto need_param;
  531. X            ps.case_code_indent = (float) atof(param_start);
  532. X            break;
  533. X
  534. X        case STDIN:
  535. X            if (input == NULL)
  536. X                input = stdin;
  537. X            if (output == NULL)
  538. X                output = stdout;
  539. X            break;
  540. X
  541. X        case KEY:
  542. X            if (*param_start == 0)
  543. X                goto need_param;
  544. X            {
  545. X                register char *str = (char *) malloc(strlen(param_start) + 1);
  546. X
  547. X                strcpy(str, param_start);
  548. X                addkey(str, 4);
  549. X            }
  550. X            break;
  551. X
  552. X        default:
  553. X            fprintf(stderr,
  554. X                    "indent: set_option: internal error: p_special %d\n",
  555. X                    p->p_special);
  556. X            exit(1);
  557. X        }
  558. X        break;
  559. X
  560. X    case PRO_BOOL:
  561. X        if (p->p_special == OFF)
  562. X            *p->p_obj = false;
  563. X        else
  564. X            *p->p_obj = true;
  565. X        break;
  566. X
  567. X    case PRO_INT:
  568. X        if (*param_start == 0)
  569. X        {
  570. X    need_param:
  571. X            fprintf(stderr, "indent: \"%s\" requires a parameter\n",
  572. X                    arg - 1);
  573. X            exit(1);
  574. X        }
  575. X        *p->p_obj = atoi(param_start);
  576. X        break;
  577. X
  578. X    case PRO_FONT:
  579. X        parsefont((struct fstate *) p->p_obj, param_start);
  580. X        break;
  581. X
  582. X    default:
  583. X        fprintf(stderr, "indent: set_option: internal error: p_type %d\n",
  584. X                p->p_type);
  585. X        exit(1);
  586. X    }
  587. X}
  588. X
  589. X/*------------------------------------------------------------------------------
  590. X
  591. X  FILE *fopenenv(char *name, char *mode, char *env)
  592. X
  593. X  Similar to fopen() but searches the directories listed in environment
  594. X  item 'env' for the file.
  595. X
  596. X  Written 14 April 1992 by Jon Saxton who is fairly sure that a function
  597. X  like this already exists somewhere but who couldn't find one.
  598. X
  599. X------------------------------------------------------------------------------*/
  600. X
  601. X#ifdef ANSIC
  602. XFILE *fopenenv(char *name, char *mode, char *env)
  603. X#else
  604. XFILE *fopenenv(name, mode, env)
  605. X    char *name, *mode, *env;
  606. X
  607. X#endif
  608. X{
  609. X    char FullName[MAXPATHLEN];
  610. X
  611. X    _searchenv(name, env, FullName);
  612. X    if (strlen(FullName) == 0)
  613. X        return NULL;
  614. X    return fopen(FullName, mode);
  615. X}
  616. END_OF_FILE
  617.   if test 11649 -ne `wc -c <'args.c'`; then
  618.     echo shar: \"'args.c'\" unpacked with wrong size!
  619.   fi
  620.   # end of 'args.c'
  621. fi
  622. if test -f 'indent.1' -a "${1}" != "-c" ; then 
  623.   echo shar: Will not clobber existing file \"'indent.1'\"
  624. else
  625.   echo shar: Extracting \"'indent.1'\" \(13574 characters\)
  626.   sed "s/^X//" >'indent.1' <<'END_OF_FILE'
  627. X.\" Copyright 1989 Object Design, Inc.
  628. X.\" Copyright (c) 1985 Sun Microsystems, Inc.
  629. X.\" Copyright (c) 1980 The Regents of the University of California.
  630. X.\" Copyright (c) 1976 Board of Trustees of the University of Illinois.
  631. X.\" All rights reserved.
  632. X.\" Redistribution and use in source and binary forms are permitted
  633. X.\" provided that the above copyright notice and this paragraph are
  634. X.\" duplicated in all such forms and that any documentation,
  635. X.\" advertising materials, and other materials related to such
  636. X.\" distribution and use acknowledge that the software was developed
  637. X.\" by the University of California, Berkeley, the University of Illinois,
  638. X.\" Urbana, and Sun Microsystems, Inc.  The name of either University
  639. X.\" or Sun Microsystems may not be used to endorse or promote products
  640. X.\" derived from this software without specific prior written permission.
  641. X.\" THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
  642. X.\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
  643. X.\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  644. X.\" 
  645. X.\"    @(#)indent.1    6.5 (Berkeley) 88/09/15
  646. X.\"
  647. X.TH INDENT 1 "July 14, 1989
  648. X.SH NAME
  649. Xindent \- indent and format C program source
  650. X.SH SYNOPSIS
  651. X.in +\w'\fBindent \fR'u
  652. X.ti -\w'\fBindent \fR'u
  653. X\fBindent \fR [ \fIinput-file\fR [ \fIoutput-file\fR ] ]
  654. X[\ \fB\-bad\fR\ |\ \fB\-nbad\fR\ ]
  655. X[\ \fB\-bap\fR\ |\ \fB\-nbap\fR\ ]
  656. X[\ \fB\-bbb\fR\ |\ \fB\-nbbb\fR\ ]
  657. X[\ \fB\-bc\fR\ |\ \fB\-nbc\fR\ ]
  658. X[\ \fB\-bl\fR\ ]
  659. X[\ \fB\-br\fR\ ]
  660. X[\ \fB\-brr\fR\ ]
  661. X[\ \fB\-c\fIn\fR\ ]
  662. X[\ \fB\-cd\fIn\fR\ ]
  663. X[\ \fB\-cdb\fR\ |\ \fB\-ncdb\fR\ ]
  664. X[\ \fB\-ce\fR\ |\ \fB\-nce\fR\ ]
  665. X[\ \fB\-ci\fIn\fR\ ]
  666. X[\ \fB\-cli\fIn\fR\ ]
  667. X[\ \fB\-cci\fIn\fR\ ]
  668. X[\ \fB\-d\fIn\fR\ ]
  669. X[\ \fB\-di\fIn\fR\ ]
  670. X[\ \fB\-fc1\fR\ |\ \fB\-nfc1\fR\ ]
  671. X[\ \fB\-i\fIn\fR\ ]
  672. X[\ \fB\-ip\fR\ |\ \fB\-nip\fR\ ]
  673. X[\ \fB\-l\fIn\fR\ ]
  674. X[\ \fB\-lc\fIn\fR\ ]
  675. X[\ \fB\-lp\fR\ |\ \fB\-nlp\fR\ ]
  676. X[\ \fB\-pcs\fR\ |\ \fB\-npcs\fR\ ]
  677. X[\ \fB\-npro\fR\ ]
  678. X[\ \fB\-prs\fR\ |\ \fB\-nprs\fR\ ]
  679. X[\ \fB\-psl\fR\ |\ \fB\-npsl\fR\ ]
  680. X[\ \fB\-sc\fR\ |\ \fB\-nsc\fR\ ]
  681. X[\ \fB\-sob\fR\ |\ \fB\-nsob\fR\ ]
  682. X[\ \fB\-st\fR\ ]
  683. X[\ \fB\-tabs\fIn\fR\ ]
  684. X[\ \fB\-troff\fR\ ]
  685. X[\ \fB\-v\fR\ |\ \fB\-nv\fR\ ]
  686. X[\ \fB-+\fR ]
  687. X
  688. X.SH DESCRIPTION
  689. X.I Indent
  690. Xis a \fBC\fR program formatter.  It reformats the \fBC\fR program in the
  691. X\fIinput-file\fR according to the switches.  The switches which can be
  692. Xspecified are described below. They may appear before or after the file
  693. Xnames.
  694. X.LP
  695. X\fBNOTE\fP: If you only specify an \fIinput-file\fR, the formatting is
  696. Xdone 'in-place', that is, the formatted file is written back into
  697. X.I input-file
  698. Xand a backup copy of
  699. X.I input-file
  700. Xis written in the current directory.  If
  701. X.I input-file
  702. Xis named '/blah/blah/file', the backup file is named
  703. X.RI file .BAK.
  704. X.LP
  705. XIf
  706. X.I output-file
  707. Xis specified,
  708. X.I indent
  709. Xchecks to make sure it is different from
  710. X.IR input-file .
  711. X.SH OPTIONS
  712. X.LP
  713. XThe options listed below control the formatting style imposed by
  714. X.IR indent .
  715. X.TP 15
  716. X.BR \-bap , \-nbap
  717. XIf
  718. X.B \-bap
  719. Xis specified, a blank line is forced after every procedure body.  Default:
  720. X.B \-nbap.
  721. X.TP 15
  722. X.BR \-bad , \-nbad
  723. XIf
  724. X.B \-bad
  725. Xis specified, a blank line is forced after every block of
  726. Xdeclarations.  Default:  
  727. X.B \-nbad.
  728. X.TP 15
  729. X.BR \-bbb , \-nbbb
  730. XIf
  731. X.B \-bbb
  732. Xis specified, a blank line is forced before every block comment.  Default:
  733. X.B \-nbbb.
  734. X.TP 15
  735. X.BR \-bc , \-nbc
  736. XIf
  737. X.B \-bc
  738. Xis specified, then a newline is forced after each comma in a declaration. 
  739. X.B \-nbc
  740. Xturns off this option.  The default is
  741. X.BR \-bc .
  742. X.TP 15
  743. X.BR \-br , \-bl , \-brr
  744. XSpecifying
  745. X.B \-bl
  746. Xlines up compound statements like this:
  747. X.ne 4
  748. X.nf
  749. X.ft L
  750. X    if (...)
  751. X    {
  752. X        code
  753. X    }
  754. X.ft R
  755. X.fi
  756. XSpecifying
  757. X.B \-br
  758. X(the default) makes them look like this:
  759. X.ne 3
  760. X.nf
  761. X.ft L
  762. X    if (...) {
  763. X        code
  764. X    }
  765. X.ft R
  766. X.fi
  767. XAnd specifying
  768. X.B \-brr
  769. Xmakes them look like this:
  770. X.ne 3
  771. X.nf
  772. X.ft L
  773. X    if (...)
  774. X        {
  775. X        code
  776. X        }
  777. X.ft R
  778. X.fi
  779. X.LP
  780. X.TP 15
  781. X.BI \-c n
  782. XThe column in which comments on code start.  The default is 33.  
  783. X.TP 15
  784. X.BI \-cd n
  785. XThe column in which comments on declarations start.  The default
  786. Xis for these comments to start in the same column as those on code.
  787. X.TP 15
  788. X.BI \-cdb , \-ncdb
  789. XEnables (disables) the placement of comment delimiters on blank lines.  With
  790. Xthis option enabled, comments look like this:
  791. X.nf
  792. X.ft L
  793. X.ne 3
  794. X    /*
  795. X     * this is a comment
  796. X     */
  797. X.ft R
  798. X.fi
  799. XRather than like this:
  800. X.nf
  801. X.ft L
  802. X    /* this is a comment */
  803. X.ft R
  804. X.fi
  805. XThis only affects block comments, not comments to the right of code. The default is
  806. X.B \-cdb .
  807. X.TP 15
  808. X.BI \-ce , \-nce
  809. XEnables (disables) forcing 'else's to cuddle up to the immediatly preceeding
  810. X'}'.  The default is
  811. X.B \-ce .
  812. X.TP 15
  813. X.BI \-ci n
  814. XSets the continuation indent to be \fIn\fR.  Continuation
  815. Xlines will be indented that far from the beginning of the first line of the
  816. Xstatement.  Parenthesized expressions have extra indentation added to
  817. Xindicate the nesting, unless \fB\-lp\fR is in effect.
  818. X\fB\-ci\fR defaults to the same value as \fB\-i\fR.
  819. X.TP 15
  820. X.BI \-cli n
  821. XCauses case labels to be indented
  822. X.I n
  823. Xtab stops to the right of the containing \fBswitch\fR statement.
  824. X\fB-cli0.5\fR causes case labels to be indented half a tab stop.  The
  825. Xdefault is
  826. X.B \-cli0 .
  827. X.TP 15
  828. X.BI \-cci n
  829. XCauses case code to be indented
  830. X.I n
  831. Xtab stops to the right of the corresponding case label.
  832. X\fB-cci0.5\fR causes case code to be indented half a tab stop.  The
  833. Xdefault is
  834. X.B \-cci1 .
  835. X.TP 15
  836. X.BI \-d n
  837. XControls the placement of comments which are not to the
  838. Xright of code.  The default
  839. X.B \-d1
  840. Xmeans that such comments are placed one indentation level to the
  841. Xleft of code.  Specifying
  842. X.B \-d0
  843. Xlines up these comments with the code.  See the section on comment
  844. Xindentation below.
  845. X.TP 15
  846. X.BI \-di n
  847. XSpecifies the indentation, in character positions, from a declaration keyword
  848. Xto the following identifier.  The default is
  849. X.B \-di16 .
  850. X.if 0 \{.TP 15
  851. X.BR \-dj , \-ndj
  852. X.B \-dj
  853. Xleft justifies declarations.
  854. X.B \-ndj
  855. Xindents declarations the same as code.  The default is
  856. X.BR \-ndj .
  857. X.TP 15
  858. X.BI \-ei , \-nei
  859. XEnables (disables) special
  860. X.B else-if
  861. Xprocessing.  If it's enabled,
  862. X.BR if "s"
  863. Xfollowing
  864. X.BR else "s"
  865. Xwill have the same indendation as the preceeding
  866. X.B if
  867. Xstatement.\}
  868. X.TP 15
  869. X.BI \-fc1 , \-nfc1
  870. XEnables (disables) the formatting of comments that start in column 1.
  871. XOften, comments whose leading '/' is in column 1 have been carefully
  872. Xhand formatted by the programmer.  In such cases, \fB\-nfc1\fR should be
  873. Xused.  The default is \fB\-fc1\fR.
  874. X.TP 15
  875. X.BI \-i n
  876. XThe number of spaces for one indentation level.  The default is 4.
  877. X.TP 15
  878. X.BI \-ip , \-nip
  879. XEnables (disables) the indentation of parameter declarations from the left
  880. Xmargin.  The default is
  881. X.B \-ip .
  882. X.TP 15
  883. X.BI \-l n
  884. XMaximum length of an output line.  The default is 75.
  885. X.TP 15
  886. X.B \-npro
  887. XCauses the profile files, './.indent.pro' and '~/.indent.pro', to be ignored.
  888. X.TP 15
  889. X.BI \-lp , \-nlp
  890. XLines up code surrounded by parenthesis in continuation lines.  If a line
  891. Xhas a left paren which is not closed on that line, then continuation lines
  892. Xwill be lined up to start at the character position just after the left
  893. Xparen.  For example, here is how a piece of continued code looks with -nlp
  894. Xin effect:
  895. X.ne 2
  896. X.nf
  897. X.ft L
  898. X    p1 = first_procedure(second_procedure(p2, p3),
  899. X        third_procedure(p4, p5));
  900. X.ft R
  901. X.fi
  902. X.ne 5
  903. XWith \fB-lp\fR in effect (the default) the code looks somewhat clearer:
  904. X.nf
  905. X.ft L
  906. X    p1 = first_procedure(second_procedure(p2, p3),
  907. X                         third_procedure(p4, p5));
  908. X.ft R
  909. X.fi
  910. X.ne 5
  911. XInserting a couple more newlines we get:
  912. X.nf
  913. X.ft L
  914. X    p1 = first_procedure(second_procedure(p2,
  915. X                                          p3),
  916. X                         third_procedure(p4,
  917. X                                         p5));
  918. X.ft R
  919. X.fi
  920. X.TP 15
  921. X.B \-pcs , \-npcs
  922. XIf true (\fB-pcs\fR) all procedure calls will have a space inserted between
  923. Xthe name and the '('.  The default is 
  924. X.B \-npcs
  925. X.TP 15
  926. X.B \-prs , \-nprs
  927. XIf true (\fB-prs\fR) all parentheses will have a space inserted
  928. Xafter the '(' and before the ')'.  The default is 
  929. X.B \-nprs
  930. X.TP 15
  931. X.B \-psl , \-npsl
  932. XIf true (\fB-psl\fR) the names of procedures being defined are placed in
  933. Xcolumn 1 \- their types, if any, will be left on the previous lines.  The
  934. Xdefault is 
  935. X.B -psl
  936. X.TP 15
  937. X.BI \-sc , \-nsc
  938. XEnables (disables) the placement of asterisks ('*'s) at the left edge of all
  939. Xcomments.    
  940. X.TP 15
  941. X.BR \-sob , \-nsob
  942. XIf
  943. X.B \-sob
  944. Xis specified, indent will swallow optional blank lines.  You can use this to
  945. Xget rid of blank lines after declarations.  Default:
  946. X.B \-nsob
  947. X.TP 15
  948. X.B \-st
  949. XCauses
  950. X.B indent
  951. Xto take its input from stdin, and put its output to stdout.
  952. X.TP 15
  953. X.BI \-T typename
  954. XAdds
  955. X.I typename
  956. Xto the list of type keywords.  Names accumulate:
  957. X.B \-T
  958. Xcan be specified more than once.  You need to specify all the typenames that
  959. Xappear in your program that are defined by \fBtypedef\fRs \- nothing will be
  960. Xharmed if you miss a few, but the program won't be formatted as nicely as
  961. Xit should.  This sounds like a painful thing to have to do, but it's really
  962. Xa symptom of a problem in C: \fBtypedef\fR causes a syntactic change in the
  963. Xlanguage and \fIindent\fR can't find all \fBtypedef\fRs.
  964. X.TP 15
  965. X.BI \-tabs n
  966. XTells indent that tabs are assumed to be at every
  967. X.I n
  968. Xcolumns.  The
  969. Xdefault is
  970. X.B \-tabs8.
  971. XIf
  972. X.I n
  973. Xis less than 3 then tabs will not be used at all in the output.
  974. X.TP 15
  975. X.B \-troff
  976. XCauses
  977. X.B indent
  978. Xto format the program for processing by troff.  It will produce a fancy
  979. Xlisting in much the same spirit as
  980. X.BR vgrind.
  981. XIf the output file is not specified, the default is standard output,
  982. Xrather than formatting in place.
  983. X.TP 15
  984. X.BR \-v , \-nv
  985. X.B \-v
  986. Xturns on 'verbose' mode,
  987. X.B \-nv
  988. Xturns it off.  When in verbose mode,
  989. X.I indent
  990. Xreports when it splits one line of input into two or more lines of output,
  991. Xand gives some size statistics at completion. The default is
  992. X.BR \-nv .
  993. X.TP 15
  994. X.B \-+
  995. Xturns on support for C++. In c++ mode, :: is permited in identifiers, 
  996. XC++ keywords are supported, and class definition keywords 
  997. X(public, private, etc.) are set in column 2.
  998. X.SH "FURTHER DESCRIPTION"
  999. X.LP
  1000. XYou may set up your own 'profile' of defaults to
  1001. X.I indent
  1002. Xby creating a file called
  1003. X.BI . indent . pro
  1004. Xin either your login directory or the current directory and including
  1005. Xwhatever switches you like.  A '.indent.pro' in the current directory takes
  1006. Xprecedence over the one in your login directory.  If
  1007. X.I indent
  1008. Xis run and a profile file exists, then it is read to set up the program's
  1009. Xdefaults.  Switches on the command line, though, always override profile
  1010. Xswitches.  The switches should be separated by spaces, tabs or newlines.
  1011. X.LP
  1012. X.B Comments
  1013. X.LP
  1014. X.IR "'Box' comments" .
  1015. X.I Indent
  1016. Xassumes that any comment with a dash or star immediately after the start of
  1017. Xcomment (that is, '/*\-' or '/**') is a comment surrounded by a box of stars.
  1018. XEach line of such a comment is left unchanged, except that its indentation
  1019. Xmay be adjusted to account for the change in indentation of the first line
  1020. Xof the comment.
  1021. X.LP
  1022. X.IR "Straight text" .
  1023. XAll other comments are treated as straight text.
  1024. X.I Indent
  1025. Xfits as many words (separated by blanks, tabs, or newlines) on a
  1026. Xline as possible.  Blank lines break paragraphs.
  1027. X.LP
  1028. X.B Comment indentation
  1029. X.LP
  1030. XIf a comment is on a line with code it is started in the 'comment column',
  1031. Xwhich is set by the
  1032. X.BI \-c n
  1033. Xcommand line parameter.  Otherwise, the comment is started at
  1034. X.I n
  1035. Xindentation levels less than where code is currently being placed, where
  1036. X.I n
  1037. Xis specified by the
  1038. X.BI \-d n
  1039. Xcommand line parameter.  If the code on a line extends past the comment
  1040. Xcolumn, the comment starts further to the right, and the right margin may be
  1041. Xautomatically extended in extreme cases.
  1042. X.LP
  1043. X.B Special Comments
  1044. X.LP
  1045. X.I Indent
  1046. Xproduces and interprets some special comments.
  1047. XWhen indent cannot parse the source, it prints a message on standard error
  1048. Xand inserts a comment into the output of the form
  1049. X.nf
  1050. X.ft L
  1051. X    /**INDENT** ErrorMessage */
  1052. X.ft R
  1053. X.fi
  1054. X.LP
  1055. X.I Indent
  1056. Xinterprets several special comments as directives. 
  1057. XFirst, it makes no attempt to format lines containing the error comment
  1058. Xdescribed above.
  1059. X.LP
  1060. XSecond, lines of the form:
  1061. X.nf
  1062. X.ft L
  1063. X    /* INDENT OFF */
  1064. Xor
  1065. X    /* INDENT ON */
  1066. X.ft R
  1067. X.fi
  1068. Xdisable and re-enable indent formatting. 
  1069. XAny amount of whitespace may replace the spaces shown in the examples.
  1070. X.LP
  1071. XThird, 
  1072. X.I indent
  1073. Xallows formatting controls to be included in the source via comments of the form:
  1074. X.nf
  1075. X.ft L
  1076. X    /* INDENT: arg1 arg2 arg3 ... arg4 */
  1077. X.ft R
  1078. X.fi
  1079. XThe arguments given are in the same syntax as the command line or profile file.
  1080. XFor example:
  1081. X.nf
  1082. X.ft L
  1083. X    /* INDENT: -cli.25 -nfc1 */
  1084. X.ft R
  1085. X.fi
  1086. X.LP
  1087. X.B Preprocessor lines
  1088. X.LP
  1089. XIn general, \fIindent\fR leaves preprocessor lines alone.  The only
  1090. Xreformmatting that it will do is to straighten up trailing comments.  It
  1091. Xleaves imbedded comments alone.  Conditional compilation
  1092. X(\fB#ifdef...#endif\fR) is recognized and \fIindent\fR attempts to correctly
  1093. Xcompensate for the syntactic peculiarites introduced.
  1094. X.LP
  1095. X.B C syntax
  1096. X.LP
  1097. X\fIIndent\fR understands a substantial amount about the syntax of C, but it
  1098. Xhas a 'forgiving' parser.  It attempts to cope with the usual sorts of
  1099. Xincomplete and misformed syntax.  In particular, the use of macros like:
  1100. X.nf
  1101. X.ft L
  1102. X        #define forever for(;;)
  1103. X.ft R
  1104. X.fi
  1105. Xis handled properly.
  1106. X.SH FILES
  1107. X.DT
  1108. X.br
  1109. X\&./.indent.pro    profile file
  1110. X.br
  1111. X.SH BUGS
  1112. X.I Indent
  1113. Xhas even more switches than \fIls\fR.
  1114. X
  1115. X.ne 5
  1116. XA common mistake that often causes grief is typing:
  1117. X.nf
  1118. X.ft L
  1119. X    indent *.c
  1120. X.ft R
  1121. X.fi
  1122. Xto the shell in an attempt to indent all the \fBC\fR programs in a directory.
  1123. XThis is a really nasty thing to do.  (Think about it.)
  1124. END_OF_FILE
  1125.   if test 13574 -ne `wc -c <'indent.1'`; then
  1126.     echo shar: \"'indent.1'\" unpacked with wrong size!
  1127.   fi
  1128.   # end of 'indent.1'
  1129. fi
  1130. if test -f 'indent.pro' -a "${1}" != "-c" ; then 
  1131.   echo shar: Will not clobber existing file \"'indent.pro'\"
  1132. else
  1133.   echo shar: Extracting \"'indent.pro'\" \(123 characters\)
  1134.   sed "s/^X//" >'indent.pro' <<'END_OF_FILE'
  1135. X-bad
  1136. X-bap
  1137. X-bl
  1138. X-nce
  1139. X-i4
  1140. X-nfc1
  1141. X-l80
  1142. X-npsl
  1143. X-lp
  1144. X-di4
  1145. X-d0
  1146. X-nsc
  1147. X-tabs4
  1148. X-TFILE
  1149. X-Tva_list
  1150. X-Tsize_t
  1151. X-Ttime_t
  1152. X-Tclock_t
  1153. X-Tjmp_buf
  1154. X-v
  1155. END_OF_FILE
  1156.   if test 123 -ne `wc -c <'indent.pro'`; then
  1157.     echo shar: \"'indent.pro'\" unpacked with wrong size!
  1158.   fi
  1159.   # end of 'indent.pro'
  1160. fi
  1161. if test -f 'proto.h' -a "${1}" != "-c" ; then 
  1162.   echo shar: Will not clobber existing file \"'proto.h'\"
  1163. else
  1164.   echo shar: Extracting \"'proto.h'\" \(752 characters\)
  1165.   sed "s/^X//" >'proto.h' <<'END_OF_FILE'
  1166. X/*------------------------------------------------------------------------------
  1167. X
  1168. X    proto.h
  1169. X
  1170. X    Function prototypes.  Only used if ANSIC is defined.
  1171. X
  1172. X    @(#)globals.h    6.0 (Berkeley) 92/06/15
  1173. X
  1174. X------------------------------------------------------------------------------*/
  1175. X
  1176. Xvoid set_profile(void);
  1177. Xvoid set_defaults(void);
  1178. Xvoid set_option(register char *);
  1179. Xvoid parsefont(register struct fstate *, char *);
  1180. Xvoid writefdef(struct fstate *, int);
  1181. Xvoid fill_buffer(void);
  1182. Xvoid parse(int);
  1183. Xvoid dump_line(void);
  1184. Xint lexi(void);
  1185. Xvoid diag(int, char *,...);
  1186. Xchar *chfont(struct fstate *, struct fstate *, char *);
  1187. Xvoid pr_comment(void);
  1188. Xint compute_label_target(void);
  1189. Xint compute_code_target(void);
  1190. Xint count_spaces(int, char *);
  1191. Xvoid addkey(char *, int);
  1192. END_OF_FILE
  1193.   if test 752 -ne `wc -c <'proto.h'`; then
  1194.     echo shar: \"'proto.h'\" unpacked with wrong size!
  1195.   fi
  1196.   # end of 'proto.h'
  1197. fi
  1198. if test -f 'typedefs.os2' -a "${1}" != "-c" ; then 
  1199.   echo shar: Will not clobber existing file \"'typedefs.os2'\"
  1200. else
  1201.   echo shar: Extracting \"'typedefs.os2'\" \(2646 characters\)
  1202.   sed "s/^X//" >'typedefs.os2' <<'END_OF_FILE'
  1203. X-TDCBINFO
  1204. X-TPDCBINFO
  1205. X-TTRACKLAYOUT
  1206. X-TPTRACKLAYOUT
  1207. X-TBIOSPARAMETERBLOCK
  1208. X-TPBIOSPARAMETERBLOCK
  1209. X-TSCREENGROUP
  1210. X-TPSCREENGROUP
  1211. X-TFRAME
  1212. X-TPFRAME
  1213. X-TKBDTYPE
  1214. X-TPKBDTYPE
  1215. X-TLINECONTROL
  1216. X-TPLINECONTROL
  1217. X-TMODEMSTATUS
  1218. X-TPMODEMSTATUS
  1219. X-TTRACKFORMAT
  1220. X-TPTRACKFORMAT
  1221. X-TRXQUEUE
  1222. X-TPRXQUEUE
  1223. X-TDEVICEPARAMETERBLOCK
  1224. X-TPDEVICEPARAMETERBLOCK
  1225. X-TPTRDRAWFUNCTION
  1226. X-TPPTRDRAWFUNCTION
  1227. X-TPTRDRAWADDRESS
  1228. X-TPPTRDRAWADDRESS
  1229. X-TSHIFTSTATE
  1230. X-TPSHIFTSTATE
  1231. X-THOTKEY
  1232. X-TPHOTKEY
  1233. X-TMONITORPOSITION
  1234. X-TPMONITORPOSITION
  1235. X-TRATEDELAY
  1236. X-TPRATEDELAY
  1237. X-TCODEPAGEINFO
  1238. X-TPCODEPAGEINFO
  1239. X-TCPID
  1240. X-TPCPID
  1241. X-TLDTADDRINFO
  1242. X-TPLDTADDRINFO
  1243. X-TPTRDRAWDATA
  1244. X-TPPTRDRAWDATA
  1245. X-TFNTHREAD
  1246. X-TPFNTHREAD
  1247. X-TRESULTCODES
  1248. X-TPRESULTCODES
  1249. X-TFNEXITLIST
  1250. X-TPFNEXITLIST
  1251. X-TEASIZEBUF
  1252. X-TPEASIZEBUF
  1253. X-TFSQBUFFER
  1254. X-TPFSQBUFFER
  1255. X-TFSQBUFFER2
  1256. X-TPFSQBUFFER2
  1257. X-TSPOOLATTACH
  1258. X-TPSPOOLATTACH
  1259. X-TFTIME
  1260. X-TPFTIME
  1261. X-TFDATE
  1262. X-TPFDATE
  1263. X-TVOLUMELABEL
  1264. X-TPVOLUMELABEL
  1265. X-TFSINFO
  1266. X-TPFSINFO
  1267. X-TFILELOCK
  1268. X-TPFILELOCK
  1269. X-THFILE
  1270. X-TPHFILE
  1271. X-THEV
  1272. X-TPHEV
  1273. X-TFILEFINDBUF
  1274. X-TPFILEFINDBUF
  1275. X-TFILEFINDBUF2
  1276. X-TPFILEFINDBUF2
  1277. X-TFILEFINDBUF3
  1278. X-TPFILEFINDBUF3
  1279. X-TFILEFINDBUF4
  1280. X-TPFILEFINDBUF4
  1281. X-TGEA
  1282. X-TPGEA
  1283. X-TGEALIST
  1284. X-TPGEALIST
  1285. X-TFEA
  1286. X-TPFEA
  1287. X-TFEALIST
  1288. X-TPFEALIST
  1289. X-TEAOP
  1290. X-TPEAOP
  1291. X-TFEA2
  1292. X-TPFEA2
  1293. X-TFEA2LIST
  1294. X-TPFEA2LIST
  1295. X-TGEA2
  1296. X-TPGEA2
  1297. X-TGEA2LIST
  1298. X-TPGEA2LIST
  1299. X-TEAOP2
  1300. X-TPEAOP2
  1301. X-TFILESTATUS
  1302. X-TPFILESTATUS
  1303. X-TFILESTATUS2
  1304. X-TPFILESTATUS2
  1305. X-TFILESTATUS3
  1306. X-TPFILESTATUS3
  1307. X-TFILESTATUS4
  1308. X-TPFILESTATUS4
  1309. X-TFSALLOCATE
  1310. X-TPFSALLOCATE
  1311. X-THDIR
  1312. X-TPHDIR
  1313. X-TDENA1
  1314. X-TPDENA1
  1315. X-TDENA2
  1316. X-TPDENA2
  1317. X-THSEM
  1318. X-TPHSEM
  1319. X-TSEMRECORD
  1320. X-TPSEMRECORD
  1321. X-THEV
  1322. X-TPHEV
  1323. X-THMTX
  1324. X-TPHMTX
  1325. X-THMUX
  1326. X-TPHMUX
  1327. X-TDATETIME
  1328. X-TPDATETIME
  1329. X-THTIMER
  1330. X-TPHTIMER
  1331. X-TCOUNTRYCODE
  1332. X-TPCOUNTRYCODE
  1333. X-TCOUNTRYINFO
  1334. X-TPCOUNTRYINF
  1335. X-THQUEUE
  1336. X-TPHQUEUE
  1337. X-TREQUESTDATA
  1338. X-TPREQUESTDATA
  1339. X-TSTARTDATA
  1340. X-TPSTARTDATA
  1341. X-TSTATUSDATA
  1342. X-TPSTATUSDATA
  1343. X-THPIPE
  1344. X-TPHPIPE
  1345. X-TAVAILDATA
  1346. X-TPAVAILDATA
  1347. X-TPIPEINFO
  1348. X-TPPIPEINFO
  1349. X-TPIPESEMSTATE
  1350. X-TPPIPESEMSTATE
  1351. X-THVDD
  1352. X-TPHVDD
  1353. X-THKBD
  1354. X-TPHKBD
  1355. X-TKBDKEYINFO
  1356. X-TPKBDKEYINFO
  1357. X-TSTRINGINBUF
  1358. X-TPSTRINGINBUF
  1359. X-TKBDINFO
  1360. X-TPKBDINFO
  1361. X-TKBDHWID
  1362. X-TPKBDHWID
  1363. X-TKBDTRANS
  1364. X-TPKBDTRANS
  1365. X-THVIO
  1366. X-TPHVIO
  1367. X-TVIOCURSORINFO
  1368. X-TPVIOCURSORINFO
  1369. X-TVIOMODEINFO
  1370. X-TPVIOMODEINFO
  1371. X-TVIOPHYSBUF
  1372. X-TPVIOPHYSBUF
  1373. X-TVIOCONFIGINFO
  1374. X-TPVIOCONFIGINFO
  1375. X-TVIOPALSTATE
  1376. X-TPVIOPALSTATE
  1377. X-TVIOOVERSCAN
  1378. X-TPVIOOVERSCAN
  1379. X-TVIOINTENSITY
  1380. X-TPVIOINTENSITY
  1381. X-TVIOCOLORREG
  1382. X-TPVIOCOLORREG
  1383. X-TVIOSETULINELOC
  1384. X-TPVIOSETULINELOC
  1385. X-TVIOSETTARGET
  1386. X-TPVIOSETTARGET
  1387. X-THMOU
  1388. X-TPHMOU
  1389. X-TPTRLOC
  1390. X-TPPTRLOC
  1391. X-TPTRSHAPE
  1392. X-TPPTRSHAPE
  1393. X-TMOUEVENTINFO
  1394. X-TPMOUEVENTINFO
  1395. X-TMOUQUEINFO
  1396. X-TPMOUQUEINFO
  1397. X-TSCALEFACT
  1398. X-TPSCALEFACT
  1399. X-TTHRESHOLD
  1400. X-TPTHRESHOLD
  1401. X-TTIB2
  1402. X-TPTIB2
  1403. X-Ttib_t
  1404. X-TTIB
  1405. X-TPTIB
  1406. X-Tpib_t
  1407. X-TPIB
  1408. X-TPPIB
  1409. X-TFPREG
  1410. X-TPFPREG
  1411. X-TCONTEXTRECORD
  1412. X-TPCONTEXTRECORD
  1413. X-TEXCEPTIONREPORTRECORD
  1414. X-TPEXCEPTIONREPORTRECORD
  1415. X-TERR
  1416. X-TEXCEPTIONREGISTRATIONRECORD
  1417. X-TPEXCEPTIONREGISTRATIONRECORD
  1418. X
  1419. END_OF_FILE
  1420.   if test 2646 -ne `wc -c <'typedefs.os2'`; then
  1421.     echo shar: \"'typedefs.os2'\" unpacked with wrong size!
  1422.   fi
  1423.   # end of 'typedefs.os2'
  1424. fi
  1425. echo shar: End of archive 4 \(of 4\).
  1426. cp /dev/null ark4isdone
  1427. MISSING=""
  1428. for I in 1 2 3 4 ; do
  1429.     if test ! -f ark${I}isdone ; then
  1430.     MISSING="${MISSING} ${I}"
  1431.     fi
  1432. done
  1433. if test "${MISSING}" = "" ; then
  1434.     echo You have unpacked all 4 archives.
  1435.     rm -f ark[1-9]isdone
  1436. else
  1437.     echo You still must unpack the following archives:
  1438.     echo "        " ${MISSING}
  1439. fi
  1440. exit 0
  1441. exit 0 # Just in case...
  1442.