Rev 16081 | Rev 16704 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 16081 | Rev 16391 | ||
---|---|---|---|
Line 121... | Line 121... | ||
121 | cd->start=time(NULL); cd->exocnt=0; |
121 | cd->start=time(NULL); cd->exocnt=0; |
122 | /* Now get the exo data */ |
122 | /* Now get the exo data */ |
123 | wlogdaccessfile(buf,"r","sheets/.require"); |
123 | wlogdaccessfile(buf,"r","sheets/.require"); |
124 | p1=strchr (buf,':'); |
124 | p1=strchr (buf,':'); |
125 | if (p1==NULL) { |
125 | if (p1==NULL) { |
- | 126 | /*old format*/ |
|
126 | for(i=k=0,p1=buf; *p1; i++,p1=p2) { |
127 | for(i=k=0,p1=buf; *p1; i++,p1=p2) { |
127 | cd->sheets[i].start=cd->sheets[i].indstart=k; |
128 | cd->sheets[i].start=cd->sheets[i].indstart=k; |
128 | p2=strchr(p1,'\n'); if(p2) *p2++=0; else p2=p1+strlen(p1); |
129 | p2=strchr(p1,'\n'); if(p2) *p2++=0; else p2=p1+strlen(p1); |
129 | for(j=0,q1=find_word_start(p1); *q1 && k<MAX_CLASSEXOS; j++,q1=find_word_start(q2)) { |
130 | for(j=0,q1=find_word_start(p1); *q1 && k<MAX_CLASSEXOS; j++,q1=find_word_start(q2)) { |
130 | q2=find_word_end(q1); if(*q2) *q2++=0; |
131 | q2=find_word_end(q1); if(*q2) *q2++=0; |
Line 194... | Line 195... | ||
194 | } |
195 | } |
195 | } |
196 | } |
196 | if(stat("sheets/.vars",&st)==0) { |
197 | if(stat("sheets/.vars",&st)==0) { |
197 | wlogdaccessfile(buf,"r","sheets/.vars"); |
198 | wlogdaccessfile(buf,"r","sheets/.vars"); |
198 | p1=strchr (buf,':'); |
199 | p1=strchr (buf,':'); |
- | 200 | if (p1!=NULL) { |
|
199 | for (i=0; i < cd->sheetcnt; i++, p1=p2){ |
201 | for (i=0; i < cd->sheetcnt; i++, p1=p2){ |
200 | p1++; |
202 | p1++; |
201 | cd->sheets[i].techoffset=0; |
203 | cd->sheets[i].techoffset=0; |
202 | p2=strchr(p1,'\n'); if(p2) *p2++=0; else p2=p1+strlen(p1); |
204 | p2=strchr(p1,'\n'); if(p2) *p2++=0; else p2=p1+strlen(p1); |
203 | if (cd->sheets[i].techcnt == 0) continue; |
205 | if (cd->sheets[i].techcnt == 0) continue; |
204 | cd->sheets[i].techoffset=offset; |
206 | cd->sheets[i].techoffset=offset; |
205 | for(l=0; l <= cd->sheets[i].techcnt;l++,p1=q2) { |
207 | for(l=0; l <= cd->sheets[i].techcnt;l++,p1=q2) { |
206 | p1=find_word_start(p1); |
208 | p1=find_word_start(p1); |
207 | q2=find_word_end(p1); if(*q2) *q2++=0; |
209 | q2=find_word_end(p1); if(*q2) *q2++=0; |
208 | strcpy(cd->techs+offset,p1); |
210 | strcpy(cd->techs+offset,p1); |
209 | offset+=strlen(p1); offset++; |
211 | offset+=strlen(p1); offset++; |
- | 212 | } |
|
210 | } |
213 | } |
211 | } |
214 | } |
212 | wlogdaccessfile(buf,"r","sheets/.active"); |
215 | wlogdaccessfile(buf,"r","sheets/.active"); |
213 | p1=strchr (buf,':'); |
216 | p1=strchr (buf,':'); |
- | 217 | if (p1!=NULL) { |
|
214 | for (i=k=0,p1++; *p1; i++,p1=p2) { |
218 | for (i=k=0,p1++; *p1; i++,p1=p2) { |
215 | p2=strchr(p1,':'); if(p2) *p2++=0; else p2=p1+strlen(p1); |
219 | p2=strchr(p1,':'); if(p2) *p2++=0; else p2=p1+strlen(p1); |
216 | for (; *p1; p1=p3) { |
220 | for (; *p1; p1=p3) { |
217 | p3=strchr(p1,'\n'); if(p3) *p3++=0; else p3=p1+strlen(p1); |
221 | p3=strchr(p1,'\n'); if(p3) *p3++=0; else p3=p1+strlen(p1); |
218 | for(q1=find_word_start(p1); *q1 && k<MAX_CLASSEXOS;q1=find_word_start(q2)) { |
222 | for(q1=find_word_start(p1); *q1 && k<MAX_CLASSEXOS;q1=find_word_start(q2)) { |
219 | q2=find_word_end(q1); if(*q2) *q2++=0; |
223 | q2=find_word_end(q1); if(*q2) *q2++=0; |
220 | cd->exos[k].active=strcmp(q1,"0"); |
224 | cd->exos[k].active=strcmp(q1,"0"); |
221 | k++; |
225 | k++; |
- | 226 | } |
|
222 | } |
227 | } |
223 | } |
228 | } |
224 | } |
229 | } |
225 | } |
230 | } |
226 | //class_dump(cd); |
231 | //class_dump(cd); |