cloudy  trunk
warnings.cpp
Go to the documentation of this file.
1 /* This file is part of Cloudy and is copyright (C)1978-2013 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 wcnint(void)
14 {
15 
16  DEBUG_ENTRY( "wcnint()" );
17 
18  /* this sub is called first, to initialize the variables */
19  warnings.nwarn = 0;
20  warnings.ncaun = 0;
21  warnings.nnote = 0;
22  warnings.nbang = 0;
23  return;
24 }
25 
26 /*warnin enter warnings at the end of the calculations into large stack */
27 void warnin(char *chLine)
28 {
29 
30  DEBUG_ENTRY( "warnin()" );
31 
32  if( warnings.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( warnings.chWarnln[warnings.nwarn], chLine );
43  }
44 
45  ++warnings.nwarn;
46  return;
47 }
48 
49 /*notein enter a note about calculation into comment array */
50 void notein(char *chLine)
51 {
52 
53  DEBUG_ENTRY( "notein()" );
54 
55  if( warnings.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( warnings.chNoteln[warnings.nnote], chLine );
66  }
67 
68  ++warnings.nnote;
69  return;
70 }
71 
72 /*bangin called by routine comment to enter surprise into comment stack */
73 void bangin(char *chLine)
74 {
75 
76  DEBUG_ENTRY( "bangin()" );
77 
78  if( warnings.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( warnings.chBangln[warnings.nbang], chLine );
89  }
90 
91  ++warnings.nbang;
92  return;
93 }
94 
95 /*caunin called by comment to enter caution into comment stack */
96 void caunin(char *chLine)
97 {
98 
99  DEBUG_ENTRY( "caunin()" );
100 
101  if( warnings.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( warnings.chCaunln[warnings.ncaun], chLine );
112  }
113 
114  ++warnings.ncaun;
115  return;
116 }
caunin
void caunin(char *chLine)
Definition: warnings.cpp:96
notein
void notein(char *chLine)
Definition: warnings.cpp:50
t_warnings::chCaunln
char chCaunln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:51
ioQQQ
FILE * ioQQQ
Definition: cddefines.cpp:7
t_warnings::nnote
long int nnote
Definition: warnings.h:42
t_warnings
Definition: warnings.h:36
t_warnings::chBangln
char chBangln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:53
wcnint
void wcnint(void)
Definition: warnings.cpp:13
t_warnings::nwarn
long int nwarn
Definition: warnings.h:40
t_warnings::ncaun
long int ncaun
Definition: warnings.h:41
cddefines.h
lgFirst
static bool lgFirst
Definition: prt_linesum.cpp:16
warnings
t_warnings warnings
Definition: warnings.cpp:11
t_warnings::chNoteln
char chNoteln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:52
t_warnings::chWarnln
char chWarnln[LIMWCN][INPUT_LINE_LENGTH]
Definition: warnings.h:50
LIMWCN
#define LIMWCN
Definition: warnings.h:34
bangin
void bangin(char *chLine)
Definition: warnings.cpp:73
warnings.h
DEBUG_ENTRY
#define DEBUG_ENTRY(funcname)
Definition: cddefines.h:684
t_warnings::nbang
long int nbang
Definition: warnings.h:43
warnin
void warnin(char *chLine)
Definition: warnings.cpp:27