Author: Bleep <tomh@inxpress.net>
[ircu2.10.12-pk.git] / include / match.h
1 /*
2  * match.h
3  *
4  * $Id$
5  */
6 #ifndef INCLUDED_match_h
7 #define INCLUDED_match_h
8 #ifndef INCLUDED_sys_types_h
9 #include <sys/types.h>         /* XXX - broken BSD system headers */
10 #define INCLUDED_sys_types_h
11 #endif
12 #ifndef INCLUDED_netinet_in_h
13 #include <netinet/in.h>        /* struct in_addr */
14 #define INCLUDED_netinet_in_h
15 #endif
16
17 /*
18  * Structures
19  */
20 struct in_mask {
21   struct in_addr bits;
22   struct in_addr mask;
23   int fall;
24 };
25
26 /*
27  * Prototypes
28  */
29
30 /*
31  * XXX - match returns 0 if a match is found. Smelly interface
32  * needs to be fixed. --Bleep
33  */
34 extern int mmatch(const char *old_mask, const char *new_mask);
35 extern int match(const char *ma, const char *na);
36 extern char *collapse(char *pattern);
37
38 extern int matchcomp(char *cmask, int *minlen, int *charset, const char *mask);
39 extern int matchexec(const char *string, const char *cmask, int minlen);
40 extern int matchdecomp(char *mask, const char *cmask);
41 extern int mmexec(const char *wcm, int wminlen, const char *rcm, int rminlen);
42 extern int matchcompIP(struct in_mask *imask, const char *mask);
43
44 #endif /* INCLUDED_match_h */