#include #define NMBNAME "/usr/local/datageisa/crs97/nmb.dat" #define NMBLINES 108 void molcodes_(void) { static char tpchar[NMBLINES][17]; /* room for max=15 + LF + 0 */ register FILE *fp; register int i; /* type Molecules */ struct molecules { char name[10]; int mcode; /* code of molecule */ int ntp; /* n of datasets */ int n1[4]; /* from */ int n2[4]; /* to */ }; /* type (Molecules) ListofMol(30) */ /* common /Reg4/ Wvmin,Wvmax */ /* common /Reg7/ Lepremier,NumSel,NbofMol */ /* common /Reg9/ ListofMol */ extern struct reg4 {float wvmin,wvmax;}; extern struct reg4 reg4_; extern struct reg7 {float lepremier;int numsel,nbofmol;}; extern struct reg7 reg7_; extern struct reg9 {struct molecules listofmol[30];}; extern struct reg9 reg9_; fp=fopen(NMBNAME,"r"); i=0; while(fseek(fp,5,SEEK_CUR),fgets(tpchar[i],17,fp)) { /* tpchar[i][strlen(tpchar[i])-2]=0; erase last & LF */ tpchar[i][strlen(tpchar[i])-1]=0; /* erase LF */ tpchar[i][14]=0; /* erase 15th */ i++; } printf("%9.3f %9.3f\n",reg4_.wvmin,reg4_.wvmax); for(i=0;i