cloudy  trunk
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
warnings.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2008 by Gary J. Ferland and
2  * others. For conditions of distribution and use see copyright notice in license.txt */
3 /*wcnint initialize stack or warnings, cautions, notes */
4 /*warnin enter warnings at the end of the calculations into large stack */
5 /*notein enter a note about calculation into comment array */
6 /*bangin called by routine comment to enter surprise into comment stack */
7 /*caunin called by comment to enter caution into comment stack */
8 #include "cddefines.h"
9 #include "warnings.h"
10 
11 void wcnint(void)
12 {
13 
14  DEBUG_ENTRY( "wcnint()" );
15 
16  /* this sub is called first, to initialize the variables */
17  warnings.nwarn = 0;
18  warnings.ncaun = 0;
19  warnings.nnote = 0;
20  warnings.nbang = 0;
21  return;
22 }
23 
24 /*warnin enter warnings at the end of the calculations into large stack */
25 void warnin(char *chLine)
26 {
27 
28  DEBUG_ENTRY( "warnin()" );
29 
30  if( warnings.nwarn >= LIMWCN )
31  {
32  static bool lgFirst=true;
33  if( lgFirst )
34  fprintf( ioQQQ,
35  " Too many warnings have been entered; increase the value of LIMWCN everywhere in the code.\n" );
36  lgFirst = false;
37  }
38  else
39  {
40  strcpy( warnings.chWarnln[warnings.nwarn], chLine );
41  }
42 
43  ++warnings.nwarn;
44  return;
45 }
46 
47 /*notein enter a note about calculation into comment array */
48 void notein(char *chLine)
49 {
50 
51  DEBUG_ENTRY( "notein()" );
52 
53  if( warnings.nnote >= LIMWCN )
54  {
55  static bool lgFirst=true;
56  if( lgFirst )
57  fprintf( ioQQQ,
58  " Too many notes have been entered; increase the value of LIMWCN everywhere in the code.\n" );
59  lgFirst = false;
60  }
61  else
62  {
63  strcpy( warnings.chNoteln[warnings.nnote], chLine );
64  }
65 
66  ++warnings.nnote;
67  return;
68 }
69 
70 /*bangin called by routine comment to enter surprise into comment stack */
71 void bangin(char *chLine)
72 {
73 
74  DEBUG_ENTRY( "bangin()" );
75 
76  if( warnings.nbang >= LIMWCN )
77  {
78  static bool lgFirst=true;
79  if( lgFirst )
80  fprintf( ioQQQ,
81  " Too many surprises have been entered; increase the value of LIMWCN everywhere in the code.\n" );
82  lgFirst = false;
83  }
84  else
85  {
86  strcpy( warnings.chBangln[warnings.nbang], chLine );
87  }
88 
89  ++warnings.nbang;
90  return;
91 }
92 
93 /*caunin called by comment to enter caution into comment stack */
94 void caunin(char *chLine)
95 {
96 
97  DEBUG_ENTRY( "caunin()" );
98 
99  if( warnings.ncaun >= LIMWCN )
100  {
101  static bool lgFirst=true;
102  if( lgFirst )
103  fprintf( ioQQQ,
104  " Too many cautions have been entered; increase the value of LIMWCN everywhere in the code.\n" );
105  lgFirst = false;
106  }
107  else
108  {
109  strcpy( warnings.chCaunln[warnings.ncaun], chLine );
110  }
111 
112  ++warnings.ncaun;
113  return;
114 }

Generated for cloudy by doxygen 1.8.1.1