-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy pathstopreq.c
48 lines (31 loc) · 1.28 KB
/
stopreq.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
/* ------- file: -------------------------- riigen.c ----------------
Version: rh2.0
Author: Han Uitenbroek ([email protected])
Last modified: Mon Oct 9 11:27:42 2000 --
-------------------------- ----------RH-- */
/* --- Checks whether iterations should be stopped prematurely while
still allowing intermediate results to be written to output
in the proper way.
Current version checks for presence of file STOP_RH in running
directory as suggested by Jo Bruls (KIS) -- -------------- */
#include <stdio.h>
#include "rh.h"
#include "error.h"
#define STOP_REQUEST_FILE "STOP_RH"
/* --- Function prototypes -- -------------- */
/* --- Global variables -- -------------- */
extern char messageStr[];
/* ------- begin -------------------------- StopRequested.c --------- */
bool_t StopRequested()
{
const char routineName[] = "StopRequested";
if (fopen(STOP_REQUEST_FILE, "r")) {
sprintf(messageStr, "Stopping iterations because file %s is present",
STOP_REQUEST_FILE);
Error(WARNING, routineName, messageStr);
return TRUE;
} else {
return FALSE;
}
}
/* ------- end ---------------------------- StopRequested.c --------- */