Subversion Repositories wimsdev

Rev

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

Rev 8160 Rev 8195
Line 21... Line 21...
21
 
21
 
22
/* internal routine. */
22
/* internal routine. */
23
void _text_cut(char *p, char *w)
23
void _text_cut(char *p, char *w)
24
{
24
{
25
    char *p1, *p2;
25
    char *p1, *p2;
26
    p1=wordchr(p,w); if(p1==NULL) error2("syntax_error");
26
    p1=wordchr(p,w); if(p1==NULL) error("syntax_error");
27
    *p1=0; p2=find_word_start(p1+strlen(w));
27
    *p1=0; p2=find_word_start(p1+strlen(w));
28
    ovlstrcpy(t_buf[0],p); ovlstrcpy(t_buf[1],p2);
28
    ovlstrcpy(t_buf[0],p); ovlstrcpy(t_buf[1],p2);
29
    strip_trailing_spaces(t_buf[0]);
29
    strip_trailing_spaces(t_buf[0]);
30
    substitute(t_buf[0]); substitute(t_buf[1]);
30
    substitute(t_buf[0]); substitute(t_buf[1]);
31
}
31
}
Line 162... Line 162...
162
    char *table, *dline, *tline[MAX_TLEN];
162
    char *table, *dline, *tline[MAX_TLEN];
163
    char *p1, *p2;
163
    char *p1, *p2;
164
    int i,j1,j2,k,l,l2,n;
164
    int i,j1,j2,k,l,l2,n;
165
 
165
 
166
    table=wordchr(p,"table");
166
    table=wordchr(p,"table");
167
    if(table==NULL) error2("syntax_error");
167
    if(table==NULL) error("syntax_error");
168
    *table=0; strip_trailing_spaces(p);
168
    *table=0; strip_trailing_spaces(p);
169
    table=find_word_start(table+strlen("table"));
169
    table=find_word_start(table+strlen("table"));
170
    snprintf(t_buf[2],MAX_LINELEN,"%s",table);
170
    snprintf(t_buf[2],MAX_LINELEN,"%s",table);
171
    _text_cut(p,"and");
171
    _text_cut(p,"and");
172
    strip_trailing_spaces(t_buf[2]); substitute(t_buf[2]);
172
    strip_trailing_spaces(t_buf[2]); substitute(t_buf[2]);
173
    n=linenum(t_buf[2])-1;
173
    n=linenum(t_buf[2])-1;
174
    if(n>=MAX_TLEN) error2("text_bad_table");
174
    if(n>=MAX_TLEN) error("text_bad_table");
175
    p2=strchr(t_buf[2],'\n'); if(p2!=NULL) *p2++=0;
175
    p2=strchr(t_buf[2],'\n'); if(p2!=NULL) *p2++=0;
176
    if(strlen(t_buf[2])!=n) error2("text_bad_table");
176
    if(strlen(t_buf[2])!=n) error("text_bad_table");
177
    dline=t_buf[2];
177
    dline=t_buf[2];
178
    for(i=0,p1=p2;i<n;i++,p1=p2) {
178
    for(i=0,p1=p2;i<n;i++,p1=p2) {
179
      if(p1==NULL) error2("text_bad_table");
179
      if(p1==NULL) error("text_bad_table");
180
      p2=strchr(p1,'\n');
180
      p2=strchr(p1,'\n');
181
      if(p2!=NULL) *p2++=0;
181
      if(p2!=NULL) *p2++=0;
182
      if(strlen(p1)!=n) error2("text_bad_table");
182
      if(strlen(p1)!=n) error("text_bad_table");
183
      tline[i]=p1;
183
      tline[i]=p1;
184
    }
184
    }
185
    l=strlen(t_buf[0]); l2=strlen(t_buf[1]); if(l2<l) l=l2;
185
    l=strlen(t_buf[0]); l2=strlen(t_buf[1]); if(l2<l) l=l2;
186
    for(i=k=0;i<l;i++) {
186
    for(i=k=0;i<l;i++) {
187
      if(maskbuf[i]!='0') {
187
      if(maskbuf[i]!='0') {
Line 401... Line 401...
401
    int i,j,n;
401
    int i,j,n;
402
    char *p1, *p2;
402
    char *p1, *p2;
403
    char c,cc;
403
    char c,cc;
404
    char buf[MAX_LINELEN+1];
404
    char buf[MAX_LINELEN+1];
405
    p1=find_word_start(p); p2=find_word_end(p1);
405
    p1=find_word_start(p); p2=find_word_end(p1);
406
    if(p2<=p1 || *p2==0) error2("syntax_error");
406
    if(p2<=p1 || *p2==0) error("syntax_error");
407
    *p2=0;
407
    *p2=0;
408
    i=search_list(text_proc,TEXT_PROC_NO,sizeof(text_proc[0]),p1);
408
    i=search_list(text_proc,TEXT_PROC_NO,sizeof(text_proc[0]),p1);
409
    if(i<0) error2("syntax_error");
409
    if(i<0) error("syntax_error");
410
    snprintf(buf,sizeof(buf),"%s",find_word_start(p2+1));
410
    snprintf(buf,sizeof(buf),"%s",find_word_start(p2+1));
411
    if((text_proc[i].tag&1)!=0 && (p1=wordchr(buf,"mask"))!=NULL) {
411
    if((text_proc[i].tag&1)!=0 && (p1=wordchr(buf,"mask"))!=NULL) {
412
      *p1=0; strip_trailing_spaces(buf);
412
      *p1=0; strip_trailing_spaces(buf);
413
      p2=find_word_start(p1+strlen("mask"));
413
      p2=find_word_start(p1+strlen("mask"));
414
      strip_trailing_spaces(p2);
414
      strip_trailing_spaces(p2);