IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Apr 23, 2004, 11:57:43 AM (22 years ago)
Author:
eugene
Message:

changes to coding requirements from MHPCC comments

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/design/specs.tex

    r424 r514  
    1 %%% $Id: specs.tex,v 1.5 2004-04-15 01:38:47 eugene Exp $
     1%%% $Id: specs.tex,v 1.6 2004-04-23 21:57:43 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    172172\subsubsection{Software Coding Requirements}
    173173
    174 \paragraph{CSCI Deliverable}
    175 
    176 All final source code generated for the IPP is to be delivered via
    177 CVS, including the test code.  CVS revision history shall be included
    178 and made available via CVS.
    179 
    180174\paragraph{Languages}
    181175
     
    205199defined in the document TBD}.
    206200
     201\paragraph{Naming Conventions}
     202
     203Header files must have names starting \code{ps} or \code{p_ps} for
     204private interface definitions. The latter must appear in a
     205subdirectory \code{private} of whichever directory is being searched
     206for the public header files.
     207
     208Functions visible at global scope which are part of the public API
     209must have names begining with \code{ps}, and follow the naming
     210conventions in the coding standard.  Functions that are visible at
     211global scope but which are not part of the public interface must have
     212names begining with \code{p_ps}.  Functions that are local to a file
     213must \textit{not} start \code{ps} (or \code{p_ps}).
     214 
     215Variables visible at global scope which are part of the public API
     216must have names begining with \code{ps}, and follow the naming
     217conventions in the coding standard.  Variables that are visible at
     218global scope but which are not part of the public interface must have
     219names begining with \code{p_ps}.  Variables that are local to a file
     220must \textit{not} start \code{ps} (or \code{p_ps}).
     221
     222The names of all enumerated types and C-preprocessor symbols (but not
     223variables declared \code{const}) must start with \code{PS_}, in the
     224case of public symbols, or \code{P_PS_}, for private symbols.  The
     225rest of the name must be uppercase with words separated by underscores
     226(\code{_}). An exception is the case of system utilities implemented
     227as macros, in which case the names must conform to the convention for
     228function names.
     229
     230When defining a function to convert from one type to another, the name
     231should be of the form \code{psOldToAlloc}, e.g.\hfil\break
     232\code{psEquatorialToEcliptic} (\emph{not}
     233\code{psEquatorial2Ecliptic}).
     234
     235\paragraph{C Programming Guidelines}
     236
     237Functions that assign to a variable should list that argument
     238\textit{first}, following the pattern of \code{strcpy}; e.g.
     239\begin{verbatim}
     240void psAddToVector(restrict psVec *outVec, const restrict psVec *inVec,
     241                   int val);
     242\end{verbatim}
     243
     244Type definitions should always be accompanied by prototypes for their
     245constructors and destructors, following these guidelines:
     246
     247\begin{itemize}
     248\item The constructor name should consist of the type name followed by
     249\code{Alloc}; e.g. a type \code{psImage} would be created by a
     250function
     251\begin{verbatim}
     252psImage *psImageAlloc(int nrow, int ncol);
     253\end{verbatim}
     254
     255\item The type should be freed with a destructor named \code{typeFree}, e.g.
     256\begin{verbatim}
     257void psImageFree(psImage *img);
     258\end{verbatim}
     259
     260\item The constructor must never return \code{NULL}, and no code calling the
     261constructor should ever check the return value.
     262
     263\item The destructor must not return a value.
     264
     265\item The destructor must handle being passed \code{NULL} by simply
     266returning immediately. This should not be treated as an error
     267condition.
     268
     269\item Constructors and Destructors should use the memory reference
     270  counter facilities of the PSLib memory management system.
     271
     272\end{itemize}
     273
    207274\paragraph{Commenting and Documentation}
    208275
     
    223290Source code version control shall be implemented with CVS. 
    224291
     292\paragraph{CSCI Deliverable}
     293
     294All final source code generated for the IPP is to be delivered via
     295CVS, including the test code.  CVS revision history shall be included
     296and made available via CVS.
     297
    225298\paragraph{Platform architectures and operating systems}
    226299
     
    238311such as those caused by lex-generated code. 
    239312
    240 Although the code must compile successfully under all three listed
     313Although the code must compile successfully under both listed
    241314operating systems, unit testing should only be performed for the
    242315x86/Linux combination.
     
    244317\paragraph{Software Configuration}
    245318
    246 \tbd{Makefiles, directory structures, UPS, etc}
     319\tbd{deferred}
    247320
    248321\subsubsection{Architectural Components}
Note: See TracChangeset for help on using the changeset viewer.