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/pslib/psLibSRS.tex

    r391 r514  
    1 %%% $Id: psLibSRS.tex,v 1.3 2004-04-07 03:26:07 eugene Exp $
     1%%% $Id: psLibSRS.tex,v 1.4 2004-04-23 21:57:43 eugene Exp $
    22\documentclass[panstarrs]{panstarrs}
    33
     
    7777\subsubsection{Software Coding Requirements}
    7878
    79 \subsubsubsection{CSCI Deliverable}
    80 
    81 All final source code generated for the IPP is to be delivered via
    82 CVS, including the test code.  CVS revision history shall be included
    83 and made available via CVS.
    84 
    85 \subsubsubsection{Languages}
     79\paragraph{Languages}
    8680
    8781Source code shall be in C.  All source code shall be compiled with
     
    9084Scripting language shall be in \tbd{Python, version TBD}.
    9185
    92 \subsubsubsection{Interfaces}
     86\paragraph{Interfaces}
    9387
    9488Access to low-level Library functions shall be provided via C APIs
     
    9892processing jobs shall be available via the UNIX shell.
    9993
    100 \subsubsubsection{Coding Standards}
     94\paragraph{Coding Standards}
    10195
    10296The C code shall comply with ANSI Standard C99.  Because the delivered
     
    110104defined in the document TBD}.
    111105
    112 \subsubsubsection{Commenting and Documentation}
     106\paragraph{Naming Conventions}
     107
     108Header files must have names starting \code{ps} or \code{p_ps} for
     109private interface definitions. The latter must appear in a
     110subdirectory \code{private} of whichever directory is being searched
     111for the public header files.
     112
     113Functions visible at global scope which are part of the public API
     114must have names begining with \code{ps}, and follow the naming
     115conventions in the coding standard.  Functions that are visible at
     116global scope but which are not part of the public interface must have
     117names begining with \code{p_ps}.  Functions that are local to a file
     118must \textit{not} start \code{ps} (or \code{p_ps}).
     119 
     120Variables visible at global scope which are part of the public API
     121must have names begining with \code{ps}, and follow the naming
     122conventions in the coding standard.  Variables that are visible at
     123global scope but which are not part of the public interface must have
     124names begining with \code{p_ps}.  Variables that are local to a file
     125must \textit{not} start \code{ps} (or \code{p_ps}).
     126
     127The names of all enumerated types and C-preprocessor symbols (but not
     128variables declared \code{const}) must start with \code{PS_}, in the
     129case of public symbols, or \code{P_PS_}, for private symbols.  The
     130rest of the name must be uppercase with words separated by underscores
     131(\code{_}). An exception is the case of system utilities implemented
     132as macros, in which case the names must conform to the convention for
     133function names.
     134
     135When defining a function to convert from one type to another, the name
     136should be of the form \code{psOldToAlloc}, e.g.\hfil\break
     137\code{psEquatorialToEcliptic} (\emph{not}
     138\code{psEquatorial2Ecliptic}).
     139
     140\paragraph{C Programming Guidelines}
     141
     142Functions that assign to a variable should list that argument
     143\textit{first}, following the pattern of \code{strcpy}; e.g.
     144\begin{verbatim}
     145void psAddToVector(restrict psVec *outVec, const restrict psVec *inVec,
     146                   int val);
     147\end{verbatim}
     148
     149Type definitions should always be accompanied by prototypes for their
     150constructors and destructors, following these guidelines:
     151
     152\begin{itemize}
     153\item The constructor name should consist of the type name followed by
     154\code{Alloc}; e.g. a type \code{psImage} would be created by a
     155function
     156\begin{verbatim}
     157psImage *psImageAlloc(int nrow, int ncol);
     158\end{verbatim}
     159
     160\item The type should be freed with a destructor named \code{typeFree}, e.g.
     161\begin{verbatim}
     162void psImageFree(psImage *img);
     163\end{verbatim}
     164
     165\item The constructor must never return \code{NULL}, and no code calling the
     166constructor should ever check the return value.
     167
     168\item The destructor must not return a value.
     169
     170\item The destructor must handle being passed \code{NULL} by simply
     171returning immediately. This should not be treated as an error
     172condition.
     173
     174\item Constructors and Destructors should use the memory reference
     175  counter facilities of the PSLib memory management system.
     176
     177\end{itemize}
     178
     179\paragraph{Commenting and Documentation}
    113180
    114181Commenting of delivered C and Python code shall follow the C and
     
    124191documentation shall be delivered as PDF documents.
    125192
    126 \subsubsubsection{Version Control}
     193\paragraph{Version Control}
    127194
    128195Source code version control shall be implemented with CVS. 
    129196
    130 \subsubsubsection{Platform architectures and operating systems}
     197\paragraph{CSCI Deliverable}
     198
     199All final source code generated for the IPP is to be delivered via
     200CVS, including the test code.  CVS revision history shall be included
     201and made available via CVS.
     202
     203\paragraph{Platform architectures and operating systems}
    131204
    132205Makefiles shall be provided with appropriate flags set so that all
     
    143216such as those caused by lex-generated code. 
    144217
    145 Although the code must compile successfully under all three listed
     218Although the code must compile successfully under both listed
    146219operating systems, unit testing should only be performed for the
    147220x86/Linux combination.
    148221
    149 \subsubsubsection{Software Configuration}
     222\paragraph{Software Configuration}
    150223
    151224\tbd{deferred}
Note: See TracChangeset for help on using the changeset viewer.