Subversion Repositories wimsdev

Rev

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

Rev 8882 Rev 8947
Line 83... Line 83...
83
      }
83
      }
84
    }
84
    }
85
    fprintf(outf,"\n!insmath %s\n$()",bf);
85
    fprintf(outf,"\n!insmath %s\n$()",bf);
86
}
86
}
87
 
87
 
-
 
88
/* deux accolades obligatoires */
88
int _matchit3(char **p, char **ps, char *name, int type)
89
int _matchit3(char **p, char **ps, char *name, int type)
89
{
90
{
90
  char *pp = find_word_start(*p+strlen(name)+1);
91
  char *pp = find_word_start(*p+strlen(name)+1);
91
  if(strncmp(*p+1,name,strlen(name))==0 && *pp=='{') {
92
  if(strncmp(*p+1,name,strlen(name))==0 && *pp=='{') {
92
    char *pp2, *pe2, *pt;
93
    char *pp2, *pe2, *pt;
93
    char *pe=find_matching(pp+1,'}');
94
    char *pe=find_matching(pp+1,'}');
94
    if(pe) pp2=find_word_start(pe+1); else return 1;
95
    if(pe) pp2=find_word_start(pe+1); else return 1;
95
    if(pp2) pe2=find_matching(pp2+1,'}'); else return 1;
96
    if(pp2 && *pp2=='{') pe2=find_matching(pp2+1,'}'); else return 1;
96
    if(pe2 && *pp2=='{' && *pe2=='}') {
97
    if(pe2) {
97
      pp++; pp2++; **p=*pe=*pe2=0;
98
      pp++; pp2++; **p=*pe=*pe2=0;
98
      switch(type) {
99
      switch(type) {
99
     /* $val1 is $imagedir supprime s'il se trouve dans le code de draw */
100
     /* $val1 is $imagedir supprime s'il se trouve dans le code de draw */
100
          case 0: while((pt=strstr(pp2,"$val1/"))!=NULL) ovlstrcpy(pt,pt+strlen("$val1/")); break;
101
          case 0: while((pt=strstr(pp2,"$val1/"))!=NULL) ovlstrcpy(pt,pt+strlen("$val1/")); break;
101
      }
102
      }
Line 119... Line 120...
119
    if(*pp2=='{') {
120
    if(*pp2=='{') {
120
      pe2=find_matching(++pp2,'}');
121
      pe2=find_matching(++pp2,'}');
121
      if(pe2) *pe2=0;
122
      if(pe2) *pe2=0;
122
    }
123
    }
123
    else pp2="";
124
    else pp2="";
124
    if(*pp=='{' && *pe=='}') {
-
 
125
      pp++; **p=*pe=0;
125
    pp++; **p=*pe=0;
126
      fprintf(outf,"%s \n\
126
    fprintf(outf,"%s \n\
127
!read oef/%s.phtml %s %s \n$()", *ps,name,pp,pp2);
127
!read oef/%s.phtml %s %s \n$()", *ps,name,pp,pp2);
128
      *ps=*p=pe2; (*ps)++; return 1;
128
    *ps=*p=pe2; (*ps)++; return 1;
129
    }
-
 
130
  }
129
  }
131
  return 0;
130
  return 0;
132
}
131
}
-
 
132
 
133
/* une seule accolade  + compteur embedcnt ne fonctionne pas comme avant */
133
/* une seule accolade */
134
int _matchit1(char **p, char **ps, char *name)
134
int _matchit1(char **p, char **ps, char *name)
135
{
135
{
136
  char *pp = find_word_start(*p+strlen(name)+1);
136
  char *pp = find_word_start(*p+strlen(name)+1);
137
  if(strncmp(*p+1,name,strlen(name))==0 && *pp=='{') {
137
  if(strncmp(*p+1,name,strlen(name))==0 && *pp=='{') {
138
    char *pe=find_matching(pp+1,'}');
138
    char *pe=find_matching(pp+1,'}');
139
    if(pe && *pp=='{' && *pe=='}') {
139
    if(pe) {
140
         pp++; **p=*pe=0;
140
      pp++; **p=*pe=0;
141
         fprintf(outf,"%s \n\
141
      fprintf(outf,"%s \n\
142
!read oef/%s.phtml %s \n$()", *ps,name,pp);
142
!read oef/%s.phtml %s \n$()", *ps,name,pp);
143
         *ps=*p=pe; (*ps)++; embedcnt++; return 1;
143
      *ps=*p=pe; (*ps)++; embedcnt++; return 1;
144
     }
144
    }
145
  }
145
  }
146
  return 0;
146
  return 0;
147
}
147
}
148
 
148
 
149
void out_exec(char *s1, char *s2)
149
void out_exec(char *s1, char *s2)