Rev 3247 | Rev 7840 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 3247 | Rev 3717 | ||
---|---|---|---|
Line 22... | Line 22... | ||
22 | void _text_cut(char *p, char *w) |
22 | void _text_cut(char *p, char *w) |
23 | { |
23 | { |
24 | char *p1, *p2; |
24 | char *p1, *p2; |
25 | p1=wordchr(p,w); if(p1==NULL) error2("syntax_error"); |
25 | p1=wordchr(p,w); if(p1==NULL) error2("syntax_error"); |
26 | *p1=0; p2=find_word_start(p1+strlen(w)); |
26 | *p1=0; p2=find_word_start(p1+strlen(w)); |
27 |
|
27 | ovlstrcpy(t_buf[0],p); ovlstrcpy(t_buf[1],p2); |
28 | strip_trailing_spaces(t_buf[0]); |
28 | strip_trailing_spaces(t_buf[0]); |
29 | substitute(t_buf[0]); substitute(t_buf[1]); |
29 | substitute(t_buf[0]); substitute(t_buf[1]); |
30 | } |
30 | } |
31 | 31 | ||
32 | /* Extract characters in buf[0] which are identical to |
32 | /* Extract characters in buf[0] which are identical to |
Line 313... | Line 313... | ||
313 | snprintf(t_buf[0],sizeof(t_buf[0]),"%s",p); |
313 | snprintf(t_buf[0],sizeof(t_buf[0]),"%s",p); |
314 | substitute(t_buf[0]); |
314 | substitute(t_buf[0]); |
315 | n=strlen(t_buf[0]); if(n>MAX_LINELEN) n=MAX_LINELEN; |
315 | n=strlen(t_buf[0]); if(n>MAX_LINELEN) n=MAX_LINELEN; |
316 | for(i=0;i<n;i++) buf[i]=t_buf[0][n-1-i]; |
316 | for(i=0;i<n;i++) buf[i]=t_buf[0][n-1-i]; |
317 | buf[n]=0; |
317 | buf[n]=0; |
318 |
|
318 | ovlstrcpy(p,buf); |
319 | } |
319 | } |
320 | 320 | ||
321 | /* remove characters of buf[1] not in buf[0]. */ |
321 | /* remove characters of buf[1] not in buf[0]. */ |
322 | void text_select(char *p) |
322 | void text_select(char *p) |
323 | { |
323 | { |
Line 395... | Line 395... | ||
395 | else for(j=n;j<MAX_LINELEN;j++) maskbuf[j]=maskbuf[j%n]; |
395 | else for(j=n;j<MAX_LINELEN;j++) maskbuf[j]=maskbuf[j%n]; |
396 | maskbuf[sizeof(maskbuf)-1]=0; |
396 | maskbuf[sizeof(maskbuf)-1]=0; |
397 | } |
397 | } |
398 | else zeromask: memset(maskbuf,0,sizeof(maskbuf)); |
398 | else zeromask: memset(maskbuf,0,sizeof(maskbuf)); |
399 | text_proc[i].routine(buf); |
399 | text_proc[i].routine(buf); |
400 | buf[MAX_LINELEN]=0; |
400 | buf[MAX_LINELEN]=0;ovlstrcpy(p,buf); |
401 | } |
401 | } |
402 | 402 |