Subversion Repositories wimsdev

Rev

Rev 18056 | Rev 18108 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 18056 Rev 18086
Line 2203... Line 2203...
2203
    }
2203
    }
2204
  }
2204
  }
2205
}
2205
}
2206
 
2206
 
2207
void calc_getexoindex(char *p){
2207
void calc_getexoindex(char *p){
2208
  char *c, *p1, *p2;
2208
  char *c, *p1, *p2, *p3, *p4;
2209
  char nbuf[MAX_LINELEN+1], nbuf2[MAX_FNAME+1], buf[MAX_LINELEN+1],
2209
  char nbuf[MAX_LINELEN+1], fname[MAX_FNAME+1], buf[MAX_LINELEN+1],
2210
     buf2[MAX_LINELEN+1], buf3[MAX_LINELEN+1];
2210
    fcontent[MAX_LINELEN+1];
2211
  int i, sheet, start=1, stop=MAX_SHEETS;
2211
  int i, sheet, start=1, stop=MAX_SHEETS;
2212
  c=getvar("wims_class"); if(c==NULL) return;
2212
  c=getvar("wims_class"); if(c==NULL) return;
2213
  p2=p1=strchr(p,' '); if (p1==NULL) return;
2213
  p1=strstr(p, "module="); if(p1==NULL) return;
2214
  *p1=0; p1=find_word_start(p1+1);
2214
  p1=find_word_start(p1+strlen("module="));
2215
  p2=strchr(p1,' ');
2215
  p2=find_word_end(p1); *p2=0;
2216
  if (p2!=NULL){
2216
  p2=strstr(p2+1, "param="); if(p2==NULL) return;
2217
    *p2=0; p2=strstr(p2+1, "sheet");
2217
  p2=find_word_start(p2+strlen("param="));
2218
    if (p2!=NULL){
2218
  p3=find_word_end(p2);
2219
      p2=strchr(p2, '=');
2219
  p4=strstr(p3, " sheet="); *p3=0;
2220
      start=stop=evalue(p2+1);
2220
  if (p4!=NULL) start=stop=evalue(p4+strlen(" sheet="));
2221
    }
-
 
2222
  }
2221
 
2223
  snprintf(nbuf2,sizeof(nbuf2),"%s/%s/sheets/.severity",class_base,c);
2222
  snprintf(fname,sizeof(fname),"%s/%s/sheets/.severity",class_base,c);
2224
  readfile(nbuf2,buf2,MAX_LINELEN);
2223
  readfile(fname,fcontent,MAX_LINELEN);
2225
  snprintf(nbuf,sizeof(nbuf),":%s\n%s\n",p,p1); *p=0;
2224
  snprintf(nbuf,sizeof(nbuf),":%s\n%s\n",p1,p2); *p=0;
2226
  for (sheet=start; sheet <= stop; ++sheet){
2225
  for (sheet=start; sheet <= stop; ++sheet){
2227
    snprintf(nbuf2,sizeof(nbuf2),"%s/%s/sheets/.sheet%d",class_base,c,sheet);
2226
    snprintf(fname,sizeof(fname),"%s/%s/sheets/.sheet%d",class_base,c,sheet);
2228
    if(readfile(nbuf2,buf,MAX_LINELEN)==NULL) break;
2227
    if(readfile(fname,buf,MAX_LINELEN)==NULL) break;
2229
    p1=strstr(buf,nbuf);
2228
    p1=strstr(buf,nbuf);
2230
    while(p1>buf && *(p1-1)!='\n') p1=strstr(p1+1,nbuf);
2229
    while(p1>buf && *(p1-1)!='\n') p1=strstr(p1+1,nbuf);
2231
    if(p1!=NULL) {
2230
    if(p1!=NULL) {
2232
      p2=strchr(buf,':');
2231
      p2=strchr(buf,':');
2233
      while(p2>buf && *(p2-1)!='\n') p2=strchr(p2+1,':');
2232
      while(p2>buf && *(p2-1)!='\n') p2=strchr(p2+1,':');
2234
      for(i=1;p2!=NULL && p2<p1;i++) {
2233
      for(i=1;p2!=NULL && p2<p1;i++) {
2235
        p2=strchr(p2+1,':');
2234
        p2=strchr(p2+1,':');
2236
        while(p2>buf && *(p2-1)!='\n') p2=strchr(p2+1,':');
2235
        while(p2>buf && *(p2-1)!='\n') p2=strchr(p2+1,':');
2237
      }
2236
      }
2238
      if(p2==NULL) return;
2237
      if(p2==NULL) return;
2239
      fnd_line(buf2,sheet+1,buf3);
2238
      fnd_line(fcontent,sheet+1,buf);
2240
      if(!buf3[0]) getdef("bases/sys/define.conf","DF_SEVERITY",buf3);
2239
      if(!buf[0]) getdef("bases/sys/define.conf","DF_SEVERITY",buf);
2241
      snprintf(p,20,"%d/%d,%s",sheet,i,buf3);
2240
      snprintf(p,20,"%d/%d,%s",sheet,i,buf);
2242
      break;
2241
      break;
2243
    }
2242
    }
2244
  }
2243
  }
2245
}
2244
}
2246
 
2245