\hypertarget{cid_8c}{
\section{cid.c File Reference}
\label{cid_8c}\index{cid.c@{cid.c}}
}
Main routine to drive the linker interface description file reader.  


{\tt \#include $<$stdio.h$>$}\par
{\tt \#include $<$string.h$>$}\par
{\tt \#include \char`\"{}CMX/CMX\_\-interface\_\-pub.h\char`\"{}}\par


Include dependency graph for cid.c:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=156pt]{cid_8c__incl}
\end{center}
\end{figure}
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct \hyperlink{struct__CID__Command}{\_\-CID\_\-Command}
\begin{CompactList}\small\item\em Standard structure for descibing a CID command. \item\end{CompactList}\item 
struct \hyperlink{struct__CID__Qualifier}{\_\-CID\_\-Qualifier}
\begin{CompactList}\small\item\em Standard structure for describing a CID qualifier. \item\end{CompactList}\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef unsigned int \hyperlink{cid_8c_a0}{CID\_\-dispatch} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Typedef for a command line callback routine. \item\end{CompactList}\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
unsigned int \hyperlink{cid_8c_a3}{abbrev} (const char $\ast$left, unsigned int llen, const char $\ast$rite, unsigned int rlen, unsigned int min)
\begin{CompactList}\small\item\em Test a string for being a minimally long abbreviation of another. \item\end{CompactList}\item 
\hypertarget{cid_8c_a4}{
unsigned int \hyperlink{cid_8c_a4}{parse\_\-arg} (unsigned int $\ast$pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]}, unsigned int qcnt, struct \hyperlink{struct__CID__Qualifier}{\_\-CID\_\-Qualifier} $\ast$qlst)}
\label{cid_8c_a4}

\begin{CompactList}\small\item\em Identify parameters and qualifiers in arguments. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a5}{check} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Check the syntax of an interface definition file. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a6}{compare} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Compare an \char`\"{}old\char`\"{} and a \char`\"{}new\char`\"{} interface definition file. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a7}{find} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Find a symbol in an interface definition file. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a8}{show} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Show some feature of an interface definition file. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a9}{show\_\-interface} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Show the interface names in an interface definition file. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a10}{show\_\-global} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Show global symbols in an interface file. \item\end{CompactList}\item 
unsigned int \hyperlink{cid_8c_a11}{show\_\-lookup} (unsigned int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})
\begin{CompactList}\small\item\em Show lookup symbols in an interface file. \item\end{CompactList}\item 
\hypertarget{cid_8c_a12}{
int \hyperlink{cid_8c_a12}{main} (int pcnt, const char $\ast$parm\mbox{[}$\,$\mbox{]})}
\label{cid_8c_a12}

\begin{CompactList}\small\item\em Main routine. \item\end{CompactList}\end{CompactItemize}
\subsection*{Variables}
\begin{CompactItemize}
\item 
\hypertarget{cid_8c_a1}{
const char $\ast$ \hyperlink{cid_8c_a1}{s\_\-few} = \char`\"{}few\char`\"{}}
\label{cid_8c_a1}

\begin{CompactList}\small\item\em The string \char`\"{}few\char`\"{}. \item\end{CompactList}\item 
\hypertarget{cid_8c_a2}{
const char $\ast$ \hyperlink{cid_8c_a2}{s\_\-many} = \char`\"{}many\char`\"{}}
\label{cid_8c_a2}

\begin{CompactList}\small\item\em The string \char`\"{}many\char`\"{}. \item\end{CompactList}\end{CompactItemize}


\subsection{Detailed Description}
Main routine to drive the linker interface description file reader. 



\footnotesize\begin{verbatim}
CVS $Id: cid.c,v 1.4 2005/07/14 22:46:45 apw Exp $
\end{verbatim}\normalsize


\subsection{Typedef Documentation}
\hypertarget{cid_8c_a0}{
\index{cid.c@{cid.c}!CID_dispatch@{CID\_\-dispatch}}
\index{CID_dispatch@{CID\_\-dispatch}!cid.c@{cid.c}}
\subsubsection[CID\_\-dispatch]{\setlength{\rightskip}{0pt plus 5cm}unsigned int \hyperlink{cid_8c_a0}{CID\_\-dispatch}}}
\label{cid_8c_a0}


Typedef for a command line callback routine. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Remaining parameter (token) count \item[{\em parm}]Remaining parameters (tokens)\end{description}
\end{Desc}
This defines the signature of a command line callback routine. The main routine peels off the first word (token) and tries to match it against a list of verbs. If a match is found, control is dispatched to the corresponding routine which must have this signature. 

\subsection{Function Documentation}
\hypertarget{cid_8c_a3}{
\index{cid.c@{cid.c}!abbrev@{abbrev}}
\index{abbrev@{abbrev}!cid.c@{cid.c}}
\subsubsection[abbrev]{\setlength{\rightskip}{0pt plus 5cm}unsigned int abbrev (const char $\ast$ {\em left}, unsigned int {\em llen}, const char $\ast$ {\em rite}, unsigned int {\em rlen}, unsigned int {\em min})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a3}


Test a string for being a minimally long abbreviation of another. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em left}]String to test \item[{\em llen}]Length of string to test \item[{\em rite}]String to test against \item[{\em rlen}]Length of string to test against \item[{\em min}]Minimum length of overlap\end{description}
\end{Desc}
\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}
\hypertarget{cid_8c_a5}{
\index{cid.c@{cid.c}!check@{check}}
\index{check@{check}!cid.c@{cid.c}}
\subsubsection[check]{\setlength{\rightskip}{0pt plus 5cm}unsigned int check (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a5}


Check the syntax of an interface definition file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a5}{check()} reads in the interface file and checks its syntax. If the syntax is good, the command will exit silently. If the syntax is bad, a list of syntax errors is printed.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=132pt]{cid_8c_a5_cgraph}
\end{center}
\end{figure}
\hypertarget{cid_8c_a6}{
\index{cid.c@{cid.c}!compare@{compare}}
\index{compare@{compare}!cid.c@{cid.c}}
\subsubsection[compare]{\setlength{\rightskip}{0pt plus 5cm}unsigned int compare (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a6}


Compare an \char`\"{}old\char`\"{} and a \char`\"{}new\char`\"{} interface definition file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a6}{compare()} tests an old and a new interface definition file for \char`\"{}compatibility\char`\"{}. On an interface by interface basis, \hyperlink{cid_8c_a6}{compare()} reports (prints) an \char`\"{}opinion\char`\"{}. If the new interface increments the major release number, the opinion is \char`\"{}major\char`\"{}. If the new interface keeps the same major release number but extends the interface the opinion will be either \char`\"{}minor\char`\"{} or \char`\"{}patch\char`\"{} depending on how the interface has been extended. All other cases (e.g. major release number decreases, interface instance in old no longer present in new, global symbol content of an interface instance changed between old and new, ...) produce the opinion \char`\"{}error\char`\"{}.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=139pt]{cid_8c_a6_cgraph}
\end{center}
\end{figure}
\hypertarget{cid_8c_a7}{
\index{cid.c@{cid.c}!find@{find}}
\index{find@{find}!cid.c@{cid.c}}
\subsubsection[find]{\setlength{\rightskip}{0pt plus 5cm}unsigned int find (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a7}


Find a symbol in an interface definition file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a7}{find()} searches the instances in an interface definition file to find the requested global symbol(s). If found, the symbol is printed along with the name of the interface in which it was found. If the symbol cannot be found, the symbol name is still printed, but attributed to interface $<$untraceable$>$.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=129pt]{cid_8c_a7_cgraph}
\end{center}
\end{figure}
\hypertarget{cid_8c_a8}{
\index{cid.c@{cid.c}!show@{show}}
\index{show@{show}!cid.c@{cid.c}}
\subsubsection[show]{\setlength{\rightskip}{0pt plus 5cm}unsigned int show (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a8}


Show some feature of an interface definition file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a8}{show()} is simply a branch routine. It peels off the next parameter to identify either \char`\"{}global\char`\"{} or \char`\"{}interface\char`\"{} and branches to the relevant routine.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=192pt]{cid_8c_a8_cgraph}
\end{center}
\end{figure}
\hypertarget{cid_8c_a10}{
\index{cid.c@{cid.c}!show_global@{show\_\-global}}
\index{show_global@{show\_\-global}!cid.c@{cid.c}}
\subsubsection[show\_\-global]{\setlength{\rightskip}{0pt plus 5cm}unsigned int show\_\-global (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a10}


Show global symbols in an interface file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a10}{show\_\-global()} simply lists all the symbols in all the interfaces defined in an interface definition file.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=149pt]{cid_8c_a10_cgraph}
\end{center}
\end{figure}
\hypertarget{cid_8c_a9}{
\index{cid.c@{cid.c}!show_interface@{show\_\-interface}}
\index{show_interface@{show\_\-interface}!cid.c@{cid.c}}
\subsubsection[show\_\-interface]{\setlength{\rightskip}{0pt plus 5cm}unsigned int show\_\-interface (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a9}


Show the interface names in an interface definition file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a9}{show\_\-interface()} prints information about the interfaces defined in an interface definition file. There are several options (see the \char`\"{}CMX User Manual\char`\"{} for details). The major options control (1) whether the display is indented to show the interface instance hierarchy, (2) whether the \char`\"{}symbol strength\char`\"{} of an interface instance is printed and (3) whether the globals defined in an interface instance are printed.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=156pt]{cid_8c_a9_cgraph}
\end{center}
\end{figure}
\hypertarget{cid_8c_a11}{
\index{cid.c@{cid.c}!show_lookup@{show\_\-lookup}}
\index{show_lookup@{show\_\-lookup}!cid.c@{cid.c}}
\subsubsection[show\_\-lookup]{\setlength{\rightskip}{0pt plus 5cm}unsigned int show\_\-lookup (unsigned int {\em pcnt}, const char $\ast$ {\em parm}\mbox{[}$\,$\mbox{]})\hspace{0.3cm}{\tt  \mbox{[}static\mbox{]}}}}
\label{cid_8c_a11}


Show lookup symbols in an interface file. 

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em pcnt}]Number of argument strings remaining \item[{\em parm}]Array of pointers to argument strings\end{description}
\end{Desc}
\hyperlink{cid_8c_a11}{show\_\-lookup()} lists all the symbols in all the interfaces marked for inclusion by the CMX symbol lookup mechanism.

\begin{Desc}
\item[Return values:]
\begin{description}
\item[{\em 0}]Success \item[{\em 1}]Failure \end{description}
\end{Desc}


Here is the call graph for this function:\begin{figure}[H]
\begin{center}
\leavevmode
\includegraphics[width=152pt]{cid_8c_a11_cgraph}
\end{center}
\end{figure}
