  C-C++ Beautifier HOW-TO

  Al Dev (Alavoor Vasudevan)        alavoor@yahoo.com
  v7.0, 5 Sep 2000
  ȣguru2k@kldp.org <mailto:guru2k@kldp.org>

    C/C++ α׷ ȭ ϴ (Ƹ)  ̴.
  ׷  C/C++ α׷ ڵ ǥ  б  Ȯ ̴.
      ü   ִ - , MS DOS,
  Windows 95/NT, OS/2, IBM OSes, Unix like ֶ󸮽  ǳ, HPUX,
  AIX, SCO, Sinix, BSD, SCO, Ÿ.. ׸ ׿ "C" Ϸ Ǵ
   ü (̰  ༺   ü ǹѴ!).
  ______________________________________________________________________

  

  1. Ұ
  2.   Ƹ ϴ α׷   ִ°??!!
  3. ٸ   Ƹ ϴ α׷
  4.  ũƮ
  5.  URL
  6.   ٸ 
  7. Copyright

  ______________________________________________________________________

  1.  Ұ

  C/C++ ̳ ٸ  ǥ ڵ α׷ α׷ӿ  
  б /ϱ   ؼ ʼ̴.   ޼ϱ
   C/C++ Ƹ ϴ (ȭϴ )  ִ. ڵ带 ȭ ϴ
  (Ƹ) 2ϴ  α׷  Ų!!

  /н "indent"  "cb"  Ҹ  ִ. "man indent"
   "man cb"  ض. indent cb ۾  "C" α׷ 
  ̴. "C++" α׷ ؼ "bcpp"  ϶. ؿ ִ 
  Ƹ ϴ α׷ ٿε ϶.

  o  C++ : BCPP Ʈ <http://dickey.his.com/bcpp/bcpp.html> Ȥ
     <http://www.clark.net/pub/dickey> ̴.

  o  C++ : BCPP ftp Ʈ <ftp://dickey.his.com/bcpp/bcpp.tar.gz>
     ̴.

  o  C++ :  <http://www.consultix-inc.com/c++b.html>

  o  C :  <http://www.chips.navy.mil/oasys/c/>

  o  C++ :  <http://www.semdesigns.com/Products/DMS/DMSToolkit.html>

      C++ α׷ ȭ ϱ ؼ BCPP  ۵ ߵǾ.
      ٸ  Ȯϱ⸦  𸣰    
      .

  BCPP steve@alpha.ocbbs.gen.nz  ִ Steven De Toni 
  .

  2.    Ƹ ϴ α׷   ִ°??!!

   Ƹ ϴ α׷ ϰ ŷϰ ϴ  
  ʿϴٰ 100% Ѵ.    ̴. Ƹ ϴ
  α׷ "Ǹϴٰ ϰ" Ȯϴٰ ޾Ƶ̰ Ϸ 
  κп   ̴.
  BCPP Ƹ ϴ α׷  ϱ ؼ, indent
  Ȥ cb  Է¹ ҽڵ带 ȭ  س  ʴ´,
   " α׷"  ũƮ ϰų   
   ִ -

  Ϸ ̿ؼ  Է¹ ҽ ڵ  Ʈ ڵ带
  ϶ -

  ______________________________________________________________________
    g++ -c myprogram.cpp
  ______________________________________________________________________

  ⼭ g++  GNU C++ Ϸ̴. ̰ myprogram.o  Ʈ
    ̴.

    Ѷ -

  ______________________________________________________________________
     mv myprogram.o myprogram_orig.o
  ______________________________________________________________________

  bcpp Ѷ -

  ______________________________________________________________________
     bcpp myprogram.cpp
  ______________________________________________________________________

    ȭ  α׷  myprogram.cpp ̰
    myprogram.cpp.orig  ̴.    ض
  -

  ______________________________________________________________________
     g++ -c myprogram.cpp
  ______________________________________________________________________

   ΰ Ʈ  ϱ ؼ н "diff" 
  ض -

  ______________________________________________________________________
     diff myprogram.o myprogram_orig.o
  ______________________________________________________________________

        ̴. bcpp Ϻϰ ۾Ѵٴ  
  ߴ. DOS Windows 95   ο Cygnus
  <http://www.cygnus.com>  Cygwin  ϱ  ̴.

    Ϸ  Ʈ  ſ   
   ִ.   -

  ______________________________________________________________________
      g++ -S myprogram.cpp
  ______________________________________________________________________

  ̰ myprogram.s .  Ϸ -

  ______________________________________________________________________
      diff myprogram.s myprogram_orig.s
  ______________________________________________________________________

      ҽ ڵ ջ ʰ bcpp  ùٸ
  ȭ ۾ ϰ  ڵ忡  ε  ̳
  ظ  ʴ´ٴ  100% Ѵ.   'bcpp' 
  Ƹ ϴ α׷  Ư ϰ ϰ  ̴.

   ΰ  ׻  bcpp, indent Ȥ cb Ƹ ϴ
  α׷ ϵ ϰ õѴ.

  3.  ٸ   Ƹ ϴ α׷

  HTML, SQL, Java, Perl, Fortran  ٸ   Ƹ ϴ
  α׷  ؼ Ʒ Ʈ 湮ض.

  o  HTML :  <http://www.digital-mines.com/htb/>

  o  HTML :
     <http://www.datacomm.ch/mwoog/software/perl/beautifier.html>

  o  HTML :  <http://www.watson-net.com/free/perl/s_fhtml.asp>

  o  SQL :  <http://www.netbula.com/products/sqlb>

  o  Java, SQL, HTML, C++ :
     <http://www.semdesigns.com/Products/DMS/DMSToolkit.html>

  o  Java :  <http://home.wtal.de/software-
     solutions/jindent/frameset.html>

  o  Java JPretty :  <http://www.mmsindia.com/index.html>

  o  Perl :  <http://www.consultix-inc.com/www.consultix-
     inc.com/talk.htm>

  o  Perl :  <http://www.consultix-inc.com/www.consultix-
     inc.com/perl_beautifier.html>

  o  Fortran beautifier :
     <http://www.aeem.iastate.edu/Fortran/tools.html>

  o  C++ : BCPP site is at
     <http://www.clark.net/pub/dickey/bcpp/bcpp.html>

  o  C++ :  <http://www.consultix-inc.com/www.consultix-
     inc.com/c++b.html>

  o  C :  <http://www.chips.navy.mil/oasys/c/>

  o  Ƹ ϴ α׷ 鼭 :  <http://www.consultix-
     inc.com/www.consultix-inc.com/talk.htm>

  HTML Ͽ ϱ  ڵ ̼  -

  o  html ̼ (C,C++,Java) :
     <http://www.perlstudio.de/cbindex.html>

       <http://www.yahoo.com> Ȥ  <http://www.lycos.com> 
     ˻ "beautfier"̶ Ű ãƺ.

  4.   ũƮ

    Ƹ ϴ α׷ ϱ  ܼ ũƮ̴.
   'contrib' õҿ ִ "pdksh*.rpm"  ʿϴ.  
  'ؽƮ' ϰ a+rx ض.  ޷   ũƮ ٽ 
   ־  Windows 95/NT Ȥ MSDOS  װ   ִ.
  bcpp, cb Ȥ indent  Ʈ PRGM  ض.

  ______________________________________________________________________
  #!/bin/ksh

  # Verification program to check C++ Beautifiers 'bcpp', 'indent' or cb
  ############################################################
  # Copyright
  # The copyright policy is GNU/GPL.
  # Author: Al Dev (Alavoor Vasudevan) alavoor@yahoo.com
  ############################################################

  check_beautify_now()
  {
          # Remove all the temp files....
          \rm -f ${TMP_FILE}
          \rm -f ${TMP_CPPFILE}*.*

          FNAME=$1
          if [ ! -f ${FNAME} ]; then
                  print "\nError: The file ${FNAME} does not exist!!. Aborting now ...."
                  exit
          fi
          \cp  -f ${FNAME} ${TMP_CPPFILE}.cpp
          ${COMPILER} -c ${TMP_CPPFILE}.cpp
          if [ ! -f ${TMP_CPPFILE}.o ]; then
                  print "Fatal Error: Failed to compile ${FNAME}. Aborting now... "
                  exit
          fi
          \mv -f ${TMP_CPPFILE}.o ${TMP_CPPFILE}_orig.o

          aa=`basename $PRGM`
          print "\nRunning, verifying $aa on ${FNAME}"
          ${PRGM} ${TMP_CPPFILE}.cpp
          ${COMPILER} -c ${TMP_CPPFILE}.cpp
          \rm -f $TMP_FILE
          diff ${TMP_CPPFILE}.o ${TMP_CPPFILE}_orig.o 1> $TMP_FILE 2>> $TMP_FILE
          result=""
          result=`wc -c $TMP_FILE | awk '{print $1}' `
          if [ "$result" = "0" ]; then
                  print "Success!! Beautifier $aa is working properly!!\n"
          else
                  print "Fatal Error: Something wrong!! Beautifier is not working!!"
                  exit
          fi
  #       ${COMPILER} -S ${TMP_CPPFILE}.cpp
  #       diff ${TMP_CPPFILE}.s ${TMP_CPPFILE}_orig.s

          # Remove all the temp files....
          \rm -f ${TMP_FILE}
          \rm -f ${TMP_CPPFILE}*.*
  }

  ########## Main of program begins here ##################3
  #PRGM=/usr/bin/bcpp
  #PRGM=/usr/bin/cb
  PRGM=/usr/bin/indent
  COMPILER=/usr/bin/g++

  TMP_FILE=beautify.tmp
  TMP_CPPFILE=beautify-tmp_cppfile

  print -n "Enter the C++ file name <default is *.cpp> : "
  read ans
  if [ "$ans" = "" -o "$ans" = " " ]; then
          ans="ALL"
  else
          FILENAME=$ans
  fi

  # Remove all the temp files....
  \rm -f ${TMP_FILE}
  \rm -f ${TMP_CPPFILE}*.*

  if [ "$ans" != "ALL" ]; then
          check_beautify_now ${FILENAME}
  else
          ls *.cpp |
          while read FILENAME
          do
                  check_beautify_now ${FILENAME}
          done
  fi
  ______________________________________________________________________

  5.   URL

  Ʒ ִ C, C++  Ʈ 湮϶ -

  o  C++, C  Vim ÷ ؽƮ 
     <http://metalab.unc.edu/LDP/HOWTO/Vim-HOWTO.html>

  o  C++ Programming HOWTO
     <http://metalab.unc.edu/LDP/HOWTO/C++Programming-HOWTO.html>

  o  CVS HOWTO for C++ programs <http://metalab.unc.edu/LDP/HOWTO/CVS-
     HOWTO.html>

  o  Linux goodies  Ʈ  <http://www.aldev.8m.com>

  o  Linux goodies ̷ Ʈ  <http://aldev.webjump.com>

  6.    ٸ 

    11 ٸ  ǵȴ. ڼ ϸ - DVI,
  Postscript, Latex, Adobe Acrobat PDF, LyX, GNU-info, HTML, RTF(Rich
  Text Format), Plain-text, Unix man pages and SGML.

  o  HTML, DVI, Postscript SGMl   Ʈ   ִ
     - <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO/other-formats/>

  o  ؽƮ   Ʈ   ִ -
     <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO>

  o  , Ͼ, ξ, ߱, Ϻ  ٸ  
       Ʈ   ִ.
     <ftp://sunsite.unc.edu/pub/Linux/docs/HOWTO> ٸ  ϱ
        ȯϴ ̴.

        Ʈ   ִ "SGML-Tools"  Ἥ
     .  <http://www.sgmltools.org>    Ἥ
     ҽ     ִ.

  o  sgml2html C-C++Beautifier-HOWTO.sgml     (html  )

  o  sgml2rtf  C-C++Beautifier-HOWTO.sgml     (RTF  )

  o  sgml2latex C-C++Beautifier-HOWTO.sgml    (latex  )

  LaTeX  PDF Ϸ sgml2latex(׸ dvips)  Postscript
    Acrobet distill (  <http://www.adobe.com> ) 
  ɾ ؼ  ų  ִ.

  ______________________________________________________________________
  bash$ man sgml2latex
  bash$ sgml2latex filename.sgml
  bash$ man dvips
  bash$ dvips -o filename.ps filename.dvi
  bash$ distill filename.ps
  bash$ man ghostscript
  bash$ man ps2pdf
  bash$ ps2pdf input.ps output.pdf
  bash$ acroread output.pdf &
  ______________________________________________________________________

  Ȥ Ghostscript ps2pdf ɾ   ִ. ps2pdf Adobe Acro
  bat Distiller      Ѵ: PostScript 
  Portable Document Format(PDF) Ϸ Ų. ps2pdf pdfwrite
  Ҹ Ư " ġ" 󳻴 Ghostscript ϴ ſ
   ɾ ũƮ (ġ ) ̴. ps2pdf  Ϸ,
  pdfwrite ġ Ghostscript  Ǿ  makefileȿ ԵǾ
  ־ Ѵ.  Ghostscript ġ ׸ ִ  .

    ⿡ ִ -

  o  <http://sunsite.unc.edu/LDP/HOWTO/C-C++Beautifier-HOWTO.html>

    ̷ Ʈ   ã  ִ -

  o  <http://www.caldera.com/LDP/HOWTO/C-C++Beautifier-HOWTO.html>

  o  <http://www.WGS.com/LDP/HOWTO/C-C++Beautifier-HOWTO.html>

  o  <http://www.cc.gatech.edu/linux/LDP/HOWTO/C-C++Beautifier-
     HOWTO.html>

  o  <http://www.redhat.com/linux-info/ldp/HOWTO/C-C++Beautifier-
     HOWTO.html>

  o  ٸ  (Ʈũ ּ) ִ¹̷ Ʈ
     <http://sunsite.unc.edu/LDP/hmirrors.html>  /LDP/HOWTO/C-
     C++Beautifier-HOWTO.html .

  dvi    ؼ, xdvi α׷  Ѵ. xdvi
  α׷ ControlPanel | Applications | Publishing | TeX ޴
  ư ã  ִ tetex-xdvi*.rpm Ű   ִ.
  dvi  б ؼ  ض -

               xdvi -geometry 80x90 howto.dvi
               man xdvi

  ׸ 콺 â ũ⸦ ٲ. xdvi  .  Page Up,
  Page Down keys  ȭǥ Ű ,  , Ʒ, ,
   ,   Ÿ ؼ f, d, u, c, l, r, p, n 
  Ű   ִ.   ޴  'x' .

   ƮũƮ  'gv' (ghostview)  ƮũƮ
  α׷ ghostscript.rpm Ű Ȥ   gv α׷
  ControlPanel | Applications | Graphics ޴ ư ִ gv*.rpm
  Ű α׷ Ἥ   ִ. gv α׷ ƮũƮ
    ģϴ. ƮũƮ gv  ٸ OS/2, Windows 95
  ׸ NT  ٸ ÷ ̿ ϴ.

  o  Windows 95, OS/2 ׸ ٸ ü Ghostscript 
     Ʈ   ִ.  <http://www.cs.wisc.edu/~ghost>

  postscript   ؼ  ɾ ϶ -

                       gv howto.ps
                       ghostscript howto.ps

   Netscape Navigator, Microsoft Internet explorer, Redhat Baron
  Web browser Ȥ ٸ   Ἥ HTML    
  ִ.

   latex "X-Windows"  պκ LyX Ἥ LyX ؼ
  latex   ִ.

  7.  Copyright

  Copyright policy is GNU/GPL as per LDP (Linux Documentation project).
  LDP is a GNU/GPL project.  Additional restrictions are - you must
  retain the author's name, email address and this copyright notice on
  all the copies. If you make any changes or additions to this document
  then you should intimate all the authors of this document.

