SEARCH.C
资源名称:teco.zip [点击查看]
上传用户:xiantiandi
上传日期:2007-01-06
资源大小:21k
文件大小:1k
源码类别:
编辑器/阅读器
开发平台:
DOS
- #include <ctype.h>
- #include <stdio.h>
- #include <string.h>
- search() /* Search for (alt terminated) string */
- {
- #include "teco.h"
- int match=0; /* Comparison cnt */
- int tmp; /* Scratch var #1 */
- bufptx++; /* Advance to nxt */
- if (getbuf[getptx] == 27) goto done; /* Found string */
- while (bufptx <= bufptr ) { /* Scan the array */
- if (toupper(buffer[bufptx+match]) != toupper(getbuf[getptx+match])) {
- bufptx++; /* Punt, no match */
- match=0; /* ..reset count */
- } else {
- match++; /* Record a match */
- if (getbuf[getptx+match] == 27) goto done;
- }
- }
- bufptx=0; /* Pointer to beg */
- done:;
- }