00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #if 0
00021 <lalVerbatim file="LALVersionTestCV">
00022 $Id: LALVersionTest.c,v 1.3 2007/06/08 14:41:54 bema Exp $
00023 </lalVerbatim>
00024
00025 <lalLaTeX>
00026 \subsection{Program \texttt{LALVersionTest.c}}
00027 \label{s:LALVersionTest.c}
00028
00029 Prints the version and configure options of the LAL library being used.
00030
00031 \subsubsection*{Usage}
00032 \begin{verbatim}
00033 LALVersionTest
00034 \end{verbatim}
00035
00036 \subsubsection*{Description}
00037
00038 This program prints the current version of LAL.\@ If the version information
00039 in the library differs from the version information in the header file, this
00040 program prints the two versions and exits with code 1. This is useful for
00041 determining which version of the LAL library and header files you are linking
00042 to.
00043
00044 \subsubsection*{Exit codes}
00045 \begin{tabular}{|c|l|}
00046 \hline
00047 Code & Explanation \00048 \hline
00049 \tt 0 & Success, normal exit. \00050 \tt 1 & Version info in library disagrees with header file. \00051 \tt 2 & Subroutine failed. \00052 \hline
00053 \end{tabular}
00054
00055
00056 \vfill{\footnotesize\input{LALVersionTestCV}}
00057
00058
00059 </lalLaTeX>
00060 #endif
00061
00062 #include <stdio.h>
00063 #include <string.h>
00064 #include <lal/LALStdlib.h>
00065 #include <lal/LALVersion.h>
00066
00067 NRCSID (LALVERSIONTESTC,"$Id: LALVersionTest.c,v 1.3 2007/06/08 14:41:54 bema Exp $");
00068
00069 int lalDebugLevel = 0;
00070
00071 int main( void )
00072 {
00073 static LALStatus status;
00074 char msg[1024];
00075 int verbose = 1;
00076
00077 if ( strcmp( LAL_VERSION, lalVersion ) ||
00078 strcmp( LAL_CONFIGURE_ARGS, lalConfigureArgs ) ||
00079 strcmp( LAL_CONFIGURE_DATE, lalConfigureDate ) )
00080 {
00081 fputs( "LAL Version Mismatch!\n\n", stderr );
00082 fputs( "Header Version ", stderr );
00083 fputs( LAL_VERSION, stderr );
00084 fputs( "\nCompiled on ", stderr );
00085 fputs( LAL_CONFIGURE_DATE, stderr );
00086 fputs( "\nWith arguments ", stderr );
00087 fputs( LAL_CONFIGURE_ARGS, stderr );
00088 fputs( "\n\n", stderr );
00089 fputs( "Library Version ", stderr );
00090 fputs( lalVersion, stderr );
00091 fputs( "\nCompiled on ", stderr );
00092 fputs( lalConfigureDate, stderr );
00093 fputs( "\nWith arguments ", stderr );
00094 fputs( lalConfigureArgs, stderr );
00095 fputs( "\n", stderr );
00096 return 1;
00097 }
00098
00099 LALVersion( &status, msg, sizeof( msg ), verbose );
00100
00101 if ( status.statusCode )
00102 {
00103 LALStatus *next = &status;
00104 do
00105 {
00106 fputs( next->statusDescription, stderr );
00107 fputs( "\n", stderr );
00108 next = next->statusPtr;
00109 }
00110 while ( next );
00111 return 2;
00112 }
00113
00114 puts( msg );
00115
00116 return 0;
00117 }