Sun Java System Web Server 6.1 SP9 NSAPI Programmer's Guide


The shexp_casecmp function validates a specified shell expression and compares it with a specified string. It returns one of three possible values representing match, no match, and invalid comparison. The comparison (in contrast to that of the shexp_casecmp function) is case-sensitive.

Use this function if you have a shell expression like * and you want to make sure that a string matches it, such as


int shexp_cmp(char *str, char *exp);


0 if a match was found.

1 if no match was found.

-1 if the comparison resulted in an invalid expression.


char *str is the string to be compared.

char *exp is the shell expression (wildcard pattern) to compare against.


/* Use wildcard match to see if this path is one we want */char
 *path;char *match = "/usr/netscape/*";if (shexp_cmp(path, match) != 0)  
  return REQ_NOACTION;   /* no match */

See Also

shexp_casecmp, shexp_match, shexp_valid