📄 strmatch.c
字号:
/**********Copyright 1991 Regents of the University of California. All rights reserved.Author: 1991 David A. Gates, U. C. Berkeley CAD Group**********/#include <string.h>#include <ctype.h>/* * Case-insensitive test of whether p is a prefix of s and at least the * first n characters are the same */intcinprefix(p, s, n)register char *p, *s;register int n;{ if (!p || !s) return( 0 ); while (*p) { if ((isupper(*p) ? tolower(*p) : *p) != (isupper(*s) ? tolower(*s) : *s)) return( 0 ); p++; s++; n--; } if (n > 0) return( 0 ); else return( 1 );}/* * Case-insensitive match of prefix string p against string s * returns the number of matching characters */intcimatch(p, s)register char *p, *s;{ register int n = 0; if (!p || !s) return( 0 ); while (*p) { if ((isupper(*p) ? tolower(*p) : *p) != (isupper(*s) ? tolower(*s) : *s)) return( n ); p++; s++; n++; } return( n );}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -