view src/lib-imap/imap-match.h @ 9266:cd29b745c8dd HEAD

configure: clock_gettime()'s -lrt adding dropped everything else from $LIBS.
author Timo Sirainen <>
date Mon, 27 Jul 2009 06:32:42 -0400
parents e4eb71ae8e96
line wrap: on
line source

#ifndef IMAP_MATCH_H
#define IMAP_MATCH_H

enum imap_match_result {
	IMAP_MATCH_NO 		= 0x00, /* definite non-match */
	IMAP_MATCH_YES		= 0x01, /* match */

	/* YES and NO are returned alone, but CHILDREN and PARENT may be
	   returned both (eg. "foo*bar" vs. "foobar/baz") */

	/* non-match, but its children could match (eg. "box" vs "box/%") */
	/* non-match, but one of its parents does match. This should often be
	   handled with YES matches, because when listing for "%" and "box/foo"
	   exists but "box" doesn't, you should still list "box" as
	   (Nonexistent HasChildren) mailbox. */

struct imap_match_glob;

/* If inboxcase is TRUE, the "INBOX" string at the beginning of line is
   compared case-insensitively */
struct imap_match_glob *
imap_match_init(pool_t pool, const char *pattern,
		bool inboxcase, char separator);
struct imap_match_glob *
imap_match_init_multiple(pool_t pool, const char *const *patterns,
			 bool inboxcase, char separator);

void imap_match_deinit(struct imap_match_glob **glob);

enum imap_match_result
imap_match(struct imap_match_glob *glob, const char *data);