#ifndef _MATCH_LIST_H_INCLUDED_
#define _MATCH_LIST_H_INCLUDED_
#include <argv.h>
#include <vstring.h>
typedef struct MATCH_LIST MATCH_LIST;
typedef int (*MATCH_LIST_FN) (MATCH_LIST *, const char *, const char *);
struct MATCH_LIST {
char *pname;
int flags;
ARGV *patterns;
int match_count;
MATCH_LIST_FN *match_func;
const char **match_args;
VSTRING *fold_buf;
int error;
};
#define MATCH_FLAG_NONE 0
#define MATCH_FLAG_PARENT (1<<0)
#define MATCH_FLAG_RETURN (1<<1)
#define MATCH_FLAG_ALL (MATCH_FLAG_PARENT | MATCH_FLAG_RETURN)
extern MATCH_LIST *match_list_init(const char *, int, const char *, int,...);
extern int match_list_match(MATCH_LIST *,...);
extern void match_list_free(MATCH_LIST *);
extern int match_string(MATCH_LIST *, const char *, const char *);
extern int match_hostname(MATCH_LIST *, const char *, const char *);
extern int match_hostaddr(MATCH_LIST *, const char *, const char *);
#endif