eeedit.c

Go to the documentation of this file.
00001 /* ELLE - Copyright 1982, 1987 by Ken Harrenstien, SRI International
00002  *      This software is quasi-public; it may be used freely with
00003  *      like software, but may NOT be sold or made part of licensed
00004  *      products without permission of the author.
00005  */
00006 /*      EEEDIT - E-type routines */
00007 
00008 #include "elle.h"
00009 
00010 /* E_   - Operate on cur_buf.  Do not change value of cur_dot unless
00011  *              unavoidable side effect (also e_setcur).
00012  * EX_  - Like E_ but take SB ptr value.  Never touch cur_dot.
00013  * ED_  - Like E_, operate on cur_buf, update cur_dot and display stuff.
00014  * D_   - Perform necessary display update for given operations.
00015  *
00016  * Note that "dot" refers to the current read/write pointer for a sbbuffer.
00017  * The name comes from EMACS/TECO where "." represents this value.
00018  */
00019 
00020 #define CURSBB (SBBUF *)cur_buf         /* Shorthand for current SB buffer */
00021 
00022 e_reset()       /* Reset current buffer */
00023 {       ex_reset(CURSBB);
00024         cur_dot = 0;
00025 }
00026 
00027 /* Basic functions - apply SB routines to current buffer.
00028  * There is some optimization here which knows that certain SB functions
00029  * are macros.
00030  */
00031 e_rgetc()       /* Read/move 1 char backward */
00032 {       return(sb_rgetc((CURSBB)));
00033 }
00034 e_rdelc()       /* Delete 1 char backward */
00035 {       return(sb_rdelc((CURSBB)));
00036 }
00037 e_delc()        /* Delete 1 char forward */
00038 {       return(sb_deln(CURSBB,(chroff)1));
00039 }
00040 e_getc()        /* Read/move 1 char forward */
00041 {       register SBBUF *sb;
00042         sb = CURSBB;            /* Macro: use reg */
00043         return(sb_getc(sb));
00044 }
00045 e_backc()       /* Move 1 char backward */
00046 {       register SBBUF *sb;
00047         sb = CURSBB;            /* Macro: use reg */
00048         sb_backc(sb);                   /* No value returned */
00049 }
00050 e_putc(c)       /* Insert/write 1 char forward */
00051 char c;
00052 {       register SBBUF *sb;
00053         sb = CURSBB;            /* Macro: use reg */
00054         return(sb_putc(sb, c));
00055 }
00056 e_peekc()       /* Read 1 char forward (no move) */
00057 {       register SBBUF *sb;
00058         sb = CURSBB;            /* Macro: use reg */
00059         return(sb_peekc(sb));
00060 }
00061 e_ovwc(ch)      /* Overwrite 1 char forward */
00062 char ch;
00063 {
00064         sb_setovw(CURSBB);      /* Turn on overwrite mode */
00065         e_putc(ch);
00066         sb_clrovw(CURSBB);      /* Turn off overwrite mode */
00067 }
00068 
00069 SBSTR *
00070 e_copyn(off)    /* Copy N chars forward/backward, return SD to sbstring */
00071 chroff off;
00072 {       return(sb_cpyn(CURSBB,off));
00073 }
00074 e_deln(off)     /* Delete N chars forward/backward */
00075 chroff off;
00076 {       return(sb_deln(CURSBB, off));
00077 }
00078 
00079 /* E_SETCUR() - set cur_dot to current position (dot).  This is the only
00080  *      E_ routine that mungs cur_dot except for e_reset.
00081  */
00082 e_setcur()
00083 {       cur_dot = e_dot();
00084 }
00085 e_gosetcur(dot)         /* Go to specified dot and set cur_dot as well */
00086 chroff dot;
00087 {       sb_seek(CURSBB,dot,0);
00088         e_setcur();     /* Not cur_dot = dot since want canonicalization */
00089 }
00090 
00091 /* E_GO(dot) - Move to specified location. */
00092 /* These "GO" routines all move to the location specified, returning
00093  *      0 if successful and -1 on error.  "cur_dot" is never changed,
00094  *      with the exception of e_gosetcur.
00095  * Note that other "GO" routines (eg E_GONL) will return 1 if successful
00096  *      and 0 if stopped by EOF.
00097  */
00098 
00099 e_gocur() { return(e_go(cur_dot)); }            /* Move to cur_dot */
00100 e_gobob() { return(e_go((chroff) 0)); }         /* Move to Beg Of Buffer */
00101 e_goeob() { return(sb_seek(CURSBB,(chroff)0,2)); } /* Move to End Of Buffer */
00102 e_go(dot)       /* Move to specified location. */
00103 chroff dot;
00104 {       return(sb_seek(CURSBB,dot,0));
00105 }
00106 e_igoff(ioff)   /* Move (int) N chars forward/backward */
00107 int ioff;
00108 {       return(sb_seek(CURSBB,(chroff)ioff,1));
00109 }
00110 
00111 e_goff(off)     /* Move (full) N chars forward/backward */
00112 chroff off;
00113 {       return(sb_seek(CURSBB,off,1));
00114 }
00115 
00116 int ex_gonl(), ex_gopl(), ex_gobol(), ex_goeol();
00117 
00118 e_gobol() { return(ex_gobol(CURSBB)); } /* Move to beg of this line */
00119 e_goeol() { return(ex_goeol(CURSBB)); } /* Move to end of this line */
00120 e_gonl()  { return(ex_gonl(CURSBB)); }  /* Move to beg of next line */
00121 e_gopl()  { return(ex_gopl(CURSBB)); }  /* Move to beg of prev line */
00122 
00123 
00124 /* E_DOT() - Return current value of dot. */
00125 chroff e_dot()   { return(sb_tell(CURSBB)); }           /* Current pos */
00126 chroff e_nldot() { return(e_alldot(CURSBB,ex_gonl)); }  /* Beg of next line */
00127 chroff e_pldot() { return(e_alldot(CURSBB,ex_gopl)); }  /* Beg of prev line */
00128 chroff e_boldot(){ return(e_alldot(CURSBB,ex_gobol));}  /* Beg of this line */
00129 chroff e_eoldot(){ return(e_alldot(CURSBB,ex_goeol));}  /* End of this line */
00130 
00131 chroff
00132 e_alldot(sbp,rtn)       /* Auxiliary for above stuff */
00133 SBBUF *sbp;
00134 int (*rtn)();
00135 {       return(ex_alldot(sbp,rtn,e_dot()));
00136 }
00137 
00138 /* E_BLEN - Return length of current buffer */
00139 chroff
00140 e_blen() { return(ex_blen(CURSBB)); }
00141 
00142 /* EX_ routines - similar to E_ but take a buffer/sbbuf argument
00143  *      instead of assuming current buffer.
00144  */
00145 
00146 /* EX_RESET - Reset a given buffer */
00147 ex_reset(b)
00148 struct buffer *b;
00149 {       sbs_del(sb_close((SBBUF *)b));
00150         sb_open((SBBUF *)b,(SBSTR *)0);
00151 }
00152 
00153 ex_go(sbp,loc)          /* Move to given dot in specified sbbuf */
00154 chroff loc;
00155 SBBUF *sbp;
00156 {       return(sb_seek(sbp,loc,0));
00157 }
00158 
00159 chroff
00160 ex_dot(sbp)     /* Return current position in specified sbbuf */
00161 SBBUF *sbp;
00162 {
00163         return(sb_tell(sbp));
00164 }
00165 
00166 
00167 chroff
00168 ex_boldot(sbp,dot)      /* Return dot for BOL of specified sbbuf */
00169 SBBUF *sbp;
00170 chroff dot;
00171 {       return(ex_alldot(sbp,ex_gobol,dot));
00172 }
00173 
00174 chroff
00175 ex_alldot(sbp,rtn,dot)  /* Auxiliary for some e_ stuff */
00176 SBBUF *sbp;
00177 int (*rtn)();
00178 chroff dot;
00179 {       register SBBUF *sb;
00180         chroff savloc, retloc;
00181 
00182         savloc = sb_tell(sb = sbp);
00183         sb_seek(sb,dot,0);
00184         (*rtn)(sb);
00185         retloc = sb_tell(sb);
00186         sb_seek(sb,savloc,0);
00187         return(retloc);
00188 }
00189 
00190 /* GO (forward) to Next Line of specified sbbuf - returns 0 if stopped at EOF
00191  * before an EOL is seen. */
00192 ex_gonl(sbp)
00193 SBBUF *sbp;
00194 {       register SBBUF *sb;
00195         register int c;
00196         sb = sbp;
00197 #if FX_EOLMODE
00198         if(eolcrlf(sb))
00199                 while((c = sb_getc(sb)) != EOF)
00200                   {     if(c == LF)             /* Possible EOL? */
00201                           {     sb_backc(sb);   /* See if prev char was CR */
00202                                 if((c = sb_rgetc(sb)) != EOF)
00203                                         sb_getc(sb);
00204                                 sb_getc(sb);    /* Must restore position */
00205                                 if(c == CR)     /* Now test for CR */
00206                                         return(1);      /* Won, CR-LF! */
00207                           }
00208                   }
00209         else
00210 #endif
00211         while((c = sb_getc(sb)) != EOF)
00212                 if(c == LF)
00213                         return(1);
00214         return(0);
00215 }
00216 
00217 /* GO (forward) to End Of Line of specified sbbuf - returns 0 if stopped at
00218  * EOF before an EOL is seen. */
00219 ex_goeol(sbp)
00220 SBBUF *sbp;
00221 {       register SBBUF *sb;
00222         register int c;
00223         sb = sbp;
00224 #if FX_EOLMODE
00225         if(eolcrlf(sb))
00226                 while((c = sb_getc(sb)) != EOF)
00227                   {     if(c == LF)             /* Possible EOL? */
00228                           {     sb_backc(sb);   /* See if prev char was CR */
00229                                 if((c = sb_rgetc(sb)) == CR)
00230                                         return(1);      /* Won, CR-LF! */
00231                                 if(c != EOF)    /* No, must restore position */
00232                                         sb_getc(sb);    /* Skip over */
00233                                 sb_getc(sb);            /* Skip over LF */
00234                           }
00235                   }
00236         else
00237 #endif
00238         while((c = sb_getc(sb)) != EOF)
00239                 if(c == LF)
00240                   {     sb_backc(sb);
00241                         return(1);
00242                   }
00243         return(0);
00244 }
00245 
00246 /* GO (backward) to Beg Of Line of specified sbbuf - returns 0 if stopped
00247  * at EOF
00248  */
00249 ex_gobol(sbp)
00250 SBBUF *sbp;
00251 {       register SBBUF *sb;
00252         register int c;
00253         sb = sbp;
00254 #if FX_EOLMODE
00255         if(eolcrlf(sb))
00256                 while((c = sb_rgetc(sb)) != EOF)
00257                   {     if(c == LF)             /* Possible EOL? */
00258                           {     if((c = sb_rgetc(sb)) == CR)
00259                                   {     sb_getc(sb);    /* Won, CR-LF! */
00260                                         sb_getc(sb);    /* Move back */
00261                                         return(1);
00262                                   }
00263                                 if(c != EOF)    /* No, must restore position */
00264                                         sb_getc(sb);    /* Undo the rgetc */
00265                           }
00266                   }
00267         else
00268 #endif
00269         while((c = sb_rgetc(sb)) != EOF)
00270                 if(c == LF)
00271                   {     sb_getc(sb);
00272                         return(1);
00273                   }
00274         return(0);
00275 }
00276 
00277 /* GO (backward) to Previous Line of specified sbbuf - returns 0 if stopped
00278  * at EOF before an EOL is seen (i.e. if already on 1st line of buffer)
00279  */
00280 ex_gopl(sbp)
00281 SBBUF *sbp;
00282 {       register SBBUF *sb;
00283         register int c;
00284         sb = sbp;
00285 #if FX_EOLMODE
00286         if(eolcrlf(sb))
00287                 while((c = sb_rgetc(sb)) != EOF)
00288                   {     if(c == LF)             /* Possible EOL? */
00289                           {     if((c = sb_rgetc(sb)) == CR)
00290                                   {     ex_gobol(sb);
00291                                         return(1);              /* Won! */
00292                                   }
00293                                 if(c != EOF)    /* No, must restore position */
00294                                         sb_getc(sb);    /* Undo the rgetc */
00295                           }
00296                   }
00297         else
00298 #endif
00299         while((c = sb_rgetc(sb)) != EOF)
00300                 if(c == LF)
00301                   {     ex_gobol(sb);
00302                         return(1);      /* Won! */
00303                   }
00304         return(0);
00305 }
00306 
00307 
00308 chroff
00309 ex_blen(sbp)            /* Return length of specified sbbuf */
00310 SBBUF *sbp;
00311 {
00312         return(sb_tell(sbp)+sb_ztell(sbp));
00313 }
00314 
00315 /* Miscellaneous stuff */
00316 
00317 /* E_GOFWSP() - Forward over whitespace */
00318 e_gofwsp()
00319 {       register int c;
00320         while((c = e_getc()) == SP || c == TAB);
00321         if(c != EOF) e_backc();
00322 }
00323 
00324 /* E_GOBWSP() - Backward over whitespace */
00325 e_gobwsp()
00326 {       register int c;
00327         while((c = e_rgetc()) == SP || c == TAB);
00328         if(c != EOF) e_getc();
00329 }
00330 
00331 
00332 /* E_GOLINE(n) - Goes N lines forward (or backward).
00333 **      If N == 0, goes to beginning of current line.
00334 **      Returns 0 if hit EOF.
00335 */
00336 e_goline(i)
00337 register int i;
00338 {
00339         if(i > 0)
00340           {     do { if(!e_gonl()) return(0); }
00341                 while(--i);
00342           }
00343         else if(i < 0)
00344           {     i = -i;
00345                 do { if(!e_gopl()) return(0); }
00346                 while(--i);
00347           }
00348         else e_gobol();         /* arg of 0 */
00349         return 1;
00350 }
00351 
00352 /* E_LBLANKP() - Returns true if all characters in rest of line are blank.
00353  *      Moves to beginning of next line as side effect, unless fails.
00354  */
00355 e_lblankp()
00356 {       register int c;
00357         for(;;) switch(e_getc())
00358           {
00359                 case SP:
00360                 case TAB:
00361                         continue;
00362                 case LF:        /* Normally drop thru to return 1 as for EOF */
00363 #if FX_EOLMODE
00364                         if(eolcrlf(cur_buf))
00365                           {     e_rgetc();
00366                                 if((c = e_rgetc()) != EOF) /* Get prev char */
00367                                         e_getc();
00368                                 e_getc();
00369                                 if(c != CR)             /* Now examine */
00370                                         continue;       /* Not CR-LF, go on */
00371                           }     /* Else drop thru to return win */
00372 #endif
00373                 case EOF:
00374                         return(1);
00375                 default:
00376                         return(0);
00377           }
00378         /* Never drops out */
00379 }
00380 
00381 
00382 e_insn(ch, cnt)
00383 int ch;
00384 int cnt;
00385 {       register int i;
00386         if((i = cnt) > 0)
00387                 do { e_putc(ch);
00388                   } while(--i);
00389 }
00390 
00391 e_sputz(acp)
00392 char *acp;
00393 {       register SBBUF *sb;
00394         register char *cp;
00395         register int c;
00396         if(cp = acp)
00397           {     sb = CURSBB;
00398                 while(c = *cp++)
00399                         sb_putc(sb,c);
00400           }
00401 }
00402 
00403 /* BOLEQ - Returns TRUE if 2 dots are on the same line
00404  *      (i.e. have the same Beg-Of-Line)
00405  */
00406 boleq(dot1,dot2)
00407 chroff dot1,dot2;
00408 {       return( (ex_boldot(CURSBB,dot1) == ex_boldot(CURSBB,dot2)));
00409 }
00410 
00411 
00412 char *
00413 dottoa(str,val)
00414 char *str;
00415 chroff val;
00416 {       register char *s;
00417 
00418         s = str;
00419         if(val < 0)
00420           {     *s++ = '-';
00421                 val = -val;
00422           }
00423         if(val >= 10)
00424                 s = dottoa(s, val/10);
00425         *s++ = '0' + (int)(val%10);
00426         *s = 0;
00427         return(s);
00428 }
00429 
00430 
00431 /* Paragraph utilities */
00432 
00433 #if FX_FPARA || FX_BPARA || FX_MRKPARA || FX_FILLPARA
00434 
00435 #if FX_SFPREF
00436 extern char *fill_prefix;       /* Defined in eefill.c for now */
00437 extern int fill_plen;           /* Ditto */
00438 #endif /*FX_SFPREF*/
00439 
00440 #if ICONOGRAPHICS
00441 int para_mode = PARABLOCK;      /* eexcmd.c only other file that refs this */
00442 #endif /*ICONOGRAPHICS*/
00443 
00444 
00445 /* Go to beginning of paragraph */
00446 e_gobpa()
00447 {       register int c;
00448         chroff savdot;
00449 
00450         savdot = e_dot();
00451         e_bwsp();
00452         while((c = e_rgetc()) != EOF)
00453                 if(c == LF)             /* Went past line? */
00454                   {     e_getc();               /* Back up and check */
00455 #if FX_SFPREF
00456                         if(fill_plen)
00457                                 if(tstfillp(fill_plen))
00458                                   {     e_igoff(-(fill_plen+1));
00459                                         continue;
00460                                   }
00461                                 else break;
00462 #endif /*FX_SFPREF*/
00463 #if ICONOGRAPHICS
00464                         c = e_peekc ();
00465 
00466                         if (para_mode == PARABLOCK)
00467                             if (c == LF)
00468                                 break;
00469 
00470                         if (para_mode == PARALINE)
00471                             if (c_wsp (c))
00472                                 break;
00473 #else
00474                         if(c_pwsp(e_peekc()))   /* Check 1st chr for wsp */
00475                                 break;          /* If wsp, done */
00476 #endif /*ICONOGRAPHICS*/
00477                         e_rgetc();              /* Nope, continue */
00478                   }
00479         if((c = e_peekc()) == '.' || c == '-')
00480           {     e_gonl();
00481                 if(e_dot() >= savdot)
00482                         e_gopl();
00483           }
00484 }
00485 
00486 /* Go to end of paragraph */
00487 e_goepa()
00488 {       register int c;
00489 
00490         e_gobol();                      /* First go to beg of cur line */
00491         e_fwsp();
00492         while((c = e_getc()) != EOF)
00493                 if (c == LF)
00494                   {
00495 #if FX_SFPREF
00496                 if(fill_plen)           /* If Fill Prefix is defined */
00497                         if(tstfillp(fill_plen)) /* then must start with it */
00498                                 continue;
00499                         else break;             /* or else we're done */
00500 #endif /*FX_SFPREF*/
00501 #if ICONOGRAPHICS
00502                 if (para_mode == PARABLOCK)
00503                     if (e_peekc () == LF)
00504                         break;
00505 
00506                 if (para_mode == PARALINE)
00507                     if (c_wsp (e_peekc ()))
00508                         break;
00509 #else
00510                 if(c_pwsp(e_peekc()))
00511                         break;
00512 #endif /*-ICONOGRAPHICS*/
00513                   }
00514 }
00515 
00516 exp_do(rpos, rneg)
00517 int (*rpos)(), (*rneg)();
00518 {       register int e;
00519         register int (*rtn)();
00520 
00521         if((e = exp) == 0)
00522                 return;
00523         rtn = rpos;
00524         if(e < 0)
00525           {     rtn = rneg;
00526                 e = -e;
00527           }
00528         do { (*rtn)();
00529           } while(--e);
00530 }
00531 
00532 
00533 e_fwsp()
00534 {       register int c;
00535         while(c_wsp(c = e_getc()));
00536         if(c != EOF) e_backc();
00537 }
00538 e_bwsp()
00539 {       register int c;
00540         while(c_wsp(c = e_rgetc()));
00541         if(c != EOF) e_getc();
00542 }
00543 
00544 
00545 c_wsp(ch)
00546 int ch;
00547 {       register int c;
00548         c = ch;
00549         if(c == SP || c == TAB || c == LF || c == FF)
00550                 return(1);
00551         return(0);
00552 }
00553 c_pwsp(ch)
00554 int ch;
00555 {       register int c;
00556         c = ch;
00557         if(c == '.' || c == '-')
00558                 return(1);
00559         return(c_wsp(c));
00560 }
00561 
00562 #endif /* FX_FPARA || FX_BPARA || FX_MRKPARA || FX_FILLPARA */
00563 
00564 /* Word function auxiliaries */
00565 
00566 /* Returns true if this character is a delimiter. */
00567 delimp(c)
00568 int  c;
00569 {       static int  delim_tab[] =
00570           {
00571             0177777, 0177777,           /* All controls */
00572             0177777, 0176000,           /* All punct but 0-9 */
00573             0000001, 0074000,           /* All punct but A-Z and _ */
00574             0000001, 0174000            /* All punct but a-z */
00575           };
00576         return (delim_tab[c >> 4] & (1 << (c & 017)));
00577 }
00578 
00579 e_wding(adot,n)
00580 register chroff *adot;
00581 int n;
00582 {       chroff savdot;
00583         savdot = e_dot();
00584         e_gowd(n);
00585         *adot = e_dot();
00586         e_go(savdot);
00587         if(*adot == savdot)
00588           {     ring_bell();
00589                 return(0);
00590           }
00591         return(1);
00592 }
00593 chroff
00594 e_wdot(dot,n)
00595 chroff dot;
00596 int n;
00597 {       chroff savdot, retdot;
00598         savdot = e_dot();
00599         e_go(dot);
00600         e_gowd(n);
00601         retdot = e_dot();
00602         e_go(savdot);
00603         return(retdot);
00604 }
00605 e_gowd(n)
00606 int n;
00607 {       register int (*gch)(), c, cnt;
00608         int e_getc(), e_rgetc();
00609         chroff ret_dot;
00610 
00611         if((cnt = n) == 0)
00612                 return;
00613         if(cnt > 0)
00614                 gch = e_getc;           /* Forward routine */
00615         else
00616           {     gch = e_rgetc;          /* Backward routine */
00617                 cnt = -cnt;
00618           }
00619         do
00620           {     ret_dot = e_dot();      /* Remember dot for last word found */
00621                 while((c = (*gch)()) != EOF && delimp(c));
00622                 if(c == EOF)
00623                   {     e_go(ret_dot);          /* Use last word found */
00624                         break;
00625                   }
00626                 while((c = (*gch)()) != EOF && !delimp(c));
00627                 if(c == EOF)
00628                         break;
00629                 if(n < 0) e_getc(); else e_backc();
00630           } while(--cnt);
00631 }
00632 
00633 /* Searching */
00634 
00635 e_search(mstr,mlen,backwards)
00636 char *mstr;
00637 int mlen;
00638 int backwards;
00639 {       register SBBUF *sb;
00640         register char *cp;
00641         register int c;
00642         char *savcp;
00643         int cnt, scnt;
00644 #if IMAGEN
00645         register int c1;
00646         register int caseless = (cur_buf->b_flags & B_TEXTMODE);
00647 #endif /*IMAGEN*/
00648 
00649         sb = (SBBUF *) cur_buf;
00650         if (!backwards)
00651           {             /* Search forwards */
00652         sfwd:   cp = mstr;
00653                 while((c = sb_getc(sb)) != EOF)
00654                   {
00655 #if IMAGEN
00656                         if((!caseless && c != *cp) || 
00657                             (caseless && upcase(c) != upcase(*cp))) continue;
00658 #else
00659                         if(c != *cp) continue;
00660 #endif /*-IMAGEN*/
00661                         cp++;
00662                         cnt = mlen;
00663                         while(--cnt > 0)
00664                           {
00665 #if IMAGEN
00666                                 c1 = *cp++;
00667                                 c = e_getc();
00668                                 if ((!caseless && c1 != c) ||
00669                                      (caseless && upcase(c1) != upcase(c)))
00670 #else
00671                                 if(*cp++ != (c = e_getc()))
00672 #endif /*-IMAGEN*/
00673                                   {     if(c == EOF) return(0);
00674                                         sb_seek(sb,(chroff)(cnt-mlen),1);
00675                                         goto sfwd;
00676                                   }
00677                           }
00678                         return(1);
00679                   }
00680           }
00681         else
00682           {             /* Search backwards */
00683                 scnt = mlen - 1;
00684                 savcp = mstr + scnt;            /* Point to end of string */
00685 
00686         sbck:   cp = savcp;
00687                 while((c = sb_rgetc(sb)) != EOF)
00688                   {
00689 #if IMAGEN
00690                         if((!caseless && c != *cp) || 
00691                             (caseless && upcase(c) != upcase(*cp))) continue;
00692 #else
00693                         if(c != *cp) continue;
00694 #endif /*-IMAGEN*/
00695                         cp--;
00696                         if((cnt = scnt) == 0) return(1);
00697                         do
00698                           {
00699 #if IMAGEN
00700                                 c1 = *cp--;
00701                                 c = e_rgetc();
00702                                 if ((!caseless && c1 != c) ||
00703                                      (caseless && upcase(c1) != upcase(c)))
00704 #else
00705                                 if(*cp-- != (c = e_rgetc()))
00706 #endif /*-IMAGEN*/
00707                                   {     if(c == EOF) return(0);
00708                                         sb_seek(sb,(chroff)(mlen-cnt),1);
00709                                         goto sbck;
00710                                   }
00711                           }
00712                         while(--cnt);
00713                         return(1);
00714                   }
00715           }
00716         return(0);              /* Failed */
00717 }

Generated on Fri Apr 14 22:56:48 2006 for minix by  doxygen 1.4.6