\begindata{text,539034816}
\textdsversion{12}
\template{help}
\define{global
}
\chapter{Conclass: Converting to use short filenames

}
\section{What conclass is

}
\leftindent{\italic{Conclass} is a program that converts ATK application code 
written prior to the class system change of April, 1989 to code that uses 
shortened filenames.


There are two main types of changes that programmers need to know about to 
convert their code to use the shortened filenames.


1. The include files need to include the shortened names.  For example, where 
one had

\example{ #include <dataobject.ih>


} one now has to have

\example{ #include <dataobj.ih>}


2. These shortened names also have to be supplied when defining the parent of 
a new class.  For example, an old foo.H file would contain the line

\example{class foo : dataobject \{}


now it is necessary to define it in a foo.ch file as

\example{class foo : dataobject [dataobj] \{}


\italic{Conclass} makes both of these conversions automatically, using the 
class indexing code and the user's current classpath.


Note, though, that \italic{conclass} only provides the proper key name for an 
object's parent's class. The new class program is more strict about some 
things than the old one was (i.e. - it expects a finalize object routine to be 
defined if there is an initialize object).  Thus, it may still be necessary 
for the user to fix up other parts of the file to eliminate warnings the new 
class program may produce.  For more details on the class system, see the 
 \italic{class  }documentation.


}\section{Using conclass

}
\leftindent{\italic{Conclass} reads either the supplied filename or standard 
input.  It always writes to standard output. } \leftindent{The usage of 
conclass is as follows:


\bold{conclass [-h] [-r] filename > newfilename}


-h    used to convert .H to .ch files

-r     reverses the conversion process.  This is useful for people who need to 
maintain code in "two worlds."


Here is an example of how you might use conclass to convert the class\bold{ 
foo}:


% \bold{cd foo}

% \bold{mv foo.c foo.c.old}

% \bold{conclass foo.c.old > foo.c}

% \bold{conclass -h foo.H > foo.ch}


Note: for conclass to work, your CLASSPATH or ANDREWDIR must be set to use the 
new ATK software, even if one is using the -r flag to convert new style back 
to old style. This is because it needs to use the class index files to do it's 
conversion.  For more details on this index and the class system, see the 
 \italic{\helptopic{class}  }documentation.


}\section{Other conversion programs}\leftindent{


There is a script called r4conv.csh that also performs conversions.  It runs 
sed over files and uses a static list of names that need converted. The 
\italic{conclass} program is more dynamic; it uses the class indexing code and 
the current classpath to do the same thing, without being tied to a static 
list. In general , the conclass program should be used, unless it is important 
to 'jumpstart' some modules that need to be compiled before the ITC supplied 
ATK programs.

}
\section{Related tools}  


Select (highlight) one of the italicized names and choose "Show Help on 
Selected Word" from the pop-up menu to see the help file for:


\leftindent{\italic{\helptopic{class}

\helptopic{fixcons}

\helptopic{r4conv}}}


\begindata{bp,537558784}
\enddata{bp,537558784}
\view{bpv,537558784,1123,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,539034816}
