Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 1 | #ifndef MATCH_H |
| 2 | #define MATCH_H |
| 3 | |
| 4 | /* |
| 5 | * Returns true if the given string matches the pattern (which may contain ? |
| 6 | * and * as wildcards), and zero if it does not match. |
| 7 | */ |
| 8 | int match_pattern(const char *s, const char *pattern); |
| 9 | |
| 10 | /* |
| 11 | * Tries to match the host name (which must be in all lowercase) against the |
| 12 | * comma-separated sequence of subpatterns (each possibly preceded by ! to |
Damien Miller | d3a1857 | 2000-06-07 19:55:44 +1000 | [diff] [blame] | 13 | * indicate negation). Returns -1 if negation matches, 1 if there is |
| 14 | * a positive match, 0 if there is no match at all. |
Damien Miller | 450a7a1 | 2000-03-26 13:04:51 +1000 | [diff] [blame] | 15 | */ |
| 16 | int match_hostname(const char *host, const char *pattern, unsigned int len); |
| 17 | |
| 18 | #endif |