IPv6 support (hopefully with fewer future transition pains)
[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_res_h
13 #include "res.h"
14 #endif
15
16 /*
17  * Prototypes
18  */
19
20 /*
21  * XXX - match returns 0 if a match is found. Smelly interface
22  * needs to be fixed. --Bleep
23  */
24 extern int mmatch(const char *old_mask, const char *new_mask);
25 extern int match(const char *ma, const char *na);
26 extern char *collapse(char *pattern);
27
28 extern int matchcomp(char *cmask, int *minlen, int *charset, const char *mask);
29 extern int matchexec(const char *string, const char *cmask, int minlen);
30 extern int matchdecomp(char *mask, const char *cmask);
31 extern int mmexec(const char *wcm, int wminlen, const char *rcm, int rminlen);
32
33 extern int ipmask_parse(const char *in, struct irc_in_addr *mask, unsigned char *bits_ptr);
34 extern int ipmask_check(const struct irc_in_addr *addr, const struct irc_in_addr *mask, unsigned char bits);
35
36 #endif /* INCLUDED_match_h */