Initial snark14m import
[snark14.git] / src / snark / getfom.c
1 /*
2  ***********************************************************
3  $SNARK_Header: S N A R K  1 4 - A PICTURE RECONSTRUCTION PROGRAM $
4  $HeadURL: svn://dig.cs.gc.cuny.edu/snark/trunk/src/snark/getfom.c $
5  $LastChangedRevision: 137 $
6  $Date: 2014-07-15 16:38:33 -0400 (Tue, 15 Jul 2014) $
7  $Author: bprommegger $
8  ***********************************************************
9
10  Previously part of SuperSNARK
11  */
12
13 #include <string.h>
14 #include "experimenter.h"
15 #include "getfom.h"
16
17 /* ----------------------- getfom.c -----------------------------------
18  This function examines the input string and returns several flags
19  whose values depend on the figures of merit present in the string
20
21  INPUTS:
22  string - input string.
23
24  OUTPUTS:
25  stru - equals 1 if STRU is present, else equals 0
26  poin - equals 1 if POIN is present, else equals 0
27  hitr - equals 1 if HITR is present, else equals 0
28  usr1 _ equals 1 if USR1 is present, else equals 0
29  usr... _ equals 1 if USR... is present, else equals 0
30  iroi _ equals 1 if IROI is present, else equals 0
31  klds _ equals 1 if KLDS is present, else equals 0
32  wsqd _ equals 1 if WSQD is present, else equals 0
33  */
34
35 void getfom(char* string, int* stru, int* poin, int* hitr, int* usr1, int* usr2, int* usr3, int* usr4, int* usr5, int* iroi, int* klds, int* wsqd)
36 {
37         *stru = 0;
38         *poin = 0;
39         *hitr = 0;
40         *usr1 = 0;
41         *usr2 = 0;
42         *usr3 = 0;
43         *usr4 = 0;
44         *usr5 = 0;
45         *iroi = 0;
46         *klds = 0;
47         *wsqd = 0;
48
49         if (strcasestr(string, "STRU") != NULL)
50         {
51                 *stru = 1;
52         }
53
54         if ((strcasestr(string, "POIN") != NULL))
55         {
56                 *poin = 1;
57         }
58
59         if ((strcasestr(string, "HITR") != NULL))
60         {
61                 *hitr = 1;
62         }
63
64         if ((strcasestr(string, "USR1") != NULL))
65         {
66                 *usr1 = 1;
67         }
68
69         if ((strcasestr(string, "USR2") != NULL))
70         {
71                 *usr2 = 1;
72         }
73
74         if ((strcasestr(string, "USR3") != NULL))
75         {
76                 *usr3 = 1;
77         }
78
79         if ((strcasestr(string, "USR4") != NULL))
80         {
81                 *usr4 = 1;
82         }
83
84         if ((strcasestr(string, "USR5") != NULL))
85         {
86                 *usr5 = 1;
87         }
88         if ((strcasestr(string, "IROI") != NULL))
89         {
90                 *iroi = 1;
91         }
92         if ((strcasestr(string, "KLDS") != NULL))
93         {
94                 *klds = 1;
95         }
96         if ((strcasestr(string, "WSQD") != NULL))
97         {
98                 *wsqd = 1;
99         }
100 }