Rev 6961 | Rev 6973 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 6961 | Rev 6967 | ||
---|---|---|---|
Line 388... | Line 388... | ||
388 | 388 | ||
389 | char *sheetindex[]={ |
389 | char *sheetindex[]={ |
390 | "title", "description", |
390 | "title", "description", |
391 | "duration", "severity", |
391 | "duration", "severity", |
392 | "level", "domain", |
392 | "level", "domain", |
393 | "keywords", "reserved1", "reserved2", " |
393 | "keywords", "reserved1", "reserved2", "information" |
394 | }; |
394 | }; |
395 | #define SHEETINDEX_NO (sizeof(sheetindex)/sizeof(sheetindex[0])) |
395 | #define SHEETINDEX_NO (sizeof(sheetindex)/sizeof(sheetindex[0])) |
396 | char sindbuf[SHEETINDEX_NO][MAX_LINELEN+1]; |
396 | char sindbuf[SHEETINDEX_NO][MAX_LINELEN+1]; |
397 | enum{s_title, s_description, |
397 | enum{s_title, s_description, |
398 | s_duration, s_severity, |
398 | s_duration, s_severity, |
399 | s_level, s_domain, |
399 | s_level, s_domain, |
400 | s_keywords, s_reserved1, s_reserved2, |
400 | s_keywords, s_reserved1, s_reserved2, |
401 |
|
401 | s_information |
402 | }; |
402 | }; |
403 | 403 | ||
404 | char *modindex[]={ |
404 | char *modindex[]={ |
405 | "title", "description", |
405 | "title", "description", |
406 | "author", "address", "copyright", |
406 | "author", "address", "copyright", |
Line 473... | Line 473... | ||
473 | } |
473 | } |
474 | p2=strstr(p1,"\n:"); if(p2==NULL) p2=p1+strlen(p1); |
474 | p2=strstr(p1,"\n:"); if(p2==NULL) p2=p1+strlen(p1); |
475 | else *p2=0; |
475 | else *p2=0; |
476 | p1=find_word_start(p1); strip_trailing_spaces(p1); |
476 | p1=find_word_start(p1); strip_trailing_spaces(p1); |
477 | for(p2=p1;*p2;p2++) if(*p2=='\n') *p2=' '; |
477 | for(p2=p1;*p2;p2++) if(*p2=='\n') *p2=' '; |
478 | ovlstrcpy(sindbuf[ |
478 | ovlstrcpy(sindbuf[s_information],p1); |
479 | return 0; |
479 | return 0; |
480 | } |
480 | } |
481 | 481 | ||
482 | unsigned char categories[16]; |
482 | unsigned char categories[16]; |
483 | char taken[MAX_LINELEN+1]; |
483 | char taken[MAX_LINELEN+1]; |
Line 734... | Line 734... | ||
734 | 734 | ||
735 | void onesheet(int serial, int lind) |
735 | void onesheet(int serial, int lind) |
736 | { |
736 | { |
737 | int i; |
737 | int i; |
738 | unsigned char trlist[]={ |
738 | unsigned char trlist[]={ |
739 | s_title,s_description,s_domain,s_keywords, |
739 | s_title,s_description,s_domain,s_keywords,s_information |
740 | }; |
740 | }; |
741 | #define trcnt (sizeof(trlist)/sizeof(trlist[0])) |
741 | #define trcnt (sizeof(trlist)/sizeof(trlist[0])) |
742 | char *p1, *p2, buf[MAX_LINELEN+1]; |
742 | char *p1, *p2, buf[MAX_LINELEN+1]; |
743 | 743 | ||
744 | if(sheet_index(serial)) return; |
744 | if(sheet_index(serial)) return; |
745 | fprintf(listf,"%s\n",mod[serial].name+3); |
745 | fprintf(listf,"%s\n",mod[serial].name+3); |
746 | fprintf(titf,"%d:%s\n",serial,sindbuf[s_title]); |
746 | fprintf(titf,"%d:%s\n",serial,sindbuf[s_title]); |
747 | fprintf(descf,"%d:%s\n",serial,sindbuf[s_description]); |
747 | fprintf(descf,"%d:%s\n",serial,sindbuf[s_description]); |
748 | fprintf(remf,"%d:%s\n",serial,sindbuf[ |
748 | fprintf(remf,"%d:%s\n",serial,sindbuf[s_information]); |
749 | 749 | ||
750 | entrycount=dentrycount; dicbuf=ddicbuf; |
750 | entrycount=dentrycount; dicbuf=ddicbuf; |
751 | memmove(entry,dentry,dentrycount*sizeof(entry[0])); |
751 | memmove(entry,dentry,dentrycount*sizeof(entry[0])); |
752 | unknown_type=unk_leave; |
752 | unknown_type=unk_leave; |
753 | for(i=0;i<trcnt;i++) { |
753 | for(i=0;i<trcnt;i++) { |
Line 772... | Line 772... | ||
772 | p2=find_word_end(p1); if(*p2) *p2++=0; |
772 | p2=find_word_end(p1); if(*p2) *p2++=0; |
773 | sappenditem(p1,lind,serial,4); |
773 | sappenditem(p1,lind,serial,4); |
774 | } |
774 | } |
775 | snprintf(buf,sizeof(buf),"%s %s %s %s", |
775 | snprintf(buf,sizeof(buf),"%s %s %s %s", |
776 | sindbuf[s_description],sindbuf[s_keywords], |
776 | sindbuf[s_description],sindbuf[s_keywords], |
777 | sindbuf[s_domain],sindbuf[ |
777 | sindbuf[s_domain],sindbuf[s_information]); |
778 | towords(buf); |
778 | towords(buf); |
779 | for(p1=find_word_start(buf);*p1; |
779 | for(p1=find_word_start(buf);*p1; |
780 | p1=find_word_start(p2)) { |
780 | p1=find_word_start(p2)) { |
781 | p2=find_word_end(p1); if(*p2) *p2++=0; |
781 | p2=find_word_end(p1); if(*p2) *p2++=0; |
782 | sappenditem(p1,lind,serial,2); |
782 | sappenditem(p1,lind,serial,2); |
Line 792... | Line 792... | ||
792 | if(strlen(p1)<=0) continue; |
792 | if(strlen(p1)<=0) continue; |
793 | sappenditem(p1,lind,serial,4); |
793 | sappenditem(p1,lind,serial,4); |
794 | } |
794 | } |
795 | snprintf(buf,sizeof(buf),"%s, %s, %s, %s", |
795 | snprintf(buf,sizeof(buf),"%s, %s, %s, %s", |
796 | sindbuf[s_description],sindbuf[s_keywords], |
796 | sindbuf[s_description],sindbuf[s_keywords], |
797 | sindbuf[s_domain],sindbuf[ |
797 | sindbuf[s_domain],sindbuf[s_information]); |
798 | translate(buf); |
798 | translate(buf); |
799 | for(p1=find_word_start(buf); *p1; |
799 | for(p1=find_word_start(buf); *p1; |
800 | p1=find_word_start(p2)) { |
800 | p1=find_word_start(p2)) { |
801 | p2=strchr(p1,','); |
801 | p2=strchr(p1,','); |
802 | if(p2!=NULL) *p2++=0; else p2=p1+strlen(p1); |
802 | if(p2!=NULL) *p2++=0; else p2=p1+strlen(p1); |
Line 823... | Line 823... | ||
823 | listf=fopen(buf,"w"); |
823 | listf=fopen(buf,"w"); |
824 | snprintf(buf,sizeof(buf),"%s/index/weight.%s",sheetdir,lang[j]); |
824 | snprintf(buf,sizeof(buf),"%s/index/weight.%s",sheetdir,lang[j]); |
825 | weightf=fopen(buf,"w"); |
825 | weightf=fopen(buf,"w"); |
826 | snprintf(buf,sizeof(buf),"%s/index/addr.%s",sheetdir,lang[j]); |
826 | snprintf(buf,sizeof(buf),"%s/index/addr.%s",sheetdir,lang[j]); |
827 | addrf=fopen(buf,"w"); |
827 | addrf=fopen(buf,"w"); |
828 | snprintf(buf,sizeof(buf),"%s/index/ |
828 | snprintf(buf,sizeof(buf),"%s/index/information.%s",sheetdir,lang[j]); |
829 | remf=fopen(buf,"w"); |
829 | remf=fopen(buf,"w"); |
830 | snprintf(buf,sizeof(buf),"%s/index/serial.%s",sheetdir,lang[j]); |
830 | snprintf(buf,sizeof(buf),"%s/index/serial.%s",sheetdir,lang[j]); |
831 | serialf=fopen(buf,"w"); |
831 | serialf=fopen(buf,"w"); |
832 | snprintf(mdic,sizeof(mdic),"%s/%s.%s",dicdir,maindic,lang[j]); |
832 | snprintf(mdic,sizeof(mdic),"%s/%s.%s",dicdir,maindic,lang[j]); |
833 | snprintf(sdic,sizeof(sdic),"%s/%s.%s",dicdir,suffixdic,lang[j]); |
833 | snprintf(sdic,sizeof(sdic),"%s/%s.%s",dicdir,suffixdic,lang[j]); |