From a4a7690c336d4c8a16b3041c86d501ba38226e96 Mon Sep 17 00:00:00 2001 From: nobody Date: Mon, 30 Dec 1996 06:50:29 +0000 Subject: This commit was manufactured by cvs2svn to create branch 'unlabeled-4.1.2'. --- bin/Makefile | 37 - bin/README.html | 148 ---- bin/class2hxxcxx | 80 -- bin/class2hxxcxxsingle | 80 -- bin/class2info | 197 ----- bin/class2info.awk | 1594 ----------------------------------- bin/class2man | 78 -- bin/class2mml | 79 -- bin/class2src | 79 -- bin/classinfo.ps | 868 ------------------- bin/clone.1 | 297 ------- bin/clone.cpp | 955 --------------------- bin/clone.csh | 26 - bin/g++dep | 80 -- bin/hiding.fmt | 20 - bin/html-windex | 33 - bin/info2doc.awk | 2181 ------------------------------------------------ bin/info2doc.fmt | 23 - bin/info2head | 166 ---- bin/info2head.fmt | 23 - bin/info2headsrc | 326 -------- bin/info2man | 169 ---- bin/info2mml | 166 ---- bin/info2src | 133 --- bin/info2src.awk | 630 -------------- bin/man2html | 88 -- bin/man2html1.awk | 139 --- bin/man2html2.awk | 18 - bin/rename-ace.pl | 175 ---- bin/vendor.fmt | 101 --- 30 files changed, 8989 deletions(-) delete mode 100644 bin/Makefile delete mode 100644 bin/README.html delete mode 100755 bin/class2hxxcxx delete mode 100755 bin/class2hxxcxxsingle delete mode 100755 bin/class2info delete mode 100644 bin/class2info.awk delete mode 100755 bin/class2man delete mode 100755 bin/class2mml delete mode 100755 bin/class2src delete mode 100755 bin/classinfo.ps delete mode 100644 bin/clone.1 delete mode 100644 bin/clone.cpp delete mode 100644 bin/clone.csh delete mode 100755 bin/g++dep delete mode 100644 bin/hiding.fmt delete mode 100755 bin/html-windex delete mode 100755 bin/info2doc.awk delete mode 100644 bin/info2doc.fmt delete mode 100755 bin/info2head delete mode 100644 bin/info2head.fmt delete mode 100755 bin/info2headsrc delete mode 100755 bin/info2man delete mode 100755 bin/info2mml delete mode 100755 bin/info2src delete mode 100755 bin/info2src.awk delete mode 100755 bin/man2html delete mode 100644 bin/man2html1.awk delete mode 100644 bin/man2html2.awk delete mode 100755 bin/rename-ace.pl delete mode 100755 bin/vendor.fmt (limited to 'bin') diff --git a/bin/Makefile b/bin/Makefile deleted file mode 100644 index 3125c849be6..00000000000 --- a/bin/Makefile +++ /dev/null @@ -1,37 +0,0 @@ -############################################################################# -# -# Makefile for assignment 1 -# -############################################################################# - -CXX = CC -CFILES = clone.cpp -OFILES = clone.o -DFLAGS = -g -CFLAGS = $(DFLAGS) -I$(WRAPPER_ROOT) - -############################################################################# -# C++ directives - -.SUFFIXES: .cpp -.cpp.o: - $(CXX) $(CFLAGS) -c $< -############################################################################# - -clone: $(OFILES) - $(CXX) $(CFLAGS) -o $@ $(OFILES) - -clean: - -/bin/rm -f *.o *.out *~ core - -realclean: clean - -/bin/rm -fr clone - -depend: - g++dep -f Makefile $(CFILES) -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -clone.o : clone.cpp -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY - diff --git a/bin/README.html b/bin/README.html deleted file mode 100644 index 0e6322f057e..00000000000 --- a/bin/README.html +++ /dev/null @@ -1,148 +0,0 @@ - - - -ACE OSE Tools - - - -
-

Modified Version of the OSE Documentation Tools

- -This directory -contains versions of the freely available OSE -tools modified by Karlheinz Dorn (kdorn@erlh.siemens.de). I (Doug -Schmidt) am grateful to him for contributing his efforts to help -improve ACE. You can obtain these files via the ACE release.

- -The primary goal of the modifications was to create a class.hxx and -class.cxx file (for each class, struct, union included within the -original ACE header file) from the ACE *.h header files by collecting -the comments from that file and feeding them into the newly created -files, but keeping the ACE *.h file untouched.

- -This helps when making product documentation using commercial -documentation tools (e.g., George, -doc++, -etc.) by feeding in these newly created files with a customizable -layout. The modifications should be an upgrade to the original -OSE-tools, but many bug-fixes are also done for the OSE-tool files -(some are listed below).

- -This extensions make it very easy to include new ACE versions into -commercial documentations without doing any painful modifications of -the deltas within a frozen ACE-version or directly within ACE source -files when a new release arises.

- -The following changes were made to the original OSE tools: - -

- -

-

Known Bugs

- -Some bugs inherited from the original OSE-tools are remaining. So the -developer of the *.h files should the following keep in mind: - -- do not write multiline inheritance!

- -INCORRECT:

- -


-  class x :
-        public y
-  {
-  }
-
- -CORRECT:

- -


-  class x : public y
-  {
-  }
-
- -- do not write multiline templates!

- -INCORRECT:

- -


-  template <class t,
-            class>
-  class x 
-  {
-  }
-
- -CORRECT:

- -


-  template <class t, class u>
-  class x 
-  {
-  }
-
- -

-


- -Other documentation tools are available at the following URLs:

- -

- -


-Back to the ACE home page. - - - diff --git a/bin/class2hxxcxx b/bin/class2hxxcxx deleted file mode 100755 index 2254f645d75..00000000000 --- a/bin/class2hxxcxx +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -# ============================================================================= -# -# = DESCRIPTION -# Script to combine class2info and info2head and info2src. -# -# = AUTHOR(S) -# K. Dorn -# -# = COPYRIGHT -# Copyright 1991 OTC LIMITED -# -# ============================================================================= - -OSE_HOST= - -OSE_RELEASE_NAME= -export OSE_RELEASE_NAME - -OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} -export OSE_ROOT - -OSE_VERSION_ROOT=$OSE_ROOT/$OSE_RELEASE_NAME -export OSE_VERSION_ROOT - -BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" -LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/lib"} - -CLASS2INFO="$BINDIR/class2info" -INFO2HEAD="$BINDIR/info2head" -INFO2SRC="$BINDIR/info2src" - -# -# Error. -# -ERROR() -{ - echo "`basename $0`: $1" >&2 - shift - while test $# != "0" - do - echo $1 >&2 - shift - done - exit 1 -} - -# -# Usage message. -# -USAGE() -{ - ERROR "Usage: `basename $0` files" -} - -# -# Check usage. -# -if test "$#" = "0" -then - USAGE -fi - -while test "$#" != "0" -do - $CLASS2INFO $1 - if test "$?" != "0" - then - exit 1 - fi - file=`basename $1` - base="`echo $file | sed -e 's/\..*$//'`" - if test -f "$base.ci" - then - $INFO2SRC $base.ci - $INFO2HEAD $base.ci -# rm -f $base.ci - fi - shift -done diff --git a/bin/class2hxxcxxsingle b/bin/class2hxxcxxsingle deleted file mode 100755 index 94c869cb739..00000000000 --- a/bin/class2hxxcxxsingle +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh -# ============================================================================= -# -# = DESCRIPTION -# Script to combine class2info and info2head and info2src. -# -# = AUTHOR(S) -# K. Dorn -# -# = COPYRIGHT -# Copyright 1991 OTC LIMITED -# -# ============================================================================= - -OSE_HOST= - -OSE_RELEASE_NAME= -export OSE_RELEASE_NAME - -OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} -export OSE_ROOT - -OSE_VERSION_ROOT=$OSE_ROOT/$OSE_RELEASE_NAME -export OSE_VERSION_ROOT - -BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" -LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/lib"} - -CLASS2INFO="$BINDIR/class2info" -INFO2HEADSRC="$BINDIR/info2headsrc" -INFO2SRC="$BINDIR/info2src" - -# -# Error. -# -ERROR() -{ - echo "`basename $0`: $1" >&2 - shift - while test $# != "0" - do - echo $1 >&2 - shift - done - exit 1 -} - -# -# Usage message. -# -USAGE() -{ - ERROR "Usage: `basename $0` files" -} - -# -# Check usage. -# -if test "$#" = "0" -then - USAGE -fi - -while test "$#" != "0" -do - $CLASS2INFO $1 - if test "$?" != "0" - then - exit 1 - fi - file=`basename $1` - base="`echo $file | sed -e 's/\..*$//'`" - if test -f "$base.ci" - then -# $INFO2SRC $base.ci - $INFO2HEADSRC $base.ci -# rm -f $base.ci - fi - shift -done diff --git a/bin/class2info b/bin/class2info deleted file mode 100755 index 752ced3ebce..00000000000 --- a/bin/class2info +++ /dev/null @@ -1,197 +0,0 @@ -#! /bin/sh -# ============================================================================= -# -# = DESCRIPTION -# Converts a C++ class header file into a classinfo description file. -# -# = AUTHOR(S) -# Graham Dumpleton -# K. Dorn -# -# = COPYRIGHT -# Copyright - OTC LIMITED (1991) -# -# ============================================================================= - -OSE_HOST= - -OSE_RELEASE_NAME= -export OSE_RELEASE_NAME - -OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} -export OSE_ROOT - -OSE_VERSION_ROOT=$OSE_ROOT -export OSE_VERSION_ROOT - -BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" -LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/bin"} - -INFO2INFO="$BINDIR/info2info" - -AWK="nawk" - -if test "$AWK" = "nawk" -then - VARG="-v" -fi - - -FILES= -V2= - -trap 'rm -f /tmp/ci.$$; exit' 1 2 3 13 15 - -# -# Error. -# -ERROR() -{ - echo "`basename $0`: $1" >&2 - shift - while test $# != "0" - do - echo $1 >&2 - shift - done - exit 1 -} - -# -# Usage message. -# -USAGE() -{ - ERROR "Usage: `basename $0` file.h ..." -} - -# -# Check usage. -# -if test $# = 0 -then - USAGE -fi - -# -# Parse command line. -# -while test $# != 0 -do - case $1 in -# -v2) -# V2=YES -# shift -# ;; - *.h|*.hh|*.H|*.hxx|*.hpp|*.h++) - FILES="$FILES $1" - shift - ;; - *) - USAGE - ;; - esac -done - -# -# Check usage again. -# -if test -z "$FILES" -then - USAGE -fi - -# -# Check for awk file. -# -CLASS2INFO=$LIBDIR/class2info.awk -HIDINGFMT=$LIBDIR/hiding.fmt - -if test ! -f $HIDINGFMT -then - ERROR "Can't find $HIDINGFMT" -fi - - -if ( test ! -f $CLASS2INFO ) -then - ERROR "Can't find $CLASS2INFO" -fi - - - -VCSA=`$AWK ' -BEGIN { - FS="\n"; RS="" -} -$1 ~ "^CSAHEADER$" { - if ( $2 ~ "on" ) - printf("%s","csaprintheader=on"); - else - printf("%s","csaprintheader="); -}' $HIDINGFMT` - -VPUBL=`$AWK ' -BEGIN { - FS="\n"; RS="" -} -$1 ~ "^PUBLIC$" { - if ( $2 ~ "on" ) - printf("%s","publ=on"); - else - printf("%s","publ="); -}' $HIDINGFMT` - -VPROT=`$AWK ' -BEGIN { - FS="\n"; RS="" -} -$1 ~ "^PROTECTED$" { - if ( $2 ~ "on" ) - printf("%s","prot=on"); - else - printf("%s","prot="); -}' $HIDINGFMT` - -VPRIV=`$AWK ' -BEGIN { - FS="\n"; RS="" -} -$1 ~ "^PRIVATE$" { - if ( $2 ~ "on" ) - printf("%s","priv=on"); - else - printf("%s","priv="); -}' $HIDINGFMT` - -#echo " $VPUBL $VPROT $VPRIV " - - -# -# Parse each file. -# -# $VARG publ=on $VARG prot=off $VARG priv=off \ -for i in $FILES -do - if test ! -f $i - then - ERROR "$i doesn't exist." - fi - FILENAME=`basename $i` - INFOFILE=`echo $FILENAME | sed -e 's/\..*$//'`.ci - rm -f $INFOFILE - if test "$?" != 0 - then - ERROR "Couldn't remove info file $INFOFILE." - fi - expand $i > /tmp/ci.$$ - $AWK \ - -f $CLASS2INFO $VARG filename=$i \ - $VARG $VPUBL $VARG $VPROT $VARG $VPRIV \ - /tmp/ci.$$ > $INFOFILE - rm -f /tmp/ci.$$ -# if test ! -z "$V2" -# then -# $INFO2INFO $INFOFILE -# fi -done diff --git a/bin/class2info.awk b/bin/class2info.awk deleted file mode 100644 index 1810a8f3e0c..00000000000 --- a/bin/class2info.awk +++ /dev/null @@ -1,1594 +0,0 @@ -# ============================================================================= -# -# = DESCRIPTION -# Awk script for converting C++ class header file to classinfo file. -# Requires nawk or gawk. -# comments like /* ... */ with ... goes over multiple lines are not ok -# and will be not printed as comments! -# class xxx -# : public yyyy is not allowed but : class xxx : public yyyy -# -# = AUTHOR(S) -# Graham Dumpleton -# K. Dorn -# -# = COPYRIGHT -# Copyright 1991 OTC LIMITED -# -# ============================================================================= - -BEGIN { - initialised = 0 - accpubl = "on" - accprot = "on" - accpriv = "on" - accpubl = publ - accprot = prot - accpriv = priv - accpubl = "on" - accprot = "off" - accpriv = "off" -} -{ - if ( initialised == 0 ) - { - initialised = 1 - "date" | getline line - printf( "CLASS2INFO\n%s\n%s\n\n", line, filename ) - anonenum = 1 - } - doParse(); - next -} - - - -{ - print "error" | "cat 1>&2" - exit -} - -# -# If a comment starts with '// ==', discard lines until the end of the -# comment or a line of the form '// = NAME' is found. This is special -# case to deal with comment headers in files. e.g: -# -# // ========== ... -# // -# // = LIBRARY -# // ... -# -# lines up to '// = LIBRARY' would be discarded. -# -# /^[\t ]*\/\/[\t ]*==+[\t ]*$/ { -# handleHeader() -# } - -function handleHeader() -{ - getline - while ( \ - ( $0 ~ "^[\t ]*//" ) \ - && \ - ( $0 !~ "^[\t ]*//[\t ]*= [a-zA-Z0-9]+[^<>]*[\t ]*$" ) \ - ) - { - getline - } -} - -# -# Extract labelled comments. These are denoted by '// = NAME', where the word -# NAME is actually replaced by the some identifying label. -# A labelled section is terminated by the end of the comment block, another -# labelled comment, or a comment line of the form '// =='. e.g: -# Note: a label cannot contain the characters '<>', these are identified -# as being special commands and are simply passed through. -# -# // = LIBRARY -# // C++ -# // -# // = VERSION -# // ... -# // -# // ========== ... -# -# the LIBRARY section would be terminated by '// = VERSION', and the VERSION -# section by '// =====...'. -# -# /^[\t ]*\/\/[\t ]*= [a-zA-Z0-9]+[^<>]*[\t ]*$/ { -# handleInfo() -# } - -function handleInfo( label ) -{ - sub( "^[\t ]*//", "", $0 ) - while ( $0 ~ "^[\t ]*= [a-zA-Z0-9]+[^<>]*[\t ]*$" ) - { - match( $0, " [a-zA-Z0-9]+[^<>]*$" ) - label = substr( $0, RSTART, RLENGTH ) - sub( "^[\t ]*", "", label ) - if ( name ~ "^$" ) - printf( "INFO\nGLOBAL\n%s\n", label ) - else if ( hiding ~ "^$" ) - printf( "INFO\nHDR\n%s\n%s\n", label, name ) - else - printf( "INFO\nBODY\n%s\n%s\n%s\n", label, name, hiding ) - $0 = outputComment() - } -} - -function SetCommentClrComment( line, comment) -{ - if ( match( line, "(\/\\*.*\\*\/)?$" ) > 0) - { - comment = substr( line, RSTART, RLENGTH ) - sub( "//.*$", "", line ) - } - else - if ( match( line, "(//.*)?$" ) > 0) - { - comment = substr( line, RSTART, RLENGTH ) - sub( "\/\\*.*$", "", line ) - } -} - - -function check_print_first() -{ - if ( ((hiding == "private") && (accpriv == "on") ) || ((hiding == "public") && (accpubl == "on") ) || ((hiding == "protected") && (accprot == "on") ) ) - pra = 1 - else - { - pra = 0 - $0 = "" - } - return pra -} - -function check_print() -{ - if ( ( type ~ "class" ) && ( hiding ~ "^$" ) ) - { - if (accpriv == "on") - { - pra = 1 - return pra - } - else - { - pra = 0 - $0 = "" - return pra - } - } - else - { - - if ((accpubl == "on") || ( hiding ~ "^$" )) - { - pra = 1 - return pra - } - else - { - pra = 0 - $0 = "" - return pra - } - } - - if ( ((hiding == "private") && (accpriv == "on") ) || ((hiding == "public") && (accpubl == "on") ) || ((hiding == "protected") && (accprot == "on") ) ) - { - pra = 1 - } - else - { - pra = 0 - $0 = "" - } - return pra -} - -# -# transfer a c comment /* ... */ to a C++ // ... comment -# the comment comes in feld and goes back in feld -# - -function Set_c_Comment_to_CPP_Comment( feld) -{ - if ( match( feld, "\/\\*.*\\*\/$" ) > 0) - { -# printf("\n----feldb=|%s|----\n",feld); - sub( "\/\\*", "\/\/", feld ) - sub( "\\*\/", "", feld ) -# printf("\n----felda=|%s|----\n",feld); - } - return feld -} - - - -# -# Gather up unlabelled comments. -# -# /^[\t ]*\/\/.*$/ { -# handleComment() -# } - -function handleComment() -{ - if ( name ~ "^$" ) - printf( "COMMENT\nGLOBAL\n" ) - else if ( hiding ~ "^$" ) - printf( "COMMENT\nHDR\n%s\n", name ) - else - printf( "COMMENT\nBODY\n%s\n%s\n", name, hiding ) - $0 = outputComment( $0 ) -} - -# -# Skip past '#define's. Leave it up to programmers to document important -# definitions with a section. -# -# /^[\t ]*#[\t ]*define/ { -# handleDefine() -# } - -function handleDefine( line ) -{ - if ( $0 ~ ".*\\\\$" ) - { - end = 0 - while ( end == 0 ) - { - getline line - if ( line !~ ".*\\\\$" ) - end = 1 - } - } - # next - $0 = "" -} - -# -# Record name of files which are included. -# Note: Since we do not process '#if's we will get all includes, even if -# some are particular to some systems etc. -# -# /^[\t ]*#[\t ]*include[\t ]*<.+>/ { -# () -# } - -function handleInclude() -{ - match( $0, "<.+>" ) - $0 = substr( $0, RSTART, RLENGTH ) - printf( "INCLUDE\n%s\n\n", $0 ) - # next - $0 = "" -} - -# /^[\t ]*#[\t ]*include[\t ]*".+"/ { -# handleLocalInclude() -# } - -function handleLocalInclude() -{ - match( $0, "\".+\"" ) - $0 = substr( $0, RSTART, RLENGTH ) - printf( "INCLUDE\n%s\n\n", $0 ) - # next - $0 = "" -} - -# -# Skip any other pre-processor directives. -# -# /^[\t ]*#.*$/ { -# handlePreprocessor() -# } - -function handlePreprocessor_alt() -{ - # next - $0 = "" -} - -function handlePreprocessor() -{ - printf( "PREPROC\n%s\n\n", $0 ) - # next - $0 = "" -} - -# -# Trap typedefs. -# -# /^typedef[\t ]+/ { -# handleTypedef() -# } - -function handleTypedef( comment, line ) -{ - line = $0 - while ( line !~ ";[\t ]*(//.*)?$" ) - { - line = uncomment( line ) - getline - sub( "^[\t ]*", "", $0 ) - line = line " " $0 - sub( "\\) \\(", ")(", line ) - } - match( line, "(//.*)?$" ) - comment = substr( line, RSTART, RLENGTH ) - sub( "//.*$", "", line ) - sub( "^[\t ]*typedef[\t ]*", "typedef ", line ) - if ( name ~ "^$" ) - printf( "TYPEDEF\n%s\n%s\n%s\n", "::", "public", line ) - else - printf( "TYPEDEF\n%s\n%s\n%s\n", name, hiding, line ) - $0 = outputComment( comment ) -} - -# -# Trap externs. -# -# /^extern[\t ]+/ { -# handleExtern() -# } - -function handleExtern( lang, comment ) -{ - if ( $0 ~ "\"C\"[\t ]*$" || $0 ~ "\"C\"[\t ]*\{[\t ]*$" ) - { - # Bracketed includes (??). Skip them for now. - while ( $0 !~ "}[\t]*$" && $0 !~ "}[\t ]*;[\t]*$" ) - getline - getline - } - else - { - if ( $0 !~ ";[\t ]*(//.*)?$" ) - $0 = handleArgs( $0 ) - match( $0, "(//.*)?$" ) - comment = substr( $0, RSTART, RLENGTH ) - sub( "//.*$", "", $0 ) - sub( "^extern[\t ]*", "", $0 ) - if ( match( $0, "\"[^\"]*\"" ) != 0 ) - { - lang = substr( $0, RSTART, RLENGTH ) - sub( "^\"[\t ]*", "", lang ) - sub( "[\t ]*\"$", "", lang ) - } - else - lang = "C++" - sub( "\"[^\"]*\"[\t ]*", "", $0 ) - printf( "EXTERN\n%s\n%s\n", lang , $0 ) - $0 = outputComment( comment ) - } -} - -# -# Trap class, struct, union and template definitions. -# Note: handleADT() does the hard work of determining if the particular -# use is in a definition, declaration or other. -# -# /^[\t ]*class/ { -# handleClass() -# } - -function handleClass() -{ - class = 1 - sub( "^[\t ]*class[\t ]+(ACE_[.]*Export[\t ]+)?", "", $0 ) - if ( handleADT( $0 ) == 1 ) - { - if ( topName ~ "^$" ) - printf( "CLASS\n%s\n", name ) - else - printf( "CLASS\n%s::%s\n", topName, name ) - outputSuperClasses( bases ) - bases = "" - } - class = 0 - # next - $0 = "" -} - -# /^[\t ]*enum/ { -# handleEnumCsa() -# } - -function handleEnumCsa() -{ - enum = 1 - sub( "^[\t ]*enum[\t ]+", "", $0 ) - if ( handleADT( $0 ) == 1 ) - { - if ( topName ~ "^$" ) - printf( "ENUM\n%s\n", name ) - else - printf( "ENUM\n%s::%s\n", topName, name ) - bases = "" - } - enum = 0 - # next - $0 = "" -} - -# /^[\t ]*struct/ { -# handleStruct() -# } - -function handleStruct() -{ - struct = 1 - sub( "^[\t ]*struct[\t ]+", "", $0 ) - if ( handleADT( $0 ) == 1 ) - { - if ( topName ~ "^$" ) - printf( "STRUCT\n%s\n", name ) - else - printf( "STRUCT\n%s::%s\n", topName, name ) - outputSuperClasses( bases ) - bases = "" - } - struct = 0 - # next - $0 = "" -} - -# /^[\t ]*union/ { -# handleUnion() -# } - -function handleUnion() -{ - union = 1 - sub( "^[\t ]*union[\t ]+", "", $0 ) - if ( handleADT( $0 ) == 1 ) - { - if ( topName ~ "^$" ) - printf( "UNION\n%s\n", name ) - else - printf( "UNION\n%s::%s\n", topName, name ) - outputSuperClasses( bases ) - bases = "" - } - union = 0 - # next - $0 = "" -} - -# /^[\t ]*template[\t ]*<.+>[\t ]+class/ { -# handleTemplate() -# } - -function handleTemplate() -{ - template = 1 - - match( $0, "^[\t ]*template[\t ]*<.+>[\t ]+(class|struct|union)[\t ]+" ) -# nested template error!!! match( $0, "^template[\t ]*<.+>[\t ]+(class|struct|union)[\t ]+" ) - - line = substr( $0, RSTART, RLENGTH ) - match( line, "[\t ]+(class|struct|union)[\t ]+$" ) - adttype = substr( line, RSTART, RLENGTH ) - sub( "^[\t ]*", "", adttype ) - sub( "[\t ]*$", "", adttype ) - match( line, "<.+>" ) - targs = substr( line, RSTART, RLENGTH ) - sub( "^[\t ]*template[\t ]*<.+>[\t ]+(class|struct|union)[\t ]+", "", $0 ) - if ( handleADT( $0 ) == 1 ) - { -# printf( "TEMPLATE\n%s\n%s\n%s\n", adttype, name, targs ) - if ( topName !~ "^$" ) - printf( "TEMPLATE\n%s\n%s::%s\n%s\n", adttype, topName, name, targs ) - else - printf( "TEMPLATE\n%s\n%s\n%s\n", adttype, name, targs ) - outputSuperClasses( bases ) - bases = "" - } - template = 0 - # next - $0 = "" -} - -# -# Trap enumerated types. -# - -# This handles enums where there is potentially more than one entry on -# a line. We throw away all comments in this case. - -function handleLineEnum() -{ - enum = 1 - sub( "^[\t ]*enum[\t ]*", "", $0 ) - line = $0 - sub( "[\t ]*\{.*", "", line ) - pushLevel() - name = line - if ( name != "" ) - { - if ( topName ~ "^$" ) - printf( "ENUM\n%s\n\n", name ) - else - printf( "ENUM\n%s::%s\n\n", topName, name ) - } - else - { - name = anonenum - anonenum++ - if ( topName ~ "^$" ) - printf( "ANONENUM\n%s\n\n", name ) - else - printf( "ANONENUM\n%s::%s\n\n", topName, name ) - } - line = $0 - sub( "^.*\{[\t ]*", "", line ) - sub( "[\t ]*//.*$", "", line ) - while ( line !~ "}.*" ) - { - getline - line = line $0 - sub( "[\t ]*//.*$", "", line ) - } - # Forget about variables for now. - sub( "[\t ]*}.*", "", line ) - gsub( "[\t ]+", "", line ) - num = split( line, item, "," ) - for ( i=1; i<=num; i++ ) - { - if ( topName ~ "^$" ) - printf( "ENUMITEM\n%s\n%s\n\n", name, item[i] ) - else - printf( "ENUMITEM\n%s::%s\n%s\n\n", topName, name, item[i] ) - } - $0 = "" - popLevel( $0 ) - enum = 0 -} - -# This handles enums which are formatted to preferred style. -# Can collect comments meaningfully in this format. - -function handleEnum() -{ - enum = 1 - sub( "^[\t ]*enum[\t ]*", "", $0 ) - sub( "([\t ]*\{)?[\t ]*$", "", $0 ) - sub( "^[\t ]*", "", $0 ) - pushLevel() - name = $0 - if ( name != "" ) - { - if ( topName ~ "^$" ) - printf( "ENUM\n%s\n\n", name ) - else - printf( "ENUM\n%s::%s\n\n", topName, name ) - } - else - { - name = anonenum - anonenum++ - if ( topName ~ "^$" ) - printf( "ANONENUM\n%s\n\n", name ) - else - printf( "ANONENUM\n%s::%s\n\n", topName, name ) - } - getline - while ( $0 ~ /^[\t ]*\/\/[\t ]*=/ ) - handleInfo() - while ( 1 ) - { - while ( $0 ~ /^[\t ]*$/ || $0 ~ /^[\t ]*\{/ ) - getline - - if ( $0 ~ /,[^\/]*,/ ) - { - line = $0 - sub( "[,\t ]*//.*", " ", line ) - gsub( "[\t ]+", "", line ) - num = split( line, item, "," ) - for ( i=1; i<=num; i++ ) - { - if ( topName ~ "^$" ) - printf( "ENUMITEM\n%s\n%s\n", name, item[i] ) - else - printf( "ENUMITEM\n%s::%s\n%s\n", topName, name, item[i] ) - if ( i != num ) - printf( "\n" ) - } - sub( "^.*//", "//", $0 ) - currentlevel = level - $0 = outputComment( $0 ) -# if ( $0 ~ /^$/ ) - if ( currentlevel != level ) - { - enum = 0 - return - } - } - else if ( $0 ~ /^.*,[\t ]*(\/\/.*)?$/ ) - { - match( $0, ".*,([\t ]*//)?" ) - enumval = substr( $0, RSTART, RLENGTH ) - sub( "[\t ]*,.*$", "", enumval ) - sub( "^[\t ]*", "", enumval ) - if ( topName ~ "^$" ) - printf( "ENUMITEM\n%s\n%s\n", name, enumval ) - else - printf( "ENUMITEM\n%s::%s\n%s\n", topName, name, enumval ) - sub( "^.*//", "//", $0 ) - currentlevel = level - $0 = outputComment( $0 ) -# if ( $0 ~ /^$/ ) - if ( currentlevel != level ) - { - enum = 0 - return - } - } - else if ( $0 ~ /^.*(\/\/.*)?$/ ) - { - match( $0, ".*([\t ]*//)?" ) - enumval = substr( $0, RSTART, RLENGTH ) - sub( "[\t ]*([\t ]*//.*)?$", "", enumval ) - sub( "^[\t ]*", "", enumval ) - if ( topName ~ "^$" ) - printf( "ENUMITEM\n%s\n%s\n", name, enumval ) - else - printf( "ENUMITEM\n%s::%s\n%s\n", topName, name, enumval ) - sub( "^.*//", "//", $0 ) - currentlevel = level - $0 = outputComment( $0 ) -# if ( $0 ~ /^$/ ) - if ( currentlevel != level ) - { - enum = 0 - return - } - $0 = "" - } - else if ( $0 ~ /^[\t ]*}[\t ]*;/ ) - { - # Shouldn't happen, but just in case. - popLevel( $0 ) - enum = 0 - return - } - } - enum = 0 -} - -# -# Trap the end of a abstract data type or enumerated type. -# Note: arrays are going to cause a problem here. e.g: -# -# int foo[] = -# { -# }; -# -# so this needs to be cleaned up a bit. -# -# /^[\t ]*}.*;[\t ]*/ { -# handleEndADT() -# } - -function handleEndADT() -{ - popLevel( $0 ) - # next - $0 = "" -} - -# -# Trap private, protected and public keywords in class, struct or union. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /^[\t ]*private[\t ]*:[\t ]*(\/\/.*)?$/ { -# handlePrivate() -# } - -function handlePrivate() -{ -#if (accpriv == "on" ) - printf( "ACCESS\n%s\nprivate\n\n", name ) - hiding = "private" - # next - $0 = "" -} - -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /^[\t ]*protected[\t ]*:[\t ]*(\/\/.*)?$/ { -# handleProtected() -# } - -function handleProtected() -{ -#if (accprot == "on" ) - printf( "ACCESS\n%s\nprotected\n\n", name ) - hiding = "protected" - # next - $0 = "" -} - -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /^[\t ]*public[\t ]*:[\t ]*(\/\/.*)?$/ { -# handlePublic() -# } - -function handlePublic() -{ -#if (accpubl == "on" ) - printf( "ACCESS\n%s\npublic\n\n", name ) - hiding = "public" - # next - $0 = "" -} - -# -# Handle friend declaration. -# -function handleFriend( comment, line ) -{ - line = $0 - if ( $0 ~ /[,(][\t ]*(\/\/.*)?$/ ) - { - line = uncomment( line ) - line = handleArgs( line ) - } - if ( line !~ /;[\t ]*(\/\/.*)?$/ ) - { - line = uncomment( line ) - comment = handleInline() - line = line ";" - } - else - { - match( line, "//.*$" ) - comment = substr( line, RSTART, RLENGTH ) - } - gsub( "\t", " ", line ) - gsub( " +", " ", line ) - sub( "^ *", "", line ) - if ( name ~ "^$" ) - printf( "FRIEND\n%s\n%s\n%s\n", "::", "public", line ) - else - if ( hiding ~ "^$" ) - printf( "FRIEND\n%s\n%s\n%s\n", name, "public", line ) - else - printf( "FRIEND\n%s\n%s\n%s\n", name, hiding, line ) - $0 = outputComment( comment ) -} - -# -# Trap inline constructors with an initialiser list. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /\)[\t ]*:[\t ]*.*\(.*\)[\t ]*({(.*})?[\t ]*)?(\/\/.*)?$/ { -# handleInlineCtor() -# } - -function handleInlineCtor() -{ - sub( "[\t ]*//.*", "", $0 ) - match( $0, ".*\\)[\t ]*:[\t ]*" ) - prototype = substr( $0, RSTART, RLENGTH ) - sub( "[\t ]*:[\t ]*$", "", prototype ) - outputFunction( prototype ) - if ( $0 !~ "}[\t ]*$" ) - { - $0 = handleInline() - if ( $0 ~ "^[\t ]*//.*$" ) - $0 = outputComment( $0 ) - } - else - $0 = outputComment( "" ) -} - -# -# Trap any inline functions, including constructors/destructors, with -# a complete prototype on the first line. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /\)[\t ]*(const[\t ]*)?({(.*})?[\t ]*)?(\/\/.*)?$/ { -# handleInlineFunction() -# } - -function handleInlineFunction() -{ - sub( "[\t ]*//.*$", "", $0 ) - -# XXXX v1 match( $0, ".*\\)[\t ]*(const[\t ]*)?([^{]*{)?[\t ]*" ) -# XXXX v2 match( $0, ".*\\)[\t ]*(const)?([\t ]*\{)?[\t ]*" ) -# XXXX v2 prototype = substr( $0, RSTART, RLENGTH ) - - pos = index($0,"{") - if ( pos != 0 ) - prototype = substr( $0, 1, pos-1 ) - else - prototype = $0 - - sub( "[\t ]*\{[\t ]*$", "", prototype ) - outputFunction( prototype ) - if ( $0 !~ "}[\t ]*$" ) - { - savename = name - $0 = handleInline() - if ( $0 ~ "^[\t ]*//.*$" ) - $0 = outputComment( $0 ) - else - { - if ( savename == name ) - printf( "\n" ) - } - } - else - $0 = outputComment() -} - -# -# Trap normal Enum declaration. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /\)[\t ]*(enum[\t ]*)?(=[\t ]*0[\t ]*)?,[\t ]*(\/\/.*)?$/ { -# handleenum() -# } - -function handleEnumFun() -{ - $0 = Set_c_Comment_to_CPP_Comment( $0) - match( $0, "//.*" ) - comment = substr( $0, RSTART, RLENGTH ) - $0 = uncomment( $0 ) - outputEnum( $0 ) - $0 = outputComment( comment ) -} - -# -# Trap normal function declaration. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /\)[\t ]*(const[\t ]*)?(=[\t ]*0[\t ]*)?;[\t ]*(\/\/.*)?$/ { -# handleFunction() -# } - -function handleFunction() -{ - $0 = Set_c_Comment_to_CPP_Comment( $0) - match( $0, "//.*" ) - comment = substr( $0, RSTART, RLENGTH ) - $0 = uncomment( $0 ) - outputFunction( $0 ) - $0 = outputComment( comment ) -} - -# -# Trap member variables. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /[\t ]*;[\t ]*(\/\/.*)?$/ { -# handleMember() -# } - -function handleMember() -{ - $0 = Set_c_Comment_to_CPP_Comment( $0) - match( $0, "//.*" ) - comment = substr( $0, RSTART, RLENGTH ) - sub( "[\t ]*//.*", "", $0 ) - outputMember( $0 ) - $0 = outputComment( comment ) -} - -function handleMember_orig() -{ - match( $0, "//.*" ) - comment = substr( $0, RSTART, RLENGTH ) - sub( "[\t ]*//.*", "", $0 ) - outputMember( $0 ) - $0 = outputComment( comment ) -} - -function handleMember_neu() -{ - match( $0, "/\\*.*\\*/" ) - comment = substr( $0, RSTART, RLENGTH ) - if ( length(comment) == 0 ) - { - match( $0, "//.*" ) - comment = substr( $0, RSTART, RLENGTH ) - } -# else -# sub( "[\t ]*//.*", "", $0 ) - $0 = uncomment( $0 ) - outputMember( $0 ) - $0 = outputComment( comment ) -} - -# -# Trap remainder of functions and constructors, where prototypes go -# over more than one line. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /((\((.*,)?)|([_a-zA-Z0-9_]+))[\t ]*(\/\/.*)?$/ { -# handleMultilineEnums() -# } - -function handleMultilineEnums( prototype ) -{ - $0 = uncomment( $0 ) - prototype = handleEnumArgs( $0 ) - prototype = uncomment( prototype ) - sub( "\{.*}[\t ]*$", "", prototype ) - outputEnum( prototype ) - if ( prototype !~ ";[\t ]*" ) - { - savename = name - $0 = handleInline() - if ( line ~ "^[\t ]*//.*$" ) - $0 = outputComment( $0 ) - else - { - if ( savename == name ) - printf( "\n" ) - } - } - else - $0 = outputComment() -} - -# -# Trap remainder of functions and constructors, where prototypes go -# over more than one line. -# -# ( name !~ "^$" ) && -# ( type !~ "enum" ) && -# /((\((.*,)?)|([_a-zA-Z0-9_]+))[\t ]*(\/\/.*)?$/ { -# handleMultilineFunctions() -# } - -function handleMultilineFunctions( prototype ) -{ - $0 = uncomment( $0 ) - prototype = handleArgs( $0 ) - prototype = uncomment( prototype ) - sub( "\{.*}[\t ]*$", "", prototype ) - outputFunction( prototype ) - if ( prototype !~ ";[\t ]*" ) - { - savename = name - $0 = handleInline() - if ( line ~ "^[\t ]*//.*$" ) - $0 = outputComment( $0 ) - else - { - if ( savename == name ) - printf( "\n" ) - } - } - else - $0 = outputComment() -} - -# -# pushLevel() and popLevel() implement a stack for classes encountered. -# This is to handle class definitions local to classes. -# pushLevel() is invoked when entering a abstract data type, and -# popLevel() is executed when leaving. -# -function pushLevel() -{ - level++ - names[level] = name - types[level] = type - hidings[level] = hiding - topName = name - -# 3.11.95 evtl auskommentieren! - hiding = "" - - if ( class == 1 ) - { - type = "class" -# hiding = "private" - } - else if ( struct == 1 ) - { - type = "struct" -# hiding = "public" - } - else if ( union == 1 ) - { - type = "union" -# hiding = "public" - } - else if ( enum == 1 ) - type = "enum" -} - -function popLevel( line ) -{ - if ( name !~ "^$" ) - { - printf( "END\n%s\n\n", name ) - oldname = name - name = names[level] - type = types[level] - hiding = hidings[level] - level-- - topName = names[level] - if ( line ~ "^[\t ]*}.*[_a-zA-Z0-9]+.*;[\t ]*(//.*)?$" ) - { - line = uncomment( line ) - sub( "^[\t ]*}[\t ]*", "", line ) - if ( line ~ "^[_a-zA-Z0-9]+" ) - line = oldname " " line - else - line = oldname line - outputMember( line ) - return outputComment() - } - return "" - } -} - -# -# Removes comments from a line. -# -function uncomment( line ) -{ - sub( "/\\*.*\\*/", "", line ) - sub( "[\t ]*//.*$", "" , line ) - return line -} - -# -# Accumulates comment blocks and outputs them, followed by a blank line. -# -function outputComment( line ) -{ - if ( line !~ "^[\t ]*//" ) - getline line - - num = 0 - while ( line ~ "^[\t ]*//" ) - { - sub( "^[\t ]*//", "", line ) - if ( line ~ "^[\t ]*=(( [a-zA-Z0-9]+[^<>]*)|(=+))[\t ]*$" ) - break - else - lines[num++] = line - - getline line - } - indent = -1 - for ( i=0; i)?[\t ]*" ) - { - printf( "// %s\n", substr( lines[i], indent+1 ) ) - } - else - { - sub( "^[\t ]*", "", lines[i] ) - printf( "// %s\n", lines[i] ) - } - } - } - printf( "\n" ) - if ( line ~ "^[\t ]*}.*;[\t ]*$" ) - line = popLevel( line ) - - return line -} - -# -# Checks occurences of ADT and determines if they are in fact a definition -# or a declaration. If they are definition, it will generate any superclasses -# for the ADT. -# -function handleADT( line ) -{ - # - # Check for class declaration: - # class Foo; - # - if ( line ~ "[_a-zA-Z][ <,>_0-9a-zA-Z]*[\t ]*;" ) - { - # Do nothing, this is a declaration. - return 0 - } - # - # Check for derived classes: - # class Foo : Foobar - # - else if ( line ~ "[^:]:[^:]*" ) - { - pushLevel() - match( line, ".*[^:]:[^:]?" ) - name = substr( line, RSTART, RLENGTH-1 ) - sub( ":.*", "", name ) - sub( "[\t ]*$", "", name ) - if ( template == 1) - { - if ( name ~ "<.+>" ) - { - match( name, "<.+>" ) - args = substr( name, RSTART, RLENGTH ) - sub( "[\t ]*<.+>[\t ]*", "", name ) - } - } - match( line, ":.*" ) - bases = substr( line, RSTART, RLENGTH ) - sub( ":[\t ]*", "", bases ) - sub( "[\t ]*$", "", bases ) - if ( bases !~ ",$" && bases !~ "^$" ) - { - sub( "[\t ]*\{[\t ]*$", "", bases ) - } - else - { - while ( bases ~ ".*,[\t ]*$" || bases ~ "^$" ) - { - getline contbases - contbases = uncomment( contbases ) - while ( length( contbases ) == 0 ) - { - getline contbases - contbases = uncomment( contbases ) - } - bases = bases " " contbases - } - sub( "[\t ]*\{[\t ]*$", "", bases ) - } - } - # - # Check for non-derived classes: - # class Foo - # - # else if ( line ~ "[_a-zA-Z][ <>,_0-9a-zA-Z]*(<.+>)?[\t ]*\{*$" ) - else if ( line ~ "[_a-zA-Z][ <>,_0-9a-zA-Z]*(<.+>)?[\t ]*(\{[\t ]*)?$" ) - { - pushLevel() - if ( template == 1) - match( line, "[_a-zA-Z][_0-9a-zA-Z]*" ) - else - match( line, "[_a-zA-Z][ <>,_0-9a-zA-Z]*" ) - name = substr( line, RSTART, RLENGTH ) - sub( "[\t ]*$", "", name ) - if ( template == 1) - { - sub( "[_a-zA-Z][_0-9a-zA-Z]*", "", line ) - if ( line ~ "^<" ) - { - match( line, "<.+>" ) - args = substr( line, RSTART, RLENGTH ) - } - } - } - else - { - # Discard anything else. - return 0 - } - return 1 -} - -# -# Generates the actual list of superclasses. -# -function outputSuperClasses( line ) -{ - if ( line ~ /^[\t ]*$/ ) - printf( "\n" ) - else - { - gsub( "(\t| )+", " ", line ) - narg = 0 - while ( match( line, "[^<>,# ]*<[^<>]*>" ) ) - { - narg++ - arg = substr( line, RSTART, RLENGTH ) - sub( "[^<>,# ]*<[^<>]*>", "#" narg, line ) - bargs["#" narg] = arg - # Need the following to stop resubstitution of the pattern matched - # back into the string. - gsub( "&", "\\\\&", bargs["#" narg] ) - } - num = split( line, item, "," ) - i = 1 - while ( i<=num ) - { - access = "private" - inherit = "" - - if ( item[i] ~ "[\t ]*public[\t ]*" ) - { - access = "public" - sub( "[\t ]*public[\t ]*", "", item[i] ) - } - else if ( item[i] ~ "[\t ]*protected[\t ]*" ) - { - access = "protected" - sub( "[\t ]*protected[\t ]*", "", item[i] ) - } - sub( "[\t ]*private[\t ]*", "", item[i] ) - - if ( item[i] ~ "[\t ]*virtual[\t ]*" ) - { - inherit = " virtual" - sub( "[\t ]*virtual[\t ]*", "", item[i] ) - } - - while ( match( item[i], "#[0-9]+" ) ) - { - arg = substr( item[i], RSTART, RLENGTH ) - sub( arg, bargs[arg], item[i] ) - } - sub( "^[\t ]*", "", item[i] ) - sub( "[\t ]*$", "", item[i] ) - - printf( "%s%s %s\n", access, inherit, item[i] ) - - ++i - } - printf( "\n" ) - } -} - -# -# Outputs enum prototypes. -# -function outputEnum( line ) -{ - if ( line !~ ";[\t ]*$" ) - { - sub( "[\t ]*$", ";", line ) - if ( line !~ /^[\t ]*inline[\t ]+/ ) - sub( "^[\t ]*", "inline ", line ) - } - if ( ( type ~ "class" ) && ( hiding ~ "^$" ) ) - hide = "private" - else - hide = "public" - printf( "ENUM\n%s\n%s\n", name, hiding ~ "^$" ? hide : hiding ) - gsub( "\t", " ", line ) - gsub( " +", " ", line ) - sub( "^ *", "", line ) - sub( " *$", "", line ) - sub( "( ?;)*$", ";", line ) - printf( "%s\n", line ) -} - -# -# Outputs function prototypes. -# -function outputFunction( line ) -{ - if ( line !~ ";[\t ]*$" ) - { - sub( "[\t ]*$", ";", line ) - if ( line !~ /^[\t ]*inline[\t ]+/ ) - sub( "^[\t ]*", "inline ", line ) - } - if ( ( type ~ "class" ) && ( hiding ~ "^$" ) ) - hide = "private" - else - hide = "public" - printf( "FUNC\n%s\n%s\n", name, hiding ~ "^$" ? hide : hiding ) - gsub( "\t", " ", line ) - gsub( " +", " ", line ) - sub( "^ *", "", line ) - sub( " *$", "", line ) - sub( "( ?;)*$", ";", line ) - printf( "%s\n", line ) -} - -# -# Output member variables. -# -function outputMember( line ) -{ - if ( ( type ~ "class" ) && ( hiding ~ "^$" ) ) - hide = "private" - else - hide = "public" - printf( "MEMBER\n%s\n%s\n", name, hiding ~ "^$" ? hide : hiding ) - gsub( "\t", " ", line ) - gsub( " +", " ", line ) - sub( "^ *", "", line ) - sub( " *$", "", line ) - sub( "( ?;)*$", ";", line ) - printf( "%s\n", line ) -} - -# -# Output member variables. -# -function outputMemberEnum( line ) -{ - if ( ( type ~ "class" ) && ( hiding ~ "^$" ) ) - hide = "private" - else - hide = "public" - printf( "ENUM\n%s\n%s\n", name, hiding ~ "^$" ? hide : hiding ) - gsub( "\t", " ", line ) - gsub( " +", " ", line ) - sub( "^ *", "", line ) - sub( " *$", "", line ) - sub( "( ?;)*$", ";", line ) - printf( "%s\n", line ) -} - -# -# Gathers up argument lists which cover more than one line. -# -function handleArgs( prototype ) -{ - getline line - line = uncomment( line ) - sub( "^[\t ]*", "", line ) - sub( "[\t ]*$", "", line ) - - # 3.11.95 supress preproc in fuctions args - sub( "#.*$", "", line ) - - if ( ( prototype ~ "\\($" || line ~ "^\\(" || line ~ "^\\)" ) && \ - prototype !~ ",$" ) - prototype = prototype line - else - prototype = prototype " " line - while ( \ - ( prototype !~ "\\)[\t ]*(const[\t ]*)?((\{.*)|(//.*))?$" ) \ - && \ - ( prototype !~ "\\)[\t ]*(const[\t ]*)?(=[\t ]*0[\t ]*)?;[\t ]*(//.*)?$" ) \ - && \ - ( prototype !~ "\\)[\t ]*:.*$" ) \ - ) - { - getline line - line = uncomment( line ) - sub( "^[\t ]*", "", line ) - sub( "[\t ]*$", "", line ) - - # 3.11.95 supress preproc in fuctions args - sub( "#.*$", "", line ) - - if ( ( prototype ~ "\\($" || line ~ "^\\(" || line ~ "^\\)" ) && \ - prototype !~ ",$" ) - prototype = prototype line - else - prototype = prototype " " line - } - if ( prototype ~ "\\)[\t ]*:.*$" ) - sub( "\\)[\t ]*:.*$", ")", prototype ) - else if ( prototype ~ "\\)[\t ]*\{.*$" ) - sub( "\\)[\t ]*\{.*$", ")", prototype ) - return prototype -} - -# -# Gathers up enum argument lists which cover more than one line. -# -function handleEnumArgs( prototype ) -{ - getline line - line = uncomment( line ) - sub( "^[\t ]*", "", line ) - sub( "[\t ]*$", "", line ) - if ( ( prototype ~ "\\{$" || line ~ "^\\{" || line ~ "^\\}" ) && \ - prototype !~ ",$" ) - prototype = prototype line - else - prototype = prototype " " line - while ( \ - ( prototype !~ "\\}[\t ]*(const[\t ]*)?((\{.*)|(//.*))?$" ) \ - && \ - ( prototype !~ "\\}[\t ]*(const[\t ]*)?(=[\t ]*0[\t ]*)?;[\t ]*(//.*)?$" ) \ - && \ - ( prototype !~ "\\}[\t ]*:.*$" ) \ - ) - { - getline line - line = uncomment( line ) - sub( "^[\t ]*", "", line ) - sub( "[\t ]*$", "", line ) - if ( ( prototype ~ "\\($" || line ~ "^\\(" || line ~ "^\\)" ) && \ - prototype !~ ",$" ) - prototype = prototype line - else - prototype = prototype " " line - } - if ( prototype ~ "\\}[\t ]*:.*$" ) - sub( "\\}[\t ]*:.*$", "}", prototype ) - else if ( prototype ~ "\\}[\t ]*\{.*$" ) - sub( "\\}[\t ]*\{.*$", "}", prototype ) - return prototype -} - -# -# Skips inline code. End of such code is determined when either a blank line, -# comment, or end of ADT is encountered. -# -function handleInline() -{ - getline line - while (line !~ "^[\t ]*(}.*;[\t ]*)?(//.*)?$" ) - getline line - - if ( line ~ "[\t ]*}[\t ]*[_a-zA-Z0-9]*[\t ]*;[\t ]*$" ) - { - printf( "\n" ) - popLevel( line ) - } - - if ( line ~ "^[\t ]*//.*" ) - return line - else - return "" -} - -# -# The main parsing loop. -# This implements a recursive descent parser of sorts. -# -function doParse() -{ - while ( $0 !~ "^$" ) - { - if ( $0 ~ /^[\t ]*template[\t ]*<[^:]+>[\t ]*$/ ) - { - getline line - $0 = $0 " " line - } - - if ( $0 ~ /^[\t ]*\/\/[\t ]*==+[\t ]*$/ ) - { - handleHeader() - } - else if ( $0 ~ /^[\t ]*\/\/[\t ]*= [a-zA-Z0-9]+[^<>]*[\t ]*$/ ) - { - handleInfo() - } - else if ( $0 ~ /^[\t ]*\/\/.*$/ ) - { - handleComment() - } - else if ( $0 ~ /^[\t ]*#[\t ]*define/ ) - { - handleDefine() - } - else if ( $0 ~ /^[\t ]*#[\t ]*include[\t ]*<.+>/ ) - { - handleInclude() - } - else if ( $0 ~ /^[\t ]*#[\t ]*include[\t ]*".+"/ ) - { - handleLocalInclude() - } - else if ( $0 ~ /^[\t ]*#.*$/ ) - { - handlePreprocessor() - } - else if ( $0 ~ /^[\t ]*typedef[\t ]+/ ) - { - handleTypedef() - } - else if ( $0 ~ /^extern[\t ]+/ ) - { - handleExtern() - } - else if ( $0 ~ /^[\t ]*class[\t ]/ ) - { - handleClass() - } - else if ( $0 ~ /^[\t ]*struct[\t ]/ ) - { - handleStruct() - } - else if ( $0 ~ /^[\t ]*union[\t ]/ ) - { - handleUnion() - } - else if ( $0 ~ /^[\t ]*template[\t ]*<.+>[\t ]+class[\t ]/ ) - { - handleTemplate() - } - else if ( $0 ~ /^[\t ]*enum[\t ]*.*;[\t ]*(\/\/.*)?$/ ) - { -#printf("\ntype=%s-------single------\n",type); - handleEnumFun() - } - else if ( ($0 ~ /((\((.*,)?)|([_a-zA-Z0-9_]+))[\t ]*(\/\/.*)?$/) && ( name !~ "^$" ) && ( $0 ~ /^[\t ]*enum/ ) ) - { -#printf("\ntype=%s-------multi------\n",type); - handleMultilineEnums() - } - else if ( $0 ~ /^[\t ]*}.*;[\t ]*/ ) - { - handleEndADT() - } - else if ( ( name !~ "^$" ) && ( type !~ "enum" ) ) - { - if ( $0 ~ /^[\t ]*private[\t ]*:[\t ]*(\/\/.*)?$/ ) - { - handlePrivate() - } - else if ( $0 ~ /^[\t ]*protected[\t ]*:[\t ]*(\/\/.*)?$/ ) - { - handleProtected() - } - else if ( $0 ~ /^[\t ]*public[\t ]*:[\t ]*(\/\/.*)?$/ ) - { - handlePublic() - } - else if ( $0 ~ /^[\t ]*friend[\t ]+/ ) - { - handleFriend() - } - else if ( $0 ~ /\)[\t ]*:[\t ]*.*\(.*\)[\t ]*(\{(.*})?[\t ]*)(\/\/.*)?$/ ) - { - handleInlineCtor() - } - else if ( $0 ~ /\)[\t ]*(const[\t ]*)?(\{(.*})?[\t ]*)?(\/\/.*)?$/ && - $0 !~ /^.*operator[\t ]*\(\)[\t ]*(\/\/.*)?$/ ) - { - handleInlineFunction() - } - else if ( $0 ~ /\)[\t ]*(const[\t ]*)?(=[\t ]*0[\t ]*)?;?[\t ]*(\/\/.*)?$/ && - $0 !~ /^.*operator[\t ]*\(\)[\t ]*(\/\/.*)?$/ ) - { - handleFunction() - } - else if ( $0 ~ /[\t ]*;[\t ]*(\/\/.*)?(\/\\*.*\\*\/)?$/ ) - { - handleMember() - } - else if ( $0 ~ /((\((.*,)?)|([_a-zA-Z0-9_>)]+[*&]?))[\t ]*(\/\/.*)?$/ ) - { - handleMultilineFunctions() - } - else - $0 = "" - } - else - $0 = "" - } -} diff --git a/bin/class2man b/bin/class2man deleted file mode 100755 index dd18b742712..00000000000 --- a/bin/class2man +++ /dev/null @@ -1,78 +0,0 @@ -#! /bin/sh -# ============================================================================= -# -# = DESCRIPTION -# Script to combine class2info and info2man. -# -# = AUTHOR(S) -# Graham Dumpleton -# -# = COPYRIGHT -# Copyright 1991 OTC LIMITED -# -# ============================================================================= - -OSE_HOST= - -OSE_RELEASE_NAME= -export OSE_RELEASE_NAME - -OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} -export OSE_ROOT - -OSE_VERSION_ROOT=$OSE_ROOT/$OSE_RELEASE_NAME -export OSE_VERSION_ROOT - -BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" -LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/lib"} - -CLASS2INFO="$BINDIR/class2info" -INFO2MAN="$BINDIR/info2man" - -# -# Error. -# -ERROR() -{ - echo "`basename $0`: $1" >&2 - shift - while test $# != "0" - do - echo $1 >&2 - shift - done - exit 1 -} - -# -# Usage message. -# -USAGE() -{ - ERROR "Usage: `basename $0` files" -} - -# -# Check usage. -# -if test "$#" = "0" -then - USAGE -fi - -while test "$#" != "0" -do - $CLASS2INFO $1 - if test "$?" != "0" - then - exit 1 - fi - file=`basename $1` - base="`echo $file | sed -e 's/\..*$//'`" - if test -f "$base.ci" - then - $INFO2MAN $base.ci - rm -f $base.ci - fi - shift -done diff --git a/bin/class2mml b/bin/class2mml deleted file mode 100755 index 20453e0010b..00000000000 --- a/bin/class2mml +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh -# ============================================================================= -# -# = DESCRIPTION -# Script to combine class2info and info2mml. -# -# = AUTHOR(S) -# Graham Dumpleton -# -# = COPYRIGHT -# Copyright 1991 OTC LIMITED -# Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED -# -# ============================================================================= - -OSE_HOST= - -OSE_RELEASE_NAME= -export OSE_RELEASE_NAME - -OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} -export OSE_ROOT - -OSE_VERSION_ROOT=$OSE_ROOT/$OSE_RELEASE_NAME -export OSE_VERSION_ROOT - -BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" -LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/lib"} - -CLASS2INFO="$BINDIR/class2info" -INFO2MAN="$BINDIR/info2mml" - -# -# Error. -# -ERROR() -{ - echo "`basename $0`: $1" >&2 - shift - while test $# != "0" - do - echo $1 >&2 - shift - done - exit 1 -} - -# -# Usage message. -# -USAGE() -{ - ERROR "Usage: `basename $0` files" -} - -# -# Check usage. -# -if test "$#" = "0" -then - USAGE -fi - -while test "$#" != "0" -do - $CLASS2INFO $1 - if test "$?" != "0" - then - exit 1 - fi - file=`basename $1` - base="`echo $file | sed -e 's/\..*$//'`" - if test -f "$base.ci" - then - $INFO2MAN $base.ci - rm -f $base.ci - fi - shift -done diff --git a/bin/class2src b/bin/class2src deleted file mode 100755 index 9feb23fe857..00000000000 --- a/bin/class2src +++ /dev/null @@ -1,79 +0,0 @@ -#! /bin/sh -# ============================================================================= -# -# = DESCRIPTION -# Generates member function stubs for the src file to standard output. -# -# = AUTHOR(S) -# Graham Dumpleton -# K. Dorn -# -# = COPYRIGHT -# Copyright 1991 OTC LIMITED -# -# ============================================================================= - -OSE_HOST= - -OSE_RELEASE_NAME= -export OSE_RELEASE_NAME - -OSE_ROOT=${OSE_ROOT-$WRAPPER_ROOT} -export OSE_ROOT - -OSE_VERSION_ROOT=$OSE_ROOT/$OSE_RELEASE_NAME -export OSE_VERSION_ROOT - -BINDIR="$OSE_VERSION_ROOT/$OSE_HOST/bin" -LIBDIR=${CLASSINFOLIBDIR-"$OSE_VERSION_ROOT/lib"} - -CLASS2INFO="$BINDIR/class2info" -INFO2SRC="$BINDIR/info2src" - -# -# Error. -# -ERROR() -{ - echo "`basename $0`: $1" >&2 - shift - while test $# != "0" - do - echo $1 >&2 - shift - done - exit 1 -} - -# -# Usage message. -# -USAGE() -{ - ERROR "Usage: `basename $0` files" -} - -# -# Check usage. -# -if test "$#" = "0" -then - USAGE -fi - -while test "$#" != "0" -do - $CLASS2INFO $1 - if test "$?" != "0" - then - exit 1 - fi - file=`basename $1` - base="`echo $file | sed -e 's/\..*$//'`" - if test -f "$base.ci" - then - $INFO2SRC $base.ci $2 $3 $4 - rm -f $base.ci - fi - shift -done diff --git a/bin/classinfo.ps b/bin/classinfo.ps deleted file mode 100755 index 950535ed86e..00000000000 --- a/bin/classinfo.ps +++ /dev/null @@ -1,868 +0,0 @@ -%!PS-Adobe-3.0 -%%BoundingBox: 54 72 558 720 -%%Creator: Mozilla (NetScape) HTML->PS -%%DocumentData: Clean7Bit -%%Orientation: Portrait -%%Pages: 9 -%%PageOrder: Ascend -%%Title: Classinfo Tools -%%EndComments -%%BeginProlog -[ /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright - /parenleft /parenright /asterisk /plus /comma /hyphen /period /slash /zero /one - /two /three /four /five /six /seven /eight /nine /colon /semicolon - /less /equal /greater /question /at /A /B /C /D /E - /F /G /H /I /J /K /L /M /N /O - /P /Q /R /S /T /U /V /W /X /Y - /Z /bracketleft /backslash /bracketright /asciicircum /underscore /quoteleft /a /b /c - /d /e /f /g /h /i /j /k /l /m - /n /o /p /q /r /s /t /u /v /w - /x /y /z /braceleft /bar /braceright /asciitilde /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef - /space /exclamdown /cent /sterling /currency /yen /brokenbar /section /dieresis /copyright - /ordfeminine /guillemotleft /logicalnot /hyphen /registered /macron /degree /plusminus /twosuperior /threesuperior - /acute /mu /paragraph /periodcentered /cedilla /onesuperior /ordmasculine /guillemotright /onequarter /onehalf - /threequarters /questiondown /Agrave /Aacute /Acircumflex /Atilde /Adieresis /Aring /AE /Ccedilla - /Egrave /Eacute /Ecircumflex /Edieresis /Igrave /Iacute /Icircumflex /Idieresis /Eth /Ntilde - /Ograve /Oacute /Ocircumflex /Otilde /Odieresis /multiply /Oslash /Ugrave /Uacute /Ucircumflex - /Udieresis /Yacute /Thorn /germandbls /agrave /aacute /acircumflex /atilde /adieresis /aring - /ae /ccedilla /egrave /eacute /ecircumflex /edieresis /igrave /iacute /icircumflex /idieresis - /eth /ntilde /ograve /oacute /ocircumflex /otilde /odieresis /divide /oslash /ugrave - /uacute /ucircumflex /udieresis /yacute /thorn /ydieresis] /isolatin1encoding exch def -/c { matrix currentmatrix currentpoint translate - 3 1 roll scale newpath 0 0 1 0 360 arc setmatrix } bind def -/F0 - /Times-Roman findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f0 { /F0 findfont exch scalefont setfont } bind def -/F1 - /Times-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f1 { /F1 findfont exch scalefont setfont } bind def -/F2 - /Times-Italic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f2 { /F2 findfont exch scalefont setfont } bind def -/F3 - /Times-BoldItalic findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f3 { /F3 findfont exch scalefont setfont } bind def -/F4 - /Courier findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f4 { /F4 findfont exch scalefont setfont } bind def -/F5 - /Courier-Bold findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f5 { /F5 findfont exch scalefont setfont } bind def -/F6 - /Courier-Oblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f6 { /F6 findfont exch scalefont setfont } bind def -/F7 - /Courier-BoldOblique findfont - dup length dict begin - {1 index /FID ne {def} {pop pop} ifelse} forall - /Encoding isolatin1encoding def - currentdict end -definefont pop -/f7 { /F7 findfont exch scalefont setfont } bind def -/rhc { - { - currentfile read { - dup 97 ge - { 87 sub true exit } - { dup 48 ge { 48 sub true exit } { pop } ifelse } - ifelse - } { - false - exit - } ifelse - } loop -} bind def - -/cvgray { % xtra_char npix cvgray - (string npix long) - dup string - 0 - { - rhc { cvr 4.784 mul } { exit } ifelse - rhc { cvr 9.392 mul } { exit } ifelse - rhc { cvr 1.824 mul } { exit } ifelse - add add cvi 3 copy put pop - 1 add - dup 3 index ge { exit } if - } loop - pop - 3 -1 roll 0 ne { rhc { pop } if } if - exch pop -} bind def - -/smartimage12rgb { % w h b [matrix] smartimage12rgb - - /colorimage where { - pop - { currentfile rowdata readhexstring pop } - false 3 - colorimage - } { - exch pop 8 exch - 3 index 12 mul 8 mod 0 ne { 1 } { 0 } ifelse - 4 index - 6 2 roll - { 2 copy cvgray } - image - pop pop - } ifelse -} def -/cshow { dup stringwidth pop 2 div neg 0 rmoveto show } bind def -/rshow { dup stringwidth pop neg 0 rmoveto show } bind def -%%EndProlog -%%Page: 1 1 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -24 f1 0 697.5 moveto -(OSE - Tools User Guide) show -12 f2 0 668.5 moveto -(Graham Dumpleton) show -12 f2 0 655.4 moveto -(Dumpleton Software Consulting Pty Limited) show -12 f2 0 642.3 moveto -(PO BOX 3150) show -12 f2 0 629.2 moveto -(Parramatta, 2124) show -12 f2 0.2 616.1 moveto -(N.S.W, Australia) show -12 f2 0 603 moveto -(email: grahamd@nms.otc.com.au) show -0 593.9 moveto -504 0 rlineto 0 -1.4 rlineto -504 0 rlineto closepath fill -18 f1 0 557.2 moveto -(Table of Contents) show -12 f1 0 528.8 moveto -(Classinfo Tools) show -12 f0 78.3 528.8 moveto -( ) show -12 f1 28 501.7 moveto -(1 Available Programs) show -12 f0 139.3 501.7 moveto -( ) show -12 f1 28 487.9 moveto -(2 Global Sections) show -12 f0 116.6 487.9 moveto -( ) show -12 f1 28 474.1 moveto -(3 Block Formatting) show -12 f0 127.9 474.1 moveto -( ) show -12 f1 28 460.3 moveto -(4 Inline Formatting) show -12 f0 128.6 460.3 moveto -( ) show -12 f1 28 446.5 moveto -(5 Class Sections) show -12 f0 109.3 446.5 moveto -( ) show -12 f1 28 432.7 moveto -(6 Member Documentation) show -12 f0 162.6 432.7 moveto -( ) show -12 f1 28 418.9 moveto -(7 Contract Section) show -12 f0 123.3 418.9 moveto -( ) show -0 396.5 moveto -504 0 rlineto 0 -1.4 rlineto -504 0 rlineto closepath fill -24 f1 0 354 moveto -(Classinfo Tools) show -18 f1 0 318.7 moveto -(1 Available Programs) show -12 f0 0 290.8 moveto -(The documentation tools provided with the OSE build environment, allow comments in your code files,) show -12 f0 0 277.5 moveto -(to be extracted and formatted into end user documentation. To enable the tools to do this in a predictable) show -12 f0 0 264.2 moveto -(manner, the comments must be formatted according to a small set of rules. At present, the tools can) show -12 f0 0 250.9 moveto -(extract comments from C++ class header files and produce either UNIX style manual pages, of Frame) show -12 f0 0 237.6 moveto -(mml files. The tools provided are described below.) show -10 f4 0 213.7 moveto -(-------------------------------------------------------------------------------) show -10 f5 0 203.2 moveto -(Program) show -10 f4 42.2 203.2 moveto -( ) show -10 f5 72.2 203.2 moveto -(Purpose) show -10 f4 114.2 203.2 moveto -( ) show -10 f4 0 192.7 moveto -(-------------------------------------------------------------------------------) show -10 f4 0 182.2 moveto -(class2info Parses a C++ header file and produces a file which contains infor ) show -10 f4 0 171.7 moveto -( mation about the class in the header file, in a form which is more ) show -10 f4 0 161.2 moveto -( easily parsed by other tools. ) show -10 f4 0 150.7 moveto -(info2man Takes the output file from class2info and produces a UNIX ) show -10 f4 0 140.2 moveto -( style manual page for each class described in the input file. ) show -10 f4 0 129.7 moveto -(class2man Combines the programs class2info and info2man, to pro ) show -10 f4 0 119.2 moveto -( duce a UNIX style manual page for each class declaration in a ) show -10 f4 0 108.7 moveto -( header file. ) show -10 f4 0 98.2 moveto -(info2mml Takes the output file from class2info and produces a Frame ) show -10 f4 0 87.7 moveto -( mml file for each class described in the inout file. ) show -10 f4 0 77.2 moveto -(class2mml Combines the programs class2info and info2mml, to pro ) show -pagelevel restore -showpage -%%Page: 2 2 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -10 f4 0 711.9 moveto -( duce a Frame mml file for each class declaration in a header file. ) show -10 f4 0 701.4 moveto -(-------------------------------------------------------------------------------) show -12 f0 0 677.7 moveto -(Using the same front end parser as the documentation extraction tools, are the following tools:) show -10 f4 0 653.8 moveto -(----------------------------------------------------------------------------) show -10 f5 0 643.3 moveto -(Program) show -10 f4 42.2 643.3 moveto -( ) show -10 f5 66.2 643.3 moveto -(Purpose) show -10 f4 108.2 643.3 moveto -( ) show -10 f4 0 632.8 moveto -(----------------------------------------------------------------------------) show -10 f4 0 622.3 moveto -(info2src Takes the output file from class2info and produces on stan ) show -10 f4 0 611.8 moveto -( dard output, empty stub functions for each of the member func ) show -10 f4 0 601.3 moveto -( tions listed in the class declarations described in the file. ) show -10 f4 0 590.8 moveto -(class2src Combines the programs class2info and info2src, to pro ) show -10 f4 0 580.3 moveto -( duce on standard output, empty stub functions for each of the ) show -10 f4 0 569.8 moveto -( member functions listed in the class declarations described in a ) show -10 f4 0 559.3 moveto -( header file. ) show -10 f4 0 548.8 moveto -(----------------------------------------------------------------------------) show -12 f0 0 525.1 moveto -(These use information contained in a C++ class header file, to produce code stubs suitable for the) show -12 f0 0 511.8 moveto -(corresponding implementation file for that class.) show -12 f0 0 485.2 moveto -(The format which C++ class header files must adhere to is the subject of the remainder of this document.) show -18 f1 0 452.5 moveto -(2 Global Sections) show -12 f0 0 424.6 moveto -(To include a section in the manual page of each class in a header file, the comment containing the body) show -12 f0 0 411.3 moveto -(text of the section, must appear at global scope within the header file. The title of the section must) show -12 f0 0 398 moveto -(appear on a separate line, immediately prior to the body text of the section. To distinguish the title of the) show -12 f0 0 384.7 moveto -(section from the body text, you must precede it with a tag, consisting of the character `='. There must be) show -12 f0 0 371.4 moveto -(a single space only, before and after the tag. For example:) show -10 f4 0 347.5 moveto -( // = SECTION TITLE) show -10 f4 0 326.5 moveto -( // Body text.) show -12 f0 0 302.8 moveto -(Any text following the title of the section, up till the end of the comment, the start of another section, or) show -12 f0 0 289.5 moveto -(a line commencing with `==', is interpreted to be the body text for that section. Multiple sections may be) show -12 f0 0 276.2 moveto -(documented in a single comment block. Any leading, or trailing blank lines will be discarded in the) show -12 f0 0 262.9 moveto -(output. An example of a comment block containing multiple sections is given below.) show -10 f4 0 239 moveto -( // =====================================================) show -10 f4 0 218 moveto -( //) show -10 f4 0 197 moveto -( // = SECTION TITLE1) show -10 f4 0 176 moveto -( // Body text.) show -10 f4 0 155 moveto -( //) show -10 f4 0 134 moveto -( // = SECTION TITLE2) show -10 f4 0 113 moveto -( // Body text.) show -10 f4 0 92 moveto -( //) show -pagelevel restore -showpage -%%Page: 3 3 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -10 f4 0 711.9 moveto -( // =====================================================) show -12 f0 0 688.2 moveto -(Certain sections, appearing at global scope, are given special treatment in the generated manual pages.) show -12 f0 0 674.9 moveto -(These are:) show -10 f4 0 651 moveto -(-------------------------------------------------------------------------------) show -10 f5 0 640.5 moveto -(Section) show -10 f4 42 640.5 moveto -( ) show -10 f5 90 640.5 moveto -(Description) show -10 f4 156 640.5 moveto -( ) show -10 f4 0 630 moveto -(-------------------------------------------------------------------------------) show -10 f4 0 619.5 moveto -(LIBRARY The name of the library, of which the file is a part. This will ) show -10 f4 0 609 moveto -( appear in the header of each manual page. ) show -10 f4 0 598.5 moveto -(FILENAME The name of the file. This will be used in conjunction with ) show -10 f4 0 588 moveto -( the library name, to produce an include line in the synopsis. ) show -10 f4 0 577.5 moveto -(AUTHOR\(S\) The names of the authors. If the authors are placed on sepa ) show -10 f4 0 567 moveto -( rate lines, commas should not be used to terminate each line. ) show -10 f4 0 556.5 moveto -( If more than one author is placed on a single line, a comma ) show -10 f4 0 546 moveto -( should be used to separate each. ) show -10 f4 0 535.5 moveto -(COPYRIGHT The copyright applying to the contents of the file. ) show -10 f4 0 525 moveto -(VERSION The version number of the file. If using RCS, this would be ) show -10 f4 0 514.5 moveto -( set to `$Revision$'. ) show -10 f4 0 504 moveto -(DATE RELEASED The date that the current version of the file was released. If ) show -10 f4 0 493.5 moveto -( using RCS, this would be set to `$Date$'. ) show -10 f4 0 483 moveto -(RCSID The raw ID produced by RCS. Normally set to `$Id$'. ) show -10 f4 0 472.5 moveto -(SCCSID The raw ID produced by SCCS. Normally set to `%W%'. ) show -10 f4 0 462 moveto -(-------------------------------------------------------------------------------) show -12 f0 0 438.3 moveto -(Using these tags, you can construct a comment block at the start of each file, which describes the file,) show -12 f0 0 425 moveto -(authors and version of the file. For example:) show -10 f4 0 401.1 moveto -( /*) show -10 f4 0 380.1 moveto -( // ========================================================) show -10 f4 0 359.1 moveto -( //) show -10 f4 0 338.1 moveto -( // = LIBRARY) show -10 f4 0 317.1 moveto -( // OTC) show -10 f4 0 296.1 moveto -( //) show -10 f4 0 275.1 moveto -( // = FILENAME) show -10 f4 0 254.1 moveto -( // collctn/list.hh) show -10 f4 0 233.1 moveto -( //) show -10 f4 0 212.1 moveto -( // = RCSID) show -10 f4 0 191.1 moveto -( // $Id$) show -10 f4 0 170.1 moveto -( //) show -10 f4 0 149.1 moveto -( // = AUTHOR\(S\)) show -10 f4 0 128.1 moveto -( // Graham Dumpleton) show -10 f4 0 107.1 moveto -( //) show -10 f4 0 86.1 moveto -( // = COPYRIGHT) show -pagelevel restore -showpage -%%Page: 4 4 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -10 f4 0 711.9 moveto -( // Copyright 1991 1992 1993 OTC LIMITED) show -10 f4 0 690.9 moveto -( //) show -10 f4 0 669.9 moveto -( // =====================================================) show -10 f4 0 648.9 moveto -( */) show -18 f1 0 619.1 moveto -(3 Block Formatting) show -12 f0 0 591.2 moveto -(When the text of your comments appear in the manual page, they will be reformatted. If you need to) show -12 f0 0 577.9 moveto -(include an excerpt of code in the manual page, for example:) show -10 f4 0 554 moveto -( // = EXAMPLE) show -10 f4 0 533 moveto -( // void dump\(Class* theClass\)) show -10 f4 0 512 moveto -( // {) show -10 f4 0 491 moveto -( // cout << theClass->name\(\) << endl;) show -10 f4 0 470 moveto -( // }) show -12 f0 0 446.3 moveto -(it will appear as:) show -10 f4 0 422.4 moveto -( void dump\(Class* theClass\) { cout << *theClass << endl; }) show -12 f0 0 398.7 moveto -(If the example is complicated, the result will be unreadable.) show -12 f0 0 372.1 moveto -(To let the documentation tools know that the text you have included is special and should not be) show -12 f0 0 358.8 moveto -(reformatted, you can mark it as being a code example. For example:) show -10 f4 0 334.9 moveto -( // = EXAMPLE) show -10 f4 0 313.9 moveto -( // = BEGIN) show -10 f4 0 292.9 moveto -( // void dump\(Class* theClass\)) show -10 f4 0 271.9 moveto -( // {) show -10 f4 0 250.9 moveto -( // cout << *theClass << endl;) show -10 f4 0 229.9 moveto -( // }) show -10 f4 0 208.9 moveto -( // = END) show -12 f0 0 185.2 moveto -(The commands in this example are, `BEGIN'and `END'. In all cases, the format of) show -12 f0 0 171.9 moveto -(commands used to change the formatting of a block of text is:) show -10 f4 0 148 moveto -( // = BEGIN) show -10 f4 0 127 moveto -( // ....) show -10 f4 0 106 moveto -( // = END) show -12 f0 0 82.3 moveto -(The `BEGIN' for a command, must always have a matching `END'. The commands which are currently) show -pagelevel restore -showpage -%%Page: 5 5 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -12 f0 0 709.2 moveto -(understood by the documentation tools are:) show -10 f4 0 685.3 moveto -(--------------------------------------------------------------------) show -10 f5 0 674.8 moveto -(Command) show -10 f4 42 674.8 moveto -( ) show -10 f5 54 674.8 moveto -(Description) show -10 f4 120 674.8 moveto -( ) show -10 f4 0 664.3 moveto -(--------------------------------------------------------------------) show -10 f4 0 653.8 moveto -(INDENT Text will be indented with respect to the surrounding text. ) show -10 f4 0 643.3 moveto -(NOFILL Text will be output with indentation and formatting as it ) show -10 f4 0 632.8 moveto -( appears. ) show -10 f4 0 622.3 moveto -(CODE Text is output in `NOFILL' mode using a fixed width font. ) show -10 f4 0 611.8 moveto -(COMMENT Text will not be output. This command would be used to sur ) show -10 f4 0 601.3 moveto -( round comments about the implementation, which should not ) show -10 f4 0 590.8 moveto -( appear in the user documentation. ) show -10 f4 0 580.3 moveto -(--------------------------------------------------------------------) show -12 f0 0 556.6 moveto -(Commands may be nested, with the exception that no commands should be nested within a `CODE') show -12 f0 0 543.3 moveto -(block.) show -18 f1 0 510.6 moveto -(4 Inline Formatting) show -12 f0 0 482.7 moveto -(As well as changing the formatting of a block of text, you can change the font style used. This is done) show -12 f0 0 469.4 moveto -(by placing special sequences of characters in the body of the text. Inline formatting commands come in) show -12 f0 0 456.1 moveto -(the following three forms:) show -10 f4 0 432.2 moveto -(----------------------------------------------------------------------------------) show -10 f5 0 421.7 moveto -(Command) show -10 f4 42 421.7 moveto -( ) show -10 f5 96 421.7 moveto -(Description) show -10 f4 162 421.7 moveto -( ) show -10 f4 0 411.2 moveto -(----------------------------------------------------------------------------------) show -10 f4 0 400.7 moveto -( Text between `<` and `>', is displayed in a fixed with font. ) show -10 f4 0 390.2 moveto -(<{text}> Text between `<{` and `}>', is displayed in an italic font. ) show -10 f4 0 379.7 moveto -(<[text]> Text between `<[` and `]>', is displayed in a bold font. ) show -10 f4 0 369.2 moveto -(----------------------------------------------------------------------------------) show -12 f0 0 345.5 moveto -(`' should be used for all C++ keywords, function names, variable names, class names, expressions) show -12 f0 0 332.2 moveto -(etc. The others can be used to highlight text. An example of how inline formatting commands may be) show -12 f0 0 318.9 moveto -(used, follows:) show -10 f4 0 295 moveto -( // = ASSERTIONS) show -10 f4 0 274 moveto -( // Assertion checks can be placed into code using) show -10 f4 0 253 moveto -( // the macro. Note that you should) show -10 f4 0 232 moveto -( // <[NOT]> use an expression in the condition check,) show -10 f4 0 211 moveto -( // which has a side effect, the result of which is) show -10 f4 0 190 moveto -( // necessary for the correct operation of the) show -10 f4 0 169 moveto -( // program. The reason for this, is that assertions) show -10 f4 0 148 moveto -( // can be compiled out of your code by defining the) show -10 f4 0 127 moveto -( // symbol.) show -12 f0 0 103.3 moveto -(Since `<`, and `>' are special characters, you must prefix them with a `\\' if the actual character needs to) show -12 f0 0 90 moveto -(printed. For example:) show -pagelevel restore -showpage -%%Page: 6 6 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -10 f4 0 711.9 moveto -( ) show -12 f0 0 688.2 moveto -(If `{`, `}', `[` or `]' appear adjacent to either `<` or `>' in the forms described above, they will also need) show -12 f0 0 674.9 moveto -(to be prefixed with a `\\'. For example:) show -10 f4 0 651 moveto -( <\\[A-Za-z_]*>) show -18 f1 0 621.2 moveto -(5 Class Sections) show -12 f0 0 593.3 moveto -(Sections pertaining to a class, are placed in the class declaration before the initial opening brace. For) show -12 f0 0 580 moveto -(example:) show -10 f4 0 556.1 moveto -( template) show -10 f4 0 535.1 moveto -( class OTC_List : public OTC_Collection) show -10 f4 0 514.1 moveto -( // = SECTION NAME) show -10 f4 0 493.1 moveto -( // Body text.) show -10 f4 0 472.1 moveto -( {) show -10 f4 0 451.1 moveto -( ...) show -10 f4 0 430.1 moveto -( };) show -12 f0 0 406.4 moveto -(These sections will only appear in the manual page for that class. Sections appearing with a class, which) show -12 f0 0 393.1 moveto -(are given special treatment in the manual page are:) show -10 f4 0 369.2 moveto -(-----------------------------------------------------------------------------) show -10 f5 0 358.7 moveto -(Section) show -10 f4 42 358.7 moveto -( ) show -10 f5 78 358.7 moveto -(Description) show -10 f4 144 358.7 moveto -( ) show -10 f4 0 348.2 moveto -(-----------------------------------------------------------------------------) show -10 f4 0 337.7 moveto -(TITLE A one line description of the class. This will be used in the ) show -10 f4 0 327.2 moveto -( `NAME' section of the manual page. ) show -10 f4 0 316.7 moveto -(CLASS TYPE The type of class. For example: Abstract or Concrete. ) show -10 f4 0 306.2 moveto -(AUDIENCE Who may use the class. For example, the class may only be ) show -10 f4 0 295.7 moveto -( of interest to the class librarian. ) show -10 f4 0 285.2 moveto -(DESCRIPTION A description of the class. ) show -10 f4 0 274.7 moveto -(NOTES Any special features, unimplemented but desirable features, ) show -10 f4 0 264.2 moveto -( side effects, or known bugs. ) show -10 f4 0 253.7 moveto -(SEE ALSO References to any associated documents, systems or classes. ) show -10 f4 0 243.2 moveto -( If listed separately on each line, no comma should be used at ) show -10 f4 0 232.7 moveto -( the end of the line. If more than one appears on a single line, ) show -10 f4 0 222.2 moveto -( a comma should be used to separate them. ) show -10 f4 0 211.7 moveto -(EXAMPLE If realistic, a brief example of how the class may be used. ) show -10 f4 0 201.2 moveto -( Copious examples should not be included here, but should be ) show -10 f4 0 190.7 moveto -( described in a separate user guide. ) show -10 f4 0 180.2 moveto -(-----------------------------------------------------------------------------) show -18 f1 0 150.4 moveto -(6 Member Documentation) show -12 f0 0 122.5 moveto -(Documentation for member variables and member functions do not have to be tagged, as has been the) show -12 f0 0 109.2 moveto -(case so far. It does however have to be put in a certain place with respect to the member variable or) show -12 f0 0 95.9 moveto -(function declaration. The locations, where comments related to a member function or variable can be) show -12 f0 0 82.6 moveto -(placed, are on the same line as the declaration following the semi-colon,) show -pagelevel restore -showpage -%%Page: 7 7 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -10 f4 0 706.7 moveto -( void func1\(\); // Comment) show -10 f4 0 685.7 moveto -( void func2\(\); // Comment) show -12 f0 0 662 moveto -(or on the line immediately following the declaration.) show -10 f4 0 638.1 moveto -( void func1\(\);) show -10 f4 0 617.1 moveto -( // Comment) show -10 f4 0 585.6 moveto -( void func2\(\);) show -10 f4 0 564.6 moveto -( // Comment) show -12 f0 0 540.9 moveto -(The comment may extend over more than one line. A comment for a particular member variable or) show -12 f0 0 527.6 moveto -(function will be terminated by any line which doesn't contain only a comment. A comment will only be) show -12 f0 0 514.3 moveto -(associated with the declaration which immediately preceeds it. For example:) show -10 f4 0 490.4 moveto -( void func1\(\);) show -10 f4 0 469.4 moveto -( void func2\(\);) show -10 f4 0 448.4 moveto -( // Comment) show -12 f0 0 424.7 moveto -(the comment is associated with func2\(\) only and not func1\(\).) show -12 f0 0 398.1 moveto -(If a member function is defined inline, the comment must be placed after the code. For example:) show -10 f4 0 374.2 moveto -( void func1\(\) { ... }) show -10 f4 0 353.2 moveto -( // Comment) show -10 f4 0 321.7 moveto -( void func2\(\)) show -10 f4 0 300.7 moveto -( { ... }) show -10 f4 0 279.7 moveto -( // Comment) show -12 f0 0 256 moveto -(A limitation of the extraction tools, currently requires that you do not place comments, or blank lines,) show -12 f0 0 242.7 moveto -(within the body of the inline code.) show -18 f1 0 210 moveto -(7 Contract Section) show -12 f0 0 182.1 moveto -(Contracts allow grouping of related member functions and variables. This) show -12 f0 0 155.5 moveto -(makes it easier to find a function which serves the purpose you require.) show -12 f0 0 128.9 moveto -(A contract is a grouping of operations which fulfill a responsibility of the class. Contracts could include:) show -18.1 106.4 moveto -3.3 3.3 c fill -12 f0 28 102.3 moveto -(Initialisation of the class.) show -18.1 93.1 moveto -3.3 3.3 c fill -12 f0 28 89 moveto -(Destruction of the class.) show -18.1 79.8 moveto -3.3 3.3 c fill -12 f0 28 75.7 moveto -(The ability to insert items into, or modify a particular aspect of a class.) show -pagelevel restore -showpage -%%Page: 8 8 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -18.1 713.3 moveto -3.3 3.3 c fill -12 f0 28 709.2 moveto -(The ability to make queries about a class or iterate over data it contains.) show -12 f0 0 682.6 moveto -(A contract section is started by placing a comment containing the section title, prior to the functions in) show -12 f0 0 669.3 moveto -(the class that are being grouped together. The list of functions in a contract is terminated by the) show -12 f0 0 656 moveto -(commencement of another contract, a new public, protected, or private section, or the end of the class.) show -12 f0 0 629.4 moveto -(If contract sections are used, only functions which appear under a contract section will appear in the) show -12 f0 0 616.1 moveto -(manual page. Functions which are not in a contract section are not displayed. If no contract sections are) show -12 f0 0 602.8 moveto -(used, two default contract sections, with labels `PROTECTED MEMBERS' and `PUBLIC) show -12 f0 0 589.5 moveto -(MEMBERS', will be created.) show -12 f0 0 562.9 moveto -(An example of a class using contracts is:) show -10 f4 0 539 moveto -( class Class) show -10 f4 0 518 moveto -( // ...) show -10 f4 0 497 moveto -( {) show -10 f4 0 476 moveto -( public:) show -10 f4 0 444.5 moveto -( ~Class\(\);) show -10 f4 0 423.5 moveto -( // This will not appear in the) show -10 f4 0 402.5 moveto -( // manual page.) show -10 f4 0 371 moveto -( // = INITIALISATION) show -10 f4 0 339.5 moveto -( Class\(char const* theString\);) show -10 f4 0 318.5 moveto -( // This will appear in the manual) show -10 f4 0 297.5 moveto -( // page in section INITIALISATION.) show -10 f4 0 276.5 moveto -( //) show -10 f4 0 255.5 moveto -( // Inline formatting, for example:) show -10 f4 0 234.5 moveto -( // , may be used, as may) show -10 f4 0 213.5 moveto -( // block formatting commands.) show -10 f4 0 182 moveto -( // = QUERY) show -10 f4 0 161 moveto -( // As with all other sections, a contract) show -10 f4 0 140 moveto -( // section can have body text. This will appear) show -10 f4 0 119 moveto -( // in the manual page after the section name and) show -10 f4 0 98 moveto -( // before the functions are listed.) show -pagelevel restore -showpage -%%Page: 9 9 -%%BeginPageSetup -/pagelevel save def -54 0 translate -%%EndPageSetup -newpath 0 72 moveto 504 0 rlineto 0 648 rlineto -504 0 rlineto closepath clip newpath -10 f4 0 711.9 moveto -( char const* string\(\);) show -10 f4 0 680.4 moveto -( // Extra information for the current contract may) show -10 f4 0 659.4 moveto -( // also be included between members. This is) show -10 f4 0 638.4 moveto -( // generally used where it is necessary to make a) show -10 f4 0 617.4 moveto -( // comment about a specific set of members in a) show -10 f4 0 596.4 moveto -( // contract.) show -10 f4 0 564.9 moveto -( OTC_Boolean isValid\(\) const;) show -10 f4 0 543.9 moveto -( };) show -10 f4 0 522.9 moveto -( ) show -pagelevel restore -showpage -%%EOF diff --git a/bin/clone.1 b/bin/clone.1 deleted file mode 100644 index 7c36d90fd85..00000000000 --- a/bin/clone.1 +++ /dev/null @@ -1,297 +0,0 @@ -.TH CLONE 1 "6 June 1989" "" -.SH NAME -clone \- make a clone of an entire directory tree -.SH SYNOPSIS -.B clone -[ -.B -q -] [ -.B -v -] [ -.B -f -] [ -.B -c | -s -] [ -.B -S -] -.I "dir1 dir2" -.SH DESCRIPTION -.I Clone -makes an identical copy of an entire (source) directory tree rooted at -the directory named -.I dir1 -into the (target) directory tree -rooted at -.I dir2. -The target directory -.I dir2 -will be created if it does not already exist. -On the other hand, if the directory -.I dir2 -exists, or if the -.I dir2 -directory has any existing subdirectories, then these -directories will -.B not -be deleted or replaced by -.I clone. -.PP -.I Clone -normally creates the clone -directory tree by creating any new directories needed -beneath -.I dir2 -(possibly including -.I dir2 -itself). -.I Clone -then fills in the new directories with hard links -to all of the files in the original (source) directory tree -.I dir1 -such that the new (target) directory tree appears to also contain -all of the files and subdirectories contained in the original (source) -directory tree. -Hard links are normally used when creating -.I clones -of the files in the source directory tree -inside the new (target) directory tree. -This insures that the cost (in disk space) of -.I cloning -a given source directory tree will be very low. -If desired, the new (clone) directory tree can be filled in with -symbolic links or with actual copies of the original files (instead of -using hard links). -.PP -.I Clone -may be particularly useful for maintaining multiple versions -of nearly identical source trees. -.PP -An important feature of -.I clone -is that the -.I dir2 -argument may already exist and may already contain some -files and subdirectories. In such cases, -.I clone -does not disturb these existing files or subdirectories. -Rather, it simply adds the material from the source directory, -.I dir1, -to the material already present within -.I dir2. -In cases where -there are conflicts between files or directories which -already exist in -.I dir2 -but which also exist in -.I dir1, -.I clone -(by default) leaves the files or directories in the target directory -.I dir2 -untouched unless the -.B -f -(force) flag is used, in which case, -.I clone -will override (i.e. delete) the conflicting entries -from the target directory -.I dir2 -and replace them with clones from the source directory -.I dir1. -.SH OPTIONS -.I Clone -recognizes the following options: -.TP -.BI \-q -Quite mode. Suppress all warnings and non-fatal error messages. -.TP -.BI \-v -Verbose mode. Print verbose messages which describe each individual -linking (or copying) action, as well as all -.I mkdir -actions that -.I clone -executes. -.TP -.BI \-f -Force mode. In cases where an item (i.e. either a file or a directory) -exists in the source directory tree -.I dir1, -and also already exists in the target directory tree -.I dir2, -delete the item (ether a file or a directory) in -the target directory tree and then replace it with a clone -of the corresponding item from the source directory tree. -All such deletions causes warning to be issued to -.I stderr -unless the -.B \-q -(quite mode) -option is also specified. -Note that if a given item already exists in the target directory tree, -and if it also exists in the source directory tree, and if both the -(existing) source and target items are themselves directories, then the -.B \-f -option has no effect for these items. Existing directories in the -target directory tree are never deleted by -.I clone -unless there is a corresponding item in the source directory tree which is -.B not -a directory (i.e. is a regular file) and the -.B \-f -option is in effect. -.TP -.BI \-s -Symbolic link mode (not available on System V). When used, this -option causes all non-directory files to be -.I cloned -by making symbolic links from the target directory tree into the source -directory tree. This mode overrides the default mode in which -hard links are used to clone all non-directory files. -.TP -.BI \-c -Copy mode. -In this mode, a physical copy of each non-directory file in the source directory -tree is created in the target directory tree. Note that when this mode is used, -it is an error for the source directory tree to contain any block or character -device files, or any named pipe files. -.TP -.BI \-S -SCCS mode. -In this mode, only the source tree structure is cloned, not its contents. -Symbolic links are created within the destination tree to subdirectories -in the source tree named -.B SCCS. -This mode is useful when multiple developers work from a common SCCS project -tree. To accomplish this, each developer creates a local project tree by -.I cloning -the common SCCS project directory, specifying the -.B \-S -option. -Individual developers are then able to work within their local project tree while -ensuring that all SCCS operations are applied to the common SCCS project tree. -Use of the -.B \-S -option implies the use of the -.B \-s -option and is thus not available on System V. -.SH EXAMPLES -Assume that you have -two directory trees called -.I src1 -and -.I src2 -and that you wish to combine the contents of these -two directories into a new directory named -.I dst -such that if there are any files with duplicate names in both -.I src1 -and in -.I src2 -the files from the -.I src2 -directory tree will take precedence -over the corresponding files in the directory tree -.I src1. -The following commands would accomplish this task: -.sp 1 -.in +0.4i -.ft B -clone src1 dst -.br -clone -f src2 dst -.sp 1 -.in -0.4i -.ft R -Or alternatively, for this simple case, you could have said: -.ft B -.in +0.4i -.sp 1 -clone src2 dst -.br -clone src1 dst -.br -.sp 1 -.in -04.i -.ft R -.PP -To clone an SCCS project tree, such as -.B /pub/EOS_client_server, -one might use the following command, shown with the resulting output: -.sp 1 -.in +0.4i -.ft B -doc% clone -S -v /pub/EOS_client_server ~/EOS_CS -.br -clone: created new output directory: /home/ebupsn/EOS_CS -.br -clone: created new output directory: /home/ebupsn/EOS_CS/bin -.br -clone: created new output directory: /home/ebupsn/EOS_CS/lib -.br -clone: created new output directory: /home/ebupsn/EOS_CS/include -.br -clone: created new output directory: /home/ebupsn/EOS_CS/cmd -.br -clone: created new output directory: /home/ebupsn/EOS_CS/cmd/clone -.br -clone: created symlink /home/ebupsn/EOS_CS/cmd/clone/SCCS -> /pub/EOS_client_server/cmd/clone/SCCS -.br -clone: created symlink /home/ebupsn/EOS_CS/cmd/SCCS -> /pub/EOS_client_server/cmd/SCCS -.br -clone: created new output directory: /home/ebupsn/EOS_CS/man -.br -clone: created new output directory: /home/ebupsn/EOS_CS/man/man1 -.br -clone: created new output directory: /home/ebupsn/EOS_CS/man/man3 -.br -clone: created new output directory: /home/ebupsn/EOS_CS/man/cat1 -.br -clone: created new output directory: /home/ebupsn/EOS_CS/man/cat3 -.br -clone: created symlink /home/ebupsn/EOS_CS/SCCS -> /pub/EOS_client_server/SCCS -.br -.sp 1 -.in -0.4i -.ft R -.SH CAVEATS -On BSD systems, if there are symbolic links in the source tree, -the effects of -.I cloning -may not be what you expect. -A symbolic link within the source tree results in the creation of an -identical symbolic link within the destination tree. -A warning is issued if the symbolic link is either absolute and points -into the source directory or if the symbolic link is relative and -points out of the source tree. -.PP -If the -.B \-S -option is in effect and the source directory is itself a symbolic link -to a directory, the contents of the symbolic link are cloned in the -destination directory rather than setting the destination directory -to be an identical symbolic link. -The rational for this is as follows. -In networked environments, SCCS project directories are often configured -as NFS file systems managed by an NFS auto-mount daemon. -The NFS auto-mount daemon mounts NFS file systems in a temporary locations -and then creates symbolic links to the temporary locations. -Accesses to this symbolic links trigger the NFS auto-mount daemon. -It is therefore necessary that symbolic links in the destination tree -refer to the NFS auto-mount point symbolic link rather than to the NFS -auto-mount point itself. -Symbolic links within the source tree are ignored. -.SH WARNINGS -There are numerous possible warning and/or error messages which -.I clone -will issue for strange circumstances. -These should all be self-explanatory. -.SH FILES -.ta 1.7i -/usr/local/bin/clone The clone program -.SH "SEE ALSO" -ln(1), link(2), symlink(2), readlink(2), mkdir (1), mkdir (2) -.SH AUTHORS -Written by Ron Guilmette at the Microelectronics and Computer Technology -Corporation. Current E-mail address is rfg@ics.uci.edu. -.PP -SCCS mode added 07-April-1993 by Paul Stephenson at Ericsson Business -Communications. Current E-mail address is paul.stephenson@ebu.ericsson.se. diff --git a/bin/clone.cpp b/bin/clone.cpp deleted file mode 100644 index ce7b67afd8e..00000000000 --- a/bin/clone.cpp +++ /dev/null @@ -1,955 +0,0 @@ -#include "ace/OS.h" -// $Id$ - - -#if 0 -#if defined (USG) -#define lstat stat -#else -extern "C" char *getwd (char *); -#define getcwd(str,len) (getwd(str)) -#endif -#endif - -#ifndef MAXPATHLEN -#define MAXPATHLEN 1024 -#endif - -#ifndef BLKDEV_IOSIZE -#define BLKDEV_IOSIZE 1024 -#endif - -extern char *sys_errlist[]; -static void clone (char* s_path, char* d_path, int sroot_flag); - -static char *pname; -static int errors = 0; - -static char* src_path = 0; -static char* dst_path = 0; - -static int quiet_flag = 0; -static int verbose_flag = 0; -static int force_flag = 0; -#ifndef USG -static int symlink_flag = 0; -#endif -static int copy_flag = 0; -static int sccs_flag = 0; - -static void -usage (void) -{ -#ifdef USG - fprintf (stderr, "%s: usage: '%s [-q][-v][-f][-c] pathname1 pathname2'\n", pname, pname); -#else - fprintf (stderr, "%s: usage: '%s [-q][-v][-f][-S][-c | -s | -S] pathname1 pathname2'\n", pname, pname); -#endif - exit (1); -} - -/* abspath(): return the absolutized pathname for the given relative - pathname. Note that if that pathname is already absolute, it may - still be returned in a modified form because this routine also - eliminates redundant slashes and single dots and eliminates double - dots to get a shortest possible pathname from the given input - pathname. The absolutization of relative pathnames is made by - assuming that the given pathname is to be taken as relative to the - first argument (cwd) or to the current directory if cwd is null. */ - -static char * -abspath (char *cwd, char *rel_pathname) -{ - static char cwd_buffer[MAXPATHLEN]; - char abs_buffer[MAXPATHLEN]; - register char *endp; - register char *p; - register char *inp = abs_buffer; - register char *outp = abs_buffer; - - /* Setup the current working directory as needed. */ - - if (!cwd) - { - if (!cwd_buffer[0]) - getcwd (cwd_buffer, MAXPATHLEN); - cwd = cwd_buffer; - } - else if (*cwd != '/') - abort (); /* base path must be absolute */ - - /* Copy the pathname (possibly preceeded by the current working - directory name) into the absolutization buffer. */ - - endp = abs_buffer; - if (rel_pathname[0] != '/') - { - p = cwd; - while (*endp++ = *p++) - continue; - *(endp-1) = '/'; /* overwrite null */ - } - p = rel_pathname; - while (*endp++ = *p++) - continue; - if (endp[-1] == '/') - *endp = (char) 0; - - /* Now make a copy of abs_buffer into abs_buffer, shortening the - pathname (by taking out slashes and dots) as we go. */ - - *outp++ = *inp++; /* copy first slash */ - for (;;) - { - if (!inp[0]) - break; - else if (inp[0] == '/' && outp[-1] == '/') - { - inp++; - continue; - } - else if (inp[0] == '.' && outp[-1] == '/') - { - if (!inp[1]) - break; - else if (inp[1] == '/') - { - inp += 2; - continue; - } - else if ((inp[1] == '.') && (inp[2] == 0 || inp[2] == '/')) - { - inp += (inp[2] == '/') ? 3 : 2; - outp -= 2; - while (outp >= abs_buffer && *outp != '/') - outp--; - if (outp < abs_buffer) - { - /* Catch cases like /.. where we try to backup to a - point above the absolute root of the logical file - system. */ - - fprintf (stderr, "%s: fatal: invalid pathname: %s\n", - pname, rel_pathname); - exit (1); - } - *++outp = (char) 0; - continue; - } - } - *outp++ = *inp++; - } - - /* On exit, make sure that there is a trailing null, and make sure that - the last character of the returned string is *not* a slash. */ - - *outp = (char) 0; - if (outp[-1] == '/') - *--outp = (char) 0; - - /* Make a copy (in the heap) of the stuff left in the absolutization - buffer and return a pointer to the copy. */ - - return strcpy ((char *) malloc (outp - abs_buffer + 1), abs_buffer); -} - -static char* -path_concat (char* s1, char* s2) -{ - int s1_len; - char* ret_val = (char *) malloc ((s1_len = strlen (s1)) + strlen (s2) + 2); - - strcpy (ret_val, s1); - ret_val[s1_len] = '/'; - strcpy (&ret_val[s1_len+1], s2); - return ret_val; -} - -/* Decide if the given path (which may be relative to . or absolute) designa -tes - a point within the original "src_path" directory, and return non-zero if -it - does, or zero otherwise. */ - -static int -in_original_tree (char* other_path) -{ - char* abs_src_path = abspath (NULL, src_path); - char* abs_src_path_slash = path_concat (abs_src_path, ""); - char* abs_other_path = abspath (NULL, other_path); - int ret_val = !strncmp (abs_src_path_slash, abs_other_path, strlen (abs_src_path_slash)); - - free (abs_src_path); - free (abs_src_path_slash); - free (abs_other_path); - return ret_val; -} - -static void -fix_mode (int new_mode, char* d_path) -{ - if (chmod (d_path, new_mode)) - { - if (!quiet_flag) - fprintf (stderr, "%s: warning: can't chmod on output entity %s: %s\n", - pname, d_path, sys_errlist[errno]); - } -} - -static int -remove_item (char* s_path, char* d_path) -{ - struct stat dst_stat_buf; - DIR* dirp; - char containing_dir[MAXPATHLEN]; - - if (lstat (d_path, &dst_stat_buf) == -1) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: cannot get status of %s: %s\n", - pname, d_path, sys_errlist[errno]); - return -1; - } - - /* Before wasting a lot of time sniffing at the thing we are trying to - delete, first make sure that we have write permission into the - directory that contains this thing. Otherwise, it is all a waste - of time. */ - - if (*d_path == '/') - strcpy(containing_dir, d_path); - else - { - containing_dir[0] = '.'; - containing_dir[1] = '/'; - strcpy(containing_dir+2, d_path); - } - *(strrchr (containing_dir, '/')) = '\0'; - if (containing_dir[0] == '\0') - { - containing_dir[0] = '/'; - containing_dir[1] = '\0'; - } - if (access (containing_dir, W_OK)) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: don't have write access to %s: %s\n", - pname, containing_dir, sys_errlist[errno]); - return -1; - } - - switch (dst_stat_buf.st_mode & S_IFMT) - { - case S_IFDIR: - if (access (d_path, R_OK) != 0) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: don't have read permission for directory %s\n", - pname, d_path); - return -1; - } - if (access (d_path, X_OK) != 0) - { - if (!quiet_flag) - fprintf (stderr, - "%s: error: don't have search permission for directory %s\n", - pname, d_path); - return -1; - } - if (access (d_path, W_OK) != 0) - { - if (!quiet_flag) - fprintf (stderr, - "%s: error: don't have write permission for directory %s\n", - pname, d_path); - return -1; - } - if ((dirp = opendir (d_path)) == NULL) - { - if (!quiet_flag) - fprintf (stderr, - "%s: error: can't open directory %s for reading: %s\n", - pname, d_path, sys_errlist[errno]); - return -1; - } - for (;;) - { - struct dirent* dir_entry_p; - char* new_s_path; - char* new_d_path; - - if ((dir_entry_p = readdir (dirp)) == NULL) - break; - if (!strcmp (dir_entry_p->d_name, ".")) - continue; - if (!strcmp (dir_entry_p->d_name, "..")) - continue; - new_s_path = path_concat (s_path, dir_entry_p->d_name); - new_d_path = path_concat (d_path, dir_entry_p->d_name); - if (remove_item (new_s_path, new_d_path)) - { - closedir (dirp); - return -1; - } - free (new_s_path); - free (new_d_path); - } - closedir (dirp); - if (rmdir (d_path)) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: can't delete existing directory %s: %s\n", - pname, d_path, sys_errlist[errno]); - return -1; - } - if (!quiet_flag) - fprintf (stderr, "%s: removed directory %s\n", - pname, d_path); - break; - - /* Note that symbolic links can be treated just like normal files - when the time comes for deleting them. Unlinking a symbolic link - just deletes the link and *not* the thing it points to. */ - - default: - if (unlink (d_path)) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: can't delete existing file %s: %s\n", - pname, d_path, sys_errlist[errno]); - return -1; - } - if (!quiet_flag) - fprintf (stderr, "%s: removed file %s\n", - pname, d_path); - break; - } - return 0; -} - -#ifndef USG -static void -mk_symbolic_link (char *s_path, char *d_path) -{ - if (symlink (s_path, d_path)) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: can't symlink %s to %s: %s\n", - pname, s_path, d_path, sys_errlist[errno]); - } - else - { - if (verbose_flag) - fprintf (stderr, "%s: created symlink %s -> %s\n", - pname, d_path, s_path); - } -} -#endif - -static void -mk_hard_link (char *s_path, char *d_path) -{ - if (link (s_path, d_path)) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: can't link %s to %s: %s\n", - pname, s_path, d_path, sys_errlist[errno]); - } - else - { - if (verbose_flag) - fprintf (stderr, "%s: created hard link %s = %s\n", - pname, d_path, s_path); - } -} - -static void -copy_file (char *s_path, char *d_path) -{ - int input, output; - struct stat src_stat_buf; - - if (lstat (s_path, &src_stat_buf) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't get status of %s: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input entity %s will be ignored\n", - pname, s_path); - } - return; - } - - if ((input = open (s_path, O_RDONLY, 0)) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't open input file %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input file %s will be ignored\n", - pname, s_path); - } - return; - } - - if ((output = open (d_path, O_CREAT | O_WRONLY, src_stat_buf.st_mode & 07777)) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't create output file %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input file %s will be ignored\n", - pname, s_path); - } - return; - } - - for (;;) - { - int rlen, wlen; - char block_buf[BLKDEV_IOSIZE]; - - if ((rlen = read (input, block_buf, BLKDEV_IOSIZE)) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: bad read from input file %s: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input file %s was not fully copied\n", - pname, s_path); - } - break; - } - - if (rlen == 0) - break; - - if ((wlen = write (output, block_buf, rlen)) == -1 || wlen != rlen) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: bad write to output file %s: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input file %s not fully copied\n", - pname, s_path); - } - break; - } - } - - close (output); - close (input); - - fix_mode (src_stat_buf.st_mode & 07777, d_path); - - if (verbose_flag) - fprintf (stderr, "%s: created file copy %s = %s\n", - pname, d_path, s_path); -} - -static void -symlink_SCCS (char* s_path, char* d_path) -{ - struct stat dst_stat_buf; - char symlink_buf[MAXPATHLEN]; - int count; - - if (access (d_path, F_OK)) /* Does d_path exit? */ - { - if (errno != ENOENT) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't check accessability of %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input %s will be ignored\n", - pname, s_path); - } - return; - } - } - else /* d_path exists. What is it? */ - { - if (lstat (d_path, &dst_stat_buf) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: unable to get status of %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input %s will be ignored\n", - pname, s_path); - } - return; - } - - if (S_ISLNK(dst_stat_buf.st_mode)) /* d_path is a symbolic link */ - { - if ((count = readlink (d_path, symlink_buf, MAXPATHLEN)) == -1) - { - fprintf (stderr, "%s: error: can't read symlink %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input file %s will be ignored\n", - pname, s_path); - return; - } - symlink_buf[count] = '\0'; - - if (!strcmp(s_path, symlink_buf)) /* symlink = s_path. Done */ - { - return; - } - else /* symlink != s_path */ - { - if (force_flag) - { - if (remove_item (s_path, d_path) != 0) - return; - } - else - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: Symbolic link %s already exists \ - but does not point to %s\n", - pname, d_path, s_path); - fprintf (stderr, "%s: input s %s will be ignored\n", - pname, s_path); - } - return; - } - } - } - else /* d_path is NOT a symbolic link */ - { - if (force_flag) - { - if (remove_item (s_path, d_path)) - return; - } - else - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: output already exists: %s\n", - pname, d_path); - fprintf (stderr, "%s: input %s will be ignored\n", - pname, s_path); - } - return; - } - } - } - - if (symlink (s_path, d_path)) - { - if (!quiet_flag) - fprintf (stderr, "%s: error: can't symlink %s to %s: %s\n", - pname, s_path, d_path, sys_errlist[errno]); - } - else - { - if (verbose_flag) - fprintf (stderr, "%s: created symlink %s -> %s\n", - pname, d_path, s_path); - } -} - -static void -clone_dir (char* s_path, char* d_path) -{ - DIR* dirp; - - if (access (s_path, R_OK) != 0) - { - if (!quiet_flag) - { - fprintf (stderr, - "%s: error: don't have read permission for input directory %s\n" -, - pname, s_path); - fprintf (stderr, "%s: input directory %s will be ignored\n", - pname, s_path); - } - return; - } - - if (access (s_path, X_OK) != 0) - { - if (!quiet_flag) - { - fprintf (stderr, - "%s: error: don't have search permission for input directory %s\n", - pname, s_path); - fprintf (stderr, "%s: input directory %s will be ignored\n", - pname, s_path); - } - return; - } - - if ((dirp = opendir (s_path)) == NULL) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't open directory %s for reading: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input directory %s will be ignored\n", - pname, s_path); - } - return; - } - - for (;;) - { - struct dirent* dir_entry_p; - char* new_s_path; - char* new_d_path; - char symlink_buf[MAXPATHLEN]; - int len; - - if ((dir_entry_p = readdir (dirp)) == NULL) - break; - if (!strcmp (dir_entry_p->d_name, ".")) - continue; - if (!strcmp (dir_entry_p->d_name, "..")) - continue; - - new_s_path = path_concat (s_path, dir_entry_p->d_name); - new_d_path = path_concat (d_path, dir_entry_p->d_name); - - if (sccs_flag && !strcmp (dir_entry_p->d_name, "SCCS")) - symlink_SCCS(new_s_path, new_d_path); - else - clone (new_s_path, new_d_path, 0); - - free (new_s_path); - free (new_d_path); - } - - closedir (dirp); -} - -static void -clone_symbolic_link (char* s_path,char* d_path) -{ - char symlink_buf[MAXPATHLEN]; - int count; - - if ((count = readlink (s_path, symlink_buf, MAXPATHLEN)) == -1) - { - fprintf (stderr, "%s: error: can't read symlink %s: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input file %s will be ignored\n", - pname, s_path); - return; - } - symlink_buf[count] = '\0'; - - if (symlink_buf[0] == '/') /* symlink is absolute */ - { - if (in_original_tree (symlink_buf)) - { - if (!quiet_flag) - fprintf (stderr, - "%s: warning: absolute symlink points into source tree %s -> %s\n", - pname, s_path, symlink_buf); - } - } - else /* symlink is relative */ - { - char* src_root_relative = path_concat (s_path, symlink_buf); - int in_orig = in_original_tree (src_root_relative); - - free (src_root_relative); - if (!in_orig) - { - if (!quiet_flag) - fprintf (stderr, - "%s: warning: relative symlink points out of source tree %s -> %s\n", - pname, s_path, symlink_buf); - } - } - - mk_symbolic_link(symlink_buf, d_path); /* Make an identical symlink. */ -} - - -/* clone: clone the item designated by s_path as the new item d_path. */ - -#define IS_DIR(STAT_BUF) (((STAT_BUF).st_mode & S_IFMT) == S_IFDIR) - -static void -clone (char* s_path, char* d_path, int sroot_flag) -{ - struct stat src_stat_buf; - struct stat dst_stat_buf; - int dir_already_exists = 0; - char* intype = "file"; - - if (lstat (s_path, &src_stat_buf) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't get status of %s: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input entity %s will be ignored\n", - pname, s_path); - } - return; - } - if (sccs_flag && sroot_flag && S_ISLNK (src_stat_buf.st_mode)) - { - - /* If root of the source path is a symbolic link and - SCCS cloning is enabled, clone the target of the link */ - - if (stat(s_path, &src_stat_buf) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't get status of %s: %s\n", - pname, s_path, sys_errlist[errno]); - fprintf (stderr, "%s: input entity %s will be ignored\n", - pname, s_path); - } - return; - } - } - if (IS_DIR (src_stat_buf)) - intype = "directory"; - if (access (d_path, 0)) - { - if (errno != ENOENT) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't check accessability of %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input %s %s will be ignored\n", - pname, intype, s_path); - } - return; - } - } - else - { - char* outtype = "file"; - - if (lstat (d_path, &dst_stat_buf) == -1) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: unable to get status of %s: %s\n" -, - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input %s %s will be ignored\n", - pname, intype, s_path); - } - return; - } - if (IS_DIR (dst_stat_buf)) - outtype = "directory"; - if (IS_DIR (src_stat_buf) && IS_DIR (dst_stat_buf)) - { - dir_already_exists = -1; - - /* Have to make sure that we have full access to the output - directory (at least temporarily). */ - - chmod (d_path, (dst_stat_buf.st_mode & 07777) | 0700); - if (access (d_path, R_OK | W_OK | X_OK) != 0) - { - if (!quiet_flag) - { - fprintf (stderr, - "%s: error: too few permissions for existing directory %s\n", - pname, d_path); - fprintf (stderr, "%s: input directory %s will be ignored\n", - pname, s_path); - } - return; - } - } - else - { - if (force_flag) - { - if (remove_item (s_path, d_path)) - return; - } - else - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: output %s already exists: %s\n", - pname, outtype, d_path); - fprintf (stderr, "%s: input %s %s will be ignored\n", - pname, intype, s_path); - } - return; - } - } - } - - switch (src_stat_buf.st_mode & S_IFMT) - { - case S_IFDIR: /* Clone a directory */ - - if (!dir_already_exists) - { - /* Don't let others sneak in. - Only we can write the new directory (for now). */ - - if (mkdir (d_path, 0700)) - { - if (!quiet_flag) - { - fprintf (stderr, "%s: error: can't create output directory %s: %s\n", - pname, d_path, sys_errlist[errno]); - fprintf (stderr, "%s: input directory %s will be ignored\n", - pname, s_path); - } - return; - } - if (verbose_flag) - fprintf (stderr, "%s: created new output directory: %s\n", - pname, d_path); - } - - clone_dir(s_path, d_path); - - /* By default, output directories which existed before this - program was executed are reset back to their original - permissions (when we are done adding things to them). For - output directories which are actually created by this program - however, these have their permissions set so that they are - essentially the same as the permissions for their corresponding - input directories, except that the owner is given full - permissions. */ - - if (dir_already_exists) - fix_mode (dst_stat_buf.st_mode & 07777, d_path); - else - fix_mode ((src_stat_buf.st_mode & 07777) | 0700, d_path); - break; - -#ifndef USG - case S_IFLNK: /* Clone a symbolic link */ - - if (!sccs_flag) - clone_symbolic_link (s_path, d_path); - break; -#endif - - default: /* Clone a normal file */ - - if (sccs_flag) - break; - -#ifndef USG - if (symlink_flag) - mk_symbolic_link(s_path, d_path); - else -#endif - if (copy_flag) - copy_file(s_path, d_path); - else - mk_hard_link(s_path, d_path); - - break; - } /* switch */ -} - -int -main (int argc, char *argv[]) -{ - char **argn; - - pname = (pname = strrchr (argv[0], '/')) ? pname+1 : argv[0]; - for (argn = argv+1; *argn; argn++) - { - if (**argn != '-') - { - if (!src_path) - src_path = *argn; - else if (!dst_path) - dst_path = *argn; - else - usage (); - } - else - { - switch (* ((*argn)+1)) - { - case 0: - fprintf (stderr, "%s: invalid option: -\n", pname); - errors = -1; - break; - - case 'q': - quiet_flag = -1; - break; - - case 'v': - verbose_flag = -1; - break; - - case 'f': - force_flag = -1; - break; - -#ifndef USG - case 'S': - sccs_flag = -1; - - if (copy_flag) - errors++; - break; -#endif - -#ifndef USG - case 's': - symlink_flag = -1; - if (copy_flag) - errors++; - break; -#endif - - case 'c': - copy_flag = -1; -#ifndef USG - if (symlink_flag) - errors++; - - if (sccs_flag) - errors++; -#endif - break; - - default: - fprintf (stderr, "%s: invalid option: -%c\n", - pname, *((*argn)+1)); - errors = -1; - } - } - } - if (errors || src_path == 0 || dst_path == 0) - usage (); -#if 0 // ndef USG - if (symlink_flag && *src_path != '/') - { - fprintf (stderr, "%s: error: source root pathname must be absolute when using -s\n", - pname); - exit (1); - } -#endif - if (access (src_path, 0) == -1) - { - fprintf (stderr, "%s: error: accessing source root entity %s: %s\n", - pname, src_path, sys_errlist[errno]); - exit (1); - } - umask (0); /* disable all masking */ - clone (src_path, dst_path, 1); - return 0; -} diff --git a/bin/clone.csh b/bin/clone.csh deleted file mode 100644 index 1c14e912d64..00000000000 --- a/bin/clone.csh +++ /dev/null @@ -1,26 +0,0 @@ -#!/bin/csh - -set src_root=`pwd` -set dst_root=`abspath $1` - -set subdirs=`find * -type d -print` - -mkdir $dst_root -set files=`find * \( -type d -prune \) -o -type f -print` - -if ($#files) then - ln $files $dst_root -endif - -if ($#subdirs) then - foreach subdir ($subdirs) - cd $src_root - mkdir $dst_root/$subdir - cd $src_root/$subdir - set files=`find * \( -type d -prune \) -o -type f -print` - if ($#files) then - ln $files $dst_root/$subdir - endif - end -endif -exit 0 diff --git a/bin/g++dep b/bin/g++dep deleted file mode 100755 index b149b7ff98d..00000000000 --- a/bin/g++dep +++ /dev/null @@ -1,80 +0,0 @@ -#! /bin/sh - -# This utility is a lightly editted version of the freed Berkeley -# script `mkdep'. The current script is intended to work for GNU G++. - -# Here is the original BSD header: -# @(#)mkdep.sh 1.7 (Berkeley) 10/13/87 -# - -PATH=/bin:/usr/bin:/usr/ucb:/usr/gnu:/usr/gnu/bin:/opt/gnu/bin:/pkg/gnu/bin:$PATH -export PATH - -if [ $# = 0 ] ; then - echo 'usage: g++dep [-p] [-f makefile] [flags] file ...' - exit 1 -fi - -MAKE=Makefile # default makefile name is "Makefile" -case $1 in - # -f allows you to select a makefile name - -f) - MAKE=$2 - shift; shift ;; - - # the -p flag produces "program: program.c" style dependencies - # so .o's don't get produced - -p) - SED='-e s;\.o;;' - shift ;; - # -r allows the use of relative pathnames... - -r) - REL="-e s;$WRAPPER_ROOT;\$(WRAPPER_ROOT);g" - shift ;; -esac - -if [ ! -w $MAKE ]; then - echo "g++dep: no writeable file \"$MAKE\"" - exit 1 -fi - -TMP=/tmp/g++dep$$ - -trap 'rm -f $TMP ; exit 1' 1 2 3 13 15 - -cp $MAKE ${MAKE}.bak - -sed -e '/DO NOT DELETE THIS LINE/,$d' < $MAKE > $TMP - -cat << _EOF_ >> $TMP -# DO NOT DELETE THIS LINE -- g++dep uses it. -# DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. - -_EOF_ - -gcc -MM $* | /bin/sed -e "s; \./; ;g" $SED $REL | \ - awk ' { \ - if ($1 != prev) { \ - if (rec != "") \ - print rec; rec = $0; prev = $1; \ - } \ - else { \ - if (length(rec $2) > 78) { \ - print rec; rec = $0; \ - } else \ - rec = rec " " $2 \ - } \ - } \ - END { \ - print rec \ - } ' >> $TMP - -cat << _EOF_ >> $TMP - -# IF YOU PUT ANYTHING HERE IT WILL GO AWAY -_EOF_ - -# copy to preserve permissions -cp $TMP $MAKE -rm -f ${MAKE}.bak $TMP -exit 0 diff --git a/bin/hiding.fmt b/bin/hiding.fmt deleted file mode 100644 index e77a719aee2..00000000000 --- a/bin/hiding.fmt +++ /dev/null @@ -1,20 +0,0 @@ -# -# access control file for ADTs -# -# K. Dorn -# - -CSAMERGECXXHXX -off - -CSAHEADER -on - -PUBLIC -on - -PROTECTED -on - -PRIVATE -on diff --git a/bin/html-windex b/bin/html-windex deleted file mode 100755 index 2a80ae85f6b..00000000000 --- a/bin/html-windex +++ /dev/null @@ -1,33 +0,0 @@ -#!/bin/sh -# -# This script generates automatically to its stdout a windex.html file; -# this file is useful just after running man2html. -# All the html man pages must be located under an html directory at the -# same level as the generated windex.html file. -# - - -WINDEX=$1 - -cat < -

ACE Wrappers Man Pages Index

-

- This file has been generated from the windex file from the ACE package - and it contains a list of pointers to the man2html'ed man pages. -

-


-