1 #include "Local.h" /* standard header file */
3 /********************************************************************/
6 /* Organization: W/OSO242 - GRAPHICS AND DISPLAY SECTION */
7 /* Date: 12 Dec 1995 */
8 /* Programmer: CINDY L. CHONG */
11 /* Abstract: This function will compare each character in the */
12 /* string match with each character in the pattern */
13 /* which is made up of characters. The str can */
14 /* be longer than the pattern. */
16 /* External Functions Called: */
19 /* Input: str is a pointer to char */
20 /* pattern is a pointer to char */
22 /* Output: Return true if str matches pattern, */
23 /* otherwise, return false */
25 /* Modification History: */
28 /********************************************************************/
30 bool charcmp(char *str, char *pattern)
34 /**********************************************************/
35 /* Loop while str and pattern is not equal to null, then */
36 /* inscreases str and pattern by one */
37 /**********************************************************/
39 for (; *pattern != '\0'; pattern++)
44 /************************************************************/
45 /* If pattern match str, then increase str and jump out the */
46 /* case and read next char of the str and pattern */
47 /************************************************************/
49 if ( isspace(*pattern) )
50 pattern = nxtalpha(pattern);
55 if ( !isalnum(*str++) )
70 if ( !iscntrl(*str++) )
85 if ( !isgraph(*str++) )
92 if ( !islower(*str++) )
99 if ( !isprint(*str++) )
106 if ( !ispunct(*str++) )
113 if ( !isspace(*str++) )
120 if ( !isupper(*str++) )
134 if ( !isspace(*str) )
140 while ( isspace(*str) )
147 if (*pattern != *str)