Mapper
test.c
Go to the documentation of this file.
1 #include "prototypes.h"
2 
3 char values[]={0xc8,0x48,0x03,0x30,0x02,0x5c,
4  0xc8,0x48,0x03,0x24,0x02,0x1b,
5  0xc8,0x40,0x03,0x4a,0x02,0x6d,
6  0xc8,0x48,0x03,0x45,0x02,0x34,
7  0xc8,0x48,0x03,0x61,0x02,0x6e,
8  0xc8,0x48,0x03,0x75,0x02,0x58,
9  0xc8,0x48,0x03,0x6a,0x02,0x2f,
10  0xc8,0x48,0x03,0x18,0x01,0xf1,
11  0xc8,0x40,0x03,0x58,0x01,0xea,
12  0xc8,0x48,0x03,0x30,0x01,0xd3,
13  0xc8,0x48,0x03,0x51,0x01,0xbb,
14  0xc8,0x48,0x03,0x0b,0x01,0xb7,
15  0xc8,0x48,0x03,0x37,0x01,0xae,
16  0xc8,0x40,0x03,0x53,0x01,0x93,
17  0xc8,0x48,0x03,0x8d,0x01,0xf4,
18  0xc8,0x50,0x03,0x8f,0x01,0xc0,
19  0xc8,0x48,0x03,0x9e,0x01,0x8f,
20  0xc8,0x48,0x03,0x9a,0x02,0x40,
21  0xc8,0x40,0x03,0xb8,0x02,0x15,
22  0xc8,0x48,0x03,0x03,0x02,0x0d,
23  0xc8,0x48,0x03,0x7c,0x02,0x86,
24  0xff};
25 
26 
27 main(argc,argv)
28 
29 int argc;
30 char *argv[];
31 
32 {
33 
34 FILE *fw,*fp;
35 char fbuf[60000],abuf[10];
36 int ier,mer,i,k,j,h,m,nflag,ival;
37 
38 fw=fopen("3:/usr/afos/gph/NMCGPH6KA.1","r");
39 if(fw==NULL)
40  exit(1);
41 
42 ier=fread(fbuf,1,50000,fw);
43 
44 for(m=0;m<25;m++) {
45 
46 h=m*6;
47 
48 if(values[h]==0xff)
49  break;
50 
51 k=0;
52 
53 for(i=0;i<ier;i++) {
54 
55  mer=memcmp(&fbuf[i],&values[h],6);
56 
57  if(mer==0) {
58 
59  for(j=i+8;j<i+12;j++) {
60 
61  if(fbuf[j]==0x0d)
62  break;
63 
64  else
65  abuf[k++]=fbuf[j];
66 
67  }
68  abuf[k]=0;
69  ival=atoi(abuf);
70 
71  printf("%d found %d\n",m,ival);
72  break;
73 
74  }
75 
76  }
77 
78 }
79 
80 }
static int i
char fbuf[100]
Definition: decode_HDP.c:2
printf("fbuf is %s\n", fbuf)
fp
Definition: make_NEXRAD.c:339
int j
Definition: mapp2h.h:48
int k
Definition: mapp2h.h:48
main(int argc, argv)
Definition: test.c:27
char values[]
Definition: test.c:3