cloudy  trunk
 All Data Structures Namespaces 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-2022 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 
12 
13 void t_warnings::zero(void)
14 {
15 
16  DEBUG_ENTRY( "t_warnings::zero()" );
17 
18  /* this sub is called first, to initialize the variables */
19  nwarn = 0;
20  ncaun = 0;
21  nnote = 0;
22  nbang = 0;
23  return;
24 }
25 
26 /*warnin enter warnings at the end of the calculations into large stack */
27 void t_warnings::warnin(const char *chLine)
28 {
29 
30  DEBUG_ENTRY( "t_warnings::warnin()" );
31 
32  if( nwarn >= LIMWCN )
33  {
34  static bool lgFirst=true;
35  if( lgFirst )
36  fprintf( ioQQQ,
37  " Too many warnings have been entered; increase the value of LIMWCN everywhere in the code.\n" );
38  lgFirst = false;
39  }
40  else
41  {
42  strcpy( chWarnln[nwarn], chLine );
43  }
44 
45  ++nwarn;
46  return;
47 }
48 
49 /*notein enter a note about calculation into comment array */
50 void t_warnings::notein(const char *chLine)
51 {
52 
53  DEBUG_ENTRY( "notein()" );
54 
55  if( nnote >= LIMWCN )
56  {
57  static bool lgFirst=true;
58  if( lgFirst )
59  fprintf( ioQQQ,
60  " Too many notes have been entered; increase the value of LIMWCN everywhere in the code.\n" );
61  lgFirst = false;
62  }
63  else
64  {
65  strcpy( chNoteln[nnote], chLine );
66  }
67 
68  ++nnote;
69  return;
70 }
71 
72 /*bangin called by routine comment to enter surprise into comment stack */
73 void t_warnings::bangin(const char *chLine)
74 {
75 
76  DEBUG_ENTRY( "t_warnings::bangin()" );
77 
78  if( nbang >= LIMWCN )
79  {
80  static bool lgFirst=true;
81  if( lgFirst )
82  fprintf( ioQQQ,
83  " Too many surprises have been entered; increase the value of LIMWCN everywhere in the code.\n" );
84  lgFirst = false;
85  }
86  else
87  {
88  strcpy( chBangln[nbang], chLine );
89  }
90 
91  ++nbang;
92  return;
93 }
94 
95 /*caunin called by comment to enter caution into comment stack */
96 void t_warnings::caunin(const char *chLine)
97 {
98 
99  DEBUG_ENTRY( "t_warnings::caunin()" );
100 
101  if( ncaun >= LIMWCN )
102  {
103  static bool lgFirst=true;
104  if( lgFirst )
105  fprintf( ioQQQ,
106  " Too many cautions have been entered; increase the value of LIMWCN everywhere in the code.\n" );
107  lgFirst = false;
108  }
109  else
110  {
111  strcpy( chCaunln[ncaun], chLine );
112  }
113 
114  ++ncaun;
115  return;
116 }
void warnin(const char *chLine)
Definition: warnings.cpp:27
t_warnings warnings
Definition: warnings.cpp:11
char chWarnln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:38
FILE * ioQQQ
Definition: cddefines.cpp:7
long int ncaun
Definition: warnings.h:28
long int nbang
Definition: warnings.h:28
char chNoteln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:38
char chCaunln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:38
long int nnote
Definition: warnings.h:28
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:723
int fprintf(const Output &stream, const char *format,...)
Definition: service.cpp:1121
void zero(void)
Definition: warnings.cpp:13
long int nwarn
Definition: warnings.h:28
void notein(const char *chLine)
Definition: warnings.cpp:50
char chBangln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:38
void bangin(const char *chLine)
Definition: warnings.cpp:73
void caunin(const char *chLine)
Definition: warnings.cpp:96
static const int LIMWCN
Definition: warnings.h:13