![]() |
|
Purpose of this document
This is a draft of ING's requirements for using the Concurrent Versions System (CVS). It describes some of the file templates to be used. It also defines the specified CVS macros to be used in the source code. The rationale behind the specified CVS macros are to provide the necessary information both in printed and displayed form on the source document and in compiled code.
Please checkout from CVS the unixstarterkit which will provide the basic templates for all types of files in use at ING ie Imakefiles, html files etc.
The command :- cvs checkout unixstarterkit
will get this for you. It also provides the basic directory structure for your imported module.
/*---------------------------------------------------------------------------*/
/* */
/* Isaac Newton Group of Telescopes */
/* Roque de los Muchachos Observatory */
/* La Palma */
/* */
/* Copyright PPARC 2000 */
/* */
/*---------------------------------------------------------------------------*/
/*- start of module header information ----------------------------------------
COMPONENT:
$Id:$
TYPE:
C source file.
PURPOSE:
PORTABILITY:
Would be fully ANSI-C compliant but for definition of NULL
defined in locale.h . Therefore this module is only POSIX-C compliant.
DESCRIPTION:
PERSONNEL:
Dennis Armstrong, Computer Software Group,ING. dba@ing.iac.es
HISTORY:
$Log:$
--- End of module header information ----------------------------------------*/
/*- Feature test switches ---------------------------------------------------*/
#define _POSIX_SOURCE 1
/*- System headers ----------------------------------------------------------*/
#include <locale.h> /* needed for definition of NULL */
#include <stdio.h> /* for debugging */
#include <stdlib.h> /* for EXIT_SUCCESS */
/*- Local headers -----------------------------------------------------------*/
#include "../include/starter.h" /* local header */
/*- Local macros ------------------------------------------------------------*/
/*- Local typedefs, structures and unions -----------------------------------*/
/*- External data -----------------------------------------------------------*/
/*- Local data --------------------------------------------------------------*/
const char id_header_c[] = "@(#)$Id:$";
/*- Local function prototypes -----------------------------------------------*/
/*- Signal catching functions -----------------------------------------------*/
/*- Main --------------------------------------------------------------------*/
int main(int argc, char *argv[])
{
return EXIT_SUCCESS;
}
/*- Externally visible functions --------------------------------------------*/
/*---------------------------------------------------------------------------*/
/* A_Function */
/* Describes what the function provides */
/* */
/* Parameters */
/* Input: inp - some input value */
/* */
/* Output: outp - some output value */
/* status - some status value */
/* */
/* Returns: an integer */
/* */
/*---------------------------------------------------------------------------*/
int A_Function(int inp, int *outp, int *status)
{
return 0;
}
/*---------------------------------------------------------------------------*/
/* end of $RCSfile:$ */
/*---------------------------------------------------------------------------*/
The $Id:$ macro will give the information as to the current version number and who last checked it into the repository.
The $Log:$ macro will display the login information when last checked into the repository.
The 'const char id_header_c[] = "@(#)$Id:$";' function will display the log version information in the compiled binary.
The construct @(#)$Id:$ will provide this information with the strings(1) command for both SCCS and CVS repositories. ie. use the command 'strings * | grep "@(#)"' Alternatively the what(1) command can be used to show the embeded strings.
Please remember to change the id_header_c[] to the name of your source file. ie id_mysource_c[].
The $RCSfile:$ macro is only to aid in the definition of the end of the file.
/*---------------------------------------------------------------------------*/
/* */
/* Isaac Newton Group of Telescopes */
/* Roque de los Muchachos Observatory */
/* La Palma */
/* */
/* Copyright PPARC 2000 */
/* */
/*---------------------------------------------------------------------------*/
/*- start of module header information ----------------------------------------
COMPONENT:
$Id:$
TYPE:
C source-code header file.
PURPOSE:
FUNCTION:
Test Program.
SUBORDINATES:
None.
DEPENDENCIES:
None.
INTERFACES:
None
PERSONNEL:
Dennis Armstrong, Computer Software Group,ING. dba@ing.iac.es
HISTORY:
$Log:$
--- End of module header information ----------------------------------------*/
#ifndef _HEADER_H
#define _HEADER_H
/*- Global constants --------------------------------------------------------*/
#pragma ident "@(#)$Id:$"
#define ING_OK 0 /* All subroutines return this value if OK */
#define ING_DEBUG /* Define this if debugging information required */
/*- Global typedefs, structures and unions ----------------------------------*/
/*- Global function prototypes ----------------------------------------------*/
int A_Function(int, int *, int *);
#endif /* HEADER INCLUDED */
/*---------------------------------------------------------------------------*/
/* end of $RCSfile:$ */
/*---------------------------------------------------------------------------*/
The section '#pragma ident "@(#)$Id:$"' allows the header id information to be inserted into the compiled object code.
This is required for use in the what(1) command.
#--------------------------------------------------------------------------- # # Isaac Newton Group of Telescopes # Roque de Los Muchachos Observatory # La Palma # # Copyright PPARC 2000 # #--------------------------------------------------------------------------- # # COMPONENT: # $Id:$ # # TYPE: # Tcl/Tk source-code file. # # PURPOSE: # # FUNCTION: # Test Program. # # SUBORDINATES: # None. # # DEPENDENCIES: # wish version 8.0 or later # # INTERFACES: # None # # PERSONNEL: # Dennis Armstrong, Computer Software Group, ING. dba@ing.iac.es # # HISTORY: # $Log:$ # # #--------------------------------------------------------------------------- .pack the_code_in_here #--------------------------------------------------------------------------- # end of $RCSfile:$ #---------------------------------------------------------------------------