X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=include%2Fmatch.h;h=a2d7542ab973095e1f1e0dff1faa8dcf8b34759d;hb=refs%2Fheads%2Fupstream-ssl;hp=7a328a74d1af1fc89dc17725a4603871e30d7c7d;hpb=b70944c4b84fc2b707d0853ddf03975569dac2bd;p=ircu2.10.12-pk.git diff --git a/include/match.h b/include/match.h index 7a328a7..a2d7542 100644 --- a/include/match.h +++ b/include/match.h @@ -1,27 +1,25 @@ -#ifndef MATCH_H -#define MATCH_H - -/*============================================================================= - * System headers used by this header file +/** @file match.h + * @brief Interface for matching strings to IRC masks. + * @version $Id$ */ -#include -#include -#include +#ifndef INCLUDED_match_h +#define INCLUDED_match_h +#ifndef INCLUDED_sys_types_h +#include /* XXX - broken BSD system headers */ +#define INCLUDED_sys_types_h +#endif +#ifndef INCLUDED_res_h +#include "res.h" +#endif -/*============================================================================= - * Structures +/* + * Prototypes */ -struct in_mask { - struct in_addr bits; - struct in_addr mask; - int fall; -}; - -/*============================================================================= - * Proto types +/* + * XXX - match returns 0 if a match is found. Smelly interface + * needs to be fixed. --Bleep */ - extern int mmatch(const char *old_mask, const char *new_mask); extern int match(const char *ma, const char *na); extern char *collapse(char *pattern); @@ -30,6 +28,7 @@ extern int matchcomp(char *cmask, int *minlen, int *charset, const char *mask); extern int matchexec(const char *string, const char *cmask, int minlen); extern int matchdecomp(char *mask, const char *cmask); extern int mmexec(const char *wcm, int wminlen, const char *rcm, int rminlen); -extern int matchcompIP(struct in_mask *imask, const char *mask); -#endif /* MATCH_H */ +extern int ipmask_check(const struct irc_in_addr *addr, const struct irc_in_addr *mask, unsigned char bits); + +#endif /* INCLUDED_match_h */