Mapper
check_sens.c
Go to the documentation of this file.
1 #include <sqlhdr.h>
2 #include <sqliapi.h>
3 #line 1 "check_sens.ec"
4 #include "prototypes.h"
5 
6 int check_sens(char *stn_id,char *shef)
7 {
8 
9 /* general variable definitions */
10 int good=1;
11 int bad=0;
12 
13 /* declare informix host variables */
14 /*
15  * exec sql begin declare section;
16  */
17 #line 11 "check_sens.ec"
18 #line 12 "check_sens.ec"
19  char id[6];
20  char pe1[2];
21  char pe2[2];
22  char dur[2];
23  char t[2];
24  char s[2];
25  char e[2];
26  char p[2];
27 int post;
28 /*
29  * exec sql end declare section;
30  */
31 #line 21 "check_sens.ec"
32 
33 
34  strcpy(id,stn_id);
35  strncpy(pe1,shef+0,1);
36  *(pe1+1)='\0';
37  strncpy(pe2,shef+1,1);
38  *(pe2+1)='\0';
39  strncpy(dur,shef+2,1);
40  *(dur+1)='\0';
41  strncpy(t,"F",1);
42  *(t+1)='\0';
43  strncpy(s,"Z",1);
44  *(s+1)='\0';
45  strncpy(e,shef+5,1);
46  *(e+1)='\0';
47  strncpy(p,shef+6,1);
48  *(p+1)='\0';
49 
50 /*
51  * $select post into $post
52  * from sens
53  * where id=$id and
54  * pe1=$pe1 and pe2=$pe2 and
55  * dur=$dur and t=$t and s=$s and
56  * e=$e and p=$p;
57  */
58 #line 39 "check_sens.ec"
59  {
60 #line 44 "check_sens.ec"
61  static const char *sqlcmdtxt[] =
62 #line 44 "check_sens.ec"
63  {
64 #line 44 "check_sens.ec"
65  "select post from sens where id = ? and pe1 = ? and pe2 = ? and dur = ? and t = ? and s = ? and e = ? and p = ?",
66  0
67  };
68 #line 44 "check_sens.ec"
69 static ifx_cursor_t _SQ0 = {0};
70  static ifx_sqlvar_t _sqibind[] =
71  {
72  { 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
73  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
74  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
75  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
76  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
77  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
78  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
79  { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
80 #line 44 "check_sens.ec"
81  };
82  static ifx_sqlvar_t _sqobind[] =
83  {
84  { 102, sizeof(post), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
85 #line 44 "check_sens.ec"
86  };
87 #line 44 "check_sens.ec"
88  _sqibind[0].sqldata = id;
89 #line 44 "check_sens.ec"
90  _sqibind[1].sqldata = pe1;
91 #line 44 "check_sens.ec"
92  _sqibind[2].sqldata = pe2;
93 #line 44 "check_sens.ec"
94  _sqibind[3].sqldata = dur;
95 #line 44 "check_sens.ec"
96  _sqibind[4].sqldata = t;
97 #line 44 "check_sens.ec"
98  _sqibind[5].sqldata = s;
99 #line 44 "check_sens.ec"
100  _sqibind[6].sqldata = e;
101 #line 44 "check_sens.ec"
102  _sqibind[7].sqldata = p;
103 #line 44 "check_sens.ec"
104  _sqobind[0].sqldata = (char *) &post;
105 #line 44 "check_sens.ec"
106  sqli_slct(ESQLINTVERSION, &_SQ0,sqlcmdtxt,8,_sqibind,1,_sqobind,0,(ifx_literal_t *)0,(ifx_namelist_t *)0,0);
107 #line 44 "check_sens.ec"
108  }
109  if(!sqlca.sqlcode)
110  return(good);
111  else
112  return(bad);
113 }
114 
115 
116 #line 50 "check_sens.ec"
int check_sens(char *stn_id, char *shef)
Definition: check_sens.c:6
struct sqlca_s sqlca
long sqlcode
Definition: db.c:44