00001 /* This file is part of Cloudy and is copyright (C)1978-2007 by Gary J. Ferland 00002 * For conditions of distribution and use see copyright notice in license.txt */ 00003 /*wcnint initialize stack or warnings, cautions, notes */ 00004 /*warnin enter warnings at the end of the calculations into large stack */ 00005 /*notein enter a note about calculation into comment array */ 00006 /*bangin called by routine comment to enter surprise into comment stack */ 00007 /*caunin called by comment to enter caution into comment stack */ 00008 #include "cddefines.h" 00009 #include "warnings.h" 00010 00011 void wcnint(void) 00012 { 00013 00014 DEBUG_ENTRY( "wcnint()" ); 00015 00016 /* this sub is called first, to initialize the variables */ 00017 warnings.nwarn = 0; 00018 warnings.ncaun = 0; 00019 warnings.nnote = 0; 00020 warnings.nbang = 0; 00021 00022 DEBUG_EXIT( "wcnint()" ); 00023 return; 00024 } 00025 00026 /*warnin enter warnings at the end of the calculations into large stack */ 00027 void warnin(char *chLine) 00028 { 00029 00030 DEBUG_ENTRY( "warnin()" ); 00031 00032 if( warnings.nwarn >= LIMWCN ) 00033 { 00034 static bool lgFirst=true; 00035 if( lgFirst ) 00036 fprintf( ioQQQ, 00037 " Too many warnings have been entered; increase the value of LIMWCN everywhere in the code.\n" ); 00038 lgFirst = false; 00039 } 00040 else 00041 { 00042 strcpy( warnings.chWarnln[warnings.nwarn], chLine ); 00043 } 00044 00045 ++warnings.nwarn; 00046 00047 DEBUG_EXIT( "warnin()" ); 00048 return; 00049 } 00050 00051 /*notein enter a note about calculation into comment array */ 00052 void notein(char *chLine) 00053 { 00054 00055 DEBUG_ENTRY( "notein()" ); 00056 00057 if( warnings.nnote >= LIMWCN ) 00058 { 00059 static bool lgFirst=true; 00060 if( lgFirst ) 00061 fprintf( ioQQQ, 00062 " Too many notes have been entered; increase the value of LIMWCN everywhere in the code.\n" ); 00063 lgFirst = false; 00064 } 00065 else 00066 { 00067 strcpy( warnings.chNoteln[warnings.nnote], chLine ); 00068 } 00069 00070 ++warnings.nnote; 00071 00072 DEBUG_EXIT( "notein()" ); 00073 return; 00074 } 00075 00076 /*bangin called by routine comment to enter surprise into comment stack */ 00077 void bangin(char *chLine) 00078 { 00079 00080 DEBUG_ENTRY( "bangin()" ); 00081 00082 if( warnings.nbang >= LIMWCN ) 00083 { 00084 static bool lgFirst=true; 00085 if( lgFirst ) 00086 fprintf( ioQQQ, 00087 " Too many surprises have been entered; increase the value of LIMWCN everywhere in the code.\n" ); 00088 lgFirst = false; 00089 } 00090 else 00091 { 00092 strcpy( warnings.chBangln[warnings.nbang], chLine ); 00093 } 00094 00095 ++warnings.nbang; 00096 00097 DEBUG_EXIT( "bangin()" ); 00098 return; 00099 } 00100 00101 /*caunin called by comment to enter caution into comment stack */ 00102 void caunin(char *chLine) 00103 { 00104 00105 DEBUG_ENTRY( "caunin()" ); 00106 00107 if( warnings.ncaun >= LIMWCN ) 00108 { 00109 static bool lgFirst=true; 00110 if( lgFirst ) 00111 fprintf( ioQQQ, 00112 " Too many cautions have been entered; increase the value of LIMWCN everywhere in the code.\n" ); 00113 lgFirst = false; 00114 } 00115 else 00116 { 00117 strcpy( warnings.chCaunln[warnings.ncaun], chLine ); 00118 } 00119 00120 ++warnings.ncaun; 00121 00122 DEBUG_EXIT( "caunin()" ); 00123 return; 00124 } 00125