cloudy trunk
Loading...
Searching...
No Matches
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
13void 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 */
27void 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 */
50void 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 */
73void 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 */
96void 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}
FILE * ioQQQ
Definition cddefines.cpp:7
#define DEBUG_ENTRY(funcname)
Definition cddefines.h:684
static bool lgFirst
t_warnings warnings
Definition warnings.cpp:11
void wcnint(void)
Definition warnings.cpp:13
void caunin(char *chLine)
Definition warnings.cpp:96
void warnin(char *chLine)
Definition warnings.cpp:27
void bangin(char *chLine)
Definition warnings.cpp:73
void notein(char *chLine)
Definition warnings.cpp:50
#define LIMWCN
Definition warnings.h:34