  C-C++ Beautifier HOW-TO
  Al Dev (Alavoor Vasudevan)        alavoor@yahoo.com
  v3.0, 21 April 2000

   : ȣ <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. ۱



  ______________________________________________________________________

  1.  Ұ

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

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

    C++ : BCPP Ʈ 
     <http://dickey.his.com/bcpp/bcpp.html>

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

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

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

  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  ٸ   Ƹ ϴ
  α׷  ؼ Ʒ Ʈ 湮ض.

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

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

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

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

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

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

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

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

    C++ : BCPP site is at
     <http://dickey.his.com/bcpp/bcpp.html>

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

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


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

  HTML Ͽ ϱ  ڵ ̼  -

    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++  Ʈ 湮϶ -

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

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

    C++ α׷ CVS HOWTO  <http://metalab.unc.edu/LDP/HOWTO/CVS-
     HOWTO.html>

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

    Linux goodies ̷ Ʈ  <http://www.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.

    HTML tar  ϳ  Ͽ    ִ,
     DVI, Postscript Ȥ SGML  -
     <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/other-formats/> or
     <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO/other-formats/>

    ؽƮ :
     <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO> or
     <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO>

    , Ͼ, ξ, ߱, Ϻ  ٸ  
     
     <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO> Ȥ
     <ftp://metalab.unc.edu/pub/Linux/docs/HOWTO> ٸ  
         ȯѴ.

       "SGML tool" ̶ Ҹ  Ͽ .
     <http://www.xs4all.nl/~cg/sgmltools/> κ   ְ
        Ἥ ҽ     ִ.

    sgml2html C-C++Beautifier-howto.sgml     (html  Ϸ)

    sgml2rtf  C-C++Beautifier-howto.sgml     (RTF  Ϸ)


    sgml2latex C-C++Beautifier-howto.sgml    (latex  Ϸ)

    ⿡ ִ -

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

   ٸ ̷ Ʈ   ã  ִ -

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

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

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

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

    ٸ  (Ʈũ ּ) ִ¹̷ Ʈ
     <http://metalab.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
               ׸ 콺 â ũ⸦ ٲ. 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 
  ٸ ÷ ̿ ϴ.


               ƮũƮ  б ؼ´  ϶ -
                       gv howto.ps

               ƮũƮ  -
                       ghostscript howto.ps



    Windows95, OS/2 ׸  ü ƮũƮ 
     <http://www.cs.wisc.edu/~ghost>

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

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

  7.  ۱

  ۱ LDP(Linux Documentation project)  GNU/GPL̴.
  LDP GNU/GPL Ʈ̴. Ư  -   ̸, ̸
  ּ ׸  纻 ۱ ؾ߸ Ѵ.  ٸ ٲٰų
    ÷     ڿ ģؾ Ѵ.