-#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 <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
+#ifndef INCLUDED_match_h
+#define INCLUDED_match_h
+#ifndef INCLUDED_sys_types_h
+#include <sys/types.h> /* 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);
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 check_if_ipmask(const char *mask);
+extern int ipmask_parse(const char *in, struct irc_in_addr *mask, unsigned char *bits_ptr);
+extern int ipmask_check(const struct irc_in_addr *addr, const struct irc_in_addr *mask, unsigned char bits);
+
+#endif /* INCLUDED_match_h */