home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / INDENTSR.ZIP / README < prev   
Text File  |  1992-08-27  |  6KB  |  156 lines

  1. ---------------------------------------------------------------------
  2.  
  3. Indent is a C/C++ program formatter.  It reformats the C/C++ program
  4. in the input-file according to a long list of command line switches.
  5.  
  6. The original indent (part of the Berkeley Software Distribution) was
  7. only for C programs.  It has since been modified to understand C++
  8. syntax as well.
  9.  
  10. ---------------------------------------------------------------------
  11.  
  12.             A quick guide to indent
  13.         (for impatient users of OS/2 or MSDOS)
  14.  
  15. Assuming you have managed to unpack the distribution sources and have
  16. compiled indent.exe:-
  17.  
  18. 1. Set up an environment variable called HOME pointing at some directory
  19.    where you keep useful things.  Copy indent.pro into that directory.
  20.  
  21. 2. If you use a brain-damaged editor which doesn't allow tabs to be set
  22.    at any interval other than 8 columns, either change the line in
  23.    indent.pro which says
  24.     -tabs 4
  25.    or simply remove it altogether.
  26.  
  27. 3. Copy indent.exe to some directory on your PATH.
  28.  
  29. 4. Change directory to where your messy C or C++ programs reside.
  30.  
  31. 5. To clean up all the programs issue the command:
  32.     for %f in (*.c *.cpp) do indent %f
  33.  
  34. ---------------------------------------------------------------------
  35.  
  36.              An even quicker guide to indent
  37.         (for impatient users of BSD-flavoured UNIX)
  38.  
  39. Read the guide for OS/2-MSDOS and make the following changes:
  40.  
  41. 1. Copy indent.pro into your home directory, calling it .indent.pro
  42.  
  43. 5. Use a loop syntax appropriate for your shell.
  44.  
  45. ---------------------------------------------------------------------
  46.  
  47.                       OS/2 implementor's note
  48.                       -----------------------
  49.  
  50. There seems to have been three streams of development for this program.
  51.  
  52. The original indent was ported to MSDOS by Bruce Mallett and various fixes
  53. were done by Bruce Mallett and James Thompson.  James Thompson also imple-
  54. mented the handling of tabs at spacings other than 8 (surely a most worth-
  55. while enhancement; who programs in C with tabs set at 8 anyway?)
  56.  
  57. While all this good stuff was going on, other (unnamed) people upgraded the
  58. original program to handle C++ syntax as well as ordinary C and apparently
  59. fixed a few minor annoyances which were extant in the version from which
  60. the MSDOS implementation was derived.
  61.  
  62. Then of course, the GNU project people have been doing things with sources
  63. obviously derived from the BSD version.  I have not looked at the GNU
  64. version of indent.
  65.  
  66. I started with the BSD C++ formatter sources and modified them for
  67. compilation with Microsoft C386 under OS/2 2.0.  That gave me a working
  68. baseline version to which I made the following modifications:
  69.  
  70. 1  Changed some of the file names to allow compilation with Microsoft C
  71.    version 6.00A which objects to files whose names do not conform to
  72.    MSDOS's 8.3 format.
  73.  
  74. 2  Built new makefiles for OS/2 2.0 and for OS/2 1.X.  (The MSDOS version
  75.    is created by post-processing the OS/2 1.X version.)
  76.  
  77.    Note that when you use Makefile.1x you'll see some warning messages
  78.    concerning the truncation of variable names.  You may safely ignore
  79.    them.  The messages do not appear when compiling the 32-bit version.
  80.  
  81. 2  Added James Thompson's tab stuff.
  82.  
  83. 3  Fixed a bug which was causing //-style comments to be followed by an
  84.    extra newline or an extra space depending on context.
  85.  
  86. 4  Corrected the stack overflow problem in the OS/2 1.x and MSDOS versions.
  87.    (This seems to have been independently discovered and fixed twice
  88.    previously but the sources contained no trace of the fix.)
  89.  
  90. 5  Patched the manual source to reflect the new -tabs option and generated
  91.    a human-readable version.
  92.  
  93. Finally, I put the sources through the indenter to clean up the mess.
  94.  
  95. More recently still, I built the program using the IBM C Set/2 tools after
  96. generating yet another Makefile.  I also fixed a bug notified by Steve
  97. Comen which was causing overlength // comments to be split incorrectly.
  98.  
  99. Now, if I have done the job properly, the current source should combine both
  100. the BSD development streams.  Furthermore, it should compile under OS/2 1.x
  101. for OS/2 and MSDOS, under OS/2 2.0 for the 32-bit 'flat' model using either
  102. the Microsoft C386 compiler or the IBM C Set/2 compiler and on the original
  103. BSD UNIX platform.
  104.  
  105. I am indebted to Steve Comen and his colleagues for help with testing and
  106. verifying the BSD compatibility and for several patches.
  107.  
  108. Now all that remains to be done is to incorporate the nicer features of this
  109. version into the GNU one.  Any volunteers?
  110.  
  111. Jon Saxton
  112. April 1992
  113.  
  114. -------------------------------------------------------------------------
  115.  
  116. Manifest
  117.  
  118.     args.c        \
  119.     comment.c     \
  120.     indent.c      \_    Program source files
  121.     io.c          /
  122.     lexi.c         /
  123.     parse.c        /
  124.  
  125.     codes.h        \
  126.     globals.h     >-    Header files
  127.     proto.h        /
  128.  
  129.     indent.1        Manual source
  130.  
  131.     indent.man        Manual in human-readable form
  132.  
  133.     indent.def        Used only when compiling
  134.                 under OS/2 for OS/2 or MSDOS
  135.  
  136.     indent.pro        A sample profile (the one used to format
  137.                 these sources).  Rename to .indent.pro
  138.                 for use with BSD UNIX.
  139.  
  140.     Makefile.1x        Makefile for compiling under OS/2 1.x.
  141.                 Generates a bound 16-bit executable which
  142.                 will run under OS/2 or MSDOS.
  143.  
  144.     Makefile.20        Makefile for compiling under OS/2 2.0 using
  145.                 the Microsoft C386 compiler.  Generates a
  146.                 32-bit executable.
  147.  
  148.     Makefile.cs2        Makefile for compiling under OS/2 2.0 using
  149.                 the IBM C Set/2 compiler.  Generates a 32-
  150.                 bit executable.
  151.  
  152.     Makefile.bsd        Untouched.  This is the original Makefile
  153.                 as distributed with the BSD version.
  154.  
  155.     readme            This file
  156.