Subversion Repositories wimsdev

Rev

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

Rev 17177 Rev 18014
Line 2198... Line 2198...
2198
      snprintf(nbuf,sizeof(nbuf),"%s/%s/index",module_dir,p1);
2198
      snprintf(nbuf,sizeof(nbuf),"%s/%s/index",module_dir,p1);
2199
      if(stat(nbuf,&st)<0) {
2199
      if(stat(nbuf,&st)<0) {
2200
        snprintf(p,MAX_LINELEN,"%s",p1);
2200
        snprintf(p,MAX_LINELEN,"%s",p1);
2201
        return;
2201
        return;
2202
      }
2202
      }
-
 
2203
    }
-
 
2204
  }
-
 
2205
}
-
 
2206
 
-
 
2207
void calc_getexoindex(char *p){
-
 
2208
  char *c, *p1, *p2;
-
 
2209
  char nbuf[MAX_LINELEN+1], nbuf2[MAX_FNAME+1], buf[MAX_LINELEN+1],
-
 
2210
     buf2[MAX_LINELEN+1], buf3[MAX_LINELEN+1];
-
 
2211
  int i, sheet, start=1, stop=MAX_SHEETS;
-
 
2212
  c=getvar("wims_class"); if(c==NULL) return;
-
 
2213
  p2=p1=strchr(p,' '); if (p1==NULL) return;
-
 
2214
  *p1=0; p1=find_word_start(p1+1);
-
 
2215
  p2=strchr(p1,' ');
-
 
2216
  if (p2!=NULL){
-
 
2217
    *p2=0; p2=strstr(p2+1, "worksheet");
-
 
2218
    if (p2!=NULL){
-
 
2219
      p2=strchr(p2, '=');
-
 
2220
      start=stop=evalue(p2+1);
-
 
2221
    }
-
 
2222
  }
-
 
2223
  snprintf(nbuf2,sizeof(nbuf2),"%s/%s/sheets/.severity",class_base,c);
-
 
2224
  readfile(nbuf2,buf2,MAX_LINELEN);
-
 
2225
  snprintf(nbuf,sizeof(nbuf),":%s\n%s\n",p,p1); *p=0;
-
 
2226
  for (sheet=start; sheet <= stop; ++sheet){
-
 
2227
    fnd_line(buf2,sheet+1,buf3);
-
 
2228
    if(!buf3[0]) getdef("bases/sys/define.conf","DF_SEVERITY",buf3);
-
 
2229
    snprintf(nbuf2,sizeof(nbuf2),"%s/%s/sheets/.sheet%d",class_base,c,sheet);
-
 
2230
    if(readfile(nbuf2,buf,MAX_LINELEN)==NULL) break;
-
 
2231
    p1=strstr(buf,nbuf);
-
 
2232
    while(p1>buf && *(p1-1)!='\n') p1=strstr(p1+1,nbuf);
-
 
2233
    if(p1!=NULL) {
-
 
2234
      p2=strchr(buf,':');
-
 
2235
      while(p2>buf && *(p2-1)!='\n') p2=strchr(p2+1,':');
-
 
2236
      for(i=1;p2!=NULL && p2<p1;i++) {
-
 
2237
        p2=strchr(p2+1,':');
-
 
2238
        while(p2>buf && *(p2-1)!='\n') p2=strchr(p2+1,':');
-
 
2239
      }
-
 
2240
      if(p2==NULL) return;
-
 
2241
      snprintf(p,20,"%d/%d,%s",sheet,i,buf3);
-
 
2242
      break;
2203
    }
2243
    }
2204
  }
2244
  }
2205
}
2245
}
2206
 
2246
 
2207
/* tag!=0 if we don't want automatic substit(). */
2247
/* tag!=0 if we don't want automatic substit(). */
Line 2249... Line 2289...
2249
      {"execute", 0, calc_exec},
2289
      {"execute", 0, calc_exec},
2250
      {"fileexists", 0, calc_fileexists},
2290
      {"fileexists", 0, calc_fileexists},
2251
      {"filelist", 0, calc_listfile},
2291
      {"filelist", 0, calc_listfile},
2252
      {"filexists", 0, calc_fileexists},
2292
      {"filexists", 0, calc_fileexists},
2253
      {"getdef", 1, calc_defof},
2293
      {"getdef", 1, calc_defof},
-
 
2294
      {"getexoindex", 0, calc_getexoindex},
2254
      {"getopt", 1, calc_getopt},
2295
      {"getopt", 1, calc_getopt},
2255
      {"getscore", 0, calc_getscore},
2296
      {"getscore", 0, calc_getscore},
2256
      {"getscorealltries", 0, calc_getscorealltries},
2297
      {"getscorealltries", 0, calc_getscorealltries},
2257
      {"getscorebest", 0, calc_getscorebest},
2298
      {"getscorebest", 0, calc_getscorebest},
2258
      {"getscorelast", 0, calc_getscorelast},
2299
      {"getscorelast", 0, calc_getscorelast},