3 #line 1 "next_report.ec"
10 #include <sys/types.h>
29 #line 23 "next_report.ec"
30 #line 24 "next_report.ec"
43 #line 33 "next_report.ec"
47 pf=popen(
"date -u '+%Y %m %d %H %M %S'",
"r");
48 fgets(line,
sizeof(line),pf);
50 sscanf(line,
"%d %d %d %d %d %d",
52 time_cur=100*
hour+minute;
58 strncpy(pe2,shef+1,1);
60 strncpy(dur,shef+2,1);
71 strcpy(next,
"UNKNOWN");
77 strcpy(next,
"DIAL UP");
84 #line 68 "next_report.ec"
86 #line 70 "next_report.ec"
87 static const char *sqlcmdtxt[] =
88 #line 70 "next_report.ec"
90 #line 70 "next_report.ec"
91 "select obstime from sens where id = ? and pe1 = ? and pe2 = ? and dur = ? and t = ? and s = ? and e = ? and p = ?",
94 #line 70 "next_report.ec"
95 static ifx_cursor_t _SQ0 = {0};
96 static ifx_sqlvar_t _sqibind[] =
98 { 100, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
99 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
100 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
101 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
102 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
103 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
104 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
105 { 100, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
106 #line 70 "next_report.ec"
108 static ifx_sqlvar_t _sqobind[] =
110 { 102,
sizeof(obstime), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
111 #line 70 "next_report.ec"
113 #line 70 "next_report.ec"
114 _sqibind[0].sqldata = id;
115 #line 70 "next_report.ec"
116 _sqibind[1].sqldata = pe1;
117 #line 70 "next_report.ec"
118 _sqibind[2].sqldata = pe2;
119 #line 70 "next_report.ec"
120 _sqibind[3].sqldata = dur;
121 #line 70 "next_report.ec"
122 _sqibind[4].sqldata = t;
123 #line 70 "next_report.ec"
124 _sqibind[5].sqldata = s;
125 #line 70 "next_report.ec"
126 _sqibind[6].sqldata = e;
127 #line 70 "next_report.ec"
128 _sqibind[7].sqldata = p;
129 #line 70 "next_report.ec"
130 _sqobind[0].sqldata = (
char *) &obstime;
131 #line 70 "next_report.ec"
132 sqli_slct(ESQLINTVERSION, &_SQ0,sqlcmdtxt,8,_sqibind,1,_sqobind,0,(ifx_literal_t *)0,(ifx_namelist_t *)0,0);
133 #line 70 "next_report.ec"
138 if(obstime <= -99999)
147 printf(
"%s %s%s%s%s%s%s%s %d\n",
id,pe1,pe2,dur,t,s,e,p,obstime);
165 sprintf(next,
"%02d%02dZ %s",nhr,nmin,random);
170 if(time_cur < 100*(
i+nhr)+nmin)
172 sprintf(next,
"%02d%02dZ %s",
i+nhr,nmin,random);
180 printf(
"time is %d. code is %d. next report is at %s\n",
181 time_cur,obstime,next);
186 printf(
"could not read sens table for %s %s%s%s%s%s%s%s\n",
187 id,pe1,pe2,dur,t,s,e,p);
193 #line 127 "next_report.ec"
sprintf(fbuf,"/usr/mapper/nexrad/ngrid.%02d-%02d-%02d-%02d", year, month, day, hour)
printf("fbuf is %s\n", fbuf)
void next_report(char *stn_id, char *shef, char *next, int debug)