Mapper
get_area_menu.c
Go to the documentation of this file.
1 
2 #include "prototypes_new.h"
3 
4 void get_area_menu(FILE *fp)
5 
6 {
7 
8 extern void area_select();
9 extern struct MenuItem area_items[20];
10 char kbuf[300],*p,file[100],*sname[30],nm[100],*sfile[30];
11 FILE *ft;
12 int j;
13 
14 j=0;
15 for(;;) {
16 
17  p=fgets(kbuf,200,fp);
18  if(p==NULL)
19  break;
20 
21  p=pars_line(kbuf,"name=",nm);
22  if(p==NULL)
23  continue;
24 
25  p=pars_linen(kbuf,"map_index=",file);
26  if(p==NULL)
27  continue;
28 
29 printf("p is %s%s\n",p,p);
30 
31  ft=fopen(p,"r");
32  /* ft=fopen("map_index","r");*/
33 
34  if(ft==NULL) {
35 
36  printf("could not open %s\n",p);
37  continue;
38 
39  }
40 
41  fclose(ft);
42 
43  p=strchr(file,'\n');
44  if(p!=NULL)
45  *p=0;
46 
47  sname[j]=calloc(1,strlen(nm)+1);
48  strcpy(sname[j],nm);
49  sfile[j]=calloc(1,strlen(file)+1);
50  strcpy(sfile[j],file);
51  area_items[j].label=sname[j];
54 
55  j++;
56 
57  }
58 
59 area_items[j].label=NULL;
60 
61 return;
62 
63 }
64 
65 
66 
67 
68 
69 
70 
71 
72 
void get_area_menu(FILE *fp)
Definition: get_area_menu.c:7
char * pars_line(char *buf, char *s, char *sbuf)
Definition: pars_line.c:3
void area_select(Widget, XtPointer)
Definition: mapper.c:1267
fclose(fp)
printf("fbuf is %s\n", fbuf)
fp
Definition: make_NEXRAD.c:339
int j
Definition: mapp2h.h:48
struct MenuItem area_items[10]
Definition: mapper.c:137
struct sensor_file * sfile
Definition: mapper.c:126
char * pars_linen(char *, char *, char *)
Definition: pars_linen.c:3
Definition: misc.h:459
char * label
Definition: misc.h:461
void(* callback)()
Definition: misc.h:463
XtPointer callback_data
Definition: misc.h:464