Mapper
get_custom_list.c
Go to the documentation of this file.
1 #include "prototypes.h"
2 
3 void get_custom_list(char *fname)
4 {
5  FILE *fp;
6  char *p,kbuf[100],hb5[6],pc[8];
7 /*
8  extern struct custom custom[6000];
9 */
10  extern struct custom custom[9000];
11  int i,xadd,yadd,ier;
12 
13  fp=fopen(fname,"r");
14  if(fp==NULL)
15  return;
16 
17  i=0;
18  for(;;)
19  {
20  p=fgets(kbuf,80,fp);
21  if(p==NULL)
22  break;
23 
24  p=strchr(kbuf,'\n');
25  *p=0;
26 
27  ier=sscanf(kbuf,"%s %s %d %d",hb5,pc,&xadd,&yadd);
28 
29  strcpy(custom[i].hb5,hb5);
30  strcpy(custom[i].pc,pc);
31  if(xadd > 1 || xadd < -1) xadd=0;
32  if(yadd > 1 || yadd < -1) yadd=0;
33  custom[i].xadd=xadd;
34  custom[i++].yadd=yadd;
35 
36  if(i==8999)
37  break;
38 
39  }
40  custom[i].hb5[0]=0;
41  fclose(fp);
42  return;
43 }
static int i
void get_custom_list(char *fname)
fclose(fp)
fp
Definition: make_NEXRAD.c:339
char fname[100]
Definition: send_afos.c:6
Definition: misc.h:30
int xadd
Definition: misc.h:34
char hb5[10]
Definition: misc.h:32
int yadd
Definition: misc.h:35
char pc[10]
Definition: misc.h:33