LALVersion.c

Go to the documentation of this file.
00001 /*
00002 *  Copyright (C) 2007 Jolien Creighton
00003 *
00004 *  This program is free software; you can redistribute it and/or modify
00005 *  it under the terms of the GNU General Public License as published by
00006 *  the Free Software Foundation; either version 2 of the License, or
00007 *  (at your option) any later version.
00008 *
00009 *  This program is distributed in the hope that it will be useful,
00010 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012 *  GNU General Public License for more details.
00013 *
00014 *  You should have received a copy of the GNU General Public License
00015 *  along with with program; see the file COPYING. If not, write to the
00016 *  Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00017 *  MA  02111-1307  USA
00018 */
00019 
00020 #if 0 /* autodoc block */
00021 <lalVerbatim file="LALVersionCV">
00022 $Id: LALVersion.c,v 1.3 2007/06/08 14:41:53 bema Exp $
00023 </lalVerbatim>
00024 
00025 <lalLaTeX>
00026 \subsection*{Module \texttt{LALVersion.c}}
00027 
00028 Routine that returns the version of LAL.
00029 
00030 \subsubsection*{Prototypes}
00031 \input{LALVersionCP}
00032 \idx{LALVersion()}
00033 
00034 \subsubsection*{Description}
00035 
00036 This function writes a version message into the string buffer of specified
00037 size (and is truncated if the buffer is too small).  Configuration information
00038 is also provided if the verbose flag is set.
00039 
00040 \vfill{\footnotesize\input{LALVersionCV}}
00041 
00042 </lalLaTeX>
00043 #endif /* autodoc block */
00044 
00045 /*
00046  *
00047  * Use LAL's config.h file rather than LALConfig.h which may be from some
00048  * previous installation.
00049  *
00050  */
00051 #include <config.h>
00052 
00053 #include <stdio.h>
00054 #include <lal/LALStatusMacros.h>
00055 #include <lal/LALStdio.h>
00056 #include <lal/LALVersion.h>
00057 
00058 NRCSID( LALVERSIONC, "$Id: LALVersion.c,v 1.3 2007/06/08 14:41:53 bema Exp $" );
00059 
00060 const char *lalVersion       = LAL_VERSION;
00061 const int   lalVersionMajor  = LAL_VERSION_MAJOR;
00062 const int   lalVersionMinor  = LAL_VERSION_MINOR;
00063 const int   lalVersionMicro  = LAL_VERSION_MICRO;
00064 const char *lalConfigureArgs = LAL_CONFIGURE_ARGS;
00065 const char *lalConfigureDate = LAL_CONFIGURE_DATE;
00066 const char *lalCVSTag        = LAL_CVS_TAG;
00067 
00068 /* <lalVerbatim file="LALVersionCP"> */
00069 void
00070 LALVersion( LALStatus *status, CHAR *message, UINT4 size, INT4 verbose )
00071 { /* </lalVerbatim> */
00072   INT4 nchar;
00073   INITSTATUS( status, "LALVersion", LALVERSIONC );
00074 
00075   ASSERT( message,  status, LALVERSIONH_ENULL, LALVERSIONH_MSGENULL );
00076   ASSERT( size > 0, status, LALVERSIONH_ESIZE, LALVERSIONH_MSGESIZE );
00077 
00078   nchar = verbose ?
00079     LALSnprintf( message, size,
00080         "LAL Version:         %s\n"
00081         "CVS Tag:             %s\n"
00082         "Build Date:          %s\n"
00083         "Configure Date:      %s\n"
00084         "Configure Arguments: %s\n"
00085         "(RCS %s)\n",
00086         lalVersion, LAL_CVS_TAG, lalBuildDate, lalConfigureDate,
00087         lalConfigureArgs, LALVERSIONC ) :
00088     LALSnprintf( message, size, "LAL Version: %s\n", lalVersion ) ;
00089 
00090   if ( nchar < 0 )
00091   {
00092     ABORT( status, LALVERSIONH_ESPRN, LALVERSIONH_MSGESPRN );
00093   }
00094   if ( nchar > (INT4) size )
00095   {
00096     ABORT( status, LALVERSIONH_ESHRT, LALVERSIONH_MSGESHRT );
00097   }
00098 
00099   RETURN( status );
00100 }

Generated on Tue Oct 7 02:40:05 2008 for LAL by  doxygen 1.5.2