File tree 2 files changed +16
-3
lines changed
2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change
1
+ #ifndef EXITCODES_H
2
+ #define EXITCODES_H
3
+
4
+ // Exit codes for SIPNET; most of the current uses of exit(1) should
5
+ // get better codes, which will appear here
6
+ typedef enum {
7
+ EXIT_SUCCESS = 0 ,
8
+ EXIT_FAILURE = 1 ,
9
+ EXIT_UNKNOWN_EVENT = 2
10
+ } ExitCode ;
11
+
12
+ #endif
Original file line number Diff line number Diff line change 20
20
#include "outputItems.h"
21
21
#include "modelStructures.h"
22
22
#include "events.h"
23
+ #include "exitCodes.h"
23
24
24
25
// begin definitions for choosing different model structures
25
26
// (1 -> true, 0 -> false)
@@ -2280,8 +2281,8 @@ void updateTrackers(double oldSoilWater) {
2280
2281
// let's leave it here for now. Maybe someday we will factor that out.
2281
2282
//
2282
2283
// Process events for current location/year/day
2283
- void processEvents () {
2284
2284
#if EVENT_HANDLER
2285
+ void processEvents () {
2285
2286
// If locEvent starts off NULL, this function will just fall through, as it should.
2286
2287
const int year = climate -> year ;
2287
2288
const int day = climate -> day ;
@@ -2318,13 +2319,13 @@ void processEvents() {
2318
2319
break ;
2319
2320
default :
2320
2321
printf ("Unknown event type (%d) in processEvents()\n" , locEvent -> type );
2321
- exit (1 );
2322
+ exit (EXIT_UNKNOWN_EVENT );
2322
2323
}
2323
2324
2324
2325
locEvent = locEvent -> nextEvent ;
2325
2326
}
2326
- #endif
2327
2327
}
2328
+ #endif
2328
2329
2329
2330
2330
2331
// !!! main runner function !!!
You can’t perform that action at this time.
0 commit comments